diff --git a/src/BRepOffset/BRepOffset_MakeOffset_1.cxx b/src/BRepOffset/BRepOffset_MakeOffset_1.cxx index 6462ea6348..de3239f7a1 100644 --- a/src/BRepOffset/BRepOffset_MakeOffset_1.cxx +++ b/src/BRepOffset/BRepOffset_MakeOffset_1.cxx @@ -304,6 +304,13 @@ static const TopTools_IndexedMapOfShape& theMERemoved, TopTools_IndexedMapOfShape& theInvEdges); +static + void CheckEdgesCreatedByVertex (const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, + const TopTools_DataMapOfShapeShape& theArtInvFaces, + const TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + const TopTools_IndexedMapOfShape& theValidEdges, + TopTools_IndexedMapOfShape& theInvEdges); + static void FindFacesToRebuild(const TopTools_IndexedDataMapOfShapeListOfShape& theLFImages, const TopTools_IndexedMapOfShape& theInvEdges, @@ -1185,6 +1192,10 @@ void BuildSplitsOfFaces(const TopTools_ListOfShape& theLF, // filter invalid edges FilterInvalidEdges(theInvFaces, theArtInvFaces, aDMFMIE, aMERemoved, theInvEdges); // + // Check additionally validity of edges originated from vertices. + CheckEdgesCreatedByVertex (theInvFaces, theArtInvFaces, theEdgesOrigins, + theValidEdges, theEdgesToAvoid); + #ifdef OFFSET_DEBUG // show invalid edges TopoDS_Compound aCEInv; @@ -3970,6 +3981,56 @@ void FilterInvalidFaces(TopTools_IndexedDataMapOfShapeListOfShape& theFImages, theInvFaces = aReallyInvFaces; } +//======================================================================= +//function : CheckEdgesCreatedByVertex +//purpose : Checks additionally the unchecked edges originated from vertices +//======================================================================= +void CheckEdgesCreatedByVertex (const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, + const TopTools_DataMapOfShapeShape& theArtInvFaces, + const TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + const TopTools_IndexedMapOfShape& theValidEdges, + TopTools_IndexedMapOfShape& theInvEdges) +{ + // Mark the unchecked edges contained in invalid faces as invalid + const Standard_Integer aNbF = theInvFaces.Extent(); + for (Standard_Integer i = 1; i <= aNbF; ++i) + { + const TopoDS_Shape& aF = theInvFaces.FindKey (i); + if (theArtInvFaces.IsBound (aF)) + continue; + + const TopTools_ListOfShape& aLFIm = theInvFaces (i); + for (TopTools_ListOfShape::Iterator it (aLFIm); it.More(); it.Next()) + { + const TopoDS_Shape& aFIm = it.Value(); + for (TopExp_Explorer expE (aFIm, TopAbs_EDGE); expE.More(); expE.Next()) + { + const TopoDS_Shape& aE = expE.Current(); + if (theInvEdges.Contains (aE) + || theValidEdges.Contains (aE)) + { + continue; + } + + // check if this edges is created by vertex + const TopTools_ListOfShape* pLEOr = theEdgesOrigins.Seek (aE); + if (!pLEOr) + continue; + TopTools_ListOfShape::Iterator itLEO (*pLEOr); + for (; itLEO.More(); itLEO.Next()) + { + if (itLEO.Value().ShapeType() != TopAbs_VERTEX) + break; + } + if (!itLEO.More()) + { + theInvEdges.Add (aE); + } + } + } + } +} + //======================================================================= //function : FilterInvalidEdges //purpose : Filtering the invalid edges according to currently invalid faces diff --git a/tests/offset/shape_type_i_c/XV1 b/tests/offset/shape_type_i_c/XV1 new file mode 100644 index 0000000000..0f47a790e7 --- /dev/null +++ b/tests/offset/shape_type_i_c/XV1 @@ -0,0 +1,20 @@ +puts "========" +puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection" +puts "========" +puts "" + +restore [locate_data_file bug31542_trim.brep] s +offsetparameter 1e-7 c i r +offsetload s 0 +explode s f +offsetonface s_3 8 +offsetonface s_2 2 +offsetonface s_10 2 +offsetperform result + +checkprops result -s 80331.8 -v 940931 + +unifysamedom result_unif result +checknbshapes result_unif -wire 12 -face 12 -shell 1 -solid 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XV2 b/tests/offset/shape_type_i_c/XV2 new file mode 100644 index 0000000000..3fed2d7bc6 --- /dev/null +++ b/tests/offset/shape_type_i_c/XV2 @@ -0,0 +1,20 @@ +puts "========" +puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection" +puts "========" +puts "" + +restore [locate_data_file bug31542_trim.brep] s +offsetparameter 1e-7 c i r +offsetload s 0 +explode s f +offsetonface s_3 8 +offsetonface s_2 2 +offsetonface s_10 5 +offsetperform result + +checkprops result -s 81322.5 -v 962242 + +unifysamedom result_unif result +checknbshapes result_unif -wire 13 -face 13 -shell 1 -solid 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XV3 b/tests/offset/shape_type_i_c/XV3 new file mode 100644 index 0000000000..4caf5686cc --- /dev/null +++ b/tests/offset/shape_type_i_c/XV3 @@ -0,0 +1,20 @@ +puts "========" +puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection" +puts "========" +puts "" + +restore [locate_data_file bug31542_trim.brep] s +offsetparameter 1e-7 c i r +offsetload s 0 +explode s f +offsetonface s_3 8 +offsetonface s_2 5 +offsetonface s_10 2 +offsetperform result + +checkprops result -s 81322.5 -v 962242 + +unifysamedom result_unif result +checknbshapes result_unif -wire 13 -face 13 -shell 1 -solid 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XV4 b/tests/offset/shape_type_i_c/XV4 new file mode 100644 index 0000000000..ff4ea86880 --- /dev/null +++ b/tests/offset/shape_type_i_c/XV4 @@ -0,0 +1,20 @@ +puts "========" +puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection" +puts "========" +puts "" + +restore [locate_data_file bug31542_trim.brep] s +offsetparameter 1e-7 c i r +offsetload s 0 +explode s f +offsetonface s_3 10 +offsetonface s_2 5 +offsetonface s_10 5 +offsetperform result + +checkprops result -s 83093.5 -v 1.0107e+06 + +unifysamedom result_unif result +checknbshapes result_unif -wire 11 -face 11 -shell 1 -solid 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XV5 b/tests/offset/shape_type_i_c/XV5 new file mode 100644 index 0000000000..9fe074c981 --- /dev/null +++ b/tests/offset/shape_type_i_c/XV5 @@ -0,0 +1,18 @@ +puts "========" +puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection" +puts "========" +puts "" + +restore [locate_data_file bug31542_trim.brep] s +offsetparameter 1e-7 c i r +offsetload s 0 +explode s f +offsetonface s_9 7 +offsetperform result + +checkprops result -s 76756.9 -v 854480 + +unifysamedom result_unif result +checknbshapes result_unif -wire 14 -face 14 -shell 1 -solid 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XV6 b/tests/offset/shape_type_i_c/XV6 new file mode 100644 index 0000000000..d4982d04e7 --- /dev/null +++ b/tests/offset/shape_type_i_c/XV6 @@ -0,0 +1,18 @@ +puts "========" +puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection" +puts "========" +puts "" + +restore [locate_data_file bug31542_trim.brep] s +offsetparameter 1e-7 c i r +offsetload s 0 +explode s f +offsetonface s_9 15 +offsetperform result + +checkprops result -s 77082.5 -v 861875 + +unifysamedom result_unif result +checknbshapes result_unif -wire 15 -face 15 -shell 1 -solid 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XV7 b/tests/offset/shape_type_i_c/XV7 new file mode 100644 index 0000000000..cd4cf3780e --- /dev/null +++ b/tests/offset/shape_type_i_c/XV7 @@ -0,0 +1,21 @@ +puts "========" +puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection" +puts "========" +puts "" + +restore [locate_data_file bug31542_trim.brep] s +offsetparameter 1e-7 c i r +offsetload s 0 +explode s f +offsetonface s_3 5 +offsetonface s_2 2 +offsetonface s_9 8 +offsetonface s_10 2 +offsetperform result + +checkprops result -s 78683.2 -v 908272 + +unifysamedom result_unif result +checknbshapes result_unif -wire 16 -face 16 -shell 1 -solid 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XV8 b/tests/offset/shape_type_i_c/XV8 new file mode 100644 index 0000000000..f2bd393b2f --- /dev/null +++ b/tests/offset/shape_type_i_c/XV8 @@ -0,0 +1,45 @@ +puts "========" +puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection" +puts "========" +puts "" + +set X1 5; # positive x-axis +set X2 10; # nagative x-axis +set Y1 5; # positive y-axis +set Y2 10; # negative y-axis +set TOP 0; # positive z-axis + +set eps 1.e-5 + +restore [locate_data_file bug31542_trim.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 +foreach f [explode s f] { + mksurface surf $f; + regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z + if {[regexp "REVERSED" [whatis $f]]} { + set x [dval -1*$x]; + set y [dval -1*$y]; + set z [dval -1*$z]; + } + if {$y < -1*$eps} { + offsetonface $f $Y2 + } elseif {$y > $eps} { + offsetonface $f $Y1 + } elseif {$x < -1*$eps} { + offsetonface $f $X2 + } elseif {$x > $eps} { + offsetonface $f $X1 + } elseif {$z > $eps} { + offsetonface $f $TOP + } +} +offsetperform result + +checkprops result -s 98415.4 -v 1.30965e+06 + +unifysamedom result_unif result +checknbshapes result_unif -wire 15 -face 15 -shell 1 -solid 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XV9 b/tests/offset/shape_type_i_c/XV9 new file mode 100644 index 0000000000..477b0b3caa --- /dev/null +++ b/tests/offset/shape_type_i_c/XV9 @@ -0,0 +1,45 @@ +puts "========" +puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection" +puts "========" +puts "" + +set X1 10; # positive x-axis +set X2 5; # nagative x-axis +set Y1 10; # positive y-axis +set Y2 5; # negative y-axis +set TOP 5; # positive z-axis + +set eps 1.e-5 + +restore [locate_data_file bug31542_trim.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 +foreach f [explode s f] { + mksurface surf $f; + regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z + if {[regexp "REVERSED" [whatis $f]]} { + set x [dval -1*$x]; + set y [dval -1*$y]; + set z [dval -1*$z]; + } + if {$y < -1*$eps} { + offsetonface $f $Y2 + } elseif {$y > $eps} { + offsetonface $f $Y1 + } elseif {$x < -1*$eps} { + offsetonface $f $X2 + } elseif {$x > $eps} { + offsetonface $f $X1 + } elseif {$z > $eps} { + offsetonface $f $TOP + } +} +offsetperform result + +checkprops result -s 99229.3 -v 1.33021e+06 + +unifysamedom result_unif result +checknbshapes result_unif -wire 16 -face 16 -shell 1 -solid 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XW1 b/tests/offset/shape_type_i_c/XW1 new file mode 100644 index 0000000000..ef85c767fb --- /dev/null +++ b/tests/offset/shape_type_i_c/XW1 @@ -0,0 +1,45 @@ +puts "========" +puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection" +puts "========" +puts "" + +set X1 10; # positive x-axis +set X2 5; # nagative x-axis +set Y1 10; # positive y-axis +set Y2 5; # negative y-axis +set TOP 5; # positive z-axis + +set eps 1.e-5 + +restore [locate_data_file bug31542_dom-18777.input.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 +foreach f [explode s f] { + mksurface surf $f; + regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z + if {[regexp "REVERSED" [whatis $f]]} { + set x [dval -1*$x]; + set y [dval -1*$y]; + set z [dval -1*$z]; + } + if {$y < -1*$eps} { + offsetonface $f $Y2 + } elseif {$y > $eps} { + offsetonface $f $Y1 + } elseif {$x < -1*$eps} { + offsetonface $f $X2 + } elseif {$x > $eps} { + offsetonface $f $X1 + } elseif {$z > $eps} { + offsetonface $f $TOP + } +} +offsetperform result + +checkprops result -s 705116 -v 2.26365e+07 + +unifysamedom result_unif result +checknbshapes result_unif -wire 32 -face 32 -shell 1 -solid 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XW2 b/tests/offset/shape_type_i_c/XW2 new file mode 100644 index 0000000000..7d122d280f --- /dev/null +++ b/tests/offset/shape_type_i_c/XW2 @@ -0,0 +1,45 @@ +puts "========" +puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection" +puts "========" +puts "" + +set X1 5; # positive x-axis +set X2 10; # nagative x-axis +set Y1 5; # positive y-axis +set Y2 10; # negative y-axis +set TOP 5; # positive z-axis + +set eps 1.e-5 + +restore [locate_data_file bug31542_dom-18777.input.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 +foreach f [explode s f] { + mksurface surf $f; + regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z + if {[regexp "REVERSED" [whatis $f]]} { + set x [dval -1*$x]; + set y [dval -1*$y]; + set z [dval -1*$z]; + } + if {$y < -1*$eps} { + offsetonface $f $Y2 + } elseif {$y > $eps} { + offsetonface $f $Y1 + } elseif {$x < -1*$eps} { + offsetonface $f $X2 + } elseif {$x > $eps} { + offsetonface $f $X1 + } elseif {$z > $eps} { + offsetonface $f $TOP + } +} +offsetperform result + +checkprops result -s 705116 -v 2.26365e+07 + +unifysamedom result_unif result +checknbshapes result_unif -wire 32 -face 32 -shell 1 -solid 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XW3 b/tests/offset/shape_type_i_c/XW3 new file mode 100644 index 0000000000..616fe86b6e --- /dev/null +++ b/tests/offset/shape_type_i_c/XW3 @@ -0,0 +1,45 @@ +puts "========" +puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection" +puts "========" +puts "" + +set X1 5; # positive x-axis +set X2 5; # nagative x-axis +set Y1 10; # positive y-axis +set Y2 10; # negative y-axis +set TOP 5; # positive z-axis + +set eps 1.e-5 + +restore [locate_data_file bug31542_dom-18777.input.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 +foreach f [explode s f] { + mksurface surf $f; + regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z + if {[regexp "REVERSED" [whatis $f]]} { + set x [dval -1*$x]; + set y [dval -1*$y]; + set z [dval -1*$z]; + } + if {$y < -1*$eps} { + offsetonface $f $Y2 + } elseif {$y > $eps} { + offsetonface $f $Y1 + } elseif {$x < -1*$eps} { + offsetonface $f $X2 + } elseif {$x > $eps} { + offsetonface $f $X1 + } elseif {$z > $eps} { + offsetonface $f $TOP + } +} +offsetperform result + +checkprops result -s 705089 -v 2.27281e+07 + +unifysamedom result_unif result +checknbshapes result_unif -wire 32 -face 32 -shell 1 -solid 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XW4 b/tests/offset/shape_type_i_c/XW4 new file mode 100644 index 0000000000..ede5f3ee35 --- /dev/null +++ b/tests/offset/shape_type_i_c/XW4 @@ -0,0 +1,45 @@ +puts "========" +puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection" +puts "========" +puts "" + +set X1 10; # positive x-axis +set X2 10; # nagative x-axis +set Y1 5; # positive y-axis +set Y2 5; # negative y-axis +set TOP 5; # positive z-axis + +set eps 1.e-5 + +restore [locate_data_file bug31542_dom-18777.input.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 +foreach f [explode s f] { + mksurface surf $f; + regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z + if {[regexp "REVERSED" [whatis $f]]} { + set x [dval -1*$x]; + set y [dval -1*$y]; + set z [dval -1*$z]; + } + if {$y < -1*$eps} { + offsetonface $f $Y2 + } elseif {$y > $eps} { + offsetonface $f $Y1 + } elseif {$x < -1*$eps} { + offsetonface $f $X2 + } elseif {$x > $eps} { + offsetonface $f $X1 + } elseif {$z > $eps} { + offsetonface $f $TOP + } +} +offsetperform result + +checkprops result -s 703838 -v 2.25528e+07 + +unifysamedom result_unif result +checknbshapes result_unif -wire 30 -face 30 -shell 1 -solid 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XW5 b/tests/offset/shape_type_i_c/XW5 new file mode 100644 index 0000000000..cbf7a46f6c --- /dev/null +++ b/tests/offset/shape_type_i_c/XW5 @@ -0,0 +1,45 @@ +puts "========" +puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection" +puts "========" +puts "" + +set X1 5; # positive x-axis +set X2 10; # nagative x-axis +set Y1 5; # positive y-axis +set Y2 10; # negative y-axis +set TOP 0; # positive z-axis + +set eps 1.e-5 + +restore [locate_data_file bug31542_dom-18777.input.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 +foreach f [explode s f] { + mksurface surf $f; + regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z + if {[regexp "REVERSED" [whatis $f]]} { + set x [dval -1*$x]; + set y [dval -1*$y]; + set z [dval -1*$z]; + } + if {$y < -1*$eps} { + offsetonface $f $Y2 + } elseif {$y > $eps} { + offsetonface $f $Y1 + } elseif {$x < -1*$eps} { + offsetonface $f $X2 + } elseif {$x > $eps} { + offsetonface $f $X1 + } elseif {$z > $eps} { + offsetonface $f $TOP + } +} +offsetperform result + +checkprops result -s 702224 -v 2.17722e+07 + +unifysamedom result_unif result +checknbshapes result_unif -wire 28 -face 28 -shell 1 -solid 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XW6 b/tests/offset/shape_type_i_c/XW6 new file mode 100644 index 0000000000..fe7f780227 --- /dev/null +++ b/tests/offset/shape_type_i_c/XW6 @@ -0,0 +1,45 @@ +puts "========" +puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection" +puts "========" +puts "" + +set X1 10; # positive x-axis +set X2 5; # nagative x-axis +set Y1 10; # positive y-axis +set Y2 5; # negative y-axis +set TOP 0; # positive z-axis + +set eps 1.e-5 + +restore [locate_data_file bug31542_dom-18777.input.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 +foreach f [explode s f] { + mksurface surf $f; + regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z + if {[regexp "REVERSED" [whatis $f]]} { + set x [dval -1*$x]; + set y [dval -1*$y]; + set z [dval -1*$z]; + } + if {$y < -1*$eps} { + offsetonface $f $Y2 + } elseif {$y > $eps} { + offsetonface $f $Y1 + } elseif {$x < -1*$eps} { + offsetonface $f $X2 + } elseif {$x > $eps} { + offsetonface $f $X1 + } elseif {$z > $eps} { + offsetonface $f $TOP + } +} +offsetperform result + +checkprops result -s 702224 -v 2.17722e+07 + +unifysamedom result_unif result +checknbshapes result_unif -wire 28 -face 28 -shell 1 -solid 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XW7 b/tests/offset/shape_type_i_c/XW7 new file mode 100644 index 0000000000..d195a55a88 --- /dev/null +++ b/tests/offset/shape_type_i_c/XW7 @@ -0,0 +1,45 @@ +puts "========" +puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection" +puts "========" +puts "" + +set X1 10; # positive x-axis +set X2 5; # nagative x-axis +set Y1 10; # positive y-axis +set Y2 5; # negative y-axis +set TOP 10; # positive z-axis + +set eps 1.e-5 + +restore [locate_data_file bug31542_dom-18777.input.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 +foreach f [explode s f] { + mksurface surf $f; + regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z + if {[regexp "REVERSED" [whatis $f]]} { + set x [dval -1*$x]; + set y [dval -1*$y]; + set z [dval -1*$z]; + } + if {$y < -1*$eps} { + offsetonface $f $Y2 + } elseif {$y > $eps} { + offsetonface $f $Y1 + } elseif {$x < -1*$eps} { + offsetonface $f $X2 + } elseif {$x > $eps} { + offsetonface $f $X1 + } elseif {$z > $eps} { + offsetonface $f $TOP + } +} +offsetperform result + +checkprops result -s 709138 -v 2.35754e+07 + +unifysamedom result_unif result +checknbshapes result_unif -wire 31 -face 31 -shell 1 -solid 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XW8 b/tests/offset/shape_type_i_c/XW8 new file mode 100644 index 0000000000..b1cd49b94b --- /dev/null +++ b/tests/offset/shape_type_i_c/XW8 @@ -0,0 +1,16 @@ +puts "========" +puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection" +puts "========" +puts "" + +restore [locate_data_file bug31542_dom-18777.input.brep] s +offsetparameter 1e-7 c i r +offsetload s 10 +offsetperform result + +checkprops result -s 747800 -v 2.65246e+07 + +unifysamedom result_unif result +checknbshapes result_unif -wire 30 -face 30 -shell 1 -solid 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XW9 b/tests/offset/shape_type_i_c/XW9 new file mode 100644 index 0000000000..8306abe87e --- /dev/null +++ b/tests/offset/shape_type_i_c/XW9 @@ -0,0 +1,16 @@ +puts "========" +puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection" +puts "========" +puts "" + +restore [locate_data_file bug31542_dom-18777.input.brep] s +offsetparameter 1e-7 c i r +offsetload s 15 +offsetperform result + +checkprops result -s 799301 -v 3.0392e+07 + +unifysamedom result_unif result +checknbshapes result_unif -wire 34 -face 34 -shell 1 -solid 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png