generative modeling for Rhino
Hi guys,
I was looking at the Rotate method for a curve (GeometryBase.Rotate Method) in the Rhino Common SDK and noticed that it returns a boolean value, why doesn't it return a curve or any rotated geometry instead?
Many thanks,
Arthur
Tags: GeometryBase.Rotate, Method, curve, rhinocommon, rotate, sdk

Hi Arthur,
because it rotates the object you call it on.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Permalink Reply by Arthur Mamou-Mani on April 28, 2012 at 6:02am Thank you very much David. I asked this questions as I have tried several ways to rotate a curve and found out that only one worked:
Dim newcrv As Curve
newcrv = x.DuplicateCurve()
newcrv.Rotate(z, y, x.PointAtEnd)
A = newcrv
Whereas the following one returned a "true" instead of a curve:
A = x.Rotate(z, y, x.PointAtEnd)
Not sure I fully understand why this is as in the second case I am also calling the mehod on the curve x?
Permalink Reply by Arthur Mamou-Mani on April 28, 2012 at 6:37am Sorry I got it now...
Instead of A = x.Rotate(z, y, x.PointAtEnd)
I need:
A = x
It makes sense, we are returning the curve not the method...

crv.Rotate(RhinoMath.ToRadians(45), Vector3d.ZAxis, Point3d.Origin)
A = crv
This works for me, I don't have to duplicate the curve first. Rotate() always returns a Boolean value so A = x.Rotate(z, y, x.PointAtEnd) would always result in A being either True or False.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Permalink Reply by Arthur Mamou-Mani on April 28, 2012 at 8:22am Thanks David. It makes sense.
Added by David Stasiuk 8 Comments 22 Likes
Added by stefano 5 Comments 8 Likes
© 2013 Created by Scott Davidson.
Powered by