if (i2 > myFaces->UpperRow())
i2 = 0;
if (i1 != 0)
- Face1 = TopoDS::Face(myFaces->Value(i1, jj));
+ {
+ const TopoDS_Shape& aShape1 = myFaces->Value(i1, jj);
+ if (aShape1.ShapeType() == TopAbs_FACE)
+ Face1 = TopoDS::Face(aShape1);
+ }
if (i2 != 0)
- Face2 = TopoDS::Face(myFaces->Value(i2, jj));
- CorrectSameParameter(anEdge, Face1, Face2);
+ {
+ const TopoDS_Shape& aShape2 = myFaces->Value(i2, jj);
+ if (aShape2.ShapeType() == TopAbs_FACE)
+ Face2 = TopoDS::Face(aShape2);
+ }
+ if (!Face1.IsNull() && !Face2.IsNull())
+ CorrectSameParameter(anEdge, Face1, Face2);
}
}
--- /dev/null
+puts "============"
+puts "OCC30204"
+puts "============"
+puts ""
+###################################
+# BRepOffsetAPI_MakePipeShell crash
+###################################
+
+#test only for no crash
+
+restore [locate_data_file bug30204_path.brep] path
+restore [locate_data_file bug30204_base.brep] base
+
+mksweep path
+setsweep -CN 0 1 0
+addsweep base
+buildsweep result
--- /dev/null
+puts "============"
+puts "OCC30204"
+puts "============"
+puts ""
+###################################
+# BRepOffsetAPI_MakePipeShell crash
+###################################
+
+restore [locate_data_file bug30204_path.brep] path
+restore [locate_data_file bug30204_base.brep] base
+
+mksweep path
+addsweep base
+buildsweep result
+
+checkshape result
+
+checknbshapes result -shell 1 -face 20 -wire 20 -edge 44 -vertex 24
+
+set tolres [checkmaxtol result]
+
+if { ${tolres} > 2.e-7} {
+ puts "Error: bad tolerance of result"
+}
+
+checkprops result -s 6851.98