I have a very large file where I create around 100,000 lines inside dozens of closed curves of various shapes. Here’s a picture showing what I mean:
I’ve been using Trim Region for this to date: I create a bunch of lines, place them over the region (the closed curve) and then use Trim Region. The problem is this is quite slow for the number of lines I’m trimming, and every little adjustment to the script results in waiting minutes for it to calculate, so I’ve been trying to find an alternate way to do this, and have had some success with Contour, which appears to be much faster than Trim Region.
I have an additional complication now where rather than simple lines, I need to fill every region with a series of ‘stripes’ which individually form closed shapes (as pictured above). The stripes need to be a consistent width and distance apart that I specify.
I’m running into a couple issues with the Contour approach. One of which is that when I adjust the stripe width or distance, often the points at some extreme of the shape move off the shape and disappear, which means the next line is now the first point, which causes the closed and open sections to invert. Here’s a GIF showing what I mean:
How can I fix this? Is there a completely different approach to what I’m trying to do other than Contour or Trim Region?
Another thing that would be nice to figure out is how to close the appropriate lines with a section from the region they’re inside, rather than a straight line between them, as this sometimes causes corners and tight angles to be lost (as shown here):
I’ve attached the grasshopper file here. Region stripe fill.gh (22.4 KB)
Any thoughts appreciated,