The difference between length and LastParameter?

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

The difference between length and LastParameter?

Post by microelly2 »

What is the difference between length and LastParameter for a curve?

>>> bc.length()
221.19932268800784
>>> bc.LastParameter
203.44541715547686

And what is the meaning of curvatureAt for a Face?
Are the values the main curvatures or the curvaturesfor the two iso-curves trough the point?


f=App.ActiveDocument.Torus.Shape.Face1
f.curvatureAt(0,6)
(0.08054889713478175, 0.5000000000000001)
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: The difference between length and LastParameter?

Post by DeepSOIC »

microelly2 wrote:What is the difference between length and LastParameter for a curve?
LastParameter is the parameter value of the ending vertex. Length is length. LastParameter in general has no relationship to Length since parametrization is an arbitrary thing.

Parameter is t in parametric equation of the curve "r = (x(t), y(t), z(t))". The actual curve is a set of x,y,z points, parametrization is just a very convenient way to define curves. Length is a property of the curve, and doesn't depend on chosen parametrization. LastParameter does depend on parametrization.

I would guess, these values are so close in your case because "chord length" knot vector construction was used. In this case, LastParameter is probably equal to the length of polyline connecting points being interpolated.
User avatar
Chris_G
Veteran
Posts: 2601
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: The difference between length and LastParameter?

Post by Chris_G »

Code: Select all

And what is the meaning of curvatureAt for a Face?
Are the values the main curvatures or the curvatures for the two iso-curves trough the point?


f=App.ActiveDocument.Torus.Shape.Face1
f.curvatureAt(0,6)
(0.08054889713478175, 0.5000000000000001)
These are the principal curvatures : the min and max curvatures
https://github.com/FreeCAD/FreeCAD/blob ... p.cpp#L480
If you're looking for the curvature in a specific direction, I found this topic that could help :
https://www.opencascade.com/content/spe ... -curvature

EDIT : oops, sorry, it looks like the DUV derivative used in the algorithm above is not ported to FreeCAD.
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: The difference between length and LastParameter?

Post by microelly2 »

Chris_G wrote:These are the principal curvatures : the min and max curvatures
Well, that was what I'm looking for. So I can find the developable areas :)
Thank you.
Post Reply