Anyone know of a script to check if a curve with more than 3 control points that looks like an arc is close enough within a certain deviation or tolerance to be an arc.
Divide both curves (that have the same direction!) with 10 points and measure the distance between each pair of points?
Hi Ian,
Here’s an algorithm that could be scripted:
- let L equal the length of the curve.
- run -convert on the curve with the options Output=Arcs, DeleteInput=No, AngleTolerance and Tolerance set to your desired values, MinLength=L.
- check the result:
3a. If there is no resulting curve then you didn’t have an arc.
3b. If there is a resulting curve of one segment you did have an arc.
3c. If there is a resulting curve of more than one segment and the segments have the same radii you did have an arc but if the radii are different then you didn’t have an arc.
HTH
Jeremy
1 Like
HI @Ian_Empson,
A Python or C# component that calls this should do it.
https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.curve/isarc
— Dale