]> OCCT Git - occt.git/commitdiff
0028589: Data Exchange - Writing face with NaturalRestriction flag to IGES
authorika <irina.krylova@opencascade.com>
Fri, 24 Mar 2017 09:24:08 +0000 (12:24 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 30 Mar 2017 09:50:36 +0000 (12:50 +0300)
Add additional check for infinite surfaces

Correction of test case for issue CR28589

src/BRepToIGES/BRepToIGES_BRShell.cxx
tests/bugs/iges/bug28589 [new file with mode: 0644]

index 9d2003a2bbbc6f5a32839613b4bc06170b1a8183..235f8393658bf559ae3571ddbf13d5c674ab82f8 100644 (file)
@@ -26,6 +26,7 @@
 #include <Geom2d_Curve.hxx>
 #include <Geom_ConicalSurface.hxx>
 #include <Geom_CylindricalSurface.hxx>
+#include <Geom_Plane.hxx>
 #include <Geom_RectangularTrimmedSurface.hxx>
 #include <Geom_SphericalSurface.hxx>
 #include <Geom_Surface.hxx>
@@ -313,10 +314,16 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferFace(const TopoDS_Face&
     }
   }
 
+  // protection against faces on infinite surfaces with mistaken natural restriction flag
+  Standard_Boolean isWholeSurface = BRep_Tool::NaturalRestriction(start);
+  if ((Surf->IsKind(STANDARD_TYPE(Geom_Plane)) ||
+       Surf->IsKind(STANDARD_TYPE(Geom_CylindricalSurface)) ||
+       Surf->IsKind(STANDARD_TYPE(Geom_ConicalSurface))) && !IOuter.IsNull())
+    isWholeSurface = Standard_False;
   // returns the TrimmedSurface
   // --------------------------
   Handle(IGESGeom_TrimmedSurface) TrimmedSurf = new IGESGeom_TrimmedSurface;
-  if (BRep_Tool::NaturalRestriction(start)) {
+  if (isWholeSurface) {
     //if face bounds and surface bounds are same, outer wire is unnecessary
     TrimmedSurf-> Init (ISurf, Standard_False, NULL, Tab);
   }
diff --git a/tests/bugs/iges/bug28589 b/tests/bugs/iges/bug28589
new file mode 100644 (file)
index 0000000..8c1d5cf
--- /dev/null
@@ -0,0 +1,8 @@
+#######################################################################
+# Data Exchange - Writing face with NaturalRestriction flag to IGES
+#######################################################################
+
+restore [locate_data_file bug28589.brep] face
+brepiges face ${imagedir}/${casename}.igs
+igesbrep ${imagedir}/${casename}.igs result *
+checknbshapes result -shape 10