RhinoCommon Curve.Offset V6 and V7 different result

Hi all,

I am running the same code in V6 and V7, but got different results.

Expected result in Rhino 6 (red curve is offsetted curve):

Rhino 7 result:

Code used:
var offset1 = originalCurve.Offset(new Plane(), 7, 0.01, CurveOffsetCornerStyle.Smooth);
var offset2 = originalCurve.Offset(new Plane(), 7* -1, 0.01, CurveOffsetCornerStyle.Smooth).ToList();

Is this a bug or is this the new expected result?

Could it be that this is not being interpreted as you expect? It’s the only thing I see that’s different. Why didn’t you use -7, ? Or am I way off the mark here?

Hi @AlW ,

Thank you for your response.

Well, i am using the +7 and -7 in both versions. It is exactly the same code in the Rhino 6 and 7 versions, but with different results.

I am curious if the Rhino 7 variant is bugged, because it is not offsetting the curve but moving it up and down instead.

the *-1 shouldnt be a problem since this is just a mathematical calculation that will happen. We use a variable offset that we normally offset both directions. For this example is changed our variable name to 7 so it is more readable in the example.

Have a nice weekend!

to me it looks like an offset in the perpendicular directions to the plane, so maybe the plane and curve are not on the same plane. Without seeing the file and the full code though it’s hard to guess

The thing is. It is exactly the same code on exactly the same curve.

Question is. Why does rhino 7 have a different result?

You know, now that I think about it, just the other day I was doing some curve offsets and was frustrated that no matter which viewport I started in it always wanted to offset in the same direction and not the one I wanted. I had to resort to the (relatively) tedious method of clicking the direction option in the command line and providing a “base” vector and a “desired direction” vector. Then it offset along the axis I wanted.

Now that I think about it some more, I may have actually been extruding a solid from a closed curve.

I’m just so accustomed to Rhino commands that don’t work logically that I just find the workaround and don’t give it much more thought.

new Plane() produces a Plane with
Origin=0,0,0 XAxis=0,0,0, YAxis=0,0,0, ZAxis=0,0,0
so Curve.Offset is processing Plane with zero-length vectors differently between V6 and V7.

1 Like

Hi @jordy1989,

I don’t know about the changes here, but, as @spb pointed out, new Plane() has no meaning, so I guess the definition is up to the developer. Because it’s a default structure constructor, in .Net, the plane will all be initialized to 0s. You should pick a plane. For example, Plane.WorldXY.

Please post a file as well, if you think there’s more.


Giulio Piacentino
for Robert McNeel & Associates

Hi @spb , @piac ,

Yes that is correct. In Rhino 6 a new Plane() creates a Plane.WorldXY instead of empty axis vectors.

It is now clear what happens and how this can easily be fixed.

Thanks for the help, greatly appreciated.