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

0027992: Modeling Algorithms - Extrema_ExtPS crashes on face without geometric surface

The algorithm BRepExtrema_DistShapeShape has been protected against exceptions when non-geometric shape data is given on input, like a face containing triangulation only or an edge containing polygon only. Such faces/edges are ignored by the algorithm.

BRepGProps::VolumeProperties() now ignores faces without geometric surface to avoid access violation.
This commit is contained in:
msv
2016-11-17 15:50:16 +03:00
committed by apn
parent 6dd6e5c758
commit c894a5fdfc
9 changed files with 82 additions and 7 deletions

View File

@@ -40,7 +40,9 @@ BRepExtrema_ExtCC::BRepExtrema_ExtCC(const TopoDS_Edge& E1, const TopoDS_Edge& E
void BRepExtrema_ExtCC::Initialize(const TopoDS_Edge& E2)
{
Standard_Real V1,V2;
if (!BRep_Tool::IsGeometric(E2))
return; // protect against non-geometric type (e.g. polygon)
Standard_Real V1, V2;
BRepAdaptor_Curve Curv(E2);
myHC = new BRepAdaptor_HCurve(Curv);
Standard_Real Tol = Min(BRep_Tool::Tolerance(E2), Precision::Confusion());
@@ -57,6 +59,8 @@ void BRepExtrema_ExtCC::Initialize(const TopoDS_Edge& E2)
void BRepExtrema_ExtCC::Perform(const TopoDS_Edge& E1)
{
if (!BRep_Tool::IsGeometric(E1))
return; // protect against non-geometric type (e.g. polygon)
Standard_Real U1, U2;
BRepAdaptor_Curve Curv(E1);
Handle(BRepAdaptor_HCurve) HC = new BRepAdaptor_HCurve(Curv);