1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0026570: Crash on attempt to rotate a shape.

An extended draw-command trotate (ttranslate, tmirror, ...) by an additional parameter "-copy".
New check of edge range is added in BRepCheck/BRepCheck_Edge.cxx
The same checking is added in ShapeAnalysis_Edge.cxx
Fixing this problem is added in ShapeFix_Wire.cxx
GeomLib::SameRange(...) and BRepTools_TrsfModification::NewCurve2d(...) are modified to avoid exception in TrimmedCurve
This commit is contained in:
vro
2015-08-19 10:25:11 +03:00
committed by bugmaster
parent 472433e2c7
commit 4e882c7153
13 changed files with 264 additions and 25 deletions

View File

@@ -32,6 +32,7 @@
#include <Geom2d_Curve.hxx>
#include <Geom2dAdaptor_HCurve.hxx>
#include <Geom_Curve.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Surface.hxx>
#include <GeomAdaptor_Curve.hxx>
@@ -1028,3 +1029,44 @@ Standard_Boolean ShapeAnalysis_Edge::CheckOverlapping(const TopoDS_Edge& theEdge
theTolOverlap = aresTol;
return isOverlap;
}
//=======================================================================
//function : CheckPCurveRange
//purpose :
//=======================================================================
Standard_Boolean ShapeAnalysis_Edge::CheckPCurveRange (const Standard_Real theFirst,
const Standard_Real theLast,
const Handle(Geom2d_Curve)& thePC)
{
const Standard_Real eps = Precision::PConfusion();
Standard_Boolean isValid = Standard_True;
Standard_Boolean IsPeriodic = thePC->IsPeriodic();
Standard_Real aPeriod = RealLast();
if(IsPeriodic)
{
aPeriod = thePC->Period();
}
Standard_Real fp = thePC->FirstParameter(), lp = thePC->LastParameter();
if (thePC->DynamicType() == STANDARD_TYPE(Geom2d_TrimmedCurve))
{
const Handle(Geom2d_Curve)& aC = Handle(Geom2d_TrimmedCurve)::DownCast (thePC)->BasisCurve();
fp = aC->FirstParameter();
lp = aC->LastParameter();
IsPeriodic = aC->IsPeriodic();
if(IsPeriodic)
{
aPeriod = aC->Period();
}
}
if(IsPeriodic && (theLast - theFirst > aPeriod + eps))
{
isValid = Standard_False;
}
else if(!IsPeriodic && (theFirst < fp - eps || theLast > lp + eps))
{
isValid = Standard_False;
}
return isValid;
}