Length of Spline #372
-
Hi is there an easy way to calculate the length of a spline using .netdxf? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
There is no formula to calculate exactly the length of a NURBS curve. With the available methods you have at the moment you can calculate it using brute force, discretizing the spline into a set of segments, with the desired precision, using the ToPolygonVertexes method and add up their lengths which will always be a lower bound of the actual spline length. If you dig up perhaps you may find a smarter, more optimized solution. |
Beta Was this translation helpful? Give feedback.
-
Thank you so much this will do the trick as all I have to do is provide an estimate. |
Beta Was this translation helpful? Give feedback.
There is no formula to calculate exactly the length of a NURBS curve. With the available methods you have at the moment you can calculate it using brute force, discretizing the spline into a set of segments, with the desired precision, using the ToPolygonVertexes method and add up their lengths which will always be a lower bound of the actual spline length. If you dig up perhaps you may find a smarter, more optimized solution.