[Part] Fix periodic b-spline trim
When `v == u` we want to "break" the b-spline at `u` (also OCC will raise an exception if same parameter is provided). The range of parameter can in general be different than 1.0, so use a general term.
This commit is contained in:
committed by
abdullahtahiriyo
parent
dda2d4761e
commit
2ca96161ed
@@ -1602,19 +1602,9 @@ void GeomBSplineCurve::Trim(double u, double v)
|
||||
};
|
||||
|
||||
try {
|
||||
if(!isPeriodic()) {
|
||||
splitUnwrappedBSpline(u, v);
|
||||
}
|
||||
else { // periodic
|
||||
if( v < u ) { // wraps over origin
|
||||
v = v + 1.0; // v needs one extra lap (1.0)
|
||||
|
||||
splitUnwrappedBSpline(u, v);
|
||||
}
|
||||
else {
|
||||
splitUnwrappedBSpline(u, v);
|
||||
}
|
||||
}
|
||||
if (isPeriodic() && (v - u <= Precision::PConfusion()))
|
||||
v = v + myCurve->LastParameter() - myCurve->FirstParameter(); // v needs one extra lap
|
||||
splitUnwrappedBSpline(u, v);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
THROWM(Base::CADKernelError,e.GetMessageString())
|
||||
|
||||
Reference in New Issue
Block a user