Hi,
I tried to link some of my old code which depended on previous version of OpenNURBS with the recently available one. I find that the methods GetLength() and Get NormalizedArcLengthPoint() methods are not defined for ON_NurbsCurve()
Please let me know how I should go about to get Length and NormalizedArcLengthPoint for NurbsCurve.
I recently started to study the Nurbs function.
The OpenNurbs are very useful for studying Nurbs function and Topology.
Therefore I cafully read the your online manual and source.
I recently knew the status of GetLength and NormalizedArcLength etc.
But I think that is it better to remove online manual for this functions.
I am some confusing in some times.
Can you please recommend an algorithm for computing the length of a nurbs curve?
We are using openNURBS to transfer 3D geometry to our meshing application. As part of this geometry transfer, we need to manually control the discretisation of some curves based on their length. OpenNURBS includes functionality for computing the length of all curves bar ON_NurbsCurve:
ON_ArcCurve using ON_Arc::Length()
ON_LineCurve using ON_Line::Length()
ON_PolylineCurve using ON_Polyline::Length()
I followed up on the original posts where it was mentioned that ON_NurbsCurve::GetLength() existed in OpenNURBS earlier versions, but was then removed in later versions. However, the oldest and latest versions I could find with this function present was OPENNURBS_VERSION 200306060 and OPENNURBS_VERSION 201209145, respectively, but both, in their opennurbs_nurbscurve.cpp, only have the following:
BOOL ON_NurbsCurve::GetLength(
double* length,
double fractional_tolerance,
const ON_Interval* sub_domain
) const
{
// 3rd party developers who want to enhance openNURBS
// may provide a working GetLength here.
if ( length )
*length = 0;
return false;
}
Therefore I either haven’t gone back to an old enough version of openNurbs, or something else is going on. To that end, can you please recommend resources/references/etc to develop a working GetLength?
I highly doubt this was ever the case. Calculating length and arc length require some complex numerical integration - nothing we’d ever expose in the public version of openNURBS.
Sorry, there are not any names or papers I can provide reference for you. I’m sure if you Google the topic you will run into a few.
Perhaps you can do this work in Rhino and then export what you need?