Convert command for curves to Arcs and lines

Command name “convert” in Rhino 5 , takes a long curve and gives output as
Arcs Segments.

There is a Tolerance and an angler tolerance for this conversion.
Please please, some one tell me what are this two tolerance and how the code work.
I need to write a RhinoCommon c# script, which should convert a long curve into Arc and line Segments.

I wrote something, which is going through existing control points of the long curve, so not very accurate.

Can somebody explain the rule behind this existing convert command ?

Many Thanks !

1 Like

Use Rhino.Geometry.Curve.ToPolyline() The arguments are well documented.

http://4.rhino3d.com/5/rhinocommon/?topic=html/M_Rhino_Geometry_Curve_ToPolyline_1.htm

1 Like

Sorry, I see that you wanted arcs not line segments. As the code behind the Convert command is not entirely exposed in RhinoCommon, the best you can (probably) do at this time is to use Rhino.Geometry.Curve.Simplify().

http://4.rhino3d.com/5/rhinocommon/?topic=html/M_Rhino_Geometry_Curve_Simplify.htm

Does this help?

2 Likes

Check the help file for details on the Convert command, as it documents the tolerances.

1 Like

Dear Dale ,
Many thanks for the reply !
I actually need that particular command implemented in Rhino-common.
I will see Rhino documentation to understand what are those two tolerance.
I hope that will give me idea, how to do it.

I did one, which convert a long curve to arc and line segments, it is working perfect but it is not recalculating control points.
So mine one is not the optimized one.
I need to brain storm :smile:
Best regards

Hi Dale.

Just bumping this in 2019. Has the Convert command (or an equivalent function) been added to RhinoCommon? I looked through all the things you can do the Geometry in an object, but I did not find an alternative.

Thanks, as always, for all your help!

Hi @AxeManGa,

The basis of the Convert command is exposed in Curve.Simplify and Curve.ToPolyline.

– Dale