Thick curve area

I’m trying to calculate the area of a curve with a certain thickness. Is not really a problem until you get into self-intersecting curves and have to take into consideration overlapping regions. I tried to approximate the thick curve populating the curve with circles and then using rs.CurveBooleanUnion which works but is very slow.


20201029_thick curve area.gh (24.6 KB)

Is there a better way to calculate this?

/José

Hi José,

Here’s another way, that splits the self-intersecting curve into open and closed pieces, offsets these pieces, and joins all the resulting regions to get a “thickened curve”. It works for non-self-intersecting curves too, but you’ll probably have to do some tree management if you want it to work on multiple curves.

2020-10-29_DI-111218_Self intersecting thicken.gh (27.4 KB)

–Pierre

1 Like

Thanks for your answer!
It seems still tricky to escalate to a curve with an unknown number of self-intersections though

With another round of the trick “Region Difference of (Region Union - Region Intersection)”, I seem to get reasonable results on curves with multiple self intersections.

Another completely different idea would be to pipe the curve, intersect it with the xOy plane, and approximate the area of the thickened curve from that. My first try failed because the area around the intersections is counted multiple times, but there surely is a way to repair that!

2020-10-29_DI-111218_Self intersecting thicken.gh (27.5 KB)

Thanks Pierre! This looks great :smiley:

I tried before with a loose offset to get an overlapping close curved, which gives more or less the same result as the pipe section. I guess one can try multiple curve boolean based on the centres of the inside regions of the curve, pretty much the same logic you used.

This ended up being an interesting problem, now I’m wondering if there is a way to tell if certain region is overlapping more than once. Like you would expect using a transparent brush in photoshop.