Map To Surface Error- Urgent

I have a little script to create a voronoi diagram and map it to a given surface, but right now it seems to project far beyond the edges of my surface, is there any way to create a boundary condition or fix this?



map to surface problem.gh (35.0 KB)

You didnā€™t internalize your ā€˜Base Surfaceā€™ - ā€œUrgentā€ :roll_eyes:

Iā€™m hoping to have a code that works for multiple use cases, I constructed the surface in rhino. But this happens with any surface Iā€™ve tried it on.

Please donā€™t roast me too hard for messy coding/ negligence, this is my first time using grasshopper for a school project :slight_smile:

If you donā€™t want to post a working file, it canā€™t be urgent.

map to surface problem revised.gh (37.7 KB)

It should work with most surfaces, but I run into problems like this where it exceeds the bounds of the base surface when the input is complex.

Dramatic! You still havenā€™t posted that surface that breaks your algorithm, so what do you expect?

What does his lucid explanation amount to but this, that in theory there is no difference between theory and practice, while in practice there is?
ā€“ Benjamin Brewster, ā€œThe Yale Literary Magazineā€ of February 1882

https://quoteinvestigator.com/2018/04/14/theory/

I did in the edit of the post. Come on man, I didnā€™t get on this forum to get torn to shreds. Iā€™m a student and I thought this place could offer some helpful solutions. Sorry for not meeting your expectations.

I realize now this may not be the most forgiving place for beginners. Sorry. Iā€™ve posted an example that breaks it so please either help, or move on. Youā€™re a professional Iā€™m sure youā€™ve got better things to do than deal with a student any way.

The revised GH file you posted is not the shape you showed in your first post. At a glance, it appears to work fine? Take a deep breath and get a grip.

Look, I added the white group to your revised GH file to illustrate and explain what Iā€™m guessing you are seeing? It splits the shape with a planar surface and uses only the top part (green) for Map Srf (Map To Surface), yet as you can see, the Voronoi pattern is applied to the entire original (untrimmed) surface. Thatā€™s just the way it works.


map to surface_2022_Nov8a.gh (40.2 KB)

You could use Copy Trim.


map to surface problem revised_re.gh (36.6 KB)

3 Likes

@Max_Reese : Donā€™t take it personal, Joseph is known to the community to have a rather harsh tone, but heā€™s willing to help when he can. However, most of the time some friendlier soul like @HS_Kim or other will jump in and help you out as well without the pseudo moral forum rules remarksā€¦

A alternative to the solutions posted would be to use pull Curve. The problem is that a voronoi is limited to a (by default) rectangular boundary and mapping does not respect trimmed surfaces. you would want to use the trimmed surfaces boundaries that are accessable as brep.
you would want to pull the curves to the surface and the exeeding lines will be cut off.
alternatively you could also use _-squish and _-squishback, but Iā€™m pretty sure this doesnā€™t exist in grasshopper, but rhino only. If it is urgent, Iā€™d stick with pull curve or copy trim as mentionned by HS Kim.

hope this helps more than blaming you for ā€œformal errorsā€.

Ben