
This task frustrated me to no end:
Divider VR 8.gh (318.3 KB)
I’ll leave this here for now, but have comments for later.
I am sick looking at that snobby mug.
@CarlosFilho
So, there are three points that make this task more difficult than simply contouring the curves, splitting them and grouping them by Y-domain.
Firstly, curves that do not intersect with the Y-domain bounds need to culled from the data set (black curves in the image below):
Then, there are curves that appear to intersect Y-domain bounds by the contouring of the Curve Contour component, but actually live inside Y-domains. Here:
you see problematic curves with contour points that live above the Y-domain division line. This happens because as mentioned above:
And lastly, even though this sketch seems reasonable at first glance:
there are curves that intersect the Y-domain bounds more than twice:
leaving closed island curves in addition to the desired outer profile.
Dealing with these edge cases accounts for a little under a third of the scripting:
and could be avoided with the expectation of clean geometry.
Not that the geometry is as bad as curves that back-track on themselves and aren’t planar, but finding the an optimal Y-step is tedious and possibly impossible.
You’d have to have 5 to 7+ of these images to have the time and effort you put into building a generalization be recompensatory.
@ale2x72
My initial instinct was to avoid curve contouring. This was because it involves having to deal with the split curves in terms of their grouping, endpoint alignment, and direction for linear connection.
A simpler method would have been to leverage regions and boolean operations. Here is some demonstration geometry:
You create a linear array of rectangles in the width of the geometry’s bounding rectangle and in the height of the desired Y step across the height of the curves:
Then Region Difference the curves from the rectangles:
By exploding the the region curves and checking which segments have midpoints that lie on the bounding rectangle of the rectangles via Point In Curve, you know curve segments you need to cull.
Rejoining the curve sets gives the final result:
The script is no more than this once the curves are cleaned and the rectangles found:
no curve sorting, no endpoint adjustment, no nothing.
However, I could not get this to work on a large scale! I don’t know what it was, but as soon as I connected the curves to the Region Difference component, the entire script stalled. I could get subsets of the regions and curves to work, and working through all the curves and rectangles in subsets, none of the image sections failed. But the srcipt refused to work on all curves and rectangles at once.
Would this component help?: