Polycurve offsets changing sides irregularly

I’ve been struggling with this for a while. Any advise or simmilar experiences would be appreciated.

My goal:

  • Select 2 crossing autocad polylines in any shape and convert them to polycurves.
    (i’ve got this part covered, no advice needed)
  • Offset said polycurves based on the value of number sliders in order to set road width for in and outgoing traffic, separated by a median. All roads and medians have their own values.
    (i’ve got this part covered, no advice needed)
  • Position a turbo-roundabout on the intersection of said polylines.
    (i’ve got this part covered, no advice needed)

Problems (advice needed):

  • Whats holding me back is dynamo behaving weirdly when offseting polycurves.
  • For example: I select two sets of crossing polylines (in cad) with different shapes (to create two imaginary roundabout locations). One set of two crossing polycurves will offset themselves in multiple directions based on my parameters, perfect. But when i select the next set of polylines with the exact same parameters the polycurves will offset differently.
    (see image)
  • Reversing polycurves that change offset sides does not work and does not solve the initial
    problem.

Additional context:

  • I’ve tried to solve this issue on multiple dynamo versions up to 3.2.2, all of the versions managed to recreate the same problem.
  • I draw the cad polylines from left to right and up to down for a consistent direction.

How do i make sure the polycurves always know what side to offset to?
It just seems random at this point.

I’ve attached the part of my script that manages offsets and the dwg with two sets of alignments.

Greetings, Johnny.

Offsets.dyn (155.5 KB)
Offset.dwg (373.8 KB)

Hi @Johnny.pronk,

It’s probably a result of the normal vector for the curves, which can depend on how the polylines were originally drawn. You can have more control of Dynamo’s offset behavior by using the planeNormal input in the PolyCurve.OffsetMany node. I’d expect in most cases that you’d want to force the offset to use the world Z axis vector here.

2 Likes

Using Z-axis worked like a absolute charm. Thanks a lot.

1 Like