rs.OffsetCurveOnSurface() doesn't work the same as Rhino.OffsetCurveOnSurface()

While Rhinoscript method would offset the curve and extend it to the edges, python rs method would NOT.
Ok, fine, let me just run rs.ExtendCurve(crv, 2, 2, [srf]) with the surface as a border. Nope, some random curves would only extend to the border of the surface on one random end. So I have to literally run rs.ExtendCurve(crv, 2, 2, [srf]) again. Why is it so bad with python methods?..

test0.3dm (48.2 KB)

test.3dm (131.6 KB)

Hi @Asterisk

I’ve logged this - https://mcneel.myjetbrains.com/youtrack/issue/RH-59447

In the mean time, use the following RhinoCommon methods:

Curve.OffsetOnSurface
Curve.ExtendOnSurface

– Dale

Hi @dale and @Asterisk,

Is this really a desirable behaviour for OffsetCurveOnSurface? Why the extension?


It would probably be better to control the extension with additional parameter.

Hi @spineribjoint1,

Does the OffsetCrvOnSrf have the same behavior?

– Dale

Not entirely @dale. Here is another video.


First half of the video demonstrates OffsetCrvOnSurface and second half is rs.OffsetCurveOnSurface().
In case of closed curve rs.OffsetCurveOnSurface() does the extensions while OffsetCrvOnSurface does not.

I am not sure that having this extension at all is consistent with other offset commands and methods in Rhino. Shouldn’t this be an optional parameter? Or maybe extending should be done with rs.ExtendCurveOnSurface().

OffsetCurveOnSurface.3dm (75.7 KB)

Hi @spineribjoint1,

Here is the source to rs.OffsetCurveOnSurface if you are curious. I can see the code does not check to see if the results create a closed curve. Only open curves should be extended - this is how the Rhino command operates. I’ll open an issue for this.

https://mcneel.myjetbrains.com/youtrack/issue/RH-60743

– Dale