diff --git a/src/BRepOffset/BRepOffset_MakeOffset_1.cxx b/src/BRepOffset/BRepOffset_MakeOffset_1.cxx index 0ce35454e1..cede6ad8a6 100644 --- a/src/BRepOffset/BRepOffset_MakeOffset_1.cxx +++ b/src/BRepOffset/BRepOffset_MakeOffset_1.cxx @@ -63,6 +63,10 @@ #include #include +#ifdef OFFSET_DEBUG +#include +#endif + typedef NCollection_DataMap BRepOffset_DataMapOfShapeMapOfShape; @@ -247,6 +251,13 @@ static BOPAlgo_Builder& theBuilder, TopTools_DataMapOfShapeListOfShape& theSSInterfs); +static + void RemoveHangingParts(const BOPAlgo_MakerVolume& theMV, + const TopTools_DataMapOfShapeShape& theDMFImF, + const TopTools_IndexedMapOfShape& theMFInv, + const TopTools_IndexedMapOfShape& theInvEdges, + TopTools_MapOfShape& theMFToRem); + static void RemoveValidSplits(const TopTools_MapOfShape& theSpRem, TopTools_IndexedDataMapOfShapeListOfShape& theImages, @@ -349,7 +360,10 @@ static void FindVerticesToAvoid(const TopTools_IndexedDataMapOfShapeListOfShape& theDMEFInv, const TopTools_IndexedMapOfShape& theInvEdges, const TopTools_IndexedMapOfShape& theValidEdges, - TopTools_DataMapOfShapeListOfShape& theDMVEFull, + const TopTools_MapOfShape& theInvertedEdges, + const TopTools_DataMapOfShapeListOfShape& theDMVEFull, + const TopTools_DataMapOfShapeListOfShape& theOEImages, + const TopTools_DataMapOfShapeListOfShape& theOEOrigins, TopTools_MapOfShape& theMVRInv); static @@ -823,6 +837,14 @@ void BuildSplitsOfFaces(const TopTools_ListOfShape& theLF, continue; } // +#ifdef OFFSET_DEBUG + // check the found edges on self-intersection + BRepAlgoAPI_Check aChecker(aCE); + if (!aChecker.IsValid()) + { + cout << "Offset_i_c Error: set of edges to build faces is self-intersecting\n"; + } +#endif // build splits TopTools_ListOfShape aLFImages; BuildSplitsOfFace(aF, aCE, theFacesOrigins, aLFImages); @@ -1250,7 +1272,8 @@ Standard_Boolean GetEdges(const TopoDS_Face& theFace, // the resulting edges TopoDS_Compound anEdges; aBB.MakeCompound(anEdges); - // + // Fence map + TopTools_MapOfShape aMEFence; // the edges by which the offset face should be split const TopTools_ListOfShape& aLE = theAsDes->Descendant(theFace); TopTools_ListIteratorOfListOfShape aItLE(aLE); @@ -1267,6 +1290,9 @@ Standard_Boolean GetEdges(const TopoDS_Face& theFace, for (; aItLEIm.More(); aItLEIm.Next()) { const TopoDS_Edge& aEIm = TopoDS::Edge(aItLEIm.Value()); // + if (!aMEFence.Add(aEIm)) + continue; + if (theInvEdges.Contains(aEIm)) { theInv.Add(aEIm); if (!bUpdate) { @@ -2876,7 +2902,12 @@ void RemoveInsideFaces(TopTools_IndexedDataMapOfShapeListOfShape& theFImages, if (aMV.HasDeleted()) { TopTools_IndexedMapOfShape aMEHoles; TopExp::MapShapes(theFHoles, TopAbs_EDGE, aMEHoles); - // + + // Map edges of the solids to check the connectivity + // of the removed invalid splits + TopTools_IndexedMapOfShape aMESols; + TopExp::MapShapes(aSols, TopAbs_EDGE, aMESols); + // perform additional check on faces aNb = theFImages.Extent(); for (i = 1; i <= aNb; ++i) { @@ -2884,7 +2915,13 @@ void RemoveInsideFaces(TopTools_IndexedDataMapOfShapeListOfShape& theFImages, if (aLFIm.IsEmpty()) { continue; } - // + + const TopoDS_Shape& aF = theFImages.FindKey(i); + Standard_Boolean bInvalid = theInvFaces.Contains(aF); + // For invalid faces it is allowed to be at least connected + // to the solids, otherwise the solids are considered as broken + Standard_Boolean bConnected = Standard_False; + Standard_Boolean bFaceKept = Standard_False; aItLF.Initialize(aLFIm); for (; aItLF.More(); aItLF.Next()) { @@ -2901,10 +2938,12 @@ void RemoveInsideFaces(TopTools_IndexedDataMapOfShapeListOfShape& theFImages, aMFToRem.Add(aFIm); break; } + if (!bFaceKept && bInvalid && !bConnected) + bConnected = aMESols.Contains(aExpE.Current()); } } // - if (!bFaceKept) { + if (!bFaceKept && !bConnected) { return; } } @@ -3020,8 +3059,11 @@ void RemoveInsideFaces(TopTools_IndexedDataMapOfShapeListOfShape& theFImages, for (; aItM.More(); aItM.Next()) { aMFToRem.Remove(aItM.Value()); } - // - // remove newly found internal faces + + // Remove the invalid hanging parts external to the solids + RemoveHangingParts(aMV, aDMFImF, aMFInv, theInvEdges, aMFToRem); + + // Remove newly found internal and hanging faces RemoveValidSplits(aMFToRem, theFImages, aMV, theMERemoved); RemoveInvalidSplits(aMFToRem, theArtInvFaces, theInvEdges, theInvFaces, aMV, theMERemoved); // @@ -3197,6 +3239,179 @@ void ShapesConnections(const TopTools_IndexedDataMapOfShapeListOfShape& theInvFa } } +//======================================================================= +//function : RemoveHangingParts +//purpose : Remove isolated invalid hanging parts +//======================================================================= +void RemoveHangingParts(const BOPAlgo_MakerVolume& theMV, + const TopTools_DataMapOfShapeShape& theDMFImF, + const TopTools_IndexedMapOfShape& theMFInv, + const TopTools_IndexedMapOfShape& theInvEdges, + TopTools_MapOfShape& theMFToRem) +{ + // Map the faces of the result solids to filter them from avoided faces + TopTools_IndexedMapOfShape aMFS; + TopExp::MapShapes(theMV.Shape(), TopAbs_FACE, aMFS); + + BRep_Builder aBB; + // Build compound of all faces not included into solids + TopoDS_Compound aCFHangs; + aBB.MakeCompound(aCFHangs); + + // Tool for getting the splits of faces + const BOPCol_DataMapOfShapeListOfShape& aMVIms = theMV.Images(); + + TopTools_ListIteratorOfListOfShape aItLArgs(theMV.Arguments()); + for (; aItLArgs.More(); aItLArgs.Next()) + { + TopExp_Explorer anExpF(aItLArgs.Value(), TopAbs_FACE); + for (; anExpF.More(); anExpF.Next()) + { + const TopoDS_Shape& aF = anExpF.Current(); + const BOPCol_ListOfShape* pLFIm = aMVIms.Seek(aF); + if (pLFIm) + { + TopTools_ListIteratorOfListOfShape aItLFIm(*pLFIm); + for (; aItLFIm.More(); aItLFIm.Next()) + { + const TopoDS_Shape& aFIm = aItLFIm.Value(); + if (!aMFS.Contains(aFIm)) + aBB.Add(aCFHangs, aFIm); + } + } + else + { + if (!aMFS.Contains(aF)) + aBB.Add(aCFHangs, aF); + } + } + } + + // Make connexity blocks of all hanging parts and check that they are isolated + BOPCol_ListOfShape aLCBHangs; + BOPTools_AlgoTools::MakeConnexityBlocks(aCFHangs, TopAbs_EDGE, TopAbs_FACE, aLCBHangs); + if (aLCBHangs.IsEmpty()) + return; + + // To be removed, the block should contain invalid splits of offset faces and should + // meet one of the following conditions: + // 1. The block should not be connected to any invalid parts (Faces or Edges) + // contained in solids; + // 2. The block should be isolated from other faces, i.e. it should consist of + // the splits of the single offset face. + + // Map the edges and vertices of the result solids to check connectivity + // of the hanging blocks to invalid parts contained in solids + TopTools_IndexedDataMapOfShapeListOfShape aDMEF, aDMVE; + TopExp::MapShapesAndAncestors(theMV.Shape(), TopAbs_EDGE , TopAbs_FACE, aDMEF); + TopExp::MapShapesAndAncestors(theMV.Shape(), TopAbs_VERTEX, TopAbs_EDGE, aDMVE); + + // Update invalid edges with intersection results + TopTools_MapOfShape aMEInv; + Standard_Integer i, aNbE = theInvEdges.Extent(); + for (i = 1; i <= aNbE; ++i) { + const TopoDS_Shape& aEInv = theInvEdges(i); + const BOPCol_ListOfShape *pLEIm = aMVIms.Seek(aEInv); + if (pLEIm) + { + BOPCol_ListIteratorOfListOfShape aItLEIm(*pLEIm); + for (; aItLEIm.More(); aItLEIm.Next()) + aMEInv.Add(aItLEIm.Value()); + } + else + aMEInv.Add(aEInv); + } + + // Tool for getting the origins of the splits + const BOPCol_DataMapOfShapeListOfShape& aMVOrs = theMV.Origins(); + + BOPCol_ListIteratorOfListOfShape aItLCBH(aLCBHangs); + for (; aItLCBH.More(); aItLCBH.Next()) + { + const TopoDS_Shape& aCBH = aItLCBH.Value(); + + // Check the block to contain invalid split + Standard_Boolean bHasInvalidFace = Standard_False; + // Check connectivity to invalid parts + Standard_Boolean bIsConnected = Standard_False; + TopTools_IndexedMapOfShape aBlockME; + TopExp::MapShapes(aCBH, TopAbs_EDGE, aBlockME); + // Map to collect all original faces + TopTools_MapOfShape aMOffsetF; + + TopExp_Explorer anExpF(aCBH, TopAbs_FACE); + for (; anExpF.More(); anExpF.Next()) + { + const TopoDS_Shape& aF = anExpF.Current(); + // Check block to contain invalid face + if (!bHasInvalidFace) + bHasInvalidFace = theMFInv.Contains(aF); + + // Check block for connectivity to invalid parts + if (!bIsConnected) + { + // check edges + TopExp_Explorer anExpE(aF, TopAbs_EDGE); + for (; anExpE.More() && !bIsConnected; anExpE.Next()) + { + const TopoDS_Shape& aE = anExpE.Current(); + const TopTools_ListOfShape *pLF = aDMEF.Seek(aE); + if (pLF) + { + TopTools_ListIteratorOfListOfShape aItLF(*pLF); + for (; aItLF.More() && !bIsConnected; aItLF.Next()) + bIsConnected = theMFInv.Contains(aItLF.Value()); + } + } + // check vertices + TopExp_Explorer anExpV(aF, TopAbs_VERTEX); + for (; anExpV.More() && !bIsConnected; anExpV.Next()) + { + const TopoDS_Shape& aV = anExpV.Current(); + const TopTools_ListOfShape *pLE = aDMVE.Seek(aV); + if (pLE) + { + TopTools_ListIteratorOfListOfShape aItLE(*pLE); + for (; aItLE.More() && !bIsConnected; aItLE.Next()) + bIsConnected = !aBlockME.Contains(aItLE.Value()) && + aMEInv .Contains(aItLE.Value()); + } + } + } + + // Check block to be isolated + const BOPCol_ListOfShape* pLFOr = aMVOrs.Seek(aF); + if (pLFOr) + { + TopTools_ListIteratorOfListOfShape aItLFOr(*pLFOr); + for (; aItLFOr.More(); aItLFOr.Next()) + { + const TopoDS_Shape* pFOffset = theDMFImF.Seek(aItLFOr.Value()); + if (pFOffset) + aMOffsetF.Add(*pFOffset); + } + } + else + { + const TopoDS_Shape* pFOffset = theDMFImF.Seek(aF); + if (pFOffset) + aMOffsetF.Add(*pFOffset); + } + } + + Standard_Boolean bRemove = bHasInvalidFace && + (!bIsConnected || aMOffsetF.Extent() == 1); + + if (bRemove) + { + // remove the block + anExpF.Init(aCBH, TopAbs_FACE); + for (; anExpF.More(); anExpF.Next()) + theMFToRem.Add(anExpF.Current()); + } + } +} + //======================================================================= //function : RemoveValidSplits //purpose : Removing valid splits according to results of intersection @@ -3793,7 +4008,8 @@ void IntersectFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebui // edges adjacent to this vertex must be either invalid // or contained in invalid faces TopTools_MapOfShape aMVRInv = theVertsToAvoid; - FindVerticesToAvoid(aDMEFInv, theInvEdges, theValidEdges, aDMVEFull, aMVRInv); + FindVerticesToAvoid(aDMEFInv, theInvEdges, theValidEdges, theInvertedEdges, + aDMVEFull, theOEImages, theOEOrigins, aMVRInv); // // The faces should be intersected selectively - // intersect only faces neighboring to the same invalid face @@ -4129,13 +4345,20 @@ void IntersectFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebui IntersectAndTrimEdges(theFToRebuild, aMFInt, aMEToInt, aDMEETrim, aME, aMECV, aMVInv, aMVRInv, aMECheckExt, aMVBounds, aEImages); // - TopTools_ListOfShape aLEToInt; Standard_Integer iE, aNbEToInt = aMEToInt.Extent(); for (iE = 1; iE <= aNbEToInt; ++iE) - aLEToInt.Append(aMEToInt(iE)); - TopExp_Explorer aExpE(aCBELoc, TopAbs_EDGE); - for (; aExpE.More(); aExpE.Next()) - aDMOENEdges.Add(aExpE.Current(), aLEToInt); + { + const TopoDS_Shape& aEInt = aMEToInt(iE); + TopExp_Explorer anExpE(aCBELoc, TopAbs_EDGE); + for (; anExpE.More(); anExpE.Next()) + { + const TopoDS_Shape& aE = anExpE.Current(); + TopTools_ListOfShape* pLEToInt = aDMOENEdges.ChangeSeek(aE); + if (!pLEToInt) + pLEToInt = &aDMOENEdges(aDMOENEdges.Add(aE, TopTools_ListOfShape())); + AppendToList(*pLEToInt, aEInt); + } + } } } } @@ -4246,7 +4469,10 @@ void PrepareFacesForIntersection(const TopTools_IndexedDataMapOfShapeListOfShape void FindVerticesToAvoid(const TopTools_IndexedDataMapOfShapeListOfShape& theDMEFInv, const TopTools_IndexedMapOfShape& theInvEdges, const TopTools_IndexedMapOfShape& theValidEdges, - TopTools_DataMapOfShapeListOfShape& theDMVEFull, + const TopTools_MapOfShape& theInvertedEdges, + const TopTools_DataMapOfShapeListOfShape& theDMVEFull, + const TopTools_DataMapOfShapeListOfShape& theOEImages, + const TopTools_DataMapOfShapeListOfShape& theOEOrigins, TopTools_MapOfShape& theMVRInv) { TopTools_MapOfShape aMFence; @@ -4261,24 +4487,66 @@ void FindVerticesToAvoid(const TopTools_IndexedDataMapOfShapeListOfShape& theDME if (!theInvEdges.Contains(aE) || theValidEdges.Contains(aE)) { continue; } - // - TopExp_Explorer aExp(aE, TopAbs_VERTEX); - for (; aExp.More(); aExp.Next()) { - const TopoDS_Shape& aV = aExp.Current(); - TopTools_ListOfShape *pLE = theDMVEFull.ChangeSeek(aV); + + if (!aMFence.Add(aE)) + continue; + + TopTools_IndexedDataMapOfShapeListOfShape aMVEEdges; + // Do not check the splitting vertices, but check only the ending ones + const TopTools_ListOfShape *pLEOr = theOEOrigins.Seek(aE); + if (pLEOr) + { + TopTools_ListIteratorOfListOfShape aItLEOr(*pLEOr); + for (; aItLEOr.More(); aItLEOr.Next()) + { + const TopTools_ListOfShape& aLEIm = theOEImages.Find(aItLEOr.Value()); + TopTools_ListIteratorOfListOfShape aItLEIm(aLEIm); + for (; aItLEIm.More(); aItLEIm.Next()) + { + aMFence.Add(aItLEIm.Value()); + TopExp::MapShapesAndAncestors(aItLEIm.Value(), TopAbs_VERTEX, TopAbs_EDGE, aMVEEdges); + } + } + } + else + { + TopExp::MapShapesAndAncestors(aE, TopAbs_VERTEX, TopAbs_EDGE, aMVEEdges); + } + + Standard_Integer j, aNbV = aMVEEdges.Extent(); + for (j = 1; j <= aNbV; ++j) + { + if (aMVEEdges(j).Extent() != 1) + continue; + + const TopoDS_Shape& aV = aMVEEdges.FindKey(j); + if (!aMFence.Add(aV)) + continue; + const TopTools_ListOfShape *pLE = theDMVEFull.Seek(aV); if (!pLE) { + // isolated vertex theMVRInv.Add(aV); continue; } // + // If all edges sharing the vertex are either invalid or + // the vertex is connected to at least two inverted edges + // mark the vertex to be avoided in the new splits + Standard_Integer iNbEInverted = 0; + Standard_Boolean bAllEdgesInv = Standard_True; TopTools_ListIteratorOfListOfShape aItLE(*pLE); for (; aItLE.More(); aItLE.Next()) { const TopoDS_Shape& aEV = aItLE.Value(); - if (!theInvEdges.Contains(aEV) && !theDMEFInv.Contains(aEV)) { - break; - } + + if (theInvertedEdges.Contains(aEV)) + ++iNbEInverted; + + if (bAllEdgesInv) + bAllEdgesInv = theInvEdges.Contains(aEV); } - if (!aItLE.More()) { + + if (iNbEInverted > 1 || bAllEdgesInv) + { theMVRInv.Add(aV); } } diff --git a/tests/offset/shape_type_i_c/XE5 b/tests/offset/shape_type_i_c/XE5 index 005acc3ddc..c0f44c9ba4 100644 --- a/tests/offset/shape_type_i_c/XE5 +++ b/tests/offset/shape_type_i_c/XE5 @@ -1,5 +1,6 @@ -puts "TODO CR27414 ALL: Error : The area of result shape is" -puts "TODO CR27414 ALL: Error : The volume of result shape is" +puts "TODO OCC27414 ALL: Error: The command cannot be built" +puts "TODO OCC27414 ALL: gives an empty result" +puts "TODO OCC27414 ALL: TEST INCOMPLETE" restore [locate_data_file bug26917_dom-7724_trim3.brep] s diff --git a/tests/offset/shape_type_i_c/XF1 b/tests/offset/shape_type_i_c/XF1 index b609a31887..30fac369f1 100644 --- a/tests/offset/shape_type_i_c/XF1 +++ b/tests/offset/shape_type_i_c/XF1 @@ -1,5 +1,6 @@ -puts "TODO CR27414 ALL: Error : The area of result shape is" -puts "TODO CR27414 ALL: Error : The volume of result shape is" +puts "TODO OCC27414 ALL: Error: The command cannot be built" +puts "TODO OCC27414 ALL: gives an empty result" +puts "TODO OCC27414 ALL: TEST INCOMPLETE" restore [locate_data_file bug26917_dom-7724_trim9.brep] s diff --git a/tests/offset/shape_type_i_c/XP1 b/tests/offset/shape_type_i_c/XP1 new file mode 100644 index 0000000000..9ff3d07ec9 --- /dev/null +++ b/tests/offset/shape_type_i_c/XP1 @@ -0,0 +1,12 @@ +restore [locate_data_file bug29188_offset.input.fail_2.brep] s + +offsetparameter 1.e-7 c i r +offsetload s 1 +offsetperform result + +checkprops result -s 3.8337e+006 -v 9.03404e+007 + +unifysamedom result_unif result +checknbshapes result_unif -vertex 2424 -edge 3636 -wire 1214 -face 1214 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XP2 b/tests/offset/shape_type_i_c/XP2 new file mode 100644 index 0000000000..f20902f679 --- /dev/null +++ b/tests/offset/shape_type_i_c/XP2 @@ -0,0 +1,12 @@ +restore [locate_data_file bug29188_offset.input.fail_2.brep] s + +offsetparameter 1.e-7 c i r +offsetload s 2 +offsetperform result + +checkprops result -s 3.78989e+006 -v 9.41523e+007 + +unifysamedom result_unif result +checknbshapes result_unif -vertex 2414 -edge 3621 -wire 1209 -face 1209 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XP3 b/tests/offset/shape_type_i_c/XP3 new file mode 100644 index 0000000000..20d46d19ac --- /dev/null +++ b/tests/offset/shape_type_i_c/XP3 @@ -0,0 +1,12 @@ +restore [locate_data_file bug29188_offset.input.fail_2.brep] s + +offsetparameter 1.e-7 c i r +offsetload s 4 +offsetperform result + +checkprops result -s 3.59077e+006 -v 1.01607e+008 + +unifysamedom result_unif result +checknbshapes result_unif -vertex 760 -edge 1140 -wire 382 -face 382 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XP4 b/tests/offset/shape_type_i_c/XP4 new file mode 100644 index 0000000000..df0e42ebdb --- /dev/null +++ b/tests/offset/shape_type_i_c/XP4 @@ -0,0 +1,12 @@ +restore [locate_data_file bug29188_offset.input.fail_2_trim1.brep] s + +offsetparameter 1.e-7 c i r +offsetload s 1 +offsetperform result + +checkprops result -s 14593.4 -v 73831.6 + +unifysamedom result_unif result +checknbshapes result_unif -vertex 18 -edge 27 -wire 11 -face 11 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XP5 b/tests/offset/shape_type_i_c/XP5 new file mode 100644 index 0000000000..b657ef9f8d --- /dev/null +++ b/tests/offset/shape_type_i_c/XP5 @@ -0,0 +1,12 @@ +restore [locate_data_file bug29188_offset.input.fail_2_trim1.brep] s + +offsetparameter 1.e-7 c i r +offsetload s 2 +offsetperform result + +checkprops result -s 15689.6 -v 88931 + +unifysamedom result_unif result +checknbshapes result_unif -vertex 12 -edge 18 -wire 8 -face 8 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XP6 b/tests/offset/shape_type_i_c/XP6 new file mode 100644 index 0000000000..a96a31012d --- /dev/null +++ b/tests/offset/shape_type_i_c/XP6 @@ -0,0 +1,12 @@ +restore [locate_data_file bug29188_offset.input.fail_2_trim1.brep] s + +offsetparameter 1.e-7 c i r +offsetload s 15 +offsetperform result + +checkprops result -s 38954.1 -v 435324 + +unifysamedom result_unif result +checknbshapes result_unif -vertex 12 -edge 18 -wire 8 -face 8 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XP7 b/tests/offset/shape_type_i_c/XP7 new file mode 100644 index 0000000000..fb4eea10a6 --- /dev/null +++ b/tests/offset/shape_type_i_c/XP7 @@ -0,0 +1,12 @@ +restore [locate_data_file bug29188_offset.input.fail_2_trim2.brep] s + +offsetparameter 1.e-7 c i r +offsetload s 1 +offsetperform result + +checkprops result -s 7573.52 -v 22082 + +unifysamedom result_unif result +checknbshapes result_unif -vertex 16 -edge 24 -wire 10 -face 10 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XP8 b/tests/offset/shape_type_i_c/XP8 new file mode 100644 index 0000000000..33459b8869 --- /dev/null +++ b/tests/offset/shape_type_i_c/XP8 @@ -0,0 +1,12 @@ +restore [locate_data_file bug29188_offset.input.fail_2_trim2.brep] s + +offsetparameter 1.e-7 c i r +offsetload s 4 +offsetperform result + +checkprops result -s 11270.1 -v 50239.3 + +unifysamedom result_unif result +checknbshapes result_unif -vertex 14 -edge 21 -wire 9 -face 9 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XP9 b/tests/offset/shape_type_i_c/XP9 new file mode 100644 index 0000000000..fbcfd33e68 --- /dev/null +++ b/tests/offset/shape_type_i_c/XP9 @@ -0,0 +1,12 @@ +restore [locate_data_file bug29188_offset.input.fail_2_trim2.brep] s + +offsetparameter 1.e-7 c i r +offsetload s 15 +offsetperform result + +checkprops result -s 29345 -v 268160 + +unifysamedom result_unif result +checknbshapes result_unif -vertex 12 -edge 18 -wire 8 -face 8 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XQ1 b/tests/offset/shape_type_i_c/XQ1 new file mode 100644 index 0000000000..cd515da051 --- /dev/null +++ b/tests/offset/shape_type_i_c/XQ1 @@ -0,0 +1,27 @@ +restore [locate_data_file bug29188_xm6_trim.brep] s + +offsetparameter 1.e-7 c i r +offsetload s 4 +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found && abs(abs($z) - 1) < 1.e-7} { + offsetonface $f 3 + } else { + if { y < -0.7 } { + offsetonface $f 5 + } else { + if { y > 0.7 } { + offsetonface $f 3 + } + } + } +} +offsetperform result + +checkprops result -s 34789.1 -v 364306 + +unifysamedom result_unif result +checknbshapes result_unif -vertex 26 -edge 39 -wire 15 -face 15 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XQ2 b/tests/offset/shape_type_i_c/XQ2 new file mode 100644 index 0000000000..c3b5bb0008 --- /dev/null +++ b/tests/offset/shape_type_i_c/XQ2 @@ -0,0 +1,19 @@ +restore [locate_data_file bug29188_xb4_trim.brep] s + +offsetparameter 1.e-7 c i r +offsetload s 10 +foreach f [explode s f] { + mksurface surf $f + set found [regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z] + if {$found && abs(abs($z) - 1) < 1.e-7} { + offsetonface $f 0 + } +} +offsetperform result + +checkprops result -s 83647.4 -v 1.00827e+006 + +unifysamedom result_unif result +checknbshapes result_unif -vertex 31 -edge 47 -wire 18 -face 18 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XQ3 b/tests/offset/shape_type_i_c/XQ3 new file mode 100644 index 0000000000..b103af09ae --- /dev/null +++ b/tests/offset/shape_type_i_c/XQ3 @@ -0,0 +1,12 @@ +restore [locate_data_file bug29188_zt8_trim.brep] s + +offsetparameter 1.e-7 c i r +offsetload s 5 +offsetperform result + +checkprops result -s 43255.5 -v 461843 + +unifysamedom result_unif result +checknbshapes result_unif -vertex 14 -edge 21 -wire 9 -face 9 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XQ4 b/tests/offset/shape_type_i_c/XQ4 new file mode 100644 index 0000000000..8c058f266f --- /dev/null +++ b/tests/offset/shape_type_i_c/XQ4 @@ -0,0 +1,12 @@ +restore [locate_data_file bug29188_zt8_trim.brep] s + +offsetparameter 1.e-7 c i r +offsetload s 10 +offsetperform result + +checkprops result -s 56967.2 -v 711670 + +unifysamedom result_unif result +checknbshapes result_unif -vertex 14 -edge 21 -wire 9 -face 9 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZX6 b/tests/offset/shape_type_i_c/ZX6 index 49bb858112..85f9bdac0e 100644 --- a/tests/offset/shape_type_i_c/ZX6 +++ b/tests/offset/shape_type_i_c/ZX6 @@ -1,12 +1,12 @@ -puts "TODO OCC27414 ALL: Error: The command cannot be built" -puts "TODO OCC27414 ALL: gives an empty result" -puts "TODO OCC27414 ALL: TEST INCOMPLETE" - restore [locate_data_file bug26917_t114_c2.recipe.brep] s -OFFSETSHAPE 35 {} $calcul $type +offsetparameter 1.e-7 c i r +offsetload s 35 +offsetperform result -checkprops result -v 7.93275e+008 -checkprops result -s 6.15377e+006 +checkprops result -s 6.15377e+006 -v 7.93275e+008 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -vertex 64 -edge 96 -wire 34 -face 34 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZX7 b/tests/offset/shape_type_i_c/ZX7 index 4b84273e40..f2986ebe75 100644 --- a/tests/offset/shape_type_i_c/ZX7 +++ b/tests/offset/shape_type_i_c/ZX7 @@ -1,12 +1,12 @@ -puts "TODO OCC27414 ALL: Error: The command cannot be built" -puts "TODO OCC27414 ALL: gives an empty result" -puts "TODO OCC27414 ALL: TEST INCOMPLETE" - restore [locate_data_file bug26917_t115_c2.recipe.brep] s -OFFSETSHAPE 35 {} $calcul $type +offsetparameter 1.e-7 c i r +offsetload s 35 +offsetperform result -checkprops result -v 7.93275e+008 -checkprops result -s 6.15377e+006 +checkprops result -s 6.15377e+006 -v 7.93275e+008 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -vertex 64 -edge 96 -wire 34 -face 34 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZX8 b/tests/offset/shape_type_i_c/ZX8 index 6ec303d8a0..6cc1e9c46a 100644 --- a/tests/offset/shape_type_i_c/ZX8 +++ b/tests/offset/shape_type_i_c/ZX8 @@ -1,12 +1,12 @@ -puts "TODO OCC27414 ALL: Error: The command cannot be built" -puts "TODO OCC27414 ALL: gives an empty result" -puts "TODO OCC27414 ALL: TEST INCOMPLETE" - restore [locate_data_file bug26917_t116_c2.recipe.brep] s -OFFSETSHAPE 35 {} $calcul $type +offsetparameter 1.e-7 c i r +offsetload s 35 +offsetperform result -checkprops result -v 8.96742e+008 -checkprops result -s 6.85555e+006 +checkprops result -s 6.85555e+006 -v 8.96742e+008 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -vertex 64 -edge 96 -wire 34 -face 34 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png \ No newline at end of file diff --git a/tests/offset/shape_type_i_c/ZY2 b/tests/offset/shape_type_i_c/ZY2 index 3d262407b3..b0b9a3bcd8 100644 --- a/tests/offset/shape_type_i_c/ZY2 +++ b/tests/offset/shape_type_i_c/ZY2 @@ -1,12 +1,12 @@ -puts "TODO OCC27414 ALL: Error: The command cannot be built" -puts "TODO OCC27414 ALL: gives an empty result" -puts "TODO OCC27414 ALL: TEST INCOMPLETE" - restore [locate_data_file bug26917_t130_c2.recipe.brep] s -OFFSETSHAPE 35 {} $calcul $type +offsetparameter 1.e-7 c i r +offsetload s 35 +offsetperform result -checkprops result -v 6.89789e+008 -checkprops result -s 5.45195e+006 +checkprops result -s 5.45195e+006 -v 6.89789e+008 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -vertex 64 -edge 96 -wire 34 -face 34 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZY3 b/tests/offset/shape_type_i_c/ZY3 index 63a4e3017b..667f7fda32 100644 --- a/tests/offset/shape_type_i_c/ZY3 +++ b/tests/offset/shape_type_i_c/ZY3 @@ -1,12 +1,12 @@ -puts "TODO OCC27414 ALL: Error: The command cannot be built" -puts "TODO OCC27414 ALL: gives an empty result" -puts "TODO OCC27414 ALL: TEST INCOMPLETE" - restore [locate_data_file bug26917_t137_c2.recipe.brep] s -OFFSETSHAPE 35 {} $calcul $type +offsetparameter 1.e-7 c i r +offsetload s 35 +offsetperform result -checkprops result -v 8.96742e+008 -checkprops result -s 6.85555e+006 +checkprops result -s 6.85555e+006 -v 8.96742e+008 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -vertex 64 -edge 96 -wire 34 -face 34 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZY9 b/tests/offset/shape_type_i_c/ZY9 index 119631939a..713df9744e 100644 --- a/tests/offset/shape_type_i_c/ZY9 +++ b/tests/offset/shape_type_i_c/ZY9 @@ -1,12 +1,12 @@ -puts "TODO OCC27414 ALL: Error: The command cannot be built" -puts "TODO OCC27414 ALL: gives an empty result" -puts "TODO OCC27414 ALL: TEST INCOMPLETE" - restore [locate_data_file bug26917_t114_c2.recipe_art1.brep] s -OFFSETSHAPE 2 {} $calcul $type +offsetparameter 1.e-7 c i r +offsetload s 2 +offsetperform result -checkprops result -v 475 -checkprops result -s 454.58 +checkprops result -s 454.58 -v 475 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -vertex 14 -edge 21 -wire 9 -face 9 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png