GeomBSplineCurve: Add interpolate without tangents

Now with description

Periodic selectable
This commit is contained in:
Benjamin Alterauge
2022-05-22 19:58:37 +02:00
committed by Uwe
parent c48a569696
commit b7ab1dc895
2 changed files with 20 additions and 0 deletions

View File

@@ -1394,6 +1394,22 @@ bool GeomBSplineCurve::join(const Handle(Geom_BSplineCurve)& spline)
return true;
}
void GeomBSplineCurve::interpolate(const std::vector<gp_Pnt>& p, Standard_Boolean periodic)
{
if (p.size() < 2)
Standard_ConstructionError::Raise();
double tol3d = Precision::Approximation();
Handle(TColgp_HArray1OfPnt) pts = new TColgp_HArray1OfPnt(1, p.size());
for (std::size_t i=0; i<p.size(); i++) {
pts->SetValue(i+1, p[i]);
}
GeomAPI_Interpolate interpolate(pts, periodic, tol3d);
interpolate.Perform();
this->myCurve = interpolate.Curve();
}
void GeomBSplineCurve::interpolate(const std::vector<gp_Pnt>& p,
const std::vector<gp_Vec>& t)
{

View File

@@ -265,6 +265,10 @@ public:
virtual ~GeomBSplineCurve();
virtual Geometry *copy(void) const;
/*!
* Interpolate a spline passing through the given points without tangency.
*/
void interpolate(const std::vector<gp_Pnt>&, Standard_Boolean=Standard_False);
/*!
* Set the poles and tangents for the cubic Hermite spline
*/