From: emv Date: Thu, 2 Mar 2017 11:29:53 +0000 (+0300) Subject: 0028501: Incomplete result of offset operation in mode Complete with Join type inters... X-Git-Tag: V7_2_0_beta~220 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=093a3fe5bb3cff9a10a5e409e722e48015efd11a 0028501: Incomplete result of offset operation in mode Complete with Join type intersection 1. The algorithm BOPAlgo_ShellSplitter has been improved for the cases with multi-connected edges to produce as many shells as possible from the given input faces. 2. Building tool prism in BRepFeat_MakePrism has been changed in order to avoid self-intersections in the cases when the limiting faces are intersecting. 3. Test cases for the issue. 4. Test cases boolean/bcut_complex/N9 and boolean/gdml_private/ZH3 are improvements. 5. Test cases boolean/volumemaker/C5 and boolean/volumemaker/C6 has been marked as BAD due to found problem in intersection algorithm. The results in these cases obtained on the branch are better than on master, but still not complete. Adjusting test case bugs/moddata_2/bug469 for its current behavior. --- diff --git a/src/BOPAlgo/BOPAlgo_ShellSplitter.cxx b/src/BOPAlgo/BOPAlgo_ShellSplitter.cxx index ebc4fe58dd..de199ffde9 100644 --- a/src/BOPAlgo/BOPAlgo_ShellSplitter.cxx +++ b/src/BOPAlgo/BOPAlgo_ShellSplitter.cxx @@ -28,14 +28,11 @@ #include #include #include +#include #include #include #include -// -// -// -// // static void MakeShell(const BOPCol_ListOfShape& , @@ -43,6 +40,7 @@ static // static void RefineShell(TopoDS_Shell& theShell, + const BOPCol_IndexedDataMapOfShapeListOfShape& theMEF, BOPCol_ListOfShape& aLShX); // static @@ -338,135 +336,212 @@ void BOPAlgo_ShellSplitter::SplitBlock(BOPTools_ConnexityBlock& aCB) BOPCol_ListOfShape& myLoops=aCB.ChangeLoops(); myLoops.Clear(); // - // 1. Shells Usual + // Copy faces into the map, for recursive search of free bounds + BOPCol_MapOfOrientedShape aMFaces; aItF.Initialize (myShapes); for (; aItF.More(); aItF.Next()) { - const TopoDS_Shape& aFF = aItF.Value(); - BOPTools::MapShapesAndAncestors (aFF, - TopAbs_EDGE, - TopAbs_FACE, - aEFMap); + aMFaces.Add(aItF.Value()); } // + // remove the faces with free edges from processing + for (;;) { + // map the shapes + aEFMap.Clear(); + aItF.Initialize(myShapes); + for (; aItF.More(); aItF.Next()) { + const TopoDS_Shape& aF = aItF.Value(); + if (aMFaces.Contains(aF)) { + BOPTools::MapShapesAndAncestors (aF, TopAbs_EDGE, TopAbs_FACE, aEFMap); + } + } + // + Standard_Integer aNbBegin = aMFaces.Extent(); + // check the free edges + Standard_Integer aNbE = aEFMap.Extent(); + for (i = 1; i <= aNbE; ++i) { + const TopoDS_Edge& aE = TopoDS::Edge(aEFMap.FindKey(i)); + if (!(BRep_Tool::Degenerated(aE) || aE.Orientation() == TopAbs_INTERNAL)) { + const BOPCol_ListOfShape& aLF = aEFMap(i); + if (aLF.Extent() == 1) { + // remove the face + aMFaces.Remove(aLF.First()); + } + } + } + // + // check if any faces have been removed + Standard_Integer aNbEnd = aMFaces.Extent(); + if ((aNbEnd == aNbBegin) || (aNbEnd == 0)) { + break; + } + } + // + if (aMFaces.IsEmpty()) { + return; + } + // + // use only connected faces + BOPCol_ListOfShape aLFConnected; aItF.Initialize (myShapes); - for (i=1; aItF.More(); aItF.Next(), ++i) { + for (; aItF.More(); aItF.Next()) { + const TopoDS_Shape& aF = aItF.Value(); + if (aMFaces.Contains(aF)) { + aLFConnected.Append(aF); + } + } + // + const Standard_Integer aNbShapes = aLFConnected.Extent(); + Standard_Boolean bAllFacesTaken = Standard_False; + // + // Build the shells + aItF.Initialize (aLFConnected); + for (i = 1; aItF.More() && !bAllFacesTaken; aItF.Next(), ++i) { const TopoDS_Shape& aFF = aItF.Value(); if (!AddedFacesMap.Add(aFF)) { continue; } // // make a new shell - TopoDS_Shell aShell; - aBB.MakeShell(aShell); - aBB.Add(aShell, aFF); + TopoDS_Shell aShellStart; + aBB.MakeShell(aShellStart); + aBB.Add(aShellStart, aFF); // - aMEFP.Clear(); - BOPTools::MapShapesAndAncestors(aFF, - TopAbs_EDGE, - TopAbs_FACE, - aMEFP); + BOPCol_ListOfShape aLShells; + aLShells.Append(aShellStart); // - // loop on faces added to Shell; - // add their neighbor faces to Shell and so on - aItS.Initialize (aShell); - for (; aItS.More(); aItS.Next()) { - const TopoDS_Face& aF = (*(TopoDS_Face*)(&aItS.Value())); + BOPCol_ListIteratorOfListOfShape aItLShells(aLShells); + for (; aItLShells.More(); aItLShells.Next()) { + TopoDS_Shell& aShell = TopoDS::Shell(aItLShells.ChangeValue()); // - // loop on edges of aF; find a good neighbor face of aF by aE - aExp.Init(aF, TopAbs_EDGE); - for (; aExp.More(); aExp.Next()) { - const TopoDS_Edge& aE = (*(TopoDS_Edge*)(&aExp.Current())); + aMEFP.Clear(); + BOPTools::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aMEFP); + // + // loop on faces added to Shell; + // add their neighbor faces to Shell and so on + aItS.Initialize(aShell); + for (; aItS.More(); aItS.Next()) { + const TopoDS_Face& aF = (*(TopoDS_Face*)(&aItS.Value())); // - //1 - if (aMEFP.Contains(aE)) { - const BOPCol_ListOfShape& aLFP=aMEFP.FindFromKey(aE); - aNbFP=aLFP.Extent(); - if (aNbFP>1) { + // loop on edges of aF; find a good neighbor face of aF by aE + aExp.Init(aF, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Edge& aE = (*(TopoDS_Edge*)(&aExp.Current())); + // + // proceed only free edges in this shell + if (aMEFP.Contains(aE)) { + const BOPCol_ListOfShape& aLFP = aMEFP.FindFromKey(aE); + aNbFP = aLFP.Extent(); + if (aNbFP > 1) { + continue; + } + } + // avoid processing of internal edges + anOr = aE.Orientation(); + if (anOr == TopAbs_INTERNAL) { continue; } - } - //2 - anOr=aE.Orientation(); - if (anOr==TopAbs_INTERNAL) { - continue; - } - //3 - if (BRep_Tool::Degenerated(aE)) { - continue; - } - // - // candidate faces list - const BOPCol_ListOfShape& aLF=aEFMap.FindFromKey(aE); - aNbLF=aLF.Extent(); - if (!aNbLF) { - continue; - } - // - // try to select one of neighbors - // check if a face already added to Shell shares E - Standard_Boolean bFound; - BOPCol_ListIteratorOfListOfShape aItLF; - BOPTools_ListOfCoupleOfShape aLCSOff; - // - aItLF.Initialize(aLF); - for (; aItLF.More(); aItLF.Next()) { - const TopoDS_Face& aFL=(*(TopoDS_Face*)(&aItLF.Value())); - if (aF.IsSame(aFL)) { + // avoid processing of degenerated edges + if (BRep_Tool::Degenerated(aE)) { continue; - } - if (AddedFacesMap.Contains(aFL)){ + } + // + // candidate faces list + const BOPCol_ListOfShape& aLF = aEFMap.FindFromKey(aE); + aNbLF = aLF.Extent(); + if (!aNbLF) { continue; } // - bFound=BOPTools_AlgoTools::GetEdgeOff(aE, aFL, aEL); - if (!bFound) { + // prepare for selecting the next face + // take only not-processed faces as a candidates + BOPTools_ListOfCoupleOfShape aLCSOff; + // + BOPCol_ListIteratorOfListOfShape aItLF(aLF); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Face& aFL = (*(TopoDS_Face*)(&aItLF.Value())); + if (aF.IsSame(aFL) || AddedFacesMap.Contains(aFL)) { + continue; + } + // + // find current edge in the face + if (!BOPTools_AlgoTools::GetEdgeOff(aE, aFL, aEL)) { + continue; + } + // + aCSOff.SetShape1(aEL); + aCSOff.SetShape2(aFL); + aLCSOff.Append(aCSOff); + }//for (; aItLF.More(); aItLF.Next()) { + // + aNbOff = aLCSOff.Extent(); + if (!aNbOff){ continue; } // - aCSOff.SetShape1(aEL); - aCSOff.SetShape2(aFL); - aLCSOff.Append(aCSOff); - }//for (; aItLF.More(); aItLF.Next()) { - // - aNbOff=aLCSOff.Extent(); - if (!aNbOff){ - continue; - } + // among all the adjacent faces chose one with the minimal + // angle to the current one + TopoDS_Face aSelF; + if (aNbOff == 1) { + aSelF = (*(TopoDS_Face*)(&aLCSOff.First().Shape2())); + } + else if (aNbOff > 1) { + BOPTools_AlgoTools::GetFaceOff(aE, aF, aLCSOff, aSelF, aContext); + } + // + if (!aSelF.IsNull() && AddedFacesMap.Add(aSelF)) { + aBB.Add(aShell, aSelF); + BOPTools::MapShapesAndAncestors(aSelF, TopAbs_EDGE, TopAbs_FACE, aMEFP); + } + } // for (; aExp.More(); aExp.Next()) { + } // for (; aItS.More(); aItS.Next()) { + // + // split the shell on multi-connected edges + BOPCol_ListOfShape aLShSp; + RefineShell(aShell, aMEFP, aLShSp); + // + // collect the not closed shells for further processing + BOPCol_ListOfShape aLShNC; + // + BOPCol_ListIteratorOfListOfShape aItLShSp(aLShSp); + for (; aItLShSp.More(); aItLShSp.Next()) { + TopoDS_Shell& aShSp = *((TopoDS_Shell*)&aItLShSp.Value()); // - TopoDS_Face aSelF; - if (aNbOff==1) { - aSelF=(*(TopoDS_Face*)(&aLCSOff.First().Shape2())); - } - else if (aNbOff>1){ - BOPTools_AlgoTools::GetFaceOff(aE, - aF, - aLCSOff, - aSelF, - aContext); + if (BRep_Tool::IsClosed(aShSp)) { + aShSp.Closed(Standard_True); + myLoops.Append(aShSp); } - // - if (!aSelF.IsNull() && AddedFacesMap.Add(aSelF)) { - aBB.Add(aShell, aSelF); - BOPTools::MapShapesAndAncestors(aSelF, - TopAbs_EDGE, - TopAbs_FACE, - aMEFP); + else { + aLShNC.Append(aShSp); } - } // for (; aExp.More(); aExp.Next()) { - } // for (; aItS.More(); aItS.Next()) { - // - BOPCol_ListOfShape aLShX; - BOPCol_ListIteratorOfListOfShape aItLShX; - // - RefineShell(aShell, aLShX); - // - aItLShX.Initialize(aLShX); - for (; aItLShX.More(); aItLShX.Next()) { - TopoDS_Shell& aShX=*((TopoDS_Shell*)&aItLShX.Value()); + } + // + bAllFacesTaken = (AddedFacesMap.Extent() == aNbShapes); + if (bAllFacesTaken) { + break; + } + // + if (aLShSp.Extent() == 1) { + // not further processing of not closed shells is needed, + // as it will not bring any new results + continue; + } // - if (BRep_Tool::IsClosed(aShX)) { - aShX.Closed(Standard_True); - myLoops.Append(aShX); + Standard_Integer aNbShNC = aLShNC.Extent(); + if (aNbShNC == 1) { + // try to complete the shell with other faces + aLShells.Append(aLShNC); + } + else if (aNbShNC > 1) { + // remove th faces of not closed shells from the map of processed faces + // and try to rebuild the shells using all not processed faces, + // because faces of one shell might be needed for building the other + BOPCol_ListIteratorOfListOfShape aItLShNC(aLShNC); + for (; aItLShNC.More(); aItLShNC.Next()) { + TopoDS_Iterator aItNC(aItLShNC.Value()); + for (; aItNC.More(); aItNC.Next()) { + AddedFacesMap.Remove(aItNC.Value()); + } + } } } } // for (; aItF.More(); aItF.Next()) { @@ -475,49 +550,67 @@ void BOPAlgo_ShellSplitter::SplitBlock(BOPTools_ConnexityBlock& aCB) //function : RefineShell //purpose : //======================================================================= -void RefineShell(TopoDS_Shell& theShell, - BOPCol_ListOfShape& aLShX) +void RefineShell(TopoDS_Shell& theShell, + const BOPCol_IndexedDataMapOfShapeListOfShape& theMEF, + BOPCol_ListOfShape& theLShSp) { - TopoDS_Iterator aIt; - // - aIt.Initialize(theShell); + TopoDS_Iterator aIt(theShell); if(!aIt.More()) { return; } // - Standard_Integer i, aNbMEF, aNbF, aNbMFB; - BOPCol_IndexedDataMapOfShapeListOfShape aMEF; - TopoDS_Builder aBB; - TopExp_Explorer aExp; - BOPCol_IndexedMapOfShape aMFB; - BOPCol_MapOfShape aMEStop, aMFProcessed; - BOPCol_ListIteratorOfListOfShape aItLF, aItLFP; - BOPCol_ListOfShape aLFP, aLFP1; + // Find edges with more than 2 adjacent faces - branch edges - + // edges on which the input shell should be split + BOPCol_MapOfShape aMEStop; // - // Branch points - BOPTools::MapShapesAndAncestors (theShell, - TopAbs_EDGE, - TopAbs_FACE, - aMEF); - // - aNbMEF=aMEF.Extent(); - for (i=1; i<=aNbMEF; ++i) { - const TopoDS_Shape& aE=aMEF.FindKey(i); - const BOPCol_ListOfShape& aLF=aMEF.FindFromIndex(i); - aNbF=aLF.Extent(); - if (aNbF>2) { + Standard_Integer i, aNbMEF = theMEF.Extent(); + for (i = 1; i <= aNbMEF; ++i) { + const TopoDS_Edge& aE = TopoDS::Edge(theMEF.FindKey(i)); + const BOPCol_ListOfShape& aLF = theMEF(i); + if (aLF.Extent() > 2) { + aMEStop.Add(aE); + continue; + } + // + // check for internal edges - count faces, in which the edge + // is internal, twice + Standard_Integer aNbF = 0; + BOPCol_ListIteratorOfListOfShape aItLF(aLF); + for (; aItLF.More() && aNbF <= 2; aItLF.Next()) { + const TopoDS_Face& aF = TopoDS::Face(aItLF.Value()); + ++aNbF; + TopExp_Explorer aExp(aF, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aEF = aExp.Current(); + if (aEF.IsSame(aE)) { + if (aEF.Orientation() == TopAbs_INTERNAL) { + ++aNbF; + } + break; + } + } + } + // + if (aNbF > 2) { aMEStop.Add(aE); } } // if (aMEStop.IsEmpty()) { - aLShX.Append(theShell); + theLShSp.Append(theShell); return; } // - // The first Face + TopoDS_Builder aBB; + TopExp_Explorer aExp; + BOPCol_IndexedMapOfShape aMFB; + BOPCol_MapOfOrientedShape aMFProcessed; + BOPCol_ListOfShape aLFP, aLFP1; + BOPCol_ListIteratorOfListOfShape aItLF, aItLFP; + // + // The first Face for (; aIt.More(); aIt.Next()) { - const TopoDS_Shape& aF1=aIt.Value(); + const TopoDS_Shape& aF1 = aIt.Value(); if (!aMFProcessed.Add(aF1)) { continue; } @@ -531,12 +624,12 @@ void RefineShell(TopoDS_Shell& theShell, // Trying to reach the branch point for (;;) { aItLFP.Initialize(aLFP); - for (; aItLFP.More(); aItLFP.Next()) { - const TopoDS_Shape& aFP=aItLFP.Value(); + for (; aItLFP.More(); aItLFP.Next()) { + const TopoDS_Shape& aFP = aItLFP.Value(); // aExp.Init(aFP, TopAbs_EDGE); for (; aExp.More(); aExp.Next()) { - const TopoDS_Edge& aE=(*(TopoDS_Edge*)(&aExp.Current())); + const TopoDS_Edge& aE = (*(TopoDS_Edge*)(&aExp.Current())); if (aMEStop.Contains(aE)) { continue; } @@ -549,11 +642,11 @@ void RefineShell(TopoDS_Shell& theShell, continue; } // - const BOPCol_ListOfShape& aLF=aMEF.FindFromKey(aE); + const BOPCol_ListOfShape& aLF = theMEF.FindFromKey(aE); // aItLF.Initialize(aLF); - for (; aItLF.More(); aItLF.Next()) { - const TopoDS_Shape& aFP1=aItLF.Value(); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Shape& aFP1 = aItLF.Value(); if (aFP1.IsSame(aFP)) { continue; } @@ -561,9 +654,10 @@ void RefineShell(TopoDS_Shell& theShell, continue; } // - aMFProcessed.Add(aFP1); - aMFB.Add(aFP1); - aLFP1.Append(aFP1); + if (aMFProcessed.Add(aFP1)) { + aMFB.Add(aFP1); + aLFP1.Append(aFP1); + } }// for (; aItLF.More(); aItLF.Next()) { }// for (; aExp.More(); aExp.Next()) { } // for (; aItLFP.More(); aItLFP.Next()) { @@ -574,24 +668,19 @@ void RefineShell(TopoDS_Shell& theShell, } // aLFP.Clear(); - aItLF.Initialize(aLFP1); - for (; aItLF.More(); aItLF.Next()) { - const TopoDS_Shape& aFP1=aItLF.Value(); - aLFP.Append(aFP1); - } - aLFP1.Clear(); + aLFP.Append(aLFP1); }// for (;;) { // - aNbMFB=aMFB.Extent(); + Standard_Integer aNbMFB = aMFB.Extent(); if (aNbMFB) { - TopoDS_Shell aShX; - aBB.MakeShell(aShX); + TopoDS_Shell aShSp; + aBB.MakeShell(aShSp); // - for (i=1; i<=aNbMFB; ++i) { - const TopoDS_Shape& aFB=aMFB(i); - aBB.Add(aShX, aFB); + for (i = 1; i <= aNbMFB; ++i) { + const TopoDS_Shape& aFB = aMFB(i); + aBB.Add(aShSp, aFB); } - aLShX.Append(aShX); + theLShSp.Append(aShSp); } }//for (; aIt.More(); aIt.Next()) { } diff --git a/src/BRepFeat/BRepFeat_MakePrism.cxx b/src/BRepFeat/BRepFeat_MakePrism.cxx index 01e62e0b4b..6594631dd8 100644 --- a/src/BRepFeat/BRepFeat_MakePrism.cxx +++ b/src/BRepFeat/BRepFeat_MakePrism.cxx @@ -59,10 +59,6 @@ #include #include -//modified by NIZNHY-PKV Thu Mar 21 18:14:23 2002 f -//#include -//#include -//modified by NIZNHY-PKV Thu Mar 21 18:14:26 2002 t #ifdef OCCT_DEBUG extern Standard_Boolean BRepFeat_GettraceFEAT(); #endif @@ -285,25 +281,15 @@ void BRepFeat_MakePrism::Perform(const Standard_Real Length) // if there is no gluing -> call of ope topo if(!myJustGluer) { if(myFuse == 1 && !myJustFeat) { - //modified by NIZNHY-PKV Thu Mar 21 17:55:30 2002 f - //BRepAlgo_Fuse f(mySbase, myGShape); - //myShape = f.Shape(); - //UpdateDescendants(f.Builder(), myShape, Standard_False); BRepAlgoAPI_Fuse f(mySbase, myGShape); myShape = f.Shape(); UpdateDescendants(f, myShape, Standard_False); - //modified by NIZNHY-PKV Thu Mar 21 17:55:34 2002 t Done(); } else if(myFuse == 0) { - //modified by NIZNHY-PKV Thu Mar 21 17:55:59 2002 f - //BRepAlgo_Cut c(mySbase, myGShape); - //myShape = c.Shape(); - //UpdateDescendants(c.Builder(), myShape, Standard_False); BRepAlgoAPI_Cut c(mySbase, myGShape); myShape = c.Shape(); UpdateDescendants(c, myShape, Standard_False); - //modified by NIZNHY-PKV Thu Mar 21 17:56:02 2002 t Done(); } else { @@ -373,10 +359,10 @@ void BRepFeat_MakePrism::Perform(const TopoDS_Shape& Until) TopAbs_Orientation Or; if (ASI.IsDone() && ASI.NbPoints(1) >=1) { if (myFuse == 1) { - Or = ASI.Point(1,1).Orientation(); + Or = ASI.Point(1, 1).Orientation(); } else { - Or = ASI.Point(1,ASI.NbPoints(1)).Orientation(); + Or = ASI.Point(1, ASI.NbPoints(1)).Orientation(); } if(sens==-1) Or=TopAbs::Reverse(Or); TopoDS_Face FUntil = ASI.Point(1,1).Face(); @@ -385,80 +371,31 @@ void BRepFeat_MakePrism::Perform(const TopoDS_Shape& Until) B.MakeCompound(TopoDS::Compound(Comp)); TopoDS_Solid S = BRepFeat::Tool(mySUntil, FUntil, Or); if (!S.IsNull()) B.Add(Comp,S); - //modified by NIZNHY-PKV Thu Mar 21 17:56:31 2002 f - //BRepAlgo_Cut trP(VraiPrism,Comp); - //UpdateDescendants(trP.Builder(),trP.Shape(), Standard_False); BRepAlgoAPI_Cut trP(VraiPrism,Comp); UpdateDescendants(trP, trP.Shape(), Standard_False); - //modified by NIZNHY-PKV Thu Mar 21 17:56:38 2002 t + // TopExp_Explorer ex(trP.Shape(), TopAbs_SOLID); TopoDS_Shape Cutsh = ex.Current(); - if(myFuse == 1 && !myJustFeat) { - //modified by NIZNHY-PKV Thu Mar 21 17:57:49 2002 f - //BRepAlgo_Fuse f(mySbase, Cutsh); - //myShape = f.Shape(); - //UpdateDescendants(f.Builder(), myShape, Standard_False); - BRepAlgoAPI_Fuse f(mySbase, Cutsh); - myShape = f.Shape(); - UpdateDescendants(f, myShape, Standard_False); - //modified by NIZNHY-PKV Thu Mar 21 17:57:53 2002 t - Done(); + if (myFuse == 1 && !myJustFeat) { + BRepAlgoAPI_Fuse f(mySbase, Cutsh); + myShape = f.Shape(); + UpdateDescendants(f, myShape, Standard_False); + Done(); } else if(myFuse == 0) { - //modified by NIZNHY-PKV Thu Mar 21 17:59:33 2002 f - //BRepAlgo_Cut c(mySbase, Cutsh); - //myShape = c.Shape(); - //UpdateDescendants(c.Builder(), myShape, Standard_False); - BRepAlgoAPI_Cut c(mySbase, Cutsh); - myShape = c.Shape(); - UpdateDescendants(c, myShape, Standard_False); - //modified by NIZNHY-PKV Thu Mar 21 17:59:43 2002 t - Done(); + BRepAlgoAPI_Cut c(mySbase, Cutsh); + myShape = c.Shape(); + UpdateDescendants(c, myShape, Standard_False); + Done(); } else { - myShape = Cutsh; - Done(); + myShape = Cutsh; + Done(); } - } - } -/* // loop of control of descendance - - TopExp_Explorer expr(mySbase, TopAbs_FACE); - char nom1[20], nom2[20]; - Standard_Integer ii = 0; - for(; expr.More(); expr.Next()) { - ii++; - sprintf(nom1, "faceinitial_%d", ii); - DBRep::Set(nom1, expr.Current()); - Standard_Integer jj = 0; - const TopTools_ListOfShape& list = Modified(expr.Current()); - TopTools_ListIteratorOfListOfShape ite(list); - for(; ite.More(); ite.Next()) { - jj++; - sprintf(nom2, "facemodifie_%d_%d", ii, jj); - DBRep::Set(nom2, ite.Value()); } } - - expr.Init(myPbase, TopAbs_EDGE); - ii=0; - for(; expr.More(); expr.Next()) { - ii++; - sprintf(nom1, "edgeinitial_%d", ii); - DBRep::Set(nom1, expr.Current()); - Standard_Integer jj = 0; - const TopTools_ListOfShape& list = Generated(expr.Current()); - TopTools_ListIteratorOfListOfShape ite(list); - for(; ite.More(); ite.Next()) { - jj++; - sprintf(nom2, "facegeneree_%d_%d", ii, jj); - DBRep::Set(nom2, ite.Value()); - } - } -*/ } - //======================================================================= //function : Perform //purpose : construction of a sufficiently long and properly oriented prism @@ -593,12 +530,11 @@ void BRepFeat_MakePrism::Perform(const TopoDS_Shape& From, OrU = OrF; OrF = Or; } - TopoDS_Shape Comp; - BRep_Builder B; - B.MakeCompound(TopoDS::Compound(Comp)); + // + TopTools_ListOfShape aLTools; TopoDS_Solid S = BRepFeat::Tool(mySUntil, FUntil, OrU); if (!S.IsNull()) { - B.Add(Comp,S); + aLTools.Append(S); } else { NotDone(); @@ -607,85 +543,41 @@ void BRepFeat_MakePrism::Perform(const TopoDS_Shape& From, } TopoDS_Solid SS = BRepFeat::Tool(mySFrom, FFrom, OrF); if (!SS.IsNull()) { - B.Add(Comp,SS); + aLTools.Append(SS); } else { NotDone(); myStatusError = BRepFeat_NullToolF; return; } - //modified by NIZNHY-PKV Thu Mar 21 18:00:10 2002 f - //BRepAlgo_Cut trP(VraiPrism,Comp); - //UpdateDescendants(trP.Builder(), trP.Shape(), Standard_False); - BRepAlgoAPI_Cut trP(VraiPrism,Comp); + // + TopTools_ListOfShape aLObj; + aLObj.Append(VraiPrism); + // + BRepAlgoAPI_Cut trP; + trP.SetArguments(aLObj); + trP.SetTools(aLTools); + trP.Build(); UpdateDescendants(trP, trP.Shape(), Standard_False); - //modified by NIZNHY-PKV Thu Mar 21 18:00:16 2002 t if(myFuse == 1 && !myJustFeat) { - //modified by NIZNHY-PKV Thu Mar 21 18:00:35 2002 f - //BRepAlgo_Fuse f(mySbase, trP.Shape()); - //myShape = f.Shape(); - //UpdateDescendants(f.Builder(), myShape, Standard_False); BRepAlgoAPI_Fuse f(mySbase, trP.Shape()); myShape = f.Shape(); UpdateDescendants(f, myShape, Standard_False); - //modified by NIZNHY-PKV Thu Mar 21 18:00:40 2002 t Done(); } else if(myFuse == 0) { - //modified by NIZNHY-PKV Thu Mar 21 18:01:01 2002 f - //BRepAlgo_Cut c(mySbase, trP.Shape()); - //myShape = c.Shape(); - //UpdateDescendants(c.Builder(), myShape, Standard_False); BRepAlgoAPI_Cut c(mySbase, trP.Shape()); myShape = c.Shape(); UpdateDescendants(c, myShape, Standard_False); - //modified by NIZNHY-PKV Thu Mar 21 18:01:13 2002 t Done(); } else { myShape = trP.Shape(); - Done(); - } - } -// control history -/* - TopExp_Explorer expr(mySbase, TopAbs_FACE); - char nom1[20], nom2[20]; - Standard_Integer ii = 0; - for(; expr.More(); expr.Next()) { - ii++; - sprintf(nom1, "faceinitial_%d", ii); - DBRep::Set(nom1, expr.Current()); - Standard_Integer jj = 0; - const TopTools_ListOfShape& list = Modified(expr.Current()); - TopTools_ListIteratorOfListOfShape ite(list); - for(; ite.More(); ite.Next()) { - jj++; - sprintf(nom2, "facemodifie_%d_%d", ii, jj); - DBRep::Set(nom2, ite.Value()); - } - } - - expr.Init(myPbase, TopAbs_EDGE); - ii=0; - for(; expr.More(); expr.Next()) { - ii++; - sprintf(nom1, "edgeinitial_%d", ii); - DBRep::Set(nom1, expr.Current()); - Standard_Integer jj = 0; - const TopTools_ListOfShape& list = Generated(expr.Current()); - TopTools_ListIteratorOfListOfShape ite(list); - for(; ite.More(); ite.Next()) { - jj++; - sprintf(nom2, "egdegeneree_%d_%d", ii, jj); - DBRep::Set(nom2, ite.Value()); + Done(); } } -*/ } - - //======================================================================= //function : PerformUntilEnd //purpose : construction of a prism and reconstruction @@ -717,16 +609,10 @@ void BRepFeat_MakePrism::PerformUntilEnd() GluedFacesValid(); if(myFuse == 0) { - //modified by NIZNHY-PKV Thu Mar 21 18:02:46 2002 f - //BRepAlgo_Cut c(mySbase, myGShape); BRepAlgoAPI_Cut c(mySbase, myGShape); - //modified by NIZNHY-PKV Thu Mar 21 18:03:15 2002 t if (c.IsDone()) { myShape = c.Shape(); - //modified by NIZNHY-PKV Thu Mar 21 18:03:38 2002 f - //UpdateDescendants(c.Builder(), myShape, Standard_False); UpdateDescendants(c, myShape, Standard_False); - //modified by NIZNHY-PKV Thu Mar 21 18:03:42 2002 t Done(); } } @@ -819,16 +705,11 @@ void BRepFeat_MakePrism::PerformFromEnd(const TopoDS_Shape& Until) Trf = TransformShapeFU(0); FFrom = TopoDS::Face(mySFrom); } -// else { -// NotDone(); -// return; -// } - TopoDS_Shape Comp; - BRep_Builder B; - B.MakeCompound(TopoDS::Compound(Comp)); + + TopTools_ListOfShape aLTools; TopoDS_Solid Sol = BRepFeat::Tool(mySUntil, FUntil, OrU); if (!Sol.IsNull()) { - B.Add(Comp,Sol); + aLTools.Append(Sol); } else { NotDone(); @@ -838,50 +719,42 @@ void BRepFeat_MakePrism::PerformFromEnd(const TopoDS_Shape& Until) TopoDS_Solid Sol1 = BRepFeat::Tool(mySFrom, FFrom, OrF); if (!Sol1.IsNull()) { - B.Add(Comp,Sol1); + aLTools.Append(Sol1); } else { NotDone(); myStatusError = BRepFeat_NullToolF; return; } - //modified by NIZNHY-PKV Thu Mar 21 18:03:57 2002 f - //BRepAlgo_Cut trP(VraiPrism,Comp); - //UpdateDescendants(trP.Builder(), trP.Shape(), Standard_False); - BRepAlgoAPI_Cut trP(VraiPrism,Comp); + // + TopTools_ListOfShape aLObj; + aLObj.Append(VraiPrism); + // + BRepAlgoAPI_Cut trP; + trP.SetArguments(aLObj); + trP.SetTools(aLTools); + trP.Build(); + // UpdateDescendants(trP, trP.Shape(), Standard_False); - //modified by NIZNHY-PKV Thu Mar 21 18:04:08 2002 t if(myFuse == 1 && !myJustFeat) { - //modified by NIZNHY-PKV Thu Mar 21 18:04:33 2002 f - //BRepAlgo_Fuse f(mySbase, trP.Shape()); - //myShape = f.Shape(); - //UpdateDescendants(f.Builder(), myShape, Standard_False); BRepAlgoAPI_Fuse f(mySbase, trP.Shape()); myShape = f.Shape(); UpdateDescendants(f, myShape, Standard_False); - //modified by NIZNHY-PKV Thu Mar 21 18:04:41 2002 t Done(); } else if(myFuse == 0) { - //modified by NIZNHY-PKV Thu Mar 21 18:04:54 2002 f - //BRepAlgo_Cut c(mySbase, trP.Shape()); - //myShape = c.Shape(); - //UpdateDescendants(c.Builder(), myShape, Standard_False); BRepAlgoAPI_Cut c(mySbase, trP.Shape()); myShape = c.Shape(); UpdateDescendants(c, myShape, Standard_False); - //modified by NIZNHY-PKV Thu Mar 21 18:05:00 2002 t Done(); } else { myShape = trP.Shape(); - Done(); + Done(); } - } + } } - - //======================================================================= //function : PerformThruAll //purpose : @@ -918,16 +791,10 @@ void BRepFeat_MakePrism::PerformThruAll() GeneratedShapeValid(); if(myFuse == 0) { - //modified by NIZNHY-PKV Thu Mar 21 18:05:31 2002 f - //BRepAlgo_Cut c(mySbase, myGShape); BRepAlgoAPI_Cut c(mySbase, myGShape); - //modified by NIZNHY-PKV Thu Mar 21 18:05:33 2002 t if (c.IsDone()) { myShape = c.Shape(); - //modified by NIZNHY-PKV Thu Mar 21 18:05:46 2002 f - //UpdateDescendants(c.Builder(), myShape, Standard_False); UpdateDescendants(c, myShape, Standard_False); - //modified by NIZNHY-PKV Thu Mar 21 18:05:50 2002 t Done(); } } @@ -938,14 +805,13 @@ void BRepFeat_MakePrism::PerformThruAll() } } - //======================================================================= //function : PerformUntilHauteur //purpose : //======================================================================= void BRepFeat_MakePrism::PerformUntilHeight(const TopoDS_Shape& Until, - const Standard_Real Length) + const Standard_Real Length) { #ifdef OCCT_DEBUG Standard_Boolean trc = BRepFeat_GettraceFEAT(); @@ -1008,39 +874,25 @@ void BRepFeat_MakePrism::PerformUntilHeight(const TopoDS_Shape& Until, TopoDS_Solid S = BRepFeat::Tool(mySUntil, FUntil, Or); if (!S.IsNull()) B.Add(Comp,S); - //modified by NIZNHY-PKV Thu Mar 21 18:06:09 2002 f - //BRepAlgo_Cut trP(VraiPrism,Comp); - //UpdateDescendants(trP.Builder(), trP.Shape(), Standard_False); BRepAlgoAPI_Cut trP(VraiPrism,Comp); UpdateDescendants(trP, trP.Shape(), Standard_False); - //modified by NIZNHY-PKV Thu Mar 21 18:06:15 2002 t if(myFuse == 1 && !myJustFeat) { - //modified by NIZNHY-PKV Thu Mar 21 18:06:36 2002 f - //BRepAlgo_Fuse f(mySbase, trP.Shape()); - //myShape = f.Shape(); - //UpdateDescendants(f.Builder(), myShape, Standard_False); - BRepAlgoAPI_Fuse f(mySbase, trP.Shape()); - myShape = f.Shape(); - UpdateDescendants(f, myShape, Standard_False); - //modified by NIZNHY-PKV Thu Mar 21 18:06:41 2002 t - Done(); + BRepAlgoAPI_Fuse f(mySbase, trP.Shape()); + myShape = f.Shape(); + UpdateDescendants(f, myShape, Standard_False); + Done(); } else if(myFuse == 0) { - //modified by NIZNHY-PKV Thu Mar 21 18:07:06 2002 f - //BRepAlgo_Cut c(mySbase, trP.Shape()); - //myShape = c.Shape(); - //UpdateDescendants(c.Builder(), myShape, Standard_False); - BRepAlgoAPI_Cut c(mySbase, trP.Shape()); - myShape = c.Shape(); - UpdateDescendants(c, myShape, Standard_False); - //modified by NIZNHY-PKV Thu Mar 21 18:07:12 2002 t - Done(); + BRepAlgoAPI_Cut c(mySbase, trP.Shape()); + myShape = c.Shape(); + UpdateDescendants(c, myShape, Standard_False); + Done(); } else { - myShape = trP.Shape(); - Done(); + myShape = trP.Shape(); + Done(); } - } + } } } diff --git a/tests/boolean/bcut_complex/N9 b/tests/boolean/bcut_complex/N9 index bcb0dd7b32..748abb9b9b 100644 --- a/tests/boolean/bcut_complex/N9 +++ b/tests/boolean/bcut_complex/N9 @@ -1,11 +1,16 @@ # Original bug : pro14942 # Date : 26Aout98 -puts "TODO #22911 ALL: Faulty shapes in variables faulty_1 to faulty_" restore [locate_data_file CTO904_pro14942a.rle] a restore [locate_data_file pro14942b.rle] b bcut result a b + +checkshape result + checkprops result -s 192941 + +checknbshapes result -face 43 -shell 1 -solid 1 + checkview -display result -2d -s -otherwise { a b } -path ${imagedir}/${test_image}.png diff --git a/tests/boolean/volumemaker/C5 b/tests/boolean/volumemaker/C5 index 4459410706..35e29e7ffd 100644 --- a/tests/boolean/volumemaker/C5 +++ b/tests/boolean/volumemaker/C5 @@ -1,6 +1,10 @@ # test script on make volume operation # cone plane +puts "TODO CR28503 ALL: Error : The area of result shape is" +puts "TODO CR28503 ALL: Error : is WRONG because number of SOLID entities in shape" +puts "TODO CR28503 ALL: Faulty shapes in variables faulty_" + # planar face plane pln_f1 27.577164466275352 -1038.2137499999999 27.577164466275359 0.70710678118654746 4.4408920985006262e-016 0.70710678118654768 erase pln_f1 @@ -34,5 +38,6 @@ mkface f6 con_f6 0 6.2831853071795862 0 1000000 # make volume operation mkvolume result f1 f2 f3 f4 f5 f6 -checkprops result -s 5.1932e+006 +checkprops result -s 5.19571e+006 +checknbshapes result -solid 16 \ No newline at end of file diff --git a/tests/boolean/volumemaker/C6 b/tests/boolean/volumemaker/C6 index ecc62a2e3c..2e429f46d3 100644 --- a/tests/boolean/volumemaker/C6 +++ b/tests/boolean/volumemaker/C6 @@ -1,6 +1,8 @@ # test script on make volume operation # cone plane +puts "TODO CR28503 ALL: Error : is WRONG because number of SOLID entities in shape" + # planar face plane pln_f1 -306.53078964627537 -1038.2137499999999 -251.37646071372467 -0.70710678118654746 4.4408920985006262e-016 0.70710678118654768 erase pln_f1 @@ -39,4 +41,6 @@ mkface f7 con_f7 0 6.2831853071795862 0 1000000 # make volume operation mkvolume result f1 f2 f3 f4 f5 f6 f7 -checkprops result -s 6.22995e+006 +checkprops result -s 6.45353e+006 + +checknbshapes result -solid 29 \ No newline at end of file diff --git a/tests/bugs/modalg_6/bug28501_1 b/tests/bugs/modalg_6/bug28501_1 new file mode 100644 index 0000000000..5cf22edeed --- /dev/null +++ b/tests/bugs/modalg_6/bug28501_1 @@ -0,0 +1,22 @@ +puts "========" +puts "OCC28501" +puts "========" +puts "" +################################################# +# Incomplete result of offset operation in mode Complete with Join type intersection +################################################# + +restore [locate_data_file bug28501_ls.brep] ls + +mkvolume result ls -c + +checkshape result +checknbshapes result -solid 3 + +checkprops result -s 284510 -v 3.44632e+006 + +smallview +don result +fit + +checkview -screenshot -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/modalg_6/bug28501_2 b/tests/bugs/modalg_6/bug28501_2 new file mode 100644 index 0000000000..11e895a0fb --- /dev/null +++ b/tests/bugs/modalg_6/bug28501_2 @@ -0,0 +1,22 @@ +puts "========" +puts "OCC28501" +puts "========" +puts "" +################################################# +# Incomplete result of offset operation in mode Complete with Join type intersection +################################################# + +restore [locate_data_file bug28501_ls2.brep] ls + +mkvolume result ls -c + +checkshape result +checknbshapes result -solid 31 + +checkprops result -s 1.86075e+006 -v 1.80713e+007 + +smallview +don result +fit + +checkview -screenshot -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/modalg_6/bug28501_3 b/tests/bugs/modalg_6/bug28501_3 new file mode 100644 index 0000000000..8d209c5529 --- /dev/null +++ b/tests/bugs/modalg_6/bug28501_3 @@ -0,0 +1,22 @@ +puts "========" +puts "OCC28501" +puts "========" +puts "" +################################################# +# Incomplete result of offset operation in mode Complete with Join type intersection +################################################# + +restore [locate_data_file bug28501_ls_full.brep] ls + +mkvolume result ls -c + +checkshape result +checknbshapes result -solid 28 + +checkprops result -s 1.80723e+006 -v 1.8558e+007 + +smallview +don result +fit + +checkview -screenshot -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/modalg_6/bug28501_4 b/tests/bugs/modalg_6/bug28501_4 new file mode 100644 index 0000000000..1b5b961371 --- /dev/null +++ b/tests/bugs/modalg_6/bug28501_4 @@ -0,0 +1,22 @@ +puts "========" +puts "OCC28501" +puts "========" +puts "" +################################################# +# Incomplete result of offset operation in mode Complete with Join type intersection +################################################# + +restore [locate_data_file bug28501_D5_ls.brep] ls + +mkvolume result ls -c + +checkshape result +checknbshapes result -solid 9 -shell 17 + +checkprops result -s 7.22211e+006 -v 3.44873e+008 + +smallview +don result +fit + +checkview -screenshot -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/modalg_6/bug28501_5 b/tests/bugs/modalg_6/bug28501_5 new file mode 100644 index 0000000000..ff2f794024 --- /dev/null +++ b/tests/bugs/modalg_6/bug28501_5 @@ -0,0 +1,22 @@ +puts "========" +puts "OCC28501" +puts "========" +puts "" +################################################# +# Incomplete result of offset operation in mode Complete with Join type intersection +################################################# + +restore [locate_data_file bug28501_J7_trim_faces.brep] ls + +mkvolume result ls -c + +checkshape result +checknbshapes result -solid 22 -shell 29 + +checkprops result -s 625791 -v 9.65475e+006 + +smallview +don result +fit + +checkview -screenshot -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/modalg_6/bug28501_6 b/tests/bugs/modalg_6/bug28501_6 new file mode 100644 index 0000000000..fc86e6b350 --- /dev/null +++ b/tests/bugs/modalg_6/bug28501_6 @@ -0,0 +1,22 @@ +puts "========" +puts "OCC28501" +puts "========" +puts "" +################################################# +# Incomplete result of offset operation in mode Complete with Join type intersection +################################################# + +restore [locate_data_file bug28501_J7_trim1_faces.brep] ls + +mkvolume result ls -c + +checkshape result +checknbshapes result -solid 13 -shell 20 + +checkprops result -s 419486 -v 6.49567e+006 + +smallview +don result +fit + +checkview -screenshot -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/modalg_6/bug28501_7 b/tests/bugs/modalg_6/bug28501_7 new file mode 100644 index 0000000000..2651819fc0 --- /dev/null +++ b/tests/bugs/modalg_6/bug28501_7 @@ -0,0 +1,22 @@ +puts "========" +puts "OCC28501" +puts "========" +puts "" +################################################# +# Incomplete result of offset operation in mode Complete with Join type intersection +################################################# + +restore [locate_data_file bug28501_N9_lf.brep] ls + +mkvolume result ls -c -ni + +checkshape result +checknbshapes result -solid 3 -shell 3 + +checkprops result -s 193823 -v 4.88386e+006 + +smallview +don result +fit + +checkview -screenshot -2d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/moddata_2/bug469 b/tests/bugs/moddata_2/bug469 index e957a34f4f..f4bc4ba1ca 100755 --- a/tests/bugs/moddata_2/bug469 +++ b/tests/bugs/moddata_2/bug469 @@ -1,9 +1,7 @@ -#puts "TODO OCC12345 ALL: An exception was caught" -#puts "TODO OCC12345 ALL: \\*\\* Exception \\*\\*.*" -#puts "TODO OCC12345 ALL: TEST INCOMPLETE" -#puts "TODO OCC12345 ALL: xception" -puts "TODO OCC25892 ALL: Faulty shapes in variables" -puts "TODO OCC25892 ALL: The area of result shape is" +puts "TODO OCC28556 ALL: Faulty shapes in variables" +puts "TODO OCC28556 ALL: The area of result shape is" +puts "TODO OCC28556 ALL: The volume of result shape is" +puts "TODO OCC28556 ALL: Error : is WRONG because number of" puts "========================" puts " OCC469 " @@ -16,11 +14,10 @@ puts "" restore [locate_data_file OCC469.brep] a explode a -checkshape a_1 -checkshape a_2 - bfuse result a_1 a_2 + checkshape result +checkprops result -s 30523.3 -v 22730.1 +checknbshapes result -shell 1 -solid 1 -checkprops result -s 10 checkview -display result -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YL3 b/tests/offset/shape_type_i_c/YL3 new file mode 100644 index 0000000000..fc1bcb5fe0 --- /dev/null +++ b/tests/offset/shape_type_i_c/YL3 @@ -0,0 +1,20 @@ +restore [locate_data_file bug28501_input.r2.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +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($z + 1) > 1.e-7} { + offsetonface $f 5 + } +} +offsetperform result + +checkprops result -v 1.80714e+007 -s 1.36185e+006 + +unifysamedom result_unif result +checknbshapes result_unif -face 356 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YL4 b/tests/offset/shape_type_i_c/YL4 new file mode 100644 index 0000000000..dcc2744a2f --- /dev/null +++ b/tests/offset/shape_type_i_c/YL4 @@ -0,0 +1,10 @@ +restore [locate_data_file bug28501_input.r2.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 1.85581e+007 -s 1.35806e+006 + +unifysamedom result_unif result +checknbshapes result_unif -face 356 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YL5 b/tests/offset/shape_type_i_c/YL5 new file mode 100644 index 0000000000..c86e2a4eda --- /dev/null +++ b/tests/offset/shape_type_i_c/YL5 @@ -0,0 +1,10 @@ +restore [locate_data_file bug28501_input.r2.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 2.48594e+007 -s 1.07443e+006 + +unifysamedom result_unif result +checknbshapes result_unif -face 313 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YL6 b/tests/offset/shape_type_i_c/YL6 new file mode 100644 index 0000000000..ceb92532d3 --- /dev/null +++ b/tests/offset/shape_type_i_c/YL6 @@ -0,0 +1,20 @@ +restore [locate_data_file bug28501_input.r2_trim.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +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($z + 1) > 1.e-7} { + offsetonface $f 5 + } +} +offsetperform result + +checkprops result -v 5.96198e+006 -s 395753 + +unifysamedom result_unif result +checknbshapes result_unif -face 93 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YL7 b/tests/offset/shape_type_i_c/YL7 new file mode 100644 index 0000000000..25c9de8557 --- /dev/null +++ b/tests/offset/shape_type_i_c/YL7 @@ -0,0 +1,10 @@ +restore [locate_data_file bug28501_input.r2_trim.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 5.9944e+006 -s 392924 + +unifysamedom result_unif result +checknbshapes result_unif -face 93 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YL8 b/tests/offset/shape_type_i_c/YL8 new file mode 100644 index 0000000000..1dcc6e19d6 --- /dev/null +++ b/tests/offset/shape_type_i_c/YL8 @@ -0,0 +1,20 @@ +restore [locate_data_file bug28501_input.r2_trim1.brep] s + +offsetparameter 1e-7 c i r +offsetload s 0 + +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($z + 1) > 1.e-7} { + offsetonface $f 5 + } +} +offsetperform result + +checkprops result -v 3.63375e+006 -s 241013 + +unifysamedom result_unif result +checknbshapes result_unif -face 41 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/YL9 b/tests/offset/shape_type_i_c/YL9 new file mode 100644 index 0000000000..e71a674a40 --- /dev/null +++ b/tests/offset/shape_type_i_c/YL9 @@ -0,0 +1,10 @@ +restore [locate_data_file bug28501_input.r2_trim1.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.64128e+006 -s 238574 + +unifysamedom result_unif result +checknbshapes result_unif -face 41 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png