Polycurve.Offset not always in right direction

I posted this alos on Github (https://github.com/DynamoDS/Dynamo/issues/5477), as I think it’s a problem. But just in case there would be a good workaround of anyone has noticed the same, I would like to repost here and hope someone can help.

In the next example, it seems that when offsetting polycurves, which are composed from the perimeter curves of equal generated surfaces. Generated in Dynamo 0.8.2
In the example below, some curves are offset inside the original closed curve, in other indexes it is performed outside.

The original surfaces are the result of intersections of surfaces coming from a face selection in Revit and the solid.

Perimeter curves coming from the generated surfaces.

image

Offset curves, indicated ones are outside boundaries

Offset curves and original curves together.
Some are inside, some are outside.

 

I posted to quick… Finally I was able to be faster then my shadow and found a solution which seems to work even a bit faster and is more simple :slight_smile:

This by using the Thinshell and then a solid.difference to get the inner solid. When intersection with the global surfaces, the polycurves don’t need the offset anymore.

See script here: Solid Difference
1

 

 

If you do however want to offset consistently, you could first offset in both directions and then choose the one that you need like so:

2015-10-09_10-52-53

@dimitar thats a nice solution!

Thx Dimitar. Indeed nice solution.

<span style=“font-weight: 300;”>@dimitar is it possible to get the script?</span>

Hi Carl,

The gist of it is only 5 nodes. Here’s the graph:

offset1

2015-12-03_10-30-39

 

 

 

 

 

 

 

 

 

 

 

 

 

However there is one limitation with this approach. If the closed curve is offset internally past its bounds, the offset will fail, you’ll get a null value and you won’t be able to evaluate the list. Likewise if the closed curve is concave and is offset too far externally beyind the concave corner’s bounds, the offset will fail once more and cause a null value that will prevent us from determining the correct offset.

2015-12-03_10-43-27