mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0029430: [Regression] Curve evaluation at boundary point.
Before the fix, BRepAdaptor_CompCurve considered the input wire to be periodic with period LastParameter()-FirstParameter(). Now, method IsPeriodic will always return FALSE because it is impossible to obtain correspondence between the members of BRepAdaptor_CompCurve class and its periodicity status. New behavior has been documented in upgrade-guide.
This commit is contained in:
@@ -46,11 +46,9 @@ BRepAdaptor_CompCurve::BRepAdaptor_CompCurve()
|
||||
: TFirst (0.0),
|
||||
TLast (0.0),
|
||||
PTol (0.0),
|
||||
myPeriod(0.0),
|
||||
CurIndex(-1),
|
||||
Forward (Standard_False),
|
||||
IsbyAC (Standard_False),
|
||||
Periodic(Standard_False)
|
||||
IsbyAC (Standard_False)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -60,11 +58,9 @@ BRepAdaptor_CompCurve::BRepAdaptor_CompCurve(const TopoDS_Wire& theWire,
|
||||
TFirst (0.0),
|
||||
TLast (0.0),
|
||||
PTol (0.0),
|
||||
myPeriod(0.0),
|
||||
CurIndex(-1),
|
||||
Forward (Standard_False),
|
||||
IsbyAC (theIsAC),
|
||||
Periodic(Standard_False)
|
||||
IsbyAC (theIsAC)
|
||||
{
|
||||
Initialize(theWire, theIsAC);
|
||||
}
|
||||
@@ -78,11 +74,9 @@ BRepAdaptor_CompCurve::BRepAdaptor_CompCurve(const TopoDS_Wire& theWire,
|
||||
TFirst (theFirst),
|
||||
TLast (theLast),
|
||||
PTol (theTolerance),
|
||||
myPeriod(0.0),
|
||||
CurIndex(-1),
|
||||
Forward (Standard_False),
|
||||
IsbyAC (theIsAC),
|
||||
Periodic(Standard_False)
|
||||
IsbyAC (theIsAC)
|
||||
{
|
||||
Initialize(theWire, theIsAC, theFirst, theLast, theTolerance);
|
||||
}
|
||||
@@ -144,13 +138,6 @@ BRepAdaptor_CompCurve::BRepAdaptor_CompCurve(const TopoDS_Wire& theWire,
|
||||
|
||||
TFirst = 0;
|
||||
TLast = myKnots->Value(myKnots->Length());
|
||||
myPeriod = TLast - TFirst;
|
||||
if (NbEdge == 1) {
|
||||
Periodic = myCurves->Value(1).IsPeriodic();
|
||||
}
|
||||
else {
|
||||
Periodic = Standard_False;
|
||||
}
|
||||
}
|
||||
|
||||
void BRepAdaptor_CompCurve::Initialize(const TopoDS_Wire& W,
|
||||
@@ -200,15 +187,6 @@ BRepAdaptor_CompCurve::BRepAdaptor_CompCurve(const TopoDS_Wire& theWire,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BRepAdaptor_CompCurve::SetPeriodic(const Standard_Boolean isPeriodic)
|
||||
{
|
||||
if (myWire.Closed()) {
|
||||
Periodic = isPeriodic;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
|
||||
{
|
||||
return myWire;
|
||||
@@ -308,13 +286,13 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
|
||||
|
||||
Standard_Boolean BRepAdaptor_CompCurve::IsPeriodic() const
|
||||
{
|
||||
return Periodic;
|
||||
return Standard_False;
|
||||
|
||||
}
|
||||
|
||||
Standard_Real BRepAdaptor_CompCurve::Period() const
|
||||
{
|
||||
return myPeriod;
|
||||
return (TLast - TFirst);
|
||||
}
|
||||
|
||||
gp_Pnt BRepAdaptor_CompCurve::Value(const Standard_Real U) const
|
||||
@@ -475,12 +453,6 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
|
||||
|
||||
|
||||
Wtest = W+Eps; //Offset to discriminate the nodes
|
||||
if(Periodic){
|
||||
Wtest = ElCLib::InPeriod(Wtest,
|
||||
0,
|
||||
myPeriod);
|
||||
W = Wtest-Eps;
|
||||
}
|
||||
|
||||
// Find the index
|
||||
Standard_Boolean Trouve = Standard_False;
|
||||
|
@@ -53,6 +53,9 @@ class Geom_BSplineCurve;
|
||||
//! of the BRep topology like a 3D curve.
|
||||
//! Warning: With this class of curve, C0 and C1 continuities
|
||||
//! are not assumed. So be carful with some algorithm!
|
||||
//! Please note that BRepAdaptor_CompCurve cannot be
|
||||
//! periodic curve at all (even if it contains single
|
||||
//! periodic edge).
|
||||
class BRepAdaptor_CompCurve : public Adaptor3d_Curve
|
||||
{
|
||||
public:
|
||||
@@ -75,10 +78,6 @@ public:
|
||||
//! Sets wire <W> and trimmed parameter.
|
||||
Standard_EXPORT void Initialize (const TopoDS_Wire& W, const Standard_Boolean KnotByCurvilinearAbcissa, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol);
|
||||
|
||||
//! Set the flag Periodic.
|
||||
//! Warning: This method has no effect if the wire is not closed
|
||||
Standard_EXPORT void SetPeriodic (const Standard_Boolean Periodic);
|
||||
|
||||
//! Returns the wire.
|
||||
Standard_EXPORT const TopoDS_Wire& Wire() const;
|
||||
|
||||
@@ -197,15 +196,11 @@ private:
|
||||
Standard_Real TFirst;
|
||||
Standard_Real TLast;
|
||||
Standard_Real PTol;
|
||||
Standard_Real myPeriod;
|
||||
Handle(BRepAdaptor_HArray1OfCurve) myCurves;
|
||||
Handle(TColStd_HArray1OfReal) myKnots;
|
||||
Standard_Integer CurIndex;
|
||||
Standard_Boolean Forward;
|
||||
Standard_Boolean IsbyAC;
|
||||
Standard_Boolean Periodic;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user