Is there an easy way to get the direction of an arc with RhinoScript (clockwise, anti-clockwise)?

I cannot find anything according to curve directions. Thanks for any hint!


Views: 463

Replies to This Discussion

Hi Dirk,

An arc is a planar curve (IsCurvePlanar). Thus, it has a plane (CurvePlane), and that plane has a normal (arrPlane(3)). An arc will always run counter-clockwise in respect with the plane's normal vector.

Or, you could just use ClosedCurveOrientation.

 -- Dale

Thanks Dale!

Unfortunately ClosedCurveOrientation isn't a help for me because an Arc isn't a closed curve. :-(

And more unfortunately I have no idea what to do with the information of the CurvePlane. Just draw two arcs, one cw and one ccw. The cw-normal is (0, 0, -1), the ccw-normal is (0, -0, 1). Yes, CStr(arrPlane(3)(1)) is "-0", what ever that means.

Or is this arrPlane(3)(2) the orientation as in ClosedCurveOrientation? I'm completely confused...

I need the orientation for a script that creates an NC program (just two axis, X and Y). There I have to go from the curve start point to the curve and point clockwise (G02) or counter-clockwise (G03) and a small function that gives me the orientation would be very helpful.

Any further hints appreciated, Dirk

self reply because it seems to work, a quick & dirty example:

arrPlane= Rhino.CurvePlane(strObject)

arr3= arrPlane(3)

orient= arr3(2)

if orient = -1 then

   'do the clockwise stuff

end if

if orient = 1 then

   'do the counter-clockwise stuff

end if

That looks correct.


Great, thanks!



© 2018   Created by McNeel Admin.   Powered by

Badges  |  Report an Issue  |  Terms of Service