Trimming self intersecting portions of a curve

Hi everybody,

I have written a definition that draws a squiggly line along any non closed curve. Ultimately the goal of the script is to be able to make vegetation lines that typically I would draw using a freehand curve. The script in its current form takes a base curve, divides it, and then the points are “scattered” using a pseudo-random generator. It then creates a boundary that by offsetting the curve to either side and culling any of the control points that fall outside of it. One problem I keep running into is a high number of self intersections which will cause some problems for me further down the line. Is there a good way of either changing the script beforehand so it tries to not self intersect, or is there a good process for trimming or culling the points where those intersections are taking place? I’ve attached the definition here as well as some pictures of its results. Any help or advice would be greatly appreciated!

Squiggly Line script.gh (15.6 KB)

Here we have another approach on this… You can also use Curve Emitter fr Heteroptera plugin.


Curve Emitter.gh (23.8 KB)

1 Like