Offset a non planer PolyCurve

Hi, Friends,
I have a non planer PolyCurve (PolyCurve based in a curved plane) and i want to make offset inwards for this PolyCurve.

can any one provide me with a python code to do that in dynamo.
Any help will be appreciated.
Thanks in advance.

a plane cannot be curved by definition. Do you mean perhaps a curved surface? if that is the case, your PolyCurve can be seen as the intersection of that surface (A) with another surface (B). You can use your PolyCurve to attempt to build such surface (B) and then offset this inward to a surface (C) and intersect this with surface (A), the result could be what you are looking for.
How to build surface (B)… you can try using the surface (A) normals at the vertices of the PolyCurve to begin with, create a second PolyCurve and blend the two profiles. Be mindful that it might not work as you could easily obtain a self-intersecting object…

I think something like this would be the most robust: Surface.Thicken to build a solid of the original surface> Solid.ThinShell to offset the thickness walls inward (accounting for the offset with the interior thickness) > Solid.Difference using the original solid from the thicken node as the base solid and the thin shell as the other > Solid.Faces and PolySurface.ByJoinedSirfaces to get just the offset faces of the solid > Geometry.Intersect to get the parts of the original surface which intersect with the polysurface > PolyCurve.ByJoinedCurves to get the offset polycurve.

However that’s a LOT and it may be that there is a better way forward (Curve.ByParameterOnSirface?) with more context of the original geometry.

@Paolo_Emilio_Serra1 Yes I mean a curved Surface, and i want to make offset for its perimeter curves (as a PolyCurve) by a certain distance inward.
but unfortunately i did not get your idea about creating the b and c surfaces to get what i am looking for.

@jacob.small appreciate your suggestion , but as you know using Solids may take too much time to run (Specially when handling a large data ) and make the code more heavy, I was intend to work around the curves itself to get what i want.

Not necessarily. Note that your specific curve calculations will take pretty much all the same mathematical complexity of the solid calcs due to your non/planar surface, so even if a curve only method was required the total calculation load would be basically the same… or I think it would be. Need to see your geometry in context though.

And I say your geometry as these types of uses are rarely reused in my experience as within the context of the project you can usually find a better path forward as you don’t have to account for all edge cases.

Your polycurve is planar (Z value is consistent), and then you call the standards polycurve offset… that won’t work as far as I can tell with an undulating surface to offset onto.

1 Like

Thanks @info.wealthystar for your python code but as @jacob.small said , this only will work with a planer PolyCurve , but in my case this is non planer PolyCurve.

Tested my method above which worked well and reasonably quickly. Certainly fast enough for a one time operation on a complex shape. In extreme cases I did get some artifacts in the interior, but those can be edited out easily enough.

Also worked by sweeping a circle around the curves, unioning those into a single solid, and intersecting the result with the initial surface. This was faster but got some less desirable results when edges oddly configured.