diff --git a/src/BRepToIGES/BRepToIGES_BRShell.cxx b/src/BRepToIGES/BRepToIGES_BRShell.cxx index 9d2003a2bb..235f839365 100644 --- a/src/BRepToIGES/BRepToIGES_BRShell.cxx +++ b/src/BRepToIGES/BRepToIGES_BRShell.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -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 index 0000000000..8c1d5cf528 --- /dev/null +++ b/tests/bugs/iges/bug28589 @@ -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