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?
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
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
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.
@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ā.