So this is a complicated problem but I will describe it the best I can.
This is a file containing geometry being sliced in a nonplanar method and creating infill on the interior. However, the infill pattern I have going for it is poorly optimized and not accomplishing what I need it to. Basically, I am offsetting the outer perimeter to generate infill inside of it. But due to how the offset works, the geometry becomes confused and starts to leave the interior of the curve being offset (Offset curve in green)
I am currently shattering the offset curve then keeping the longest two segments, combining them, and then generating the infill for the resulting polyline. This works fine for the larger slices but eventually the geometry gets too thin to actually require infill and the portions of the offset curve outside the curve it was offset from get longer than the interior portions of the offset curve itsself, creating infill outside the perimeter curve. At this point I would like to switch the infill generation to just the interior offset curve if possible.
My problem is the detection of that.
I tried using the midpoints of longest, shattered interior offset curve, but midpoint distances eventually get close to zero and then “bounce”, increasing as the wrong geometry becomes more pronounced (2->1->0.5->1->3->5->etc.). and I am having a hard time detecting that with some kind of an “if” statement.
However, it isn’t a permanent solution to the problem. If the slices above the one previously sliced eventually require infill, the generation wouldn’t happen once the instance is switched to one without infill. So if anyone has a better idea on how to detect when the infill is being generated outside of the perimeter curve, or even a better way to generate infill generally, I am open to hearing about it.