diff --git a/src/BRepOffset/BRepOffset_Inter3d.cxx b/src/BRepOffset/BRepOffset_Inter3d.cxx index 9460d58346..b89e1f030a 100644 --- a/src/BRepOffset/BRepOffset_Inter3d.cxx +++ b/src/BRepOffset/BRepOffset_Inter3d.cxx @@ -443,7 +443,35 @@ void BRepOffset_Inter3d::ConnexIntByInt // map the shape for vertices if (bIsPlanar) { TopExp::MapShapes(SI, TopAbs_VERTEX, VEmap); - TopExp::MapShapesAndAncestors(SI, TopAbs_VERTEX, TopAbs_FACE, aMVF); + // + // make vertex-faces connexity map with unique ancestors + // TopExp::MapShapesAndAncestors(SI, TopAbs_VERTEX, TopAbs_FACE, aMVF); + TopExp_Explorer aExpF(SI, TopAbs_FACE); + for (; aExpF.More(); aExpF.Next()) { + const TopoDS_Shape& aF = aExpF.Current(); + // + TopExp_Explorer aExpV(aF, TopAbs_VERTEX); + for (; aExpV.More(); aExpV.Next()) { + const TopoDS_Shape& aV = aExpV.Current(); + // + TopTools_ListOfShape *pLF = aMVF.ChangeSeek(aV); + if (!pLF) { + pLF = &aMVF(aMVF.Add(aV, TopTools_ListOfShape())); + pLF->Append(aF); + continue; + } + // + TopTools_ListIteratorOfListOfShape aItLF(*pLF); + for (; aItLF.More(); aItLF.Next()) { + if (aItLF.Value().IsSame(aF)) { + break; + } + } + if (!aItLF.More()) { + pLF->Append(aF); + } + } + } } // TopTools_DataMapOfShapeListOfShape aDMVLF1, aDMVLF2, aDMIntFF; @@ -462,19 +490,15 @@ void BRepOffset_Inter3d::ConnexIntByInt if (aLF.Extent() < 2) { continue; } - // - // find pairs in which the vertex is alone (not connected to shared edges) + // build lists of faces connected to the same vertex by looking for + // the pairs in which the vertex is alone (not connected to shared edges) TopTools_ListOfShape aLF1, aLF2; - Standard_Boolean bVertexOnly = Standard_False; - TopTools_MapOfShape aMFence; // it.Initialize(aLF); for (; it.More(); it.Next()) { - const TopoDS_Face& aFV1 = *(TopoDS_Face*)&it.Value(); - if (!aMFence.Add(aFV1)) { - continue; - } + const TopoDS_Shape& aFV1 = it.Value(); // + // get edges of first face connected to current vertex TopTools_MapOfShape aME; TopExp_Explorer aExp(aFV1, TopAbs_EDGE); for (; aExp.More(); aExp.Next()) { @@ -488,37 +512,31 @@ void BRepOffset_Inter3d::ConnexIntByInt } } // - it1.Initialize(aLF); + // get to the next face in the list + it1 = it; for (it1.Next(); it1.More(); it1.Next()) { - const TopoDS_Face& aFV2 = *(TopoDS_Face*)&it1.Value(); - if (aMFence.Contains(aFV2)) { - continue; - } + const TopoDS_Shape& aFV2 = it1.Value(); // - bVertexOnly = Standard_True; aExp.Init(aFV2, TopAbs_EDGE); for (; aExp.More(); aExp.Next()) { const TopoDS_Shape& aEV2 = aExp.Current(); if (aME.Contains(aEV2)) { - bVertexOnly = Standard_False; break; } } // - if (bVertexOnly) { + if (!aExp.More()) { + // faces share only vertex - make pair for intersection aLF1.Append(aFV1); aLF2.Append(aFV2); - aMFence.Add(aFV2); } } } // - if (aLF1.IsEmpty()) { - continue; + if (aLF1.Extent()) { + aDMVLF1.Bind(aS, aLF1); + aDMVLF2.Bind(aS, aLF2); } - // - aDMVLF1.Bind(aS, aLF1); - aDMVLF2.Bind(aS, aLF2); } } // diff --git a/src/BRepOffset/BRepOffset_MakeOffset_1.cxx b/src/BRepOffset/BRepOffset_MakeOffset_1.cxx index abc54f034a..0a4b37d7de 100644 --- a/src/BRepOffset/BRepOffset_MakeOffset_1.cxx +++ b/src/BRepOffset/BRepOffset_MakeOffset_1.cxx @@ -783,19 +783,19 @@ void BuildSplitsOfFaces(const TopTools_ListOfShape& theLF, TopTools_ListOfShape aLFImages1; BuildSplitsOfFace(aF, aCE1, Standard_False, theFacesOrigins, aLFImages1); // - // additionally check if newly created faces are not the same - Standard_Boolean bAllInv = Standard_True; + // check if the rebuilding has added some new faces to the splits for (TopTools_ListIteratorOfListOfShape aItLFIm(aLFImages1); aItLFIm.More();) { + Standard_Boolean bAllInv = Standard_True; const TopoDS_Shape& aFIm = aItLFIm.Value(); TopExp_Explorer aExpE(aFIm, TopAbs_EDGE); for (; aExpE.More(); aExpE.Next()) { const TopoDS_Shape& aE = aExpE.Current(); - if (!aMapEInv.Contains(aE) && !aMENInv.Contains(aE)) { - break; - } - else if (bAllInv) { - bAllInv = aMapEInv.Contains(aE); + if (!aMapEInv.Contains(aE)) { + bAllInv = Standard_False; + if (!aMENInv.Contains(aE)) { + break; + } } } // @@ -1314,12 +1314,14 @@ Standard_Boolean CheckIfArtificial(const TopoDS_Shape& theF, TopExp_Explorer aExpV(aEInv, TopAbs_VERTEX); for (; aExpV.More(); aExpV.Next()) { const TopoDS_Shape& aVEInv = aExpV.Current(); - if (!aMEUsed.Contains(aVEInv) && aMVE.Contains(aVEInv)) { - const TopTools_ListOfShape& aLENInv = aMVE.FindFromKey(aVEInv); - TopTools_ListIteratorOfListOfShape aItLEInv(aLENInv); + const TopTools_ListOfShape* pLENInv = aMVE.Seek(aVEInv); + if (pLENInv) { + TopTools_ListIteratorOfListOfShape aItLEInv(*pLENInv); for (; aItLEInv.More(); aItLEInv.Next()) { const TopoDS_Shape& aENInv = aItLEInv.Value(); - theMENInv.Add(aENInv); + if (!aMEUsed.Contains(aENInv)) { + theMENInv.Add(aENInv); + } } } } @@ -1395,7 +1397,7 @@ void FindInvalidEdges(const TopoDS_Face& theF, // be defined by the edges on the original face adjacent to the connection vertex // const TopoDS_Face& aFOr = *(TopoDS_Face*)&theFacesOrigins.Find(theF); - // invald edges + // invalid edges TopTools_IndexedMapOfShape aMEInv; // valid edges TopTools_MapOfShape aMEVal; @@ -1479,6 +1481,11 @@ void FindInvalidEdges(const TopoDS_Face& theF, TopTools_MapOfShape aME, aMV; Standard_Boolean bInvalid = Standard_False, bChecked = Standard_False; Standard_Integer aNbP = NbPoints(aEIm); + Standard_Boolean bUseVertex = !aNbVOr ? Standard_False : + (aNbVOr == 1 && + aDMEF.FindFromKey(aEIm).Extent() == 1 && + !theOEOrigins.IsBound(aEIm)); + // aItLEO.Initialize(aLEOr); for (; aItLEO.More(); aItLEO.Next()) { const TopoDS_Shape& aSOr = aItLEO.Value(); @@ -1487,18 +1494,9 @@ void FindInvalidEdges(const TopoDS_Face& theF, TopoDS_Shape aEOrF; if (bVertex) { // for some cases it is impossible to check the validity of the edge - if (aNbVOr > 1) { + if (!bUseVertex) { continue; } - // - if (aDMEF.FindFromKey(aEIm).Extent() > 1) { - continue; - } - // - if (theOEOrigins.IsBound(aEIm)) { - continue; - } - // // find edges on the original face adjacent to this vertex if (aDMVEFOr.IsEmpty()) { // fill the map @@ -1579,8 +1577,9 @@ void FindInvalidEdges(const TopoDS_Face& theF, } // // check if the edge has been inverted - Standard_Boolean bInverted = CheckInverted(aEIm, aFOr, theOEImages, theOEOrigins, - theEdgesOrigins, aDMEF, aDMVE, aMEdges, theMEInverted); + Standard_Boolean bInverted = !aNbE ? Standard_False : + CheckInverted(aEIm, aFOr, theOEImages, theOEOrigins, + theEdgesOrigins, aDMEF, aDMVE, aMEdges, theMEInverted); // if (!bInverted || !aNbVOr) { theValidEdges.Add(aEIm); @@ -1908,10 +1907,6 @@ Standard_Boolean CheckInverted(const TopoDS_Edge& theEIm, return Standard_False; } // - if (theMEInverted.Contains(theEIm)) { - return Standard_True; - } - // // it is necessary to compare the direction from first vertex // to the last vertex on the original edge with the // same direction on the new edge. If the directions @@ -2013,7 +2008,7 @@ Standard_Boolean CheckInverted(const TopoDS_Edge& theEIm, if (aEO.ShapeType() == TopAbs_EDGE && aMFence.Add(aEO)) { TopoDS_Shape aEOin; if (FindShape(aEO, theFOr, aEOin)) { - aLOE.Append(aEO); + AppendToList(aLOE, aEO); } } } @@ -2512,6 +2507,7 @@ void RemoveInsideFaces(TopTools_IndexedDataMapOfShapeListOfShape& theFImages, // TopoDS_Compound aSolids; BRep_Builder().MakeCompound(aSolids); + TopTools_MapOfShape aMFKeep; // TopExp_Explorer aExpS(aSols, TopAbs_SOLID); for (; aExpS.More(); aExpS.Next()) { @@ -2538,7 +2534,9 @@ void RemoveInsideFaces(TopTools_IndexedDataMapOfShapeListOfShape& theFImages, const TopoDS_Shape& aFS = aExpF.Current(); // if (aMFToRem.Contains(aFS)) { - aMFToRem.Remove(aFS); + if (!aMFKeep.Add(aFS)) { + aMFKeep.Remove(aFS); + } } else { aMFToRem.Add(aFS); @@ -2551,6 +2549,11 @@ void RemoveInsideFaces(TopTools_IndexedDataMapOfShapeListOfShape& theFImages, } } // + TopTools_MapIteratorOfMapOfShape aItM(aMFKeep); + for (; aItM.More(); aItM.Next()) { + aMFToRem.Remove(aItM.Value()); + } + // // remove newly found internal faces RemoveValidSplits(aMFToRem, theFImages, aMV, theMERemoved); RemoveInvalidSplits(aMFToRem, theArtInvFaces, theInvEdges, theInvFaces, aMV, theMERemoved); @@ -3320,85 +3323,136 @@ void IntersectFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebui // when dealing with artificially invalid faces for intersection to be // complete we need to use not only invalid edges, but also the // edges connected to invalid ones - TopTools_MapOfShape aMEAlone, aMFence, aMVEInv; - TopTools_IndexedDataMapOfShapeListOfShape aDMVEVal; - // + + // find blocks of artificially invalid faces + TopTools_DataMapOfShapeShape aDMFImF; + TopoDS_Compound aCFArt; + BRep_Builder().MakeCompound(aCFArt); TopTools_DataMapIteratorOfDataMapOfShapeShape aItM(theArtInvFaces); for (; aItM.More(); aItM.Next()) { const TopoDS_Shape& aF = aItM.Key(); const TopTools_ListOfShape& aLFInv = theInvFaces.FindFromKey(aF); aItLF.Initialize(aLFInv); for (; aItLF.More(); aItLF.Next()) { - const TopoDS_Shape& aFInv = aItLF.Value(); - for (TopExp_Explorer aExp(aFInv, TopAbs_EDGE); aExp.More(); aExp.Next()) - { - const TopoDS_Shape& aE = aExp.Current(); - if (theInvEdges.Contains(aE)) { - for (TopoDS_Iterator aItV(aE); aItV.More(); aItV.Next()) { - aMVEInv.Add(aItV.Value()); - } - continue; - } - if (aMFence.Add(aE)) { - TopExp::MapShapesAndAncestors(aE, TopAbs_VERTEX, TopAbs_EDGE, aDMVEVal); - } - } + BRep_Builder().Add(aCFArt, aItLF.Value()); + aDMFImF.Bind(aItLF.Value(), aF); } } // - // collect edges with free vertices - Standard_Integer aNbV = aDMVEVal.Extent(); - for (i = 1; i <= aNbV; ++i) { - const TopoDS_Shape& aV = aDMVEVal.FindKey(i); - if (!aMVEInv.Contains(aV)) { - continue; + // make connexity blocks + TopTools_ListOfShape aLCBArt; + BOPTools_AlgoTools::MakeConnexityBlocks(aCFArt, TopAbs_VERTEX, TopAbs_FACE, aLCBArt); + // + // alone edges + TopTools_MapOfShape aMEAlone; + // + TopTools_ListIteratorOfListOfShape aItLCBArt(aLCBArt); + for (; aItLCBArt.More(); aItLCBArt.Next()) { + const TopoDS_Shape& aCB = aItLCBArt.Value(); + // + // check if aCB contains splits of only one offset face + TopTools_MapOfShape aMFArt; + TopExp_Explorer aExpF(aCB, TopAbs_FACE); + for (; aExpF.More(); aExpF.Next()) { + aMFArt.Add(aDMFImF.Find(aExpF.Current())); } // - const TopTools_ListOfShape& aLEV = aDMVEVal(i); - if (aLEV.Extent() > 1) { - continue; - } + Standard_Boolean bAlone = (aMFArt.Extent() == 1); // - const TopoDS_Shape& aE = aLEV.First(); - aMEAlone.Add(aE); + // vertices on invalid edges + TopTools_MapOfShape aMVEInv; + TopTools_MapOfShape aMFence; + // edges that should not be marked as alone - edges having same origins as invalid ones + TopTools_MapOfShape aMEAvoid; + // map to find alone edges by looking for free vertices + TopTools_IndexedDataMapOfShapeListOfShape aDMVEVal; // - // if this alone edge adds nothing to the intersection list - // it means that the origin of this edge has been split and we need to - // add the neigboring images of the same origins - if (aDMSF.Find(aE).Extent() > 1) { - continue; - } - // - // check also its vertices - TopoDS_Iterator aItE(aE); - for (; aItE.More(); aItE.Next()) { - const TopoDS_Shape& aVE = aItE.Value(); - if (aDMSF.Find(aVE).Extent() > 2) { - break; + TopExp_Explorer aExpE(aCB, TopAbs_EDGE); + for (; aExpE.More(); aExpE.Next()) { + const TopoDS_Shape& aE = aExpE.Current(); + if (theInvEdges.Contains(aE)) { + for (TopoDS_Iterator aItV(aE); aItV.More(); aItV.Next()) { + aMVEInv.Add(aItV.Value()); + } + // + if (bAlone) { + const TopTools_ListOfShape *pLEOr = theOEOrigins.Seek(aE); + if (pLEOr) { + TopTools_ListIteratorOfListOfShape aItLEOr(*pLEOr); + for (; aItLEOr.More(); aItLEOr.Next()) { + TopTools_ListIteratorOfListOfShape aItLEIm(theOEImages.Find(aItLEOr.Value())); + for (; aItLEIm.More(); aItLEIm.Next()) { + aMEAvoid.Add(aItLEIm.Value()); + } + } + } + } + continue; + } + // + if (aMFence.Add(aE)) { + TopExp::MapShapesAndAncestors(aE, TopAbs_VERTEX, TopAbs_EDGE, aDMVEVal); } } // - if (aItE.More()) { - continue; - } - // - // the edge is useless - look for other images - const TopTools_ListOfShape *pLEOr = theOEOrigins.Seek(aE); - if (!pLEOr) { - continue; - } - // - TopTools_ListIteratorOfListOfShape aItLEOr(*pLEOr); - for (; aItLEOr.More(); aItLEOr.Next()) { - const TopoDS_Shape& aEOr = aItLEOr.Value(); + // find edges with free vertices + Standard_Integer aNbV = aDMVEVal.Extent(); + for (i = 1; i <= aNbV; ++i) { + const TopoDS_Shape& aV = aDMVEVal.FindKey(i); + if (!aMVEInv.Contains(aV)) { + continue; + } // - const TopTools_ListOfShape& aLEIm = theOEImages.Find(aEOr); - TopTools_ListIteratorOfListOfShape aItLEIm(aLEIm); - for (; aItLEIm.More(); aItLEIm.Next()) { - const TopoDS_Shape& aEIm = aItLEIm.Value(); + const TopTools_ListOfShape& aLEV = aDMVEVal(i); + if (aLEV.Extent() > 1) { + continue; + } + // + const TopoDS_Shape& aE = aLEV.First(); + if (aMEAvoid.Contains(aE)) { + continue; + } + // + aMEAlone.Add(aE); + // + // if this alone edge adds nothing to the intersection list + // it means that the origin of this edge has been split and we need to + // add the neighboring images of the same origins + if (aDMSF.Find(aE).Extent() > 1) { + continue; + } + // + // check also its vertices + TopoDS_Iterator aItE(aE); + for (; aItE.More(); aItE.Next()) { + const TopoDS_Shape& aVE = aItE.Value(); + if (aDMSF.Find(aVE).Extent() > 2) { + break; + } + } + // + if (aItE.More()) { + continue; + } + // + // the edge is useless - look for other images + const TopTools_ListOfShape *pLEOr = theOEOrigins.Seek(aE); + if (!pLEOr) { + continue; + } + // + TopTools_ListIteratorOfListOfShape aItLEOr(*pLEOr); + for (; aItLEOr.More(); aItLEOr.Next()) { + const TopoDS_Shape& aEOr = aItLEOr.Value(); // - if (aMFence.Contains(aEIm)) { - aMEAlone.Add(aEIm); + const TopTools_ListOfShape& aLEIm = theOEImages.Find(aEOr); + TopTools_ListIteratorOfListOfShape aItLEIm(aLEIm); + for (; aItLEIm.More(); aItLEIm.Next()) { + const TopoDS_Shape& aEIm = aItLEIm.Value(); + // + if (aMFence.Contains(aEIm)) { + aMEAlone.Add(aEIm); + } } } } @@ -3958,17 +4012,24 @@ void ProcessCommonEdges(const TopTools_ListOfShape& theLEC, aItLE.Initialize(theLEC); for (; aItLE.More(); aItLE.Next()) { const TopoDS_Shape& aEC = aItLE.Value(); - if (theAllInvs.Contains(aEC) || theInvEdges.Contains(aEC)) { - return; - } - // - TopoDS_Iterator aItV(aEC); - for (; aItV.More(); aItV.Next()) { - if (theAllInvs.Contains(aItV.Value())) { + // check if all images of the origin of this edge + // are not connected to any invalidity + const TopoDS_Shape& aEInt = theETrimEInf.Find(aEC); + const TopTools_ListOfShape& aLVE = theMEInfETrim.Find(aEInt); + TopTools_ListIteratorOfListOfShape aItLVE(aLVE); + for (; aItLVE.More(); aItLVE.Next()) { + const TopoDS_Shape& aECx = aItLVE.Value(); + if (theAllInvs.Contains(aECx) || theInvEdges.Contains(aECx)) { return; } + // + TopoDS_Iterator aItV(aECx); + for (; aItV.More(); aItV.Next()) { + if (theAllInvs.Contains(aItV.Value())) { + return; + } + } } - // // use only one element if (aLEC.IsEmpty()) { aLEC.Append(aEC); @@ -4514,6 +4575,7 @@ void UpdateValidEdges(const TopTools_IndexedDataMapOfShapeListOfShape& theFImage // back connection from edges to faces TopTools_DataMapOfShapeListOfShape aMELF; // + TopTools_MapOfShape aMETmp; Standard_Integer i, aNb = theFLE.Extent(); for (i = 1; i <= aNb; ++i) { const TopoDS_Face& aF = TopoDS::Face(theFLE.FindKey(i)); @@ -4522,6 +4584,11 @@ void UpdateValidEdges(const TopTools_IndexedDataMapOfShapeListOfShape& theFImage TopTools_ListIteratorOfListOfShape aItLE(aLEInt); for (; aItLE.More(); aItLE.Next()) { const TopoDS_Shape& aE = aItLE.Value(); + if ((theMECheckExt.Contains(aE) || aMETmp.Contains(aE)) && !theEImages.IsBound(aE)) { + theMECheckExt.Remove(aE); + aMETmp.Add(aE); + continue; + } TopTools_ListOfShape* pLF = aMELF.ChangeSeek(aE); if (!pLF) { pLF = aMELF.Bound(aE, TopTools_ListOfShape()); @@ -4728,6 +4795,8 @@ void TrimNewIntersectionEdges(const TopTools_ListOfShape& theLE, for (; aIt.More(); aIt.Next()) { const TopoDS_Shape& aE = aIt.Value(); // + Standard_Boolean bCheckExt = theMECheckExt.Remove(aE); + // Standard_Boolean bOld = theEETrim.IsBound(aE); if (bOld) { const TopTools_ListOfShape& aLET = theEETrim.Find(aE); @@ -4820,7 +4889,6 @@ void TrimNewIntersectionEdges(const TopTools_ListOfShape& theLE, } } // - Standard_Boolean bCheckExt = theMECheckExt.Contains(aE); if (aLEIm.IsEmpty()) { theEImages.UnBind(aE); } @@ -4846,10 +4914,6 @@ void TrimNewIntersectionEdges(const TopTools_ListOfShape& theLE, } } } - // - if (bCheckExt) { - theMECheckExt.Remove(aE); - } } } diff --git a/tests/offset/shape_type_i_c/XE6 b/tests/offset/shape_type_i_c/XE6 index ec54beae60..f462c92068 100644 --- a/tests/offset/shape_type_i_c/XE6 +++ b/tests/offset/shape_type_i_c/XE6 @@ -1,10 +1,10 @@ -puts "TODO CR27414 ALL: Error : The area of result shape is" -puts "TODO CR27414 ALL: Error : The volume of result shape is" - restore [locate_data_file bug26917_dom-7724_trim5.brep] s OFFSETSHAPE 15 {} $calcul $type -checkprops result -v 0 -s 0 +checkprops result -v 596571 -s 50145.4 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -face 9 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XM1 b/tests/offset/shape_type_i_c/XM1 index 747eeadea4..f84299b516 100644 --- a/tests/offset/shape_type_i_c/XM1 +++ b/tests/offset/shape_type_i_c/XM1 @@ -1,10 +1,12 @@ restore [locate_data_file bug28046_rm-107_merged_input.brep] s -OFFSETSHAPE 8 {} $calcul $type +offsetparameter 1e-7 c i r +offsetload s 8 +offsetperform result checkprops result -v 4.40128e+007 -s 1.81672e+006 unifysamedom result_unif result -checknbshapes result_unif -face 64 -shell 1 +checknbshapes result_unif -edge 186 -face 64 -shell 1 checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XM4 b/tests/offset/shape_type_i_c/XM4 new file mode 100644 index 0000000000..53fa225192 --- /dev/null +++ b/tests/offset/shape_type_i_c/XM4 @@ -0,0 +1,27 @@ +restore [locate_data_file bug28163_merged_input.brep] s + +offsetparameter 1e-7 c i +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 -v 4.27764e+007 -s 1.70699e+006 + +unifysamedom result_unif result +checknbshapes result_unif -face 413 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XM5 b/tests/offset/shape_type_i_c/XM5 new file mode 100644 index 0000000000..6f95451eab --- /dev/null +++ b/tests/offset/shape_type_i_c/XM5 @@ -0,0 +1,27 @@ +restore [locate_data_file bug28163_merged_input_trim1.brep] s + +offsetparameter 1e-7 c i +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 -v 1.62872e+007 -s 600815 + +unifysamedom result_unif result +checknbshapes result_unif -face 90 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XM6 b/tests/offset/shape_type_i_c/XM6 new file mode 100644 index 0000000000..73860d1a62 --- /dev/null +++ b/tests/offset/shape_type_i_c/XM6 @@ -0,0 +1,27 @@ +restore [locate_data_file bug28163_merged_input_trim3.brep] s + +offsetparameter 1e-7 c i +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 -v 1.23529e+006 -s 103271 + +unifysamedom result_unif result +checknbshapes result_unif -face 35 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XM7 b/tests/offset/shape_type_i_c/XM7 new file mode 100644 index 0000000000..d5262d3d8d --- /dev/null +++ b/tests/offset/shape_type_i_c/XM7 @@ -0,0 +1,27 @@ +restore [locate_data_file bug28163_merged_input_trim5.brep] s + +offsetparameter 1e-7 c i +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 -v 195034 -s 24982.5 + +unifysamedom result_unif result +checknbshapes result_unif -face 12 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XM8 b/tests/offset/shape_type_i_c/XM8 new file mode 100644 index 0000000000..5bf3cae8f8 --- /dev/null +++ b/tests/offset/shape_type_i_c/XM8 @@ -0,0 +1,10 @@ +restore [locate_data_file bug28163_merged_input.brep] s + +OFFSETSHAPE 4 {} $calcul $type + +checkprops result -v 4.44822e+007 -s 1.70739e+006 + +unifysamedom result_unif result +checknbshapes result_unif -face 423 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XM9 b/tests/offset/shape_type_i_c/XM9 new file mode 100644 index 0000000000..654b38d47e --- /dev/null +++ b/tests/offset/shape_type_i_c/XM9 @@ -0,0 +1,10 @@ +restore [locate_data_file bug28163_merged_input_trim1.brep] s + +OFFSETSHAPE 4 {} $calcul $type + +checkprops result -v 1.68905e+007 -s 606317 + +unifysamedom result_unif result +checknbshapes result_unif -face 91 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XN1 b/tests/offset/shape_type_i_c/XN1 new file mode 100644 index 0000000000..87b0dbff9f --- /dev/null +++ b/tests/offset/shape_type_i_c/XN1 @@ -0,0 +1,10 @@ +restore [locate_data_file bug28163_merged_input_trim3.brep] s + +OFFSETSHAPE 4 {} $calcul $type + +checkprops result -v 1.34032e+006 -s 107264 + +unifysamedom result_unif result +checknbshapes result_unif -face 36 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XN2 b/tests/offset/shape_type_i_c/XN2 new file mode 100644 index 0000000000..dc691b09a3 --- /dev/null +++ b/tests/offset/shape_type_i_c/XN2 @@ -0,0 +1,10 @@ +restore [locate_data_file bug28163_merged_input_trim5.brep] s + +OFFSETSHAPE 4 {} $calcul $type + +checkprops result -v 220952 -s 26863.2 + +unifysamedom result_unif result +checknbshapes result_unif -face 12 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZW1 b/tests/offset/shape_type_i_c/ZW1 index ed536b138f..e5e99d3606 100644 --- a/tests/offset/shape_type_i_c/ZW1 +++ b/tests/offset/shape_type_i_c/ZW1 @@ -5,4 +5,7 @@ OFFSETSHAPE 43.7 {} $calcul $type checkprops result -v 2.70147e+009 checkprops result -s 1.63922e+007 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -face 38 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZW2 b/tests/offset/shape_type_i_c/ZW2 index de81d16f66..00f26552ee 100644 --- a/tests/offset/shape_type_i_c/ZW2 +++ b/tests/offset/shape_type_i_c/ZW2 @@ -5,4 +5,7 @@ OFFSETSHAPE 43.7 {} $calcul $type checkprops result -v 4.55952e+006 checkprops result -s 178524 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -face 14 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZW3 b/tests/offset/shape_type_i_c/ZW3 index 5f784419dc..2ee1535b50 100644 --- a/tests/offset/shape_type_i_c/ZW3 +++ b/tests/offset/shape_type_i_c/ZW3 @@ -5,4 +5,7 @@ OFFSETSHAPE 14 {} $calcul $type checkprops result -v 702756 checkprops result -s 58381.3 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -face 9 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZW4 b/tests/offset/shape_type_i_c/ZW4 index cae34a8e19..3b3eff909e 100644 --- a/tests/offset/shape_type_i_c/ZW4 +++ b/tests/offset/shape_type_i_c/ZW4 @@ -5,4 +5,7 @@ OFFSETSHAPE 43.7 {} $calcul $type checkprops result -v 3.77467e+006 checkprops result -s 155537 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -face 8 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZW5 b/tests/offset/shape_type_i_c/ZW5 index 61a523eaf2..96d76f41b5 100644 --- a/tests/offset/shape_type_i_c/ZW5 +++ b/tests/offset/shape_type_i_c/ZW5 @@ -5,4 +5,7 @@ OFFSETSHAPE 4 {} $calcul $type checkprops result -v 3771.44 checkprops result -s 1506.76 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -face 12 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZW6 b/tests/offset/shape_type_i_c/ZW6 index ce6fc96dc4..a01c955830 100644 --- a/tests/offset/shape_type_i_c/ZW6 +++ b/tests/offset/shape_type_i_c/ZW6 @@ -5,4 +5,7 @@ OFFSETSHAPE 5 {} $calcul $type checkprops result -v 5453.96 checkprops result -s 1912.14 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -face 13 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZW7 b/tests/offset/shape_type_i_c/ZW7 index 1ae6cf9138..e7416e60a4 100644 --- a/tests/offset/shape_type_i_c/ZW7 +++ b/tests/offset/shape_type_i_c/ZW7 @@ -9,4 +9,7 @@ offsetperform result checkprops result -v 5530.7 checkprops result -s 1919.49 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -face 13 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZW8 b/tests/offset/shape_type_i_c/ZW8 index b47a2963e5..eb0b0e2d76 100644 --- a/tests/offset/shape_type_i_c/ZW8 +++ b/tests/offset/shape_type_i_c/ZW8 @@ -5,4 +5,7 @@ OFFSETSHAPE 15 {} $calcul $type checkprops result -v 48955.7 checkprops result -s 8048.95 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -face 8 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZW9 b/tests/offset/shape_type_i_c/ZW9 index c97b3d69f7..50ce6f0615 100644 --- a/tests/offset/shape_type_i_c/ZW9 +++ b/tests/offset/shape_type_i_c/ZW9 @@ -5,4 +5,7 @@ OFFSETSHAPE 6 {} $calcul $type checkprops result -v 7543.63 checkprops result -s 2359.85 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -face 13 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZX1 b/tests/offset/shape_type_i_c/ZX1 index 3910b68835..ac5f60e851 100644 --- a/tests/offset/shape_type_i_c/ZX1 +++ b/tests/offset/shape_type_i_c/ZX1 @@ -5,4 +5,7 @@ OFFSETSHAPE 43 {} $calcul $type checkprops result -v 7.05903e+008 checkprops result -s 5.59084e+006 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -face 21 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZX2 b/tests/offset/shape_type_i_c/ZX2 index 6bd9877625..17e216662e 100644 --- a/tests/offset/shape_type_i_c/ZX2 +++ b/tests/offset/shape_type_i_c/ZX2 @@ -5,4 +5,7 @@ OFFSETSHAPE 35 {} $calcul $type checkprops result -v 7.94674e+008 checkprops result -s 6.11963e+006 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -face 22 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZX3 b/tests/offset/shape_type_i_c/ZX3 index 5936be0e29..22979a735a 100644 --- a/tests/offset/shape_type_i_c/ZX3 +++ b/tests/offset/shape_type_i_c/ZX3 @@ -5,4 +5,7 @@ OFFSETSHAPE 43 {} $calcul $type checkprops result -v 7.05903e+008 checkprops result -s 5.59084e+006 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -face 21 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZX4 b/tests/offset/shape_type_i_c/ZX4 index de7b0afebb..993428c5f4 100644 --- a/tests/offset/shape_type_i_c/ZX4 +++ b/tests/offset/shape_type_i_c/ZX4 @@ -5,4 +5,7 @@ OFFSETSHAPE 43 {} $calcul $type checkprops result -v 9.12393e+008 checkprops result -s 7.01321e+006 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -face 21 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZX9 b/tests/offset/shape_type_i_c/ZX9 index 86445e1bea..fad0518ec3 100644 --- a/tests/offset/shape_type_i_c/ZX9 +++ b/tests/offset/shape_type_i_c/ZX9 @@ -5,4 +5,7 @@ OFFSETSHAPE 43 {} $calcul $type checkprops result -v 5.23391e+008 checkprops result -s 4.7898e+006 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -face 22 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZY1 b/tests/offset/shape_type_i_c/ZY1 index 070bfda432..20c26e739b 100644 --- a/tests/offset/shape_type_i_c/ZY1 +++ b/tests/offset/shape_type_i_c/ZY1 @@ -5,4 +5,7 @@ OFFSETSHAPE 43 {} $calcul $type checkprops result -v 1.58077e+009 checkprops result -s 1.04396e+007 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -face 38 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZY4 b/tests/offset/shape_type_i_c/ZY4 index c96b9e09e7..d887861a73 100644 --- a/tests/offset/shape_type_i_c/ZY4 +++ b/tests/offset/shape_type_i_c/ZY4 @@ -5,4 +5,7 @@ OFFSETSHAPE 43 {} $calcul $type checkprops result -v 2.09462e+009 checkprops result -s 1.32364e+007 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -face 38 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZY5 b/tests/offset/shape_type_i_c/ZY5 index a6b5f5d523..83c94c169a 100644 --- a/tests/offset/shape_type_i_c/ZY5 +++ b/tests/offset/shape_type_i_c/ZY5 @@ -5,4 +5,7 @@ OFFSETSHAPE 43 {} $calcul $type checkprops result -v 7.05903e+008 checkprops result -s 5.59084e+006 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -face 21 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZY6 b/tests/offset/shape_type_i_c/ZY6 index 0b63ea5457..5cb63eff3b 100644 --- a/tests/offset/shape_type_i_c/ZY6 +++ b/tests/offset/shape_type_i_c/ZY6 @@ -5,4 +5,7 @@ OFFSETSHAPE 43 {} $calcul $type checkprops result -v 5.23391e+008 checkprops result -s 4.7898e+006 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -face 22 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZY7 b/tests/offset/shape_type_i_c/ZY7 index a93a4246a1..f5dc033655 100644 --- a/tests/offset/shape_type_i_c/ZY7 +++ b/tests/offset/shape_type_i_c/ZY7 @@ -4,4 +4,7 @@ OFFSETSHAPE 6 {} $calcul $type checkprops result -v 813077 -s 70451.1 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -face 14 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZY8 b/tests/offset/shape_type_i_c/ZY8 index d97a14107f..68eb376d60 100644 --- a/tests/offset/shape_type_i_c/ZY8 +++ b/tests/offset/shape_type_i_c/ZY8 @@ -5,4 +5,7 @@ OFFSETSHAPE 3 {} $calcul $type checkprops result -v 4422.98 checkprops result -s 1736.95 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -face 14 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZZ1 b/tests/offset/shape_type_i_c/ZZ1 index afa9394e28..f235788aaf 100755 --- a/tests/offset/shape_type_i_c/ZZ1 +++ b/tests/offset/shape_type_i_c/ZZ1 @@ -1,6 +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 CR27414 ALL: is not equal to zero" +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_input_segfault.brep] s diff --git a/tests/offset/shape_type_i_c/ZZ2 b/tests/offset/shape_type_i_c/ZZ2 index 40a461796c..728bad4a1b 100755 --- a/tests/offset/shape_type_i_c/ZZ2 +++ b/tests/offset/shape_type_i_c/ZZ2 @@ -1,13 +1,10 @@ -puts "TODO CR27414 ALL: Error : The area of result shape is" -puts "TODO CR27414 ALL: Error : The volume of result shape is" -puts "TODO CR27414 ALL: Error : is WRONG because number of SHELL entities in shape" -puts "TODO CR27414 ALL: is not equal to zero" - restore [locate_data_file bug26917_offset_topology.brep] s OFFSETSHAPE 10 {} $calcul $type -checkprops result -v 0 -checkprops result -s 0 +checkprops result -s 4.24638e+006 -v 2.9367e+008 -checknbshapes result -shell 1 +unifysamedom result_unif result +checknbshapes result_unif -face 100 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png