diff --git a/Geo/GModelIO_OCC.cpp b/Geo/GModelIO_OCC.cpp index decae7ce9f2ca363b5bc4198a1cdd750e924b7e6..3b76e017ba67a86c4d1fd40a34698f438cbe1a81 100644 --- a/Geo/GModelIO_OCC.cpp +++ b/Geo/GModelIO_OCC.cpp @@ -491,6 +491,9 @@ void OCC_Internals::addPlanarFace(int tag, std::vector<int> wireTags) return; } result = f.Face(); + //ShapeFix_Face fix(face); + //fix.Perform(); + //result = fix.Face(); } catch(Standard_Failure &err){ Msg::Error("OpenCASCADE exception %s", err.GetMessageString()); @@ -535,8 +538,8 @@ void OCC_Internals::addSurfaceLoop(int tag, std::vector<int> faceTags) TopExp_Explorer exp0; for(exp0.Init(result, TopAbs_SHELL); exp0.More(); exp0.Next()){ TopoDS_Shell shell = TopoDS::Shell(exp0.Current()); - //ShapeFix_Shell fix; - //fix.FixFaceOrientation(shell); + //ShapeFix_Shell fix(shell); + //fix.Perform(); //shell = fix.Shell(); int t = tag; if(first){ @@ -574,6 +577,10 @@ void OCC_Internals::addVolume(int tag, std::vector<int> shellTags) Msg::Error("OpenCASCADE exception %s", err.GetMessageString()); return; } + // make sure the volume is finite + ShapeFix_Solid fix(result); + fix.Perform(); + result = TopoDS::Solid(fix.Solid()); bind(result, tag); } diff --git a/benchmarks/boolean/simple4.geo b/benchmarks/boolean/simple4.geo index c7d4c732795ec79ca967fa6c8eb13b46dde91c0a..8709514eb2928832fef79f01b7b723d1fd0da723 100644 --- a/benchmarks/boolean/simple4.geo +++ b/benchmarks/boolean/simple4.geo @@ -9,7 +9,7 @@ Point(2) = {1,0,0}; Point(3) = {1,1,0}; Point(4) = {0,1,0}; Point(5) = {0.5,0.5,1}; -Line(1) = {2,1}; // FIXME set {1,2} and the orientation will be screwed +Line(1) = {1,2}; Line(2) = {3,2}; Line(3) = {4,3}; Line(4) = {1,4};