mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0030269: Modeling Algorithms - unhandled Standard_NullObject within BRepBndLib::Add()
Added BRep_Tool::IsGeometric() check before every BRepAdaptor_Curve::Initialize().
This commit is contained in:
@@ -116,8 +116,11 @@ void BRepBndLib::Add(const TopoDS_Shape& S, Bnd_Box& B, Standard_Boolean useTria
|
||||
else {
|
||||
for (;ex2.More();ex2.Next()) {
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge(ex2.Current());
|
||||
BC.Initialize(anEdge);
|
||||
BndLib_Add3dCurve::Add(BC, BRep_Tool::Tolerance(anEdge), B);
|
||||
if (BRep_Tool::IsGeometric (anEdge))
|
||||
{
|
||||
BC.Initialize (anEdge);
|
||||
BndLib_Add3dCurve::Add (BC, BRep_Tool::Tolerance (anEdge), B);
|
||||
}
|
||||
}
|
||||
B.Enlarge(BRep_Tool::Tolerance(F));
|
||||
}
|
||||
@@ -198,8 +201,12 @@ void BRepBndLib::AddClose(const TopoDS_Shape& S, Bnd_Box& B)
|
||||
BRepAdaptor_Curve BC;
|
||||
|
||||
for (ex.Init(S,TopAbs_EDGE); ex.More(); ex.Next()) {
|
||||
BC.Initialize(TopoDS::Edge(ex.Current()));
|
||||
BndLib_Add3dCurve::Add(BC,0.,B);
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge (ex.Current());
|
||||
if (BRep_Tool::IsGeometric (anEdge))
|
||||
{
|
||||
BC.Initialize (anEdge);
|
||||
BndLib_Add3dCurve::Add(BC,0.,B);
|
||||
}
|
||||
}
|
||||
|
||||
// Add the vertices not in edges
|
||||
@@ -262,7 +269,7 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B,
|
||||
for (;ex2.More();ex2.Next()) {
|
||||
Bnd_Box anEBox;
|
||||
const TopoDS_Edge& anE = TopoDS::Edge(ex2.Current());
|
||||
if(BRep_Tool::Degenerated(anE))
|
||||
if (BRep_Tool::Degenerated (anE) || !BRep_Tool::IsGeometric (anE))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -289,7 +296,7 @@ void BRepBndLib::AddOptimal(const TopoDS_Shape& S, Bnd_Box& B,
|
||||
for (;ex2.More();ex2.Next()) {
|
||||
Bnd_Box anEBox;
|
||||
const TopoDS_Edge& anE = TopoDS::Edge(ex2.Current());
|
||||
if(BRep_Tool::Degenerated(anE))
|
||||
if (BRep_Tool::Degenerated (anE) || !BRep_Tool::IsGeometric (anE))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@@ -165,14 +165,17 @@ static Standard_Integer PointsForOBB(const TopoDS_Shape& theS,
|
||||
for(anExpE.Init(aF, TopAbs_EDGE); anExpE.More(); anExpE.Next())
|
||||
{
|
||||
const TopoDS_Edge &anE = TopoDS::Edge(anExpE.Current());
|
||||
const BRepAdaptor_Curve anAC(anE);
|
||||
if (!IsLinear(anAC))
|
||||
if (BRep_Tool::IsGeometric (anE))
|
||||
{
|
||||
if (!theIsTriangulationUsed)
|
||||
// not linear and triangulation usage disabled
|
||||
return 0;
|
||||
const BRepAdaptor_Curve anAC(anE);
|
||||
if (!IsLinear(anAC))
|
||||
{
|
||||
if (!theIsTriangulationUsed)
|
||||
// not linear and triangulation usage disabled
|
||||
return 0;
|
||||
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,11 +215,15 @@ static Standard_Integer PointsForOBB(const TopoDS_Shape& theS,
|
||||
for(anExpE.Init(theS, TopAbs_EDGE, TopAbs_FACE); anExpE.More(); anExpE.Next())
|
||||
{
|
||||
const TopoDS_Edge &anE = TopoDS::Edge(anExpE.Current());
|
||||
const BRepAdaptor_Curve anAC(anE);
|
||||
|
||||
if (IsLinear(anAC))
|
||||
// skip linear edge as its vertices have already been added
|
||||
continue;
|
||||
if (BRep_Tool::IsGeometric (anE))
|
||||
{
|
||||
const BRepAdaptor_Curve anAC(anE);
|
||||
if (IsLinear(anAC))
|
||||
{
|
||||
// skip linear edge as its vertices have already been added
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!theIsTriangulationUsed)
|
||||
// not linear and triangulation usage disabled
|
||||
|
Reference in New Issue
Block a user