Troubleshooting: offset in the same direction multiple closed curves

curve
grasshopper
unhandled
curves
offset

(Huskenazy) #1

Hi all
i got some closed curves from deconstruct brep and i want to offset them towards the interior; the problem is that some offset towards interior and others toward exterior.


I tried to flip the curves with a guide curve direction, but it doesnt work.
Here the definition with internalised data, and lower my attempt to solve the problem.

offset multiple closed curves.gh (180.0 KB)


(Laurent Delrieu) #2

Offset in 2 directions and sort these curve by length. Then choose the shortest curve.
If you accept polyline use Clipper plugin


(Huskenazy) #3

nice trick! Thank you very much


#4

I am working on offsetting a circle for ring sizes. How do I offset by 2 directions and then sort by longest?

I need to find outside circumference length to use to cut metal lengths.

Thanks,
«Randy

ring sizes to lines 2018.gh (18.6 KB)


(David S. Mavrov) #5

Like this?

offset multiple closed curves_v1.gh (166.0 KB)


(David S. Mavrov) #6

I think this will do for you.

ring sizes to lines 2018_v1.gh (17.1 KB)


(Laurent Delrieu) #7

Not with my pc now
You have to input a positive and negative value in offset, the 2 offseted curves need to be on the same branch, then you measure the length of the curves, sort the length and the curves. Finally extract first item with list item component. Is it clear ?


#8

I am just back. I have about 30 minutes to play before off again. Most of it makes sense. I am just opening @davidsmavrov definition to see.

Thank you,
«Randy


#9

thanks, this will work.

So it is the math * -1 that causes an opposite offset?

«Randy


#10

Thanks, I will look at this this afternoon when I have more time.

«Randy


(Huskenazy) #11

Nice trick @davidsmavrov. Anyway I don’t understand why it works with those planes from planar component and the circles plugged in the G input of Flip; instead it doesnt work if i use the same planes but i plug in G the curves from graft.
Surely there is something I am not understanding @DavidRutten


offset multiple closed curves_v1_RE.gh (332.5 KB)


(David S. Mavrov) #12

Because you can’t use the geometry you will be guiding as a guide. Doesn’t make sense. And the cirlce is perfect, because it is predictable and it will always have the same orientation. In other words, works as a guide.


(Huskenazy) #13

@laurent_delrieu
I did as you advised and it works.

offset multiple closed curves_1.gh (305.5 KB)

@davidsmavrov You are right. This is an alternative solution proposed by @laurent_delrieu. Check it out.