Added BRep_Tool::IsGeometric() check before every BRepAdaptor_Curve::Initialize().
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));
}
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
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;
}
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;
}
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;
-
- break;
+ const BRepAdaptor_Curve anAC(anE);
+ if (!IsLinear(anAC))
+ {
+ if (!theIsTriangulationUsed)
+ // not linear and triangulation usage disabled
+ return 0;
+
+ break;
+ }
}
}
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
--- /dev/null
+puts "========"
+puts "0030269: Modeling Algorithms - unhandled Standard_NullObject within BRepBndLib::Add()"
+puts "========"
+puts ""
+
+pload MODELING VISUALIZATION
+
+# sample Face with some Curve2ds missing
+set aShapeData "
+DBRep_DrawableShape
+
+CASCADE Topology V1, (c) Matra-Datavision
+Locations 0
+Curve2ds 0
+Curves 2
+1 8111.3 2939 9014.2 0.23 5.2e-07 0.97
+1 9996.2 2940 8568.4 -0.229 3.64e-07 -0.97
+Polygon3D 0
+PolygonOnTriangulations 0
+Surfaces 2
+1 9056.7 2940 8807.3 1.29e-07 -1 5e-07 -1.26e-29 -5.03e-07 -1 1 1.288e-07 -6.48e-14
+1 10000 1519 8584.45 -0.97 -8.47e-08 0.23 0.23 0 0.97 -8.24e-08 1 1.95e-08
+Triangulations 0
+
+TShapes 10
+Ve
+1e-07
+8111.30 2940 9014.2
+0 0
+
+0101101
+*
+Ve
+1e-07
+9996.21 2940 8568.4
+0 0
+
+0101101
+*
+Ed
+ 2.22e-16 0 0 0
+0
+
+0101000
++10 0 -9 0 *
+Ve
+1e-07
+8115 2940 9030
+0 0
+
+0101101
+*
+Ed
+ 1e-07 0 0 0
+1 1 0 0 16.5
+0
+
+0101000
++10 0 -7 0 *
+Ve
+1e-07
+10000 2940 8584.5
+0 0
+
+0101101
+*
+Ed
+ 2.22e-16 0 0 0
+0
+
+0101000
++7 0 -5 0 *
+Ed
+ 1e-07 0 0 0
+1 2 0 -16.5 0
+4 C0 1 0 2 0
+0
+
+0101000
++5 0 -9 0 *
+Wi
+
+0101000
+-8 0 +6 0 +4 0 +3 0 *
+Fa
+0 1e-07 1 0
+
+0101000
+-2 0 *
+
+-1 4
+"
+
+set aFile [open "$imagedir/${casename}.brep" wb]
+puts $aFile $aShapeData
+close $aFile
+restore "$imagedir/${casename}.brep" f
+file delete "$imagedir/${casename}.brep"
+
+bounding f
+bounding f -optimal
+bounding f -obb
+sprops f
+vprops f
-puts "TODO OCC641 ALL: An exception was caught"
-puts "TODO OCC641 ALL: \\*\\* Exception \\*\\*.*"
-puts "TODO OCC641 ALL: Error : result shape is displayed wrongly"
-
puts "================"
-puts "OCC641"
-puts "SAM1559"
+puts "OCC641 E x c e p t i o n during attemption to display shape ==>SAM1559 (#2901)"
puts "================"
puts ""
-#################################################
-## Exception during attemption to display shape ==>SAM1559 (#2901)
-#################################################
+pload MODELING VISUALIZATION
restore [locate_data_file OCC641.brep] a
-
-vinit
-vdisplay a
+copy a m
+tmirror m 0 0 0 0 1 0
+vinit View1
+vdisplay -dispMode 0 a m
vfit
-
-copy a result
-
-if [catch {tmirror result 0 0 0 0 1 0 } res] {
- puts "Error : function tmirror works wrongly"
-} else {
- if [catch { vdisplay result } res] {
- puts "Error : result shape is displayed wrongly"
- }
- vfit
-}
-
-checkview -screenshot -3d -path ${imagedir}/${test_image}.png
-
+vdump ${imagedir}/${casename}_wf.png
+vdisplay -dispMode 1 a m
+vdump ${imagedir}/${casename}_sh.png