GeomBSplineCurve::interpolate

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Gift
Posts: 769
Joined: Tue Aug 18, 2015 10:08 am
Location: Germany, Sauerland

GeomBSplineCurve::interpolate

Post by Gift »

Null vectors from GeomBSplineCurve::interpolate will ignored, or how I disable the load function?
User avatar
Gift
Posts: 769
Joined: Tue Aug 18, 2015 10:08 am
Location: Germany, Sauerland

Re: GeomBSplineCurve::interpolate

Post by Gift »

Ok, all are in release stress, or the weather is too good. Can I submit this as PR? Maybe is this attractive.
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: GeomBSplineCurve::interpolate

Post by jnxd »

Gift wrote: Sun May 22, 2022 6:07 pm Ok, all are in release stress, or the weather is too good. Can I submit this as PR? Maybe is this attractive.
It's not completely clear what this method does. Could you add comments and documentation?
My latest (or last) project: B-spline Construction Project.
User avatar
Gift
Posts: 769
Joined: Tue Aug 18, 2015 10:08 am
Location: Germany, Sauerland

Re: GeomBSplineCurve::interpolate

Post by Gift »

jnxd wrote: Sun May 22, 2022 7:27 pm It's not completely clear what this method does. Could you add comments and documentation?
Thanks for the response. I'm add a description to header and make periodic selectable, See the same commit. Untested example:

Code: Select all

std::vector<gp_Pnt> pts { {0.,0.,0.}, {0.,5.,2,}, {0.,10.,3.}, {0.,4.,4.}};
Part::GeomBSplineCurve bsp = Part::GeomBSplineCurve();
bsp.interpolate(pts);
Part::Feature *obj = (Part::Feature *)Document->addObject("Part::Feature", "Spline");
obj->Shape.setValue(bsp.toShape());
The idea behind this is to use already existing structure and do not implement the same things again. (Maintenance-friendly)
Post Reply