I’m reading 3DM files using RhinoIO.NET. Using samples files that have NurbsCurves that Rhino recognizes as ellipses (Properties->Details: Valid curve. Ellipse). I try to detect them but IsEllipse and TryGetEllipse return false even with a low tolerance like .001. Anything else I could try?
No problem. It’s good to know I’m not imagining things.
I actually saw that wiki article, but since IsArc, IsPlanar, IsPolyline were all working it never occurred to me that IsEllipse was not implemented. It’s OK I have other means to recognize the ellipse.
BTW the OpenNURBS toolkit is amazing. It is very intuitive and with minimal help I find everything I need.
This thread is great! I have exactly the same issue? However, I don’t have any other tricks up my sleeve to recognize Ellipses and aside from converting them ToNurbsCurve() I haven’t figured out a way to recreate those. Ideas?
Dale,
Will this functionality ever be implemented in Open Nurbs? Can you help with filtering out Ellipses? Any other way to recognize it than IsEllipse ?
Keeping in mind that the purpose of openNURBS is to read and write Rhino’s 3DM file format, and that ON_NurbsCurve::IsEllipse is not required for this, I’ll go out on a limb and say no, I don’t see this ever being added to the toolkit. But who knows…
Thanks for a quick response. I thought that you will say that so i went ahead and basically converted Ellipses to Nurbs Curve using ToNurbsCurve() and then went on to break it down to Control Points, weight, knots and degree so that i can recreate it in other software. I am writing a importer for 3dm files into Dynamo(Revit) that is using Design Script. It would be great to be able to simply create Ellipses from Radii and Plane, but since I dont have access to that information through Open Nurbs then i guess i will have to live with it
openNURBS does not have an ellipse curve. So there is no reason to convert an ellipse to NURBS curve, as it already is one.
Here is sample Rhino command that classifies curves. This might be helpful to you in your conversion efforts. Just keep in mind the the ellipse test will not work with just openNURBS.
We developed our own sorting algorithm to create more specific entities from generic NurbsCurve entities. Similar to Dale’s proposed SampleClassifyCurve command it analyses various curve properties and generates the specific Arc, Ellipse, etc. entity when appropriate. We use it with other generic formats (IGS and STEP) because sometime source software output generic NurbsCurve.