Offset curve troubles

I’m struggling with offset curve producing unexpected results. Trying to get a series of ~60 offsets, invariably some of them are missing or bizarre.

I found this topic, which seems similar, but using the curve’s plane did not make a difference.

Visually it looks like the problem occcurs when switching to/from kinked corners. But I’m not sure what to do with that info. The various “corner type” options don’t help.

Any ideas? Internalised data attached. (33.8 KB)

How about using tween curve(in the attached I used Tween Two Curvesin Pufferfish) instead? (69.9 KB)

1 Like

I typically use Offset Curve to create an extruded 3D solid from a single 2d curve. This means I only need 1 offset. But I have experienced results like yours under certain unique circumstances. So to check out what’s going on with your offset I made this addition to your sample file:

That made it easy to generate a whole bunch of different offset scenarios - here’s an interesting one:

Based on this it looks like there are a couple of quirks with your base curve and how Offset Curve works:

  1. Your base curve seems to not be totally symmetrical. This is evidenced by the pentagonal shape in your example, and also by many of the degenerate offsets I was able to create using my Series component. (Note the shorter bottom horizontal line on the innermost offset in my example.)
  2. Because of #1, Offset Curve has a problem when one of the sides of the offset disappears.
  3. It looks like the Offset Curve algorithm encounters a problem when it has to insert a corner/kink in the curve it is trying to generate. But after that it can continue to generate offsets with corners where they need to be.
  4. At some point the generated offset curve goes crazy, perhaps because the previous offset curve normals get reversed.

All this leads me to 3 conclusions:

  1. To minimize unexpected behavior the initial curve has to be truly symmetrical, or the number of offsets has to be small enough to not force elimination of curve segments.
  2. Like many other GH components, Offset Curve has some quirks that are seldom encountered but rather are lurking in the background, just waiting to be discovered.
  3. To circumvent unexpected results use an alternative method as HS_Kim suggests. (36.6 KB)

Thank you for the great analysis, and insight on the symmetrical issue. I can’t adapt this design to be symmetrical, but I can adopt HS_Kim’s clever tween curve approach.

You could also try clipper Polyline Offset, but as the component name implies, the results would be polylines…

1 Like

Thanks for this – it’s the solution I ended up adopting. And that use of reparameterize on the input to Divide Distance is just brilliant. I really appreciate all of the help you provide on these forums.