[Sketcher] Do regular drag for small B-splines

Here, "small" means that the number of poles of the spline is so low that moving
any piece of the curve without changing shape would require moving all the
poles. In that case the rest of the algorithm in `initBSplinePieceMove()` only
complicates the matter.
This commit is contained in:
Ajinkya Dahale
2022-07-06 17:45:04 +05:30
committed by abdullahtahiriyo
parent c53661014a
commit f958e1a215

View File

@@ -4040,11 +4040,16 @@ int Sketch::initBSplinePieceMove(int geoId, PointPos pos, const Base::Vector3d&
return -1;
}
GCS::BSpline &bsp = BSplines[Geoms[geoId].index];
// If spline has too few poles, just move all
if (bsp.poles.size() <= (bsp.degree + 1))
return initMove(geoId, pos, fine);
// Find the closest knot
auto partBsp = static_cast<GeomBSplineCurve*>(Geoms[geoId].geo);
double uNear;
partBsp->closestParameter(firstPoint, uNear);
GCS::BSpline &bsp = BSplines[Geoms[geoId].index];
auto& knots = bsp.knots;
auto upperknot = std::upper_bound(
knots.begin(), knots.end(), uNear,