diff --git a/src/BOPAlgo/BOPAlgo_Builder_4.cxx b/src/BOPAlgo/BOPAlgo_Builder_4.cxx index 7d07bbcf3a..bf88a8b772 100644 --- a/src/BOPAlgo/BOPAlgo_Builder_4.cxx +++ b/src/BOPAlgo/BOPAlgo_Builder_4.cxx @@ -176,7 +176,11 @@ void BOPAlgo_Builder::PrepareHistory() aItM.Initialize(aMS); for (; aItM.More(); aItM.Next()) { const TopoDS_Shape& aSx=aItM.Key(); - aType=aSx.ShapeType(); + aType = aSx.ShapeType(); + if (!(aType == TopAbs_VERTEX || aType == TopAbs_EDGE || + aType == TopAbs_FACE || aType == TopAbs_SOLID)) { + continue; + } // // 4.1 .myImagesResult bHasImage=myImages.IsBound(aSx); diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx index 591dd30c5d..38b7be516c 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx @@ -228,7 +228,6 @@ void BOPAlgo_PaveFiller::PerformFF() // bToIntersect = CheckPlanes(nF1, nF2); if (!bToIntersect) { - myDS->AddInterf(nF1, nF2); BOPDS_InterfFF& aFF=aFFs.Append1(); aFF.SetIndices(nF1, nF2); aFF.Init(0, 0); diff --git a/src/BOPTools/BOPTools_AlgoTools_2.cxx b/src/BOPTools/BOPTools_AlgoTools_2.cxx index 8dd871629b..6aee96cc1c 100644 --- a/src/BOPTools/BOPTools_AlgoTools_2.cxx +++ b/src/BOPTools/BOPTools_AlgoTools_2.cxx @@ -150,8 +150,12 @@ void BOPTools_AlgoTools::MakeSplitEdge(const TopoDS_Edge& aE, E.EmptyCopy(); // BRep_Builder BB; - BB.Add (E, aV1); - BB.Add (E, aV2); + if (!aV1.IsNull()) { + BB.Add (E, aV1); + } + if (!aV2.IsNull()) { + BB.Add (E, aV2); + } BB.Range(E, aP1, aP2); BB.UpdateEdge(E, aTol); aNewEdge=E; diff --git a/src/BRepOffset/BRepOffset_Inter2d.cxx b/src/BRepOffset/BRepOffset_Inter2d.cxx index 016e09f3af..778e7d97bd 100644 --- a/src/BRepOffset/BRepOffset_Inter2d.cxx +++ b/src/BRepOffset/BRepOffset_Inter2d.cxx @@ -115,84 +115,115 @@ static TopoDS_Vertex CommonVertex(TopoDS_Edge& E1, //======================================================================= //function : Store -//purpose : The vertices are added despite of the coincidence with +//purpose : Store the vertices into AsDes for the edge . +// The vertices are added despite of the coincidence with // already added vertices. When all vertices for all edges // are added the coinciding chains of vertices should be fused // using FuseVertices() method. //======================================================================= -static void Store (const TopoDS_Edge& E1, - const TopoDS_Edge& E2, - const TopTools_ListOfShape& LV1, - const TopTools_ListOfShape& LV2, - Handle(BRepAlgo_AsDes) AsDes, - Standard_Real Tol, - TopTools_IndexedDataMapOfShapeListOfShape& aDMVV) +static void Store(const TopoDS_Edge& theEdge, + const TopTools_ListOfShape& theLV, + const Standard_Real theTol, + const Standard_Boolean IsToUpdate, + Handle(BRepAlgo_AsDes) theAsDes2d, + TopTools_IndexedDataMapOfShapeListOfShape& theDMVV) { - BRep_Builder aBB; - for (Standard_Integer i = 0; i < 2; ++i) { - const TopoDS_Edge& aE = !i ? E1 : E2; - const TopTools_ListOfShape& aLV = !i ? LV1 : LV2; - const TopTools_ListOfShape& aLVEx = AsDes->Descendant(aE); - if (aLVEx.IsEmpty()) { - if (aLV.Extent()) AsDes->Add(aE, aLV); + const TopTools_ListOfShape& aLVEx = theAsDes2d->Descendant(theEdge); + if (!IsToUpdate && aLVEx.IsEmpty()) { + if (theLV.Extent()) theAsDes2d->Add(theEdge, theLV); + return; + } + // + GeomAPI_ProjectPointOnCurve aProjPC; + if (IsToUpdate) { + Standard_Real aT1, aT2; + const Handle(Geom_Curve)& aC = BRep_Tool::Curve(theEdge, aT1, aT2); + aProjPC.Init(aC, aT1, aT2); + } + // + TopTools_MapOfShape aMV; + TopTools_ListIteratorOfListOfShape aIt(theLV); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Vertex& aV = TopoDS::Vertex(aIt.Value()); + if (!aMV.Add(aV)) { continue; } // - TopTools_MapOfShape aMV; - TopTools_ListIteratorOfListOfShape aIt(aLV); - for (; aIt.More(); aIt.Next()) { - const TopoDS_Vertex& aV = TopoDS::Vertex(aIt.Value()); - if (!aMV.Add(aV)) { - continue; + const gp_Pnt& aP = BRep_Tool::Pnt(aV); + // + TopTools_ListOfShape aLVC; + TopTools_ListIteratorOfListOfShape aItEx(aLVEx); + for (; aItEx.More(); aItEx.Next()) { + const TopoDS_Vertex& aVEx = TopoDS::Vertex(aItEx.Value()); + if (aV.IsSame(aVEx)) { + break; } - gp_Pnt aP = BRep_Tool::Pnt(aV); - // - TopTools_ListOfShape aLVC; - TopTools_ListIteratorOfListOfShape aItEx(aLVEx); - for (; aItEx.More(); aItEx.Next()) { - const TopoDS_Vertex& aVEx = TopoDS::Vertex(aItEx.Value()); - if (aV.IsSame(aVEx)) { - break; - } - gp_Pnt aPEx = BRep_Tool::Pnt(aVEx); - // - if (aP.IsEqual(aPEx, Tol)) { - aLVC.Append(aVEx); - } + const gp_Pnt& aPEx = BRep_Tool::Pnt(aVEx); + if (aP.IsEqual(aPEx, theTol)) { + aLVC.Append(aVEx); } - // - if (aItEx.More()) { - continue; - } - // - if (aLVC.Extent()) { - TopTools_ListOfShape aLVN; - aLVN.Append(aV); - // - TopTools_ListIteratorOfListOfShape aItLV(aLVC); - for (; aItLV.More(); aItLV.Next()) { - const TopoDS_Shape& aVC = aItLV.Value(); - TopTools_ListOfShape* pLV = aDMVV.ChangeSeek(aVC); - if (!pLV) { - aDMVV.Add(aVC, aLVN); - } - else { - pLV->Append(aV); - } - } - // - TopTools_ListOfShape* pLV = aDMVV.ChangeSeek(aV); - if (!pLV) { - aDMVV.Add(aV, aLVC); - } - else { - pLV->Append(aLVC); - } - } - // - aBB.UpdateVertex(aV, Tol); - AsDes->Add(aE, aV); } + // + if (aItEx.More()) { + continue; + } + // + if (IsToUpdate) { + // get parameter of the vertex on the edge + aProjPC.Perform(aP); + if (!aProjPC.NbPoints()) { + continue; + } + // + if (aProjPC.LowerDistance() > theTol) { + continue; + } + // + Standard_Real aT = aProjPC.LowerDistanceParameter(); + TopoDS_Shape aLocalShape = aV.Oriented(TopAbs_INTERNAL); + BRep_Builder().UpdateVertex(TopoDS::Vertex(aLocalShape), aT, theEdge, theTol); + } + else { + BRep_Builder().UpdateVertex(aV, theTol); + } + // + if (aLVC.Extent()) { + TopTools_ListIteratorOfListOfShape aItLV(aLVC); + for (; aItLV.More(); aItLV.Next()) { + const TopoDS_Shape& aVC = aItLV.Value(); + TopTools_ListOfShape* pLV = theDMVV.ChangeSeek(aVC); + if (!pLV) { + pLV = &theDMVV(theDMVV.Add(aVC, TopTools_ListOfShape())); + } + pLV->Append(aV); + } + // + TopTools_ListOfShape* pLV = theDMVV.ChangeSeek(aV); + if (!pLV) { + pLV = &theDMVV(theDMVV.Add(aV, TopTools_ListOfShape())); + } + pLV->Append(aLVC); + } + theAsDes2d->Add(theEdge, aV); + } +} + +//======================================================================= +//function : Store +//purpose : Store the intersection vertices between two edges into AsDes +//======================================================================= +static void Store (const TopoDS_Edge& theE1, + const TopoDS_Edge& theE2, + const TopTools_ListOfShape& theLV1, + const TopTools_ListOfShape& theLV2, + const Standard_Real theTol, + Handle(BRepAlgo_AsDes) theAsDes2d, + TopTools_IndexedDataMapOfShapeListOfShape& theDMVV) +{ + for (Standard_Integer i = 0; i < 2; ++i) { + const TopoDS_Edge& aE = !i ? theE1 : theE2; + const TopTools_ListOfShape& aLV = !i ? theLV1 : theLV2; + Store(aE, aLV, theTol, Standard_False, theAsDes2d, theDMVV); } } @@ -453,7 +484,7 @@ static void EdgeInter(const TopoDS_Face& F, //--------------------------------- Standard_Real TolStore = BRep_Tool::Tolerance(E1) + BRep_Tool::Tolerance(E2); TolStore = Max(TolStore, 10.*Tol); - Store (E1,E2,LV1,LV2,AsDes,TolStore, aDMVV); + Store (E1,E2,LV1,LV2,TolStore,AsDes, aDMVV); } } //======================================================================= @@ -469,7 +500,8 @@ static void RefEdgeInter(const TopoDS_Face& F, Standard_Real Tol, Standard_Boolean WithOri, gp_Pnt& Pref, - TopTools_IndexedDataMapOfShapeListOfShape& aDMVV) + TopTools_IndexedDataMapOfShapeListOfShape& aDMVV, + Standard_Boolean& theCoincide) { #ifdef DRAW if (Inter2dAffichInt2d) { @@ -480,7 +512,9 @@ static void RefEdgeInter(const TopoDS_Face& F, DBRep::Set(name,E2); } #endif - + // + theCoincide = Standard_False; + // if (E1.IsSame(E2)) return; @@ -531,6 +565,14 @@ static void RefEdgeInter(const TopoDS_Face& F, Geom2dAdaptor_Curve GAC1(pcurve1, f[1], l[1]); Geom2dAdaptor_Curve GAC2(pcurve2, f[2], l[2]); Geom2dInt_GInter Inter2d( GAC1, GAC2, TolDub, TolDub ); + // + if (!Inter2d.IsDone() || !Inter2d.NbPoints()) { + theCoincide = (Inter2d.NbSegments() && + (GAC1.GetType() == GeomAbs_Line) && + (GAC2.GetType() == GeomAbs_Line)); + return; + } + // for (i = 1; i <= Inter2d.NbPoints(); i++) { gp_Pnt P3d; @@ -723,7 +765,7 @@ static void RefEdgeInter(const TopoDS_Face& F, ////----------------------------------------------------- Standard_Real TolStore = BRep_Tool::Tolerance(E1) + BRep_Tool::Tolerance(E2); TolStore = Max(TolStore, 10.*Tol); - Store (E1,E2,LV1,LV2,AsDes,TolStore, aDMVV); + Store (E1,E2,LV1,LV2,TolStore,AsDes, aDMVV); } } @@ -848,7 +890,7 @@ static Standard_Boolean ExtendPCurve(const Handle(Geom2d_Curve)& aPCurve, // Modified by skv - Fri Dec 26 17:00:55 2003 OCC4455 Begin //static void ExtentEdge(const TopoDS_Edge& E,TopoDS_Edge& NE) -static void ExtentEdge(const TopoDS_Edge& E,TopoDS_Edge& NE, const Standard_Real theOffset) +void BRepOffset_Inter2d::ExtentEdge(const TopoDS_Edge& E,TopoDS_Edge& NE, const Standard_Real theOffset) { //BRepLib::BuildCurve3d(E); @@ -1380,20 +1422,16 @@ void BRepOffset_Inter2d::Compute (const Handle(BRepAlgo_AsDes)& AsDes, //function : ConnexIntByInt //purpose : //======================================================================= - -// Modified by skv - Fri Dec 26 16:53:16 2003 OCC4455 Begin -// Add another parameter: offset value. void BRepOffset_Inter2d::ConnexIntByInt -(const TopoDS_Face& FI, - BRepOffset_Offset& OFI, - TopTools_DataMapOfShapeShape& MES, - const TopTools_DataMapOfShapeShape& Build, - const Handle(BRepAlgo_AsDes)& AsDes, - const Handle(BRepAlgo_AsDes)& AsDes2d, - const Standard_Real Offset, - const Standard_Real Tol, - TopTools_IndexedDataMapOfShapeListOfShape& theDMVV) -// Modified by skv - Fri Dec 26 16:53:18 2003 OCC4455 End + (const TopoDS_Face& FI, + BRepOffset_Offset& OFI, + TopTools_DataMapOfShapeShape& MES, + const TopTools_DataMapOfShapeShape& Build, + const Handle(BRepAlgo_AsDes)& AsDes2d, + const Standard_Real Offset, + const Standard_Real Tol, + TopTools_IndexedMapOfShape& FacesWithVerts, + TopTools_IndexedDataMapOfShapeListOfShape& theDMVV) { TopTools_DataMapOfShapeListOfShape MVE; @@ -1417,12 +1455,8 @@ void BRepOffset_Inter2d::ConnexIntByInt const TopoDS_Edge& EI = TopoDS::Edge(itL.Value()); TopoDS_Shape aLocalShape = OFI.Generated(EI); const TopoDS_Edge& OE = TopoDS::Edge(aLocalShape); -// const TopoDS_Edge& OE = TopoDS::Edge(OFI.Generated(EI)); if (!MES.IsBound(OE) && !Build.IsBound(EI)) { -// Modified by skv - Fri Dec 26 16:59:52 2003 OCC4455 Begin -// ExtentEdge(OE,NE); ExtentEdge(OE,NE, Offset); -// Modified by skv - Fri Dec 26 16:59:54 2003 OCC4455 End MES.Bind (OE,NE); } } @@ -1432,14 +1466,6 @@ void BRepOffset_Inter2d::ConnexIntByInt TopoDS_Face FIO = TopoDS::Face(OFI.Face()); if (MES.IsBound(FIO)) FIO = TopoDS::Face(MES(FIO)); // - TopTools_MapOfShape aME; - const TopTools_ListOfShape& aLE = AsDes->Descendant(FIO); - TopTools_ListIteratorOfListOfShape aItLE(aLE); - for (; aItLE.More(); aItLE.Next()) { - const TopoDS_Shape& aE = aItLE.Value(); - aME.Add(aE); - } - // BRepAdaptor_Surface BAsurf(FIO); TopExp_Explorer exp(FI.Oriented(TopAbs_FORWARD),TopAbs_WIRE); @@ -1454,8 +1480,6 @@ void BRepOffset_Inter2d::ConnexIntByInt wexp.Init(TopoDS::Wire(aLocalWire),TopoDS::Face(aLocalFace)); if (!wexp.More()) continue; // Protection from case when explorer does not contain edges. -// wexp.Init(TopoDS::Wire(W .Oriented(TopAbs_FORWARD)), -// TopoDS::Face(FI.Oriented(TopAbs_FORWARD))); CurE = FirstE = wexp.Current(); while (!end) { wexp.Next(); @@ -1467,17 +1491,13 @@ void BRepOffset_Inter2d::ConnexIntByInt } if (CurE.IsSame(NextE)) continue; - //IFV------------ TopoDS_Vertex Vref = CommonVertex(CurE, NextE); gp_Pnt Pref = BRep_Tool::Pnt(Vref); - //IFV------------ TopoDS_Shape aLocalShape = OFI.Generated(CurE); TopoDS_Edge CEO = TopoDS::Edge(aLocalShape); aLocalShape = OFI.Generated(NextE); TopoDS_Edge NEO = TopoDS::Edge(aLocalShape); -// TopoDS_Edge CEO = TopoDS::Edge(OFI.Generated(CurE)); -// TopoDS_Edge NEO = TopoDS::Edge(OFI.Generated(NextE)); //------------------------------------------ // Inter processing of images of CurE NextE. //------------------------------------------ @@ -1490,7 +1510,7 @@ void BRepOffset_Inter2d::ConnexIntByInt NE2 = Build(NextE); } else if (Build.IsBound(CurE) && MES.IsBound(NEO)) { - NE1 = Build(CurE); + NE1 = Build(CurE); NE2 = MES (NEO); } else if (Build.IsBound(NextE) && MES.IsBound(CEO)) { @@ -1504,43 +1524,31 @@ void BRepOffset_Inter2d::ConnexIntByInt //------------------------------------ // NE1,NE2 can be a compound of Edges. //------------------------------------ - TopExp_Explorer Exp1,Exp2; - for (Exp1.Init(NE1,TopAbs_EDGE) ; Exp1.More(); Exp1.Next()) { - for (Exp2.Init(NE2,TopAbs_EDGE) ; Exp2.More(); Exp2.Next()) { - RefEdgeInter(FIO,BAsurf,TopoDS::Edge(Exp1.Current()),TopoDS::Edge(Exp2.Current()), - AsDes2d,Tol,Standard_True/*Standard_False*/, Pref, theDMVV); + Standard_Boolean bCoincide; + TopExp_Explorer Exp1, Exp2; + for (Exp1.Init(NE1, TopAbs_EDGE); Exp1.More(); Exp1.Next()) { + const TopoDS_Edge& aE1 = TopoDS::Edge(Exp1.Current()); + for (Exp2.Init(NE2, TopAbs_EDGE); Exp2.More(); Exp2.Next()) { + const TopoDS_Edge& aE2 = TopoDS::Edge(Exp2.Current()); + RefEdgeInter(FIO, BAsurf, aE1, aE2, AsDes2d, + Tol, Standard_True, Pref, theDMVV, bCoincide); } } // + // check if some of the offset edges have been + // generated out of the common vertex if (Build.IsBound(Vref)) { - TopoDS_Shape NE3 = Build(Vref); - // - for (Exp2.Init(NE3,TopAbs_EDGE) ; Exp2.More(); Exp2.Next()) { - const TopoDS_Edge& aE3 = *(TopoDS_Edge*)&Exp2.Current(); - if (!aME.Contains(aE3)) { - continue; - } - // - for (Exp1.Init(NE1,TopAbs_EDGE) ; Exp1.More(); Exp1.Next()) { - RefEdgeInter(FIO,BAsurf,TopoDS::Edge(Exp1.Current()),aE3, - AsDes2d,Tol,Standard_True/*Standard_False*/, Pref, theDMVV); - } - // - for (Exp1.Init(NE2,TopAbs_EDGE) ; Exp1.More(); Exp1.Next()) { - RefEdgeInter(FIO,BAsurf,TopoDS::Edge(Exp1.Current()),aE3, - AsDes2d,Tol,Standard_True/*Standard_False*/, Pref, theDMVV); - } - } + FacesWithVerts.Add(FI); } } else { if (MES.IsBound(CEO)) { - TopoDS_Vertex V = CommonVertex(CEO,NEO); + TopoDS_Vertex V = CommonVertex(CEO,NEO); UpdateVertex (V,CEO,TopoDS::Edge(MES(CEO)),Tol); AsDes2d->Add (MES(CEO),V); } else if (MES.IsBound(NEO)) { - TopoDS_Vertex V = CommonVertex(CEO,NEO); + TopoDS_Vertex V = CommonVertex(CEO,NEO); UpdateVertex (V,NEO,TopoDS::Edge(MES(NEO)),Tol); AsDes2d->Add (MES(NEO),V); } @@ -1550,6 +1558,143 @@ void BRepOffset_Inter2d::ConnexIntByInt } } +//======================================================================= +//function : ConnexIntByIntInVert +//purpose : Intersection of the edges generated out of vertices +//======================================================================= +void BRepOffset_Inter2d::ConnexIntByIntInVert + (const TopoDS_Face& FI, + BRepOffset_Offset& OFI, + TopTools_DataMapOfShapeShape& MES, + const TopTools_DataMapOfShapeShape& Build, + const Handle(BRepAlgo_AsDes)& AsDes, + const Handle(BRepAlgo_AsDes)& AsDes2d, + const Standard_Real Tol, + TopTools_IndexedDataMapOfShapeListOfShape& theDMVV) +{ + TopoDS_Face FIO = TopoDS::Face(OFI.Face()); + if (MES.IsBound(FIO)) FIO = TopoDS::Face(MES(FIO)); + // + TopTools_MapOfShape aME; + const TopTools_ListOfShape& aLE = AsDes->Descendant(FIO); + TopTools_ListIteratorOfListOfShape aItLE(aLE); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Shape& aE = aItLE.Value(); + aME.Add(aE); + } + // + BRepAdaptor_Surface BAsurf(FIO); + // + TopExp_Explorer exp(FI.Oriented(TopAbs_FORWARD),TopAbs_WIRE); + for (; exp.More(); exp.Next()) { + const TopoDS_Wire& W = TopoDS::Wire(exp.Current()); + // + BRepTools_WireExplorer wexp; + Standard_Boolean end = Standard_False ; + TopoDS_Edge FirstE,CurE,NextE; + // + TopoDS_Shape aLocalWire = W .Oriented(TopAbs_FORWARD); + TopoDS_Shape aLocalFace = FI.Oriented(TopAbs_FORWARD); + wexp.Init(TopoDS::Wire(aLocalWire),TopoDS::Face(aLocalFace)); + if (!wexp.More()) + continue; // Protection from case when explorer does not contain edges. + // + CurE = FirstE = wexp.Current(); + while (!end) { + wexp.Next(); + if (wexp.More()) { + NextE = wexp.Current(); + } + else { + NextE = FirstE; end = Standard_True; + } + if (CurE.IsSame(NextE)) continue; + // + TopoDS_Vertex Vref = CommonVertex(CurE, NextE); + gp_Pnt Pref = BRep_Tool::Pnt(Vref); + if (!Build.IsBound(Vref)) { + CurE = NextE; + continue; + } + // + TopoDS_Shape aLocalShape = OFI.Generated(CurE); + TopoDS_Edge CEO = TopoDS::Edge(aLocalShape); + aLocalShape = OFI.Generated(NextE); + TopoDS_Edge NEO = TopoDS::Edge(aLocalShape); + // + TopoDS_Shape NE1,NE2; + + if (Build.IsBound(CurE) && Build.IsBound(NextE)) { + NE1 = Build(CurE ); + NE2 = Build(NextE); + } + else if (Build.IsBound(CurE) && MES.IsBound(NEO)) { + NE1 = Build(CurE); + NE2 = MES (NEO); + } + else if (Build.IsBound(NextE) && MES.IsBound(CEO)) { + NE1 = Build(NextE); + NE2 = MES(CEO); + } + else { + CurE = NextE; + continue; + } + // + TopExp_Explorer Exp1, Exp2; + Standard_Boolean bCoincide; + // intersect edges generated from vertex with the edges of the face + TopoDS_Shape NE3 = Build(Vref); + // + for (Exp2.Init(NE3, TopAbs_EDGE); Exp2.More(); Exp2.Next()) { + const TopoDS_Edge& aE3 = *(TopoDS_Edge*)&Exp2.Current(); + if (!aME.Contains(aE3)) { + continue; + } + // + // intersection with first edge + for (Exp1.Init(NE1, TopAbs_EDGE); Exp1.More(); Exp1.Next()) { + const TopoDS_Edge& aE1 = TopoDS::Edge(Exp1.Current()); + RefEdgeInter(FIO, BAsurf, aE1, aE3, AsDes2d, + Tol, Standard_True, Pref, theDMVV, bCoincide); + if (bCoincide) { + // in case of coincidence trim the edge E3 the same way as E1 + Store(aE3, AsDes2d->Descendant(aE1), Tol, Standard_True, AsDes2d, theDMVV); + } + } + // + // intersection with second edge + for (Exp1.Init(NE2, TopAbs_EDGE); Exp1.More(); Exp1.Next()) { + const TopoDS_Edge& aE2 = TopoDS::Edge(Exp1.Current()); + RefEdgeInter(FIO, BAsurf, aE2, aE3, AsDes2d, + Tol, Standard_True, Pref, theDMVV, bCoincide); + if (bCoincide) { + // in case of coincidence trim the edge E3 the same way as E2 + Store(aE3, AsDes2d->Descendant(aE2), Tol, Standard_True, AsDes2d, theDMVV); + } + } + // + // intersection of the edges generated from vertex + // among themselves + for (Exp1.Init(NE3, TopAbs_EDGE); Exp1.More(); Exp1.Next()) { + if (aE3.IsSame(Exp1.Current())) { + break; + } + } + // + for (Exp1.Next(); Exp1.More(); Exp1.Next()) { + const TopoDS_Edge& aE3Next = TopoDS::Edge(Exp1.Current()); + if (aME.Contains(aE3Next)) { + RefEdgeInter(FIO, BAsurf, aE3Next, aE3, AsDes2d, + Tol, Standard_True, Pref, theDMVV, bCoincide); + } + } + } + CurE = NextE; + } + } +} + //======================================================================= //function : MakeChain //purpose : diff --git a/src/BRepOffset/BRepOffset_Inter2d.hxx b/src/BRepOffset/BRepOffset_Inter2d.hxx index 5254350863..4c0689027b 100644 --- a/src/BRepOffset/BRepOffset_Inter2d.hxx +++ b/src/BRepOffset/BRepOffset_Inter2d.hxx @@ -51,27 +51,45 @@ public: const Standard_Real Tol, TopTools_IndexedDataMapOfShapeListOfShape& theDMVV); - //! Computes the intersection between the offset edges - //! stored in AsDes as descendatnds on . All intersection - //! vertices will be stored in AsDes2d. When all faces of the - //! shape are treated the intersection vertices have to be fused - //! using the FuseVertices method. + //! Computes the intersection between the offset edges of the . + //! All intersection vertices will be stored in AsDes2d. + //! When all faces of the shape are treated the intersection vertices + //! have to be fused using the FuseVertices method. //! theDMVV contains the vertices that should be fused. - Standard_EXPORT static void ConnexIntByInt (const TopoDS_Face& FI, - BRepOffset_Offset& OFI, - TopTools_DataMapOfShapeShape& MES, - const TopTools_DataMapOfShapeShape& Build, - const Handle(BRepAlgo_AsDes)& AsDes, - const Handle(BRepAlgo_AsDes)& AsDes2d, - const Standard_Real Offset, + Standard_EXPORT static void ConnexIntByInt (const TopoDS_Face& FI, + BRepOffset_Offset& OFI, + TopTools_DataMapOfShapeShape& MES, + const TopTools_DataMapOfShapeShape& Build, + const Handle(BRepAlgo_AsDes)& AsDes2d, + const Standard_Real Offset, const Standard_Real Tol, + TopTools_IndexedMapOfShape& FacesWithVerts, TopTools_IndexedDataMapOfShapeListOfShape& theDMVV); + //! Computes the intersection between the offset edges generated + //! from vertices and stored into AsDes as descendants of the . + //! All intersection vertices will be stored in AsDes2d. + //! When all faces of the shape are treated the intersection vertices + //! have to be fused using the FuseVertices method. + //! theDMVV contains the vertices that should be fused. + Standard_EXPORT static void ConnexIntByIntInVert (const TopoDS_Face& FI, + BRepOffset_Offset& OFI, + TopTools_DataMapOfShapeShape& MES, + const TopTools_DataMapOfShapeShape& Build, + const Handle(BRepAlgo_AsDes)& AsDes, + const Handle(BRepAlgo_AsDes)& AsDes2d, + const Standard_Real Tol, + TopTools_IndexedDataMapOfShapeListOfShape& theDMVV); + //! Fuses the chains of vertices in the theDMVV //! and updates AsDes by replacing the old vertices //! with the new ones. Standard_EXPORT static void FuseVertices(const TopTools_IndexedDataMapOfShapeListOfShape& theDMVV, const Handle(BRepAlgo_AsDes)& theAsDes); + //! extents the edge + Standard_EXPORT static void ExtentEdge(const TopoDS_Edge& E, + TopoDS_Edge& NE, + const Standard_Real theOffset); protected: diff --git a/src/BRepOffset/BRepOffset_Inter3d.cxx b/src/BRepOffset/BRepOffset_Inter3d.cxx index 02971539d2..56b539c10f 100644 --- a/src/BRepOffset/BRepOffset_Inter3d.cxx +++ b/src/BRepOffset/BRepOffset_Inter3d.cxx @@ -45,6 +45,8 @@ #include #include #include +// +#include //======================================================================= //function : BRepOffset_Inter3d @@ -444,51 +446,24 @@ void BRepOffset_Inter3d::ConnexIntByInt TopExp::MapShapesAndAncestors(SI, TopAbs_VERTEX, TopAbs_FACE, aMVF); } // - aNb = VEmap.Extent(); - for (i = 1; i <= aNb; ++i) { - const TopoDS_Shape& aS = VEmap(i); - // - TopoDS_Edge E; - TopTools_ListOfShape aLF1, aLF2; - // - bEdge = (aS.ShapeType() == TopAbs_EDGE); - if (bEdge) { - // faces connected by the edge - E = *(TopoDS_Edge*)&aS; - // - const BRepOffset_ListOfInterval& L = Analyse.Type(E); - if (L.IsEmpty()) { + TopTools_DataMapOfShapeListOfShape aDMVLF1, aDMVLF2; + TopTools_IndexedDataMapOfShapeListOfShape aDMIntE, aDMIntFF; + // + if (bIsPlanar) { + aNb = VEmap.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopoDS_Shape& aS = VEmap(i); + if (aS.ShapeType() != TopAbs_VERTEX) { continue; } // - BRepOffset_Type OT = L.First().Type(); - if (OT != BRepOffset_Convex && OT != BRepOffset_Concave) { - continue; - } - // - if (OT == BRepOffset_Concave) CurSide = TopAbs_IN; - else CurSide = TopAbs_OUT; - //----------------------------------------------------------- - // edge is of the proper type, return adjacent faces. - //----------------------------------------------------------- - const TopTools_ListOfShape& Anc = Analyse.Ancestors(E); - if (Anc.Extent() != 2) { - continue; - } - // - F1 = TopoDS::Face(Anc.First()); - F2 = TopoDS::Face(Anc.Last ()); - // - aLF1.Append(F1); - aLF2.Append(F2); - } - else { // faces connected by the vertex const TopTools_ListOfShape& aLF = aMVF.FindFromKey(aS); if (aLF.Extent() < 2) { continue; } // + TopTools_ListOfShape aLF1, aLF2; Standard_Boolean bVertexOnly = Standard_False; TopTools_MapOfShape aMFence; // @@ -534,6 +509,57 @@ void BRepOffset_Inter3d::ConnexIntByInt continue; } // + aDMVLF1.Bind(aS, aLF1); + aDMVLF2.Bind(aS, aLF2); + } + } + // + aNb = VEmap.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopoDS_Shape& aS = VEmap(i); + // + TopoDS_Edge E; + TopTools_ListOfShape aLF1, aLF2; + // + bEdge = (aS.ShapeType() == TopAbs_EDGE); + if (bEdge) { + // faces connected by the edge + E = *(TopoDS_Edge*)&aS; + // + const BRepOffset_ListOfInterval& L = Analyse.Type(E); + if (L.IsEmpty()) { + continue; + } + // + BRepOffset_Type OT = L.First().Type(); + if (OT != BRepOffset_Convex && OT != BRepOffset_Concave) { + continue; + } + // + if (OT == BRepOffset_Concave) CurSide = TopAbs_IN; + else CurSide = TopAbs_OUT; + //----------------------------------------------------------- + // edge is of the proper type, return adjacent faces. + //----------------------------------------------------------- + const TopTools_ListOfShape& Anc = Analyse.Ancestors(E); + if (Anc.Extent() != 2) { + continue; + } + // + F1 = TopoDS::Face(Anc.First()); + F2 = TopoDS::Face(Anc.Last ()); + // + aLF1.Append(F1); + aLF2.Append(F2); + } + else { + if (!aDMVLF1.IsBound(aS)) { + continue; + } + // + aLF1 = aDMVLF1.Find(aS); + aLF2 = aDMVLF2.Find(aS); + // CurSide = mySide; } // @@ -595,6 +621,24 @@ void BRepOffset_Inter3d::ConnexIntByInt for (; it.More(); it.Next()) { const TopoDS_Shape& aNE = it.Value(); B.Add(C, aNE); + if (bEdge) { + TopoDS_Vertex aVO1, aVO2; + TopExp::Vertices(TopoDS::Edge(aS), aVO1, aVO2); + if (!aDMVLF1.IsBound(aVO1) && !aDMVLF1.IsBound(aVO2)) { + TopTools_ListOfShape *pListS = aDMIntE.ChangeSeek(aNE); + if (!pListS) { + pListS = &aDMIntE.ChangeFromIndex(aDMIntE.Add(aNE, TopTools_ListOfShape())); + } + pListS->Append(aS); + // + if (!aDMIntFF.Contains(aNE)) { + TopTools_ListOfShape aLFF; + aLFF.Append(NF1); + aLFF.Append(NF2); + aDMIntFF.Add(aNE, aLFF); + } + } + } } // Build.Bind(aS,C); @@ -620,14 +664,33 @@ void BRepOffset_Inter3d::ConnexIntByInt } } // + TopTools_ListOfShape aLENew; for (it.Initialize(aLInt1) ; it.More(); it.Next()) { const TopoDS_Shape &anE1 = it.Value(); // for (it1.Initialize(aLInt2) ; it1.More(); it1.Next()) { const TopoDS_Shape &anE2 = it1.Value(); - - if (anE1.IsSame(anE2)) + if (anE1.IsSame(anE2)) { B.Add(C, anE1); + if (bEdge) { + TopoDS_Vertex aVO1, aVO2; + TopExp::Vertices(TopoDS::Edge(aS), aVO1, aVO2); + if (!aDMVLF1.IsBound(aVO1) && !aDMVLF1.IsBound(aVO2)) { + TopTools_ListOfShape *pListS = aDMIntE.ChangeSeek(anE1); + if (!pListS) { + pListS = &aDMIntE.ChangeFromIndex(aDMIntE.Add(anE1, TopTools_ListOfShape())); + } + pListS->Append(aS); + // + if (!aDMIntFF.Contains(anE1)) { + TopTools_ListOfShape aLFF; + aLFF.Append(NF1); + aLFF.Append(NF2); + aDMIntFF.Add(anE1, aLFF); + } + } + } + } } } Build.Bind(aS,C); @@ -639,6 +702,70 @@ void BRepOffset_Inter3d::ConnexIntByInt } // Modified by skv - Fri Dec 26 12:20:14 2003 OCC4455 End } + // + aNb = aDMIntE.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopTools_ListOfShape& aLE = aDMIntE(i); + if (aLE.Extent() == 1) { + continue; + } + // + // make connexity blocks of edges + TopoDS_Compound aCE; + B.MakeCompound(aCE); + // + TopTools_ListIteratorOfListOfShape aItLE(aLE); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Shape& aE = aItLE.Value(); + B.Add(aCE, aE); + } + // + TopTools_ListOfShape aLCBE; + BOPTools_AlgoTools::MakeConnexityBlocks(aCE, TopAbs_VERTEX, TopAbs_EDGE, aLCBE); + if (aLCBE.Extent() == 1) { + continue; + } + // + const TopoDS_Edge& aE = TopoDS::Edge(aDMIntE.FindKey(i)); + const TopTools_ListOfShape& aLFF = aDMIntFF.FindFromKey(aE); + const TopoDS_Shape& aF1 = aLFF.First(); + const TopoDS_Shape& aF2 = aLFF.Last(); + // + aItLE.Initialize(aLCBE); + for (aItLE.Next(); aItLE.More(); aItLE.Next()) { + // make new edge with different tedge instance + TopoDS_Edge aNewEdge; + TopoDS_Vertex aV1, aV2; + Standard_Real aT1, aT2; + // + TopExp::Vertices(aE, aV1, aV2); + BRep_Tool::Range(aE, aT1, aT2); + // + BOPTools_AlgoTools::MakeSplitEdge(aE, aV1, aT1, aV2, aT2, aNewEdge); + // + myAsDes->Add(aF1, aNewEdge); + myAsDes->Add(aF2, aNewEdge); + // + const TopoDS_Shape& aCB = aItLE.Value(); + TopoDS_Iterator aItCB(aCB); + for (; aItCB.More(); aItCB.Next()) { + const TopoDS_Shape& aS = aItCB.Value(); + TopoDS_Shape& aCI = Build.ChangeFind(aS); + // + TopoDS_Compound aNewCI; + B.MakeCompound(aNewCI); + TopExp_Explorer aExp(aCI, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aSx = aExp.Current(); + if (!aSx.IsSame(aE)) { + B.Add(aNewCI, aSx); + } + } + B.Add(aNewCI, aNewEdge); + aCI = aNewCI; + } + } + } } //======================================================================= diff --git a/src/BRepOffset/BRepOffset_MakeOffset.cxx b/src/BRepOffset/BRepOffset_MakeOffset.cxx index 8fa0fd15cc..9fea562ab3 100644 --- a/src/BRepOffset/BRepOffset_MakeOffset.cxx +++ b/src/BRepOffset/BRepOffset_MakeOffset.cxx @@ -113,18 +113,9 @@ #include #include // -#include -#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include +#include #include // POP for NT @@ -253,43 +244,24 @@ static void DEBVerticesControl (const TopTools_IndexedMapOfShape& NewEdges, //======================================================================= // static methods //======================================================================= -static - void SortFaces(const TopTools_ListOfShape& theLIm, - TopTools_ListOfShape& theLFImages, - const Standard_Boolean bKeepFirst); +static + void GetEnlargedFaces(const TopoDS_Shape& theShape, + const BRepOffset_DataMapOfShapeOffset& theMapSF, + const TopTools_DataMapOfShapeShape& theMES, + TopTools_DataMapOfShapeShape& theFacesOrigins, + BRepAlgo_Image& theImage, + TopTools_ListOfShape& theLSF); -static - Standard_Boolean FindShape(const TopoDS_Shape& theSWhat, - const TopoDS_Shape& theSWhere, - TopoDS_Shape& theRes); +static + Standard_Boolean BuildShellsCompleteInter(const BOPCol_ListOfShape& theLF, + const BOPCol_IndexedDataMapOfShapeListOfShape& theOrigins, + BRepAlgo_Image& theImage, + TopoDS_Shape& theShells); -static - void UpdateOrigins(TopTools_IndexedDataMapOfShapeListOfShape& theOrigins, - BOPAlgo_Builder& theGF); - -static - Standard_Boolean ProcessMicroEdge(const TopoDS_Edge& theEdge, - const Handle(IntTools_Context)& theCtx); - -static - Standard_Boolean ComputeBiNormal(const TopoDS_Face& theF, - const TopoDS_Edge& theE, - gp_Dir& theDB); -static - Standard_Boolean CheckBiNormals(const TopoDS_Face& aFIm, - const TopoDS_Face& aFOr, - const TopTools_IndexedDataMapOfShapeListOfShape& theOrigins, - const TopTools_MapOfShape& theMFence, - Standard_Boolean& bKeep, - Standard_Boolean& bRem, - const Standard_Boolean RemoveInvalidFaces); - -static - void CheckBiNormals(TopTools_ListOfShape& theLFImages, - const TopoDS_Face& theF, - const TopTools_IndexedDataMapOfShapeListOfShape& theOrigins, - TopTools_ListOfShape& theLFKeep, - const Standard_Boolean RemoveInvalidFaces); +static + Standard_Boolean GetSubShapes(const TopoDS_Shape& theShape, + const TopAbs_ShapeEnum theSSType, + TopoDS_Shape& theResult); static Standard_Boolean CheckNormals(const TopoDS_Face& theFIm, @@ -316,6 +288,28 @@ static static Standard_Boolean IsPlanar(const TopoDS_Shape& theS); +static + void TrimEdge(TopoDS_Edge& NE, + const Handle(BRepAlgo_AsDes)& AsDes2d, + Handle(BRepAlgo_AsDes)& AsDes, + TopTools_DataMapOfShapeShape& theETrimEInf); + +static + void TrimEdges(const TopoDS_Shape& theShape, + const Standard_Real theOffset, + BRepOffset_DataMapOfShapeOffset& theMapSF, + TopTools_DataMapOfShapeShape& theMES, + TopTools_DataMapOfShapeShape& theBuild, + Handle(BRepAlgo_AsDes)& theAsDes, + Handle(BRepAlgo_AsDes)& theAsDes2d, + TopTools_IndexedMapOfShape& theNewEdges, + TopTools_DataMapOfShapeShape& theETrimEInf, + TopTools_DataMapOfShapeListOfShape& theEdgesOrigins); + +static + void AppendToList(TopTools_ListOfShape& theL, + const TopoDS_Shape& theS); + static BRepOffset_Error checkSinglePoint(const Standard_Real theUParam, const Standard_Real theVParam, const Handle(Geom_Surface)& theSurf, @@ -544,7 +538,6 @@ static void FillContours(const TopoDS_Shape& aShape, } } - // //----------------------------------------------------------------------- // @@ -572,8 +565,7 @@ BRepOffset_MakeOffset::BRepOffset_MakeOffset(const TopoDS_Shape& S, const Standard_Boolean SelfInter, const GeomAbs_JoinType Join, const Standard_Boolean Thickening, - const Standard_Boolean RemoveIntEdges, - const Standard_Boolean RemInvFaces) + const Standard_Boolean RemoveIntEdges) : myOffset (Offset), myTol (Tol), @@ -584,9 +576,7 @@ mySelfInter (SelfInter), myJoin (Join), myThickening (Thickening), myRemoveIntEdges(RemoveIntEdges), -myRemoveInvalidFaces(RemInvFaces), myDone (Standard_False) - { myAsDes = new BRepAlgo_AsDes(); MakeOffsetShape(); @@ -606,8 +596,7 @@ void BRepOffset_MakeOffset::Initialize(const TopoDS_Shape& S, const Standard_Boolean SelfInter, const GeomAbs_JoinType Join, const Standard_Boolean Thickening, - const Standard_Boolean RemoveIntEdges, - const Standard_Boolean RemInvFaces) + const Standard_Boolean RemoveIntEdges) { myOffset = Offset; myShape = S; @@ -618,7 +607,6 @@ void BRepOffset_MakeOffset::Initialize(const TopoDS_Shape& S, myJoin = Join; myThickening = Thickening; myRemoveIntEdges = RemoveIntEdges; - myRemoveInvalidFaces = RemInvFaces; myDone = Standard_False; myIsPerformSewing = Standard_False; myIsPlanar = Standard_False; @@ -847,6 +835,11 @@ void BRepOffset_MakeOffset::MakeOffsetShape() // Construction of shells. //------------------------- MakeShells (); + if (myOffsetShape.IsNull()) { + // not done + myDone = Standard_False; + return; + } //-------------- // Unwinding 3D. //-------------- @@ -1021,125 +1014,33 @@ const TopoDS_Shape& BRepOffset_MakeOffset::Shape() const } //======================================================================= -//function : TrimEdge -//purpose : Trim the edge of the largest of descendants in AsDes2d. -// Order in AsDes two vertices that have trimmed the edge. -//======================================================================= -void TrimEdge(TopoDS_Edge& NE, - const Handle(BRepAlgo_AsDes)& AsDes2d, - Handle(BRepAlgo_AsDes)& AsDes) -{ - Standard_Real aSameParTol = Precision::Confusion(); - - TopoDS_Vertex V1,V2; - Standard_Real U = 0.; - Standard_Real UMin = Precision::Infinite(); - Standard_Real UMax = -UMin; - - const TopTools_ListOfShape& LE = AsDes2d->Descendant(NE); - // - Standard_Boolean bTrim = Standard_False; - // - if (LE.Extent() > 1) { - TopTools_ListIteratorOfListOfShape it (LE); - for (; it.More(); it.Next()) { - TopoDS_Vertex V = TopoDS::Vertex(it.Value()); - if (NE.Orientation() == TopAbs_REVERSED) - V.Reverse(); - //V.Orientation(TopAbs_INTERNAL); - if (!FindParameter(V, NE, U)) { - Standard_Real f, l; - Handle(Geom_Curve) theCurve = BRep_Tool::Curve(NE, f, l); - gp_Pnt thePoint = BRep_Tool::Pnt(V); - GeomAPI_ProjectPointOnCurve Projector(thePoint, theCurve); - if (Projector.NbPoints() == 0) - Standard_ConstructionError::Raise("BRepOffset_MakeOffset::TrimEdge no projection"); - U = Projector.LowerDistanceParameter(); - } - if (U < UMin) { - UMin = U; V1 = V; - } - if (U > UMax) { - UMax = U; V2 = V; - } - } - // - if (V1.IsNull() || V2.IsNull()) { - Standard_ConstructionError::Raise("BRepOffset_MakeOffset::TrimEdge"); - } - if (!V1.IsSame(V2)) { - NE.Free( Standard_True ); - BRep_Builder B; - TopAbs_Orientation Or = NE.Orientation(); - NE.Orientation(TopAbs_FORWARD); - TopoDS_Vertex VF,VL; - TopExp::Vertices (NE,VF,VL); - B.Remove(NE,VF); - B.Remove(NE,VL); - B.Add (NE,V1.Oriented(TopAbs_FORWARD)); - B.Add (NE,V2.Oriented(TopAbs_REVERSED)); - B.Range(NE,UMin,UMax); - NE.Orientation(Or); - AsDes->Add(NE,V1.Oriented(TopAbs_FORWARD)); - AsDes->Add(NE,V2.Oriented(TopAbs_REVERSED)); - BRepLib::SameParameter(NE, aSameParTol, Standard_True); - // - bTrim = Standard_True; - } - } - // - if (!bTrim) { - BRepAdaptor_Curve aBAC(NE); - if (aBAC.GetType() == GeomAbs_Line) { - if (AsDes->HasAscendant(NE)) { - AsDes->Remove(NE); - } - } - } -} - -//======================================================================= -//function : BuildOffsetByInter +//function : MakeOffsetFaces //purpose : //======================================================================= -void BRepOffset_MakeOffset::BuildOffsetByInter() +void BRepOffset_MakeOffset::MakeOffsetFaces(BRepOffset_DataMapOfShapeOffset& theMapSF) { -#ifdef OCCT_DEBUG - if ( ChronBuild) { - cout << " CONSTRUCTION OF OFFSETS :" << endl; - Clock.Reset(); - Clock.Start(); - } -#endif - - BRepOffset_DataMapOfShapeOffset MapSF; - TopTools_MapOfShape Done; - Standard_Boolean OffsetOutside = (myOffset > 0.)? Standard_True : Standard_False; - //-------------------------------------------------------- - // Construction of faces parallel to initial faces - //-------------------------------------------------------- - TopExp_Explorer Exp; - TopTools_ListOfShape LF; - TopTools_ListIteratorOfListOfShape itLF; - - BRepLib::SortFaces(myShape,LF); - + Standard_Real aCurOffset; + TopTools_ListOfShape aLF; TopTools_DataMapOfShapeShape ShapeTgt; - for (itLF.Initialize(LF); itLF.More(); itLF.Next()) { - const TopoDS_Face& F = TopoDS::Face(itLF.Value()); - Standard_Real CurOffset = myOffset; - if (myFaceOffset.IsBound(F)) CurOffset = myFaceOffset(F); - BRepOffset_Offset OF(F,CurOffset,ShapeTgt,OffsetOutside,myJoin); + TopTools_ListIteratorOfListOfShape aItLF; + // + Standard_Boolean OffsetOutside = (myOffset > 0.); + // + BRepLib::SortFaces(myShape, aLF); + // + aItLF.Initialize(aLF); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Face& aF = TopoDS::Face(aItLF.Value()); + aCurOffset = myFaceOffset.IsBound(aF) ? myFaceOffset(aF) : myOffset; + BRepOffset_Offset OF(aF, aCurOffset, ShapeTgt, OffsetOutside, myJoin); TopTools_ListOfShape Let; - myAnalyse.Edges(F,BRepOffset_Tangent,Let); - TopTools_ListIteratorOfListOfShape itl(Let); - - for ( ; itl.More(); itl.Next()) { + myAnalyse.Edges(aF,BRepOffset_Tangent,Let); + TopTools_ListIteratorOfListOfShape itl(Let); + for (; itl.More(); itl.Next()) { const TopoDS_Edge& Cur = TopoDS::Edge(itl.Value()); if ( !ShapeTgt.IsBound(Cur)) { TopoDS_Shape aLocalShape = OF.Generated(Cur); const TopoDS_Edge& OTE = TopoDS::Edge(aLocalShape); -// const TopoDS_Edge& OTE = TopoDS::Edge(OF.Generated(Cur)); ShapeTgt.Bind(Cur,OF.Generated(Cur)); TopoDS_Vertex V1,V2,OV1,OV2; TopExp::Vertices (Cur,V1,V2); @@ -1160,8 +1061,32 @@ void BRepOffset_MakeOffset::BuildOffsetByInter() } } } - MapSF.Bind(F,OF); + theMapSF.Bind(aF,OF); } +} + +//======================================================================= +//function : BuildOffsetByInter +//purpose : +//======================================================================= +void BRepOffset_MakeOffset::BuildOffsetByInter() +{ +#ifdef OCCT_DEBUG + if ( ChronBuild) { + cout << " CONSTRUCTION OF OFFSETS :" << endl; + Clock.Reset(); + Clock.Start(); + } +#endif + + TopExp_Explorer Exp, Exp2, ExpC; + TopTools_ListIteratorOfListOfShape itLF; + + //-------------------------------------------------------- + // Construction of faces parallel to initial faces + //-------------------------------------------------------- + BRepOffset_DataMapOfShapeOffset MapSF; + MakeOffsetFaces(MapSF); //-------------------------------------------------------------------- // MES : Map of OffsetShape -> Extended Shapes. // Build : Map of Initial SS -> OffsetShape build by Inter. @@ -1189,148 +1114,29 @@ void BRepOffset_MakeOffset::BuildOffsetByInter() //--------------------------------------------------------------------------------- // Extension of neighbor edges of new edges and intersection between neighbors. //-------------------------------------------------------------------------------- - TopTools_IndexedDataMapOfShapeListOfShape aDMVV; Handle(BRepAlgo_AsDes) AsDes2d = new BRepAlgo_AsDes(); - for (Exp.Init(myShape,TopAbs_FACE) ; Exp.More(); Exp.Next()) - { - const TopoDS_Face& FI = TopoDS::Face(Exp.Current()); - Standard_Real aCurrFaceTol = BRep_Tool::Tolerance(FI); - BRepOffset_Inter2d::ConnexIntByInt (FI, MapSF(FI), MES, Build, - AsDes, AsDes2d, myOffset, aCurrFaceTol, aDMVV); - } - // - // fuse vertices on edges - BRepOffset_Inter2d::FuseVertices(aDMVV, AsDes2d); + IntersectEdges(myShape, MapSF, MES, Build, AsDes, AsDes2d); //----------------------------------------------------------- // Great restriction of new edges and update of AsDes. //------------------------------------------ ---------------- + TopTools_DataMapOfShapeListOfShape anEdgesOrigins; // offset edge - initial edges TopTools_IndexedMapOfShape NewEdges; - TopExp_Explorer Exp2,ExpC; - TopoDS_Shape NE; - TopoDS_Edge TNE; - TopoDS_Face NF; - TopTools_IndexedDataMapOfShapeListOfShape anOrigins; - - for (Exp.Init(myShape,TopAbs_FACE) ; Exp.More(); Exp.Next()) { - const TopoDS_Face& FI = TopoDS::Face(Exp.Current()); - NF = MapSF(FI).Face(); - if (MES.IsBound(NF)) { - NF = TopoDS::Face(MES(NF)); - } - // - TopTools_MapOfShape View; - TopTools_IndexedMapOfShape VEmap; - Standard_Integer i, aNb; - // - TopExp::MapShapes(FI.Oriented(TopAbs_FORWARD), TopAbs_EDGE , VEmap); - TopExp::MapShapes(FI.Oriented(TopAbs_FORWARD), TopAbs_VERTEX, VEmap); - // - aNb = VEmap.Extent(); - for (i = 1; i <= aNb; ++i) { - const TopoDS_Shape& aS = VEmap(i); - if (!View.Add(aS)) { - continue; - } - // - if (Build.IsBound(aS)) { - NE = Build(aS); - if (NE.ShapeType() == TopAbs_EDGE) { - if (anOrigins.Contains(NE)) { - anOrigins.ChangeFromKey(NE).Append(aS); - } - else { - TopTools_ListOfShape aLSx; - aLSx.Append(aS); - anOrigins.Add(NE, aLSx); - } - // - if (NewEdges.Add(NE)) { - TrimEdge (TopoDS::Edge(NE),AsDes2d,AsDes); - } - } - else { - //------------------------------------------------------------ - // The Intersections are on several edges. - // The pieces without intersections with neighbors - // are removed from AsDes. - //------------------------------------------------------------ - for (ExpC.Init(NE,TopAbs_EDGE); ExpC.More(); ExpC.Next()) { - TopoDS_Edge NEC = TopoDS::Edge(ExpC.Current()); - if (NewEdges.Add(NEC)) { - NEC.Free(Standard_True); - if (anOrigins.Contains(NEC)) { - anOrigins.ChangeFromKey(NEC).Append(aS); - } - else { - TopTools_ListOfShape aLSx; - aLSx.Append(aS); - anOrigins.Add(NEC, aLSx); - } - // - if (!AsDes2d->Descendant(NEC).IsEmpty()) { - TrimEdge (NEC,AsDes2d,AsDes); - } - else { - if (AsDes->HasAscendant(NEC)) { - AsDes->Remove(NEC); - } - } - } - } - } - } - else { - if (aS.ShapeType() != TopAbs_EDGE) { - continue; - } - // - NE = MapSF(FI).Generated(aS); - //// modified by jgv, 19.12.03 for OCC4455 //// - NE.Orientation(aS.Orientation()); - if (anOrigins.Contains(NE)) { - anOrigins.ChangeFromKey(NE).Append(aS); - } - else { - TopTools_ListOfShape aLSx; - aLSx.Append(aS); - anOrigins.Add(NE, aLSx); - } - // - if (MES.IsBound(NE)) { - NE = MES(NE); - NE.Orientation(aS.Orientation()); - if (NewEdges.Add(NE)) {TrimEdge (TopoDS::Edge(NE),AsDes2d,AsDes);} - } - AsDes->Add(NF,NE); - } - } - } - + TopTools_DataMapOfShapeShape aETrimEInf; // trimmed - not trimmed edges + // + //Map of edges obtained after FACE-FACE (offsetted) intersection. + //Key1 is edge trimmed by intersection points with other edges; + //Item is not-trimmed edge. + TrimEdges(myShape, myOffset, MapSF, MES, Build, AsDes, AsDes2d, NewEdges, aETrimEInf, anEdgesOrigins); + // //--------------------------------- // Intersection 2D on // //--------------------------------- + TopTools_IndexedDataMapOfShapeListOfShape aDMVV; + TopTools_DataMapOfShapeShape aFacesOrigins; // offset face - initial face TopTools_ListOfShape LFE; BRepAlgo_Image IMOE; - for (Exp.Init(myShape,TopAbs_FACE) ; Exp.More(); Exp.Next()) { - const TopoDS_Shape& FI = Exp.Current(); - const TopoDS_Shape& OFI = MapSF(FI).Face(); - if (MES.IsBound(OFI)) { - const TopoDS_Face& aLocalFace = TopoDS::Face(MES(OFI)); - LFE.Append(aLocalFace); - IMOE.SetRoot(aLocalFace); - // - if (anOrigins.Contains(aLocalFace)) { - anOrigins.ChangeFromKey(aLocalFace).Append(FI); - } - else { - TopTools_ListOfShape aLSx; - aLSx.Append(FI); - anOrigins.Add(aLocalFace, aLSx); - } - } - } - - aDMVV.Clear(); + GetEnlargedFaces(myShape, MapSF, MES, aFacesOrigins, IMOE, LFE); + // TopTools_ListIteratorOfListOfShape itLFE(LFE); for (; itLFE.More(); itLFE.Next()) { @@ -1356,28 +1162,13 @@ void BRepOffset_MakeOffset::BuildOffsetByInter() // TopTools_MapOfShape aMFDone; // - if ((myJoin == GeomAbs_Intersection) && myInter) { - TopTools_ListOfShape aLFailed; - BuildSplitsOfFaces(LFE, AsDes, anOrigins, IMOE, aLFailed, Standard_False); - if (aLFailed.Extent()) { - myMakeLoops.Build(aLFailed, AsDes, IMOE); - } + if ((myJoin == GeomAbs_Intersection) && myInter && myIsPlanar) { + BuildSplitsOfExtendedFaces(LFE, AsDes, anEdgesOrigins, aFacesOrigins, aETrimEInf, IMOE); // - if (LFE.Extent() != aLFailed.Extent()) { - TopTools_MapOfShape aMFailed; - TopTools_ListIteratorOfListOfShape aItLF(aLFailed); - for (; aItLF.More(); aItLF.Next()) { - const TopoDS_Shape& aS = aItLF.Value(); - aMFailed.Add(aS); - } - // - aItLF.Initialize(LFE); - for (; aItLF.More(); aItLF.Next()) { - const TopoDS_Shape& aS = aItLF.Value(); - if (!aMFailed.Contains(aS)) { - aMFDone.Add(aS); - } - } + TopTools_ListIteratorOfListOfShape aItLF(LFE); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Shape& aS = aItLF.Value(); + aMFDone.Add(aS); } } else { @@ -1578,7 +1369,7 @@ void BRepOffset_MakeOffset::BuildOffsetByInter() // Modified by skv - Tue Mar 15 16:20:43 2005 //--------------------------- - // MAJ SD. for caps + // MAJ SD. for caps //--------------------------- //TopTools_MapOfShape View; for (i = 1; i <= myFaces.Extent(); i++) { @@ -1630,327 +1421,6 @@ void BRepOffset_MakeOffset::BuildOffsetByInter() #endif } -//======================================================================= -//function : BuildSplitsOfFaces -//purpose : -//======================================================================= -void BRepOffset_MakeOffset::BuildSplitsOfFaces - (const TopTools_ListOfShape& theLF, - const Handle(BRepAlgo_AsDes)& theAsDes, - TopTools_IndexedDataMapOfShapeListOfShape& theOrigins, - BRepAlgo_Image& theImage, - TopTools_ListOfShape& theLFailed, - const Standard_Boolean bLimited) -{ - if (!myIsPlanar) { - theLFailed.Assign(theLF); - return; - } - // - BOPCol_ListOfShape aLS, aLF; - BOPCol_ListIteratorOfListOfShape aIt; - TopTools_ListIteratorOfListOfShape aItLF, aItLE, aItLE1; - TopTools_DataMapOfShapeListOfShape anEImages; - BRep_Builder aBB; - TopoDS_Compound aFaces; - // - aBB.MakeCompound(aFaces); - // - // firstly it is necessary to fuse all the edges - Handle(IntTools_Context) aCtx = new IntTools_Context(); - // - aItLF.Initialize(theLF); - for (; aItLF.More(); aItLF.Next()) { - const TopoDS_Face& aF = *(TopoDS_Face*)&aItLF.Value(); - // - const TopTools_ListOfShape& aLE = theAsDes->Descendant(aF); - aItLE.Initialize(aLE); - for (; aItLE.More(); aItLE.Next()) { - const TopoDS_Edge& aE = *(TopoDS_Edge*)&aItLE.Value(); - if (BRep_Tool::Degenerated(aE)) { - continue; - } - // - if (ProcessMicroEdge(aE, aCtx)) { - continue; - } - // - aLS.Append(aE); - } - } - // - if (aLS.Extent() > 1) { - BOPAlgo_Builder aGFE; - // - aGFE.SetArguments(aLS); - aGFE.Perform(); - if (aGFE.ErrorStatus() == 0) { - // fill map with edges images - aIt.Initialize(aLS); - for (; aIt.More(); aIt.Next()) { - const TopoDS_Shape& aE = aIt.Value(); - // - const TopTools_ListOfShape& aLEIm = aGFE.Modified(aE); - if (aLEIm.Extent()) { - anEImages.Bind(aE, aLEIm); - } - } - // - UpdateOrigins(theOrigins, aGFE); - } - } - // - // now we can split the faces - aItLF.Initialize(theLF); - for (; aItLF.More(); aItLF.Next()) { - const TopoDS_Face& aF = *(TopoDS_Face*)&aItLF.Value(); - // - // the offset face - aLS.Clear(); - aLS.Append(aF.Oriented(TopAbs_FORWARD)); - // - Standard_Integer iCountE = 0; - TopTools_MapOfShape aMFE; - TopExp_Explorer aExp(aF, TopAbs_EDGE); - for (; aExp.More(); aExp.Next()) { - const TopoDS_Shape& aE = aExp.Current(); - if (anEImages.IsBound(aE)) { - const TopTools_ListOfShape& aLEIm = anEImages.Find(aE); - aItLE.Initialize(aLEIm); - for (; aItLE.More(); aItLE.Next()) { - const TopoDS_Shape& aEIm = aItLE.Value(); - aMFE.Add(aEIm); - } - } - else { - aMFE.Add(aE); - } - } - // - // the edges by which the offset face should be split - const TopTools_ListOfShape& aLE = theAsDes->Descendant(aF); - aItLE.Initialize(aLE); - for (; aItLE.More(); aItLE.Next()) { - const TopoDS_Edge& aE = *(TopoDS_Edge*)&aItLE.Value(); - if (BRep_Tool::Degenerated(aE)) { - continue; - } - // - if (anEImages.IsBound(aE)) { - const TopTools_ListOfShape& aLEIm = anEImages.Find(aE); - aItLE1.Initialize(aLEIm); - for (; aItLE1.More(); aItLE1.Next()) { - const TopoDS_Edge& aEIm = *(TopoDS_Edge*)&aItLE1.Value(); - // check for micro edge - if (ProcessMicroEdge(aEIm, aCtx)) { - continue; - } - // - aLS.Append(aEIm); - if (!aMFE.Contains(aEIm)) { - ++iCountE; - } - } - } - else { - if (ProcessMicroEdge(aE, aCtx)) { - continue; - } - aLS.Append(aE); - if (!aMFE.Contains(aE)) { - ++iCountE; - } - } - } - // - TopTools_ListOfShape aLFImages; - // - // split the face by the edges - if (!iCountE) { - if (bLimited && !theImage.HasImage(aF)) { - aLFImages.Append(aF); - theImage.Bind(aF, aLFImages); - aBB.Add(aFaces, aF); - } - continue; - } - // - BOPAlgo_Builder aGF; - // - aGF.SetArguments(aLS); - aGF.Perform(); - if (aGF.ErrorStatus()) { - theLFailed.Append(aF); - continue; - } - // - // splits of the offset shape - aLFImages = aGF.Modified(aF); - if (aLFImages.IsEmpty()) { - theLFailed.Append(aF); - continue; - } - // - TopTools_MapOfShape aME; - // collect images of Edges - aItLE.Initialize(aLE); - for (; aItLE.More(); aItLE.Next()) { - const TopoDS_Shape& aE = aItLE.Value(); - if (anEImages.IsBound(aE)) { - TopTools_MapOfShape aMFence; - TopTools_ListOfShape aLEImNew; - Standard_Boolean bModif = Standard_False; - // - TopTools_ListOfShape& aLEIm = anEImages.ChangeFind(aE); - aItLE1.Initialize(aLEIm); - for (; aItLE1.More(); aItLE1.Next()) { - const TopoDS_Shape& aEIm = aItLE1.Value(); - const TopTools_ListOfShape& aLEImIm = aGF.Modified(aEIm); - if (aLEImIm.Extent()) { - bModif = Standard_True; - TopTools_ListIteratorOfListOfShape aItLEIm(aLEImIm); - for (; aItLEIm.More(); aItLEIm.Next()) { - const TopoDS_Shape& aEImIm = aItLEIm.Value(); - if (aMFence.Add(aEImIm)) { - aLEImNew.Append(aEImIm); - aME.Add(aEImIm); - } - } - } - else { - aLEImNew.Append(aEIm); - aME.Add(aEIm); - } - } - // - if (bModif) { - aLEIm.Assign(aLEImNew); - } - } - else { - const TopTools_ListOfShape& aLEIm = aGF.Modified(aE); - if (aLEIm.Extent()) { - anEImages.Bind(aE, aLEIm); - TopTools_ListIteratorOfListOfShape aItLEIm(aLEIm); - for (; aItLEIm.More(); aItLEIm.Next()) { - const TopoDS_Shape& aEIm = aItLEIm.Value(); - aME.Add(aEIm); - } - } - else { - aME.Add(aE); - } - } - } - // - if (!bLimited) { - // - // to overcome the often errors in trimming edges it is - // better to remove first the faces containing the boundaries - // of the extended surfaces; - Standard_Boolean bKeep; - aItLE.Initialize(aLFImages); - for (; aItLE.More();) { - const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLE.Value(); - // - aExp.Init(aFIm, TopAbs_EDGE); - for (bKeep = Standard_True; aExp.More() && bKeep; aExp.Next()) { - const TopoDS_Edge& aE = *(TopoDS_Edge*)&aExp.Current(); - // - if (BRep_Tool::Degenerated(aE)) { - continue; - } - // - bKeep = aME.Contains(aE); - } - // - if (bKeep) { - aItLE.Next(); - } - else { - aLFImages.Remove(aItLE); - } - } - // - UpdateOrigins(theOrigins, aGF); - // - if (aLFImages.Extent() >= 1) { - TopTools_ListOfShape aLFKeep; - // - // check offset faces on the coincidence of the - // bi-normal directions with the original faces - CheckBiNormals(aLFImages, aF, theOrigins, aLFKeep, myRemoveInvalidFaces); - // - // limit the face - if (aLFImages.Extent() > 1) { - TopTools_ListOfShape aLFTmp = aLFImages; - aLFImages.Clear(); - // - SortFaces(aLFTmp, aLFImages, Standard_True); - } - // - if (aLFKeep.Extent()) { - TopTools_MapOfShape aMFence; - aItLE.Initialize(aLFImages); - for (; aItLE.More(); aItLE.Next()) { - const TopoDS_Shape& aFIm = aItLE.Value(); - aMFence.Add(aFIm); - } - // - aItLE.Initialize(aLFKeep); - for (; aItLE.More(); aItLE.Next()) { - const TopoDS_Shape& aFIm = aItLE.Value(); - if (aMFence.Add(aFIm)) { - aLFImages.Append(aFIm); - } - } - } - } - } - // - // Fill history for faces - if (aLFImages.Extent()) { - if (theImage.HasImage(aF)) { - theImage.Add(aF, aLFImages); - } - else { - theImage.Bind(aF, aLFImages); - } - } - // - aItLE.Initialize(aLFImages); - for (; aItLE.More(); aItLE.Next()) { - const TopoDS_Shape& aFIm = aItLE.Value(); - aBB.Add(aFaces, aFIm); - } - } - // - // fill history for edges - TopTools_IndexedMapOfShape aMFE; - TopExp::MapShapes(aFaces, TopAbs_EDGE, aMFE); - // - TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItEIm(anEImages); - for (; aItEIm.More(); aItEIm.Next()) { - const TopoDS_Shape& aE = aItEIm.Key(); - const TopTools_ListOfShape& aLEIm = aItEIm.Value(); - // - Standard_Boolean bHasImage = theImage.HasImage(aE); - aItLE.Initialize(aLEIm); - for (; aItLE.More(); aItLE.Next()) { - const TopoDS_Shape& aEIm = aItLE.Value(); - if (aMFE.Contains(aEIm)) { - if (bHasImage) { - theImage.Add(aE, aEIm); - } - else { - theImage.Bind(aE, aEIm); - bHasImage = Standard_True; - } - } - } - } -} - //======================================================================= //function : BuildOffsetByArc //purpose : @@ -1965,56 +1435,15 @@ void BRepOffset_MakeOffset::BuildOffsetByArc() } #endif - BRepOffset_DataMapOfShapeOffset MapSF; - TopTools_MapOfShape Done; - Standard_Boolean OffsetOutside = (myOffset > 0.)? Standard_True : Standard_False; + TopExp_Explorer Exp; + TopTools_ListIteratorOfListOfShape itLF; + TopTools_MapOfShape Done; + //-------------------------------------------------------- // Construction of faces parallel to initial faces //-------------------------------------------------------- - TopExp_Explorer Exp; - TopTools_ListOfShape LF; - TopTools_ListIteratorOfListOfShape itLF; - - BRepLib::SortFaces(myShape,LF); - - TopTools_DataMapOfShapeShape EdgeTgt; - for (itLF.Initialize(LF); itLF.More(); itLF.Next()) { - const TopoDS_Face& F = TopoDS::Face(itLF.Value()); - Standard_Real CurOffset = myOffset; - if (myFaceOffset.IsBound(F)) CurOffset = myFaceOffset(F); - BRepOffset_Offset OF(F,CurOffset,EdgeTgt,OffsetOutside,myJoin); - TopTools_ListOfShape Let; - myAnalyse.Edges(F,BRepOffset_Tangent,Let); - TopTools_ListIteratorOfListOfShape itl(Let); - - for ( ; itl.More(); itl.Next()) { - const TopoDS_Edge& Cur = TopoDS::Edge(itl.Value()); - if ( !EdgeTgt.IsBound(Cur)) { - TopoDS_Shape aLocalShape = OF.Generated(Cur); - const TopoDS_Edge& OTE = TopoDS::Edge(aLocalShape); -// const TopoDS_Edge& OTE = TopoDS::Edge(OF.Generated(Cur)); - EdgeTgt.Bind(Cur,OF.Generated(Cur)); - TopoDS_Vertex V1,V2,OV1,OV2; - TopExp::Vertices (Cur,V1,V2); - TopExp::Vertices (OTE,OV1,OV2); - TopTools_ListOfShape LE; - if (!EdgeTgt.IsBound(V1)) { - myAnalyse.Edges(V1,BRepOffset_Tangent,LE); - const TopTools_ListOfShape& LA =myAnalyse.Ancestors(V1); - if (LE.Extent() == LA.Extent()) - EdgeTgt.Bind(V1,OV1); - } - if (!EdgeTgt.IsBound(V2)) { - LE.Clear(); - myAnalyse.Edges(V2,BRepOffset_Tangent,LE); - const TopTools_ListOfShape& LA =myAnalyse.Ancestors(V2); - if (LE.Extent() == LA.Extent()) - EdgeTgt.Bind(V2,OV2); - } - } - } - MapSF.Bind(F,OF); - } + BRepOffset_DataMapOfShapeOffset MapSF; + MakeOffsetFaces(MapSF); //-------------------------------------------------------- // Construction of tubes on edge. //-------------------------------------------------------- @@ -2958,13 +2387,8 @@ void BRepOffset_MakeOffset::MakeLoops(TopTools_IndexedMapOfShape& Modif) LF.Append(Modif(i)); } // - if ((myJoin == GeomAbs_Intersection) && myInter) { - TopTools_ListOfShape aLFailed; - TopTools_IndexedDataMapOfShapeListOfShape anOr; - BuildSplitsOfFaces(LF, myAsDes, anOr, myImageOffset, aLFailed, Standard_True); - if (aLFailed.Extent()) { - myMakeLoops.Build(aLFailed, myAsDes, myImageOffset); - } + if ((myJoin == GeomAbs_Intersection) && myInter && myIsPlanar) { + BuildSplitsOfTrimmedFaces(LF, myAsDes, myImageOffset); } else { myMakeLoops.Build(LF,myAsDes,myImageOffset); @@ -3013,13 +2437,8 @@ void BRepOffset_MakeOffset::MakeFaces(TopTools_IndexedMapOfShape& /*Modif*/) } } // - if ((myJoin == GeomAbs_Intersection) && myInter) { - TopTools_ListOfShape aLFailed; - TopTools_IndexedDataMapOfShapeListOfShape anOr; - BuildSplitsOfFaces(LOF, myAsDes, anOr, myImageOffset, aLFailed, Standard_True); - if (aLFailed.Extent()) { - myMakeLoops.BuildFaces(aLFailed, myAsDes, myImageOffset); - } + if ((myJoin == GeomAbs_Intersection) && myInter && myIsPlanar) { + BuildSplitsOfTrimmedFaces(LOF, myAsDes, myImageOffset); } else { myMakeLoops.BuildFaces(LOF,myAsDes,myImageOffset); @@ -3515,21 +2934,20 @@ void BRepOffset_MakeOffset::MakeShells () TopTools_ListIteratorOfListOfShape it(R); // for (; it.More(); it.Next()) { + const TopoDS_Shape& aF = it.Value(); + // TopTools_ListOfShape Image; - myImageOffset.LastImage(it.Value(),Image); + myImageOffset.LastImage(aF,Image); TopTools_ListIteratorOfListOfShape it2(Image); for (; it2.More(); it2.Next()) { - const TopoDS_Shape& aF = it2.Value(); - aLSF.Append(aF); + const TopoDS_Shape& aFIm = it2.Value(); + aLSF.Append(aFIm); // - if (anOrigins.Contains(aF)) { - anOrigins.ChangeFromKey(aF).Append(it.Value()); - } - else { - TopTools_ListOfShape aLOr; - aLOr.Append(it.Value()); - anOrigins.Add(aF, aLOr); + TopTools_ListOfShape *pLOr = anOrigins.ChangeSeek(aFIm); + if (!pLOr) { + pLOr = &anOrigins(anOrigins.Add(aFIm, TopTools_ListOfShape())); } + pLOr->Append(aF); } } // @@ -3547,141 +2965,27 @@ void BRepOffset_MakeOffset::MakeShells () } } // + if (aLSF.IsEmpty()) { + return; + } + // Standard_Boolean bDone = Standard_False; if ((myJoin == GeomAbs_Intersection) && myInter && !myThickening && myFaces.IsEmpty() && IsSolid(myShape) && myIsPlanar) { // - // make shells using MakerVolume algorithm - Standard_Integer i, aNb; - TopTools_ListIteratorOfListOfShape aItLS, aItLS1; - BRep_Builder aBB; - // - BOPAlgo_MakerVolume aMV1; - aMV1.SetArguments(aLSF); - aMV1.SetIntersect(Standard_True); - aMV1.Perform(); - // - bDone = (aMV1.ErrorStatus() == 0); + TopoDS_Shape aShells; + bDone = BuildShellsCompleteInter(aLSF, anOrigins, myImageOffset, aShells); if (bDone) { - UpdateHistory(aLSF, aMV1, myImageOffset); - // - TopoDS_Shape aResult = aMV1.Shape(); - // - TopTools_IndexedMapOfShape aMFResult; - TopExp::MapShapes(aResult, TopAbs_FACE, aMFResult); - // - // check the result - Standard_Boolean bGood = Standard_True; - if (myRemoveInvalidFaces) { - BOPCol_ListIteratorOfListOfShape aItLSF(aLSF); - for (; aItLSF.More(); aItLSF.Next()) { - const TopoDS_Shape& aFx = aItLSF.Value(); - if (!aMFResult.Contains(aFx)) { - const TopTools_ListOfShape& aLFMx = aMV1.Modified(aFx); - if (aLFMx.IsEmpty()) { - bGood = Standard_False; - break; - } - } - } - } - // - TopoDS_Compound aShells; - aBB.MakeCompound(aShells); - // - if (!bGood) { - myOffsetShape = aShells; - } - else { - if (aResult.ShapeType() == TopAbs_COMPOUND) { - // collect faces attached to only one solid - BOPCol_IndexedDataMapOfShapeListOfShape aMFS; - BOPCol_ListOfShape aLSF2; - // - BOPTools::MapShapesAndAncestors(aResult, TopAbs_FACE, TopAbs_SOLID, aMFS); - aNb = aMFS.Extent(); - bDone = (aNb > 0); - // - if (bDone) { - for (i = 1; i <= aNb; ++i) { - const BOPCol_ListOfShape& aLSx = aMFS(i); - if (aLSx.Extent() == 1) { - const TopoDS_Shape& aFx = aMFS.FindKey(i); - aLSF2.Append(aFx); - } - } - // - // make solids from the new list - BOPAlgo_MakerVolume aMV2; - // - aMV2.SetArguments(aLSF2); - aMV2.SetIntersect(Standard_False); - // - aMV2.Perform(); - bDone = (aMV2.ErrorStatus() == 0); - if (bDone) { - aResult = aMV2.Shape(); - if (aResult.ShapeType() == TopAbs_COMPOUND) { - BOPCol_ListOfShape aLSF3; - // - TopExp_Explorer aExp(aResult, TopAbs_FACE); - for (; aExp.More(); aExp.Next()) { - const TopoDS_Face& aF = *(TopoDS_Face*)&aExp.Current(); - // - // check orientation - if (!anOrigins.Contains(aF)) { - aLSF3.Append(aF); - continue; - } - // - const TopTools_ListOfShape& aLFOr = anOrigins.FindFromKey(aF); - aItLS.Initialize(aLFOr); - for (; aItLS.More(); aItLS.Next()) { - const TopoDS_Face& aFOr = *(TopoDS_Face*)&aItLS.Value(); - // - if (CheckNormals(aF, aFOr)) { - aLSF3.Append(aF); - break; - } - } - } - // - // make solid containing most outer faces - BOPAlgo_MakerVolume aMV3; - // - aMV3.SetArguments(aLSF3); - aMV3.SetIntersect(Standard_False); - // - aMV3.Perform(); - bDone = (aMV3.ErrorStatus() == 0); - if (bDone) { - aResult = aMV3.Shape(); - } - } - } - } - } - // - TopExp_Explorer aExp(aResult, TopAbs_SHELL); - bDone = aExp.More(); - for (; aExp.More(); aExp.Next()) { - const TopoDS_Shell& aSh = *(TopoDS_Shell*)&aExp.Current(); - aBB.Add(aShells, aSh); - } - myOffsetShape = aShells; - } + myOffsetShape = aShells; } } // if (!bDone) { BRepTools_Quilt Glue; - BOPCol_ListIteratorOfListOfShape aItLS; - // - aItLS.Initialize(aLSF); + BOPCol_ListIteratorOfListOfShape aItLS(aLSF); for (; aItLS.More(); aItLS.Next()) { - const TopoDS_Shape& aF = aItLS.Value(); - Glue.Add(aF); + Glue.Add(aItLS.Value()); } myOffsetShape = Glue.Shells(); } @@ -3698,7 +3002,7 @@ void BRepOffset_MakeOffset::MakeShells () aS.Closed(Standard_True); } } - } + } } //======================================================================= @@ -3803,7 +3107,7 @@ void BRepOffset_MakeOffset::MakeSolid () //======================================================================= void BRepOffset_MakeOffset::SelectShells () -{ +{ TopTools_MapOfShape FreeEdges; TopExp_Explorer exp(myShape,TopAbs_EDGE); //------------------------------------------------------------- @@ -4132,6 +3436,9 @@ void CorrectSolid(TopoDS_Solid& theSol, TopTools_ListOfShape& theSolList) aVols.Append(aVProps.Mass()); } // + if (Abs(anOuterVol) < Precision::Confusion()) { + return; + } if(anOuterVol < 0.) { anOuterShell.Reverse(); @@ -4433,466 +3740,439 @@ void RemoveShapes(TopoDS_Shape& theS, } //======================================================================= -//function : SortFaces -//purpose : +//function : UpdateHistory +//purpose : Updates the history information //======================================================================= -void SortFaces(const TopTools_ListOfShape& theLIm, - TopTools_ListOfShape& theLFImages, - const Standard_Boolean bKeepFirst) +void UpdateHistory(const TopTools_ListOfShape& theLF, + BOPAlgo_Builder& theGF, + BRepAlgo_Image& theImage) { - Standard_Integer bKeep; // 1 - keep; -1 - remove - Standard_Boolean bFlag, bProceeded; - TopTools_IndexedDataMapOfShapeListOfShape aDMELF; - TopTools_ListOfShape aLFKeep, aLFLeft, aLFTmp; - TopTools_MapOfShape aMV; - TopTools_ListIteratorOfListOfShape aItLF; - TopExp_Explorer aExp; - // - aLFLeft = theLIm; - // - bKeep = bKeepFirst ? 1 : -1; - for (;;) { - aLFTmp = aLFLeft; - // - aLFLeft.Clear(); - aLFKeep.Clear(); - aDMELF.Clear(); - bProceeded = Standard_False; - // - // map list of images edge - faces - aItLF.Initialize(aLFTmp); - for (; aItLF.More(); aItLF.Next()) { - const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLF.Value(); - TopExp::MapShapesAndAncestors(aFIm, TopAbs_EDGE, TopAbs_FACE, aDMELF); - } - // - // find images that have edge attached to only one face - aItLF.Initialize(aLFTmp); - for (; aItLF.More(); aItLF.Next()) { - const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLF.Value(); - aExp.Init(aFIm, TopAbs_EDGE); - for (bFlag = Standard_False; aExp.More(); aExp.Next()) { - const TopoDS_Edge& aE = *(TopoDS_Edge*)&aExp.Current(); - const TopTools_ListOfShape& aLEF = aDMELF.FindFromKey(aE); - if (aLEF.Extent() == 1) { - TopoDS_Vertex aV1, aV2; - TopExp::Vertices(aE, aV1, aV2); - aMV.Add(aV1); - aMV.Add(aV2); - // - bFlag = Standard_True; - } - } - // - if (bFlag) { - aLFKeep.Append(aFIm); - bProceeded = Standard_True; + TopTools_ListIteratorOfListOfShape aIt(theLF); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aF = aIt.Value(); + const TopTools_ListOfShape& aLFIm = theGF.Modified(aF); + if (aLFIm.Extent()) { + if (theImage.HasImage(aF)) { + theImage.Add(aF, aLFIm); } else { - aLFLeft.Append(aFIm); + theImage.Bind(aF, aLFIm); } } - // - // map shapes left for processing - aDMELF.Clear(); - aLFTmp = aLFLeft; - aLFLeft.Clear(); - // - aItLF.Initialize(aLFTmp); - for (; aItLF.More(); aItLF.Next()) { - const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLF.Value(); - TopExp::MapShapesAndAncestors(aFIm, TopAbs_EDGE, TopAbs_FACE, aDMELF); - } - // - // find outer edges and check if they touch the first part of edges - aItLF.Initialize(aLFTmp); - for (; aItLF.More(); aItLF.Next()) { - const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLF.Value(); - aExp.Init(aFIm, TopAbs_EDGE); - for (bFlag = Standard_False; aExp.More() && !bFlag; aExp.Next()) { - const TopoDS_Edge& aE = *(TopoDS_Edge*)&aExp.Current(); - const TopTools_ListOfShape& aLEF = aDMELF.FindFromKey(aE); - if (aLEF.Extent() == 1) { - TopoDS_Vertex aV1, aV2; - TopExp::Vertices(aE, aV1, aV2); - // - bFlag = aMV.Contains(aV1) || aMV.Contains(aV2); - } - } - // - if (bFlag) { - aLFKeep.Append(aFIm); - bProceeded = Standard_True; - } - else { - aLFLeft.Append(aFIm); - } - } - // - if (bKeep == 1) { - // aLFKeep should be kept - // aLFLeft left for further processing - aItLF.Initialize(aLFKeep); - for (; aItLF.More(); aItLF.Next()) { - const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLF.Value(); - theLFImages.Append(aFIm); - } - } - // - if (aLFLeft.IsEmpty()) { - break; - } - // - bKeep *= -1; - // - if (!bProceeded) { - break; - } } } //======================================================================= -//function : FindShape +//function : IntersectEdges //purpose : //======================================================================= -Standard_Boolean FindShape(const TopoDS_Shape& theSWhat, - const TopoDS_Shape& theSWhere, - TopoDS_Shape& theRes) +void BRepOffset_MakeOffset::IntersectEdges(const TopoDS_Shape& theShape, + BRepOffset_DataMapOfShapeOffset& theMapSF, + TopTools_DataMapOfShapeShape& theMES, + TopTools_DataMapOfShapeShape& theBuild, + Handle(BRepAlgo_AsDes)& theAsDes, + Handle(BRepAlgo_AsDes)& theAsDes2d) { - Standard_Boolean bFound = Standard_False; - TopAbs_ShapeEnum aType = theSWhat.ShapeType(); - TopExp_Explorer aExp(theSWhere, aType); + Standard_Real aTolF; + TopTools_IndexedDataMapOfShapeListOfShape aDMVV; + TopExp_Explorer aExp(theShape, TopAbs_FACE); + // intersect edges created from edges + TopTools_IndexedMapOfShape aMFV; for (; aExp.More(); aExp.Next()) { - const TopoDS_Shape& aS = aExp.Current(); - if (aS.IsSame(theSWhat)) { - theRes = aS; - bFound = Standard_True; - break; - } + const TopoDS_Face& aF = TopoDS::Face(aExp.Current()); + aTolF = BRep_Tool::Tolerance(aF); + BRepOffset_Inter2d::ConnexIntByInt + (aF, theMapSF(aF), theMES, theBuild, theAsDes2d, myOffset, aTolF, aMFV, aDMVV); } - return bFound; + // intersect edges created from vertices + Standard_Integer i, aNbF = aMFV.Extent(); + for (i = 1; i <= aNbF; ++i) { + const TopoDS_Face& aF = TopoDS::Face(aMFV(i)); + aTolF = BRep_Tool::Tolerance(aF); + BRepOffset_Inter2d::ConnexIntByIntInVert + (aF, theMapSF(aF), theMES, theBuild, theAsDes, theAsDes2d, aTolF, aDMVV); + } + // + // fuse vertices on edges + BRepOffset_Inter2d::FuseVertices(aDMVV, theAsDes2d); } //======================================================================= -//function : UpdateOrigins +//function : TrimEdges //purpose : //======================================================================= -void UpdateOrigins(TopTools_IndexedDataMapOfShapeListOfShape& theOrigins, - BOPAlgo_Builder& theGF) +void TrimEdges(const TopoDS_Shape& theShape, + const Standard_Real theOffset, + BRepOffset_DataMapOfShapeOffset& theMapSF, + TopTools_DataMapOfShapeShape& theMES, + TopTools_DataMapOfShapeShape& theBuild, + Handle(BRepAlgo_AsDes)& theAsDes, + Handle(BRepAlgo_AsDes)& theAsDes2d, + TopTools_IndexedMapOfShape& theNewEdges, + TopTools_DataMapOfShapeShape& theETrimEInf, + TopTools_DataMapOfShapeListOfShape& theEdgesOrigins) { - TopTools_ListOfShape aLSTmp; - TopTools_MapOfShape aMFence; - BOPCol_ListIteratorOfListOfShape aItA; - TopTools_ListIteratorOfListOfShape aIt, aIt1; + TopExp_Explorer Exp,Exp2,ExpC; + TopoDS_Shape NE; + TopoDS_Edge TNE; + TopoDS_Face NF; // - const BOPCol_ListOfShape& aLSU = theGF.Arguments(); - aItA.Initialize(aLSU); - for (; aItA.More(); aItA.Next()) { - const TopoDS_Shape& aS = aItA.Value(); - // - if (!theOrigins.Contains(aS)) { - continue; + for (Exp.Init(theShape,TopAbs_FACE) ; Exp.More(); Exp.Next()) { + const TopoDS_Face& FI = TopoDS::Face(Exp.Current()); + NF = theMapSF(FI).Face(); + if (theMES.IsBound(NF)) { + NF = TopoDS::Face(theMES(NF)); } // - const TopTools_ListOfShape& aLSIm = theGF.Modified(aS); - if (aLSIm.IsEmpty()) { - continue; - } + TopTools_MapOfShape View; + TopTools_IndexedMapOfShape VEmap; + Standard_Integer i, aNb; // - const TopTools_ListOfShape& aLS = theOrigins.FindFromKey(aS); - // - aIt.Initialize(aLSIm); - for (; aIt.More(); aIt.Next()) { - const TopoDS_Shape& aSIm = aIt.Value(); - // - if (!theOrigins.Contains(aSIm)) { - theOrigins.Add(aSIm, aLS); + TopExp::MapShapes(FI.Oriented(TopAbs_FORWARD), TopAbs_EDGE , VEmap); + TopExp::MapShapes(FI.Oriented(TopAbs_FORWARD), TopAbs_VERTEX, VEmap); + // + aNb = VEmap.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopoDS_Shape& aS = VEmap(i); + if (!View.Add(aS)) { continue; } // - aMFence.Clear(); - // - TopTools_ListOfShape& aLS1 = theOrigins.ChangeFromKey(aSIm); - aLSTmp.Assign(aLS1); - // - aLS1.Clear(); - aIt1.Initialize(aLSTmp); - for (; aIt1.More(); aIt1.Next()) { - const TopoDS_Shape& aS1 = aIt1.Value(); - if (aMFence.Add(aS1)) { - aLS1.Append(aS1); + if (theBuild.IsBound(aS)) { + NE = theBuild(aS); + // keep connection to original edges + ExpC.Init(NE, TopAbs_EDGE); + for (; ExpC.More(); ExpC.Next()) { + const TopoDS_Edge& NEC = TopoDS::Edge(ExpC.Current()); + TopTools_ListOfShape* pLEOr = theEdgesOrigins.ChangeSeek(NEC); + if (!pLEOr) { + pLEOr = theEdgesOrigins.Bound(NEC, TopTools_ListOfShape()); + } + AppendToList(*pLEOr, aS); + } + // trim edges + if (NE.ShapeType() == TopAbs_EDGE) { + if (theNewEdges.Add(NE)) { + TrimEdge (TopoDS::Edge(NE),theAsDes2d,theAsDes, theETrimEInf); + } + } + else { + //------------------------------------------------------------ + // The Intersections are on several edges. + // The pieces without intersections with neighbors + // are removed from AsDes. + //------------------------------------------------------------ + for (ExpC.Init(NE,TopAbs_EDGE); ExpC.More(); ExpC.Next()) { + TopoDS_Edge NEC = TopoDS::Edge(ExpC.Current()); + if (theNewEdges.Add(NEC)) { + if (!theAsDes2d->Descendant(NEC).IsEmpty()) { + TrimEdge (NEC,theAsDes2d, theAsDes, theETrimEInf); + } + else { + if (theAsDes->HasAscendant(NEC)) { + theAsDes->Remove(NEC); + } + } + } + } } } - // - aIt1.Initialize(aLS); - for (; aIt1.More(); aIt1.Next()) { - const TopoDS_Shape& aS1 = aIt1.Value(); - if (aMFence.Add(aS1)) { - aLS1.Append(aS1); + else { + if (aS.ShapeType() != TopAbs_EDGE) { + continue; } - } + // + NE = theMapSF(FI).Generated(aS); + //// modified by jgv, 19.12.03 for OCC4455 //// + NE.Orientation(aS.Orientation()); + // + TopTools_ListOfShape* pLEOr = theEdgesOrigins.ChangeSeek(NE); + if (!pLEOr) { + pLEOr = theEdgesOrigins.Bound(NE, TopTools_ListOfShape()); + } + AppendToList(*pLEOr, aS); + // + if (theMES.IsBound(NE)) { + NE = theMES(NE); + NE.Orientation(aS.Orientation()); + if (theNewEdges.Add(NE)) { + TrimEdge (TopoDS::Edge(NE), theAsDes2d, theAsDes, theETrimEInf); + } + } + else { + TopoDS_Edge& anEdge = TopoDS::Edge(NE); + BRepAdaptor_Curve aBAC(anEdge); + if (aBAC.GetType() == GeomAbs_Line) { + TopoDS_Edge aNewEdge; + BRepOffset_Inter2d::ExtentEdge(anEdge, aNewEdge, theOffset); + theETrimEInf.Bind(anEdge, aNewEdge); + } + } + theAsDes->Add(NF,NE); + } } } } //======================================================================= -//function : ProcessMicroEdge -//purpose : +//function : TrimEdge +//purpose : Trim the edge of the largest of descendants in AsDes2d. +// Order in AsDes two vertices that have trimmed the edge. //======================================================================= -Standard_Boolean ProcessMicroEdge(const TopoDS_Edge& theEdge, - const Handle(IntTools_Context)& theCtx) +void TrimEdge(TopoDS_Edge& NE, + const Handle(BRepAlgo_AsDes)& AsDes2d, + Handle(BRepAlgo_AsDes)& AsDes, + TopTools_DataMapOfShapeShape& theETrimEInf) { - TopoDS_Vertex aV1, aV2; - TopExp::Vertices(theEdge, aV1, aV2); - Standard_Boolean bNull = aV1.IsNull() || aV2.IsNull(); - if (bNull) { - return Standard_False; + TopoDS_Edge aSourceEdge; + TopoDS_Vertex V1,V2; + Standard_Real aT1, aT2; + // + TopExp::Vertices(NE, V1, V2); + BRep_Tool::Range(NE, aT1, aT2); + // + BOPTools_AlgoTools::MakeSplitEdge(NE, V1, aT1, V2, aT2, aSourceEdge); + // + // + Standard_Real aSameParTol = Precision::Confusion(); + + Standard_Real U = 0.; + Standard_Real UMin = Precision::Infinite(); + Standard_Real UMax = -UMin; + + const TopTools_ListOfShape& LE = AsDes2d->Descendant(NE); + // + Standard_Boolean bTrim = Standard_False; + // + if (LE.Extent() > 1) { + TopTools_ListIteratorOfListOfShape it (LE); + for (; it.More(); it.Next()) { + TopoDS_Vertex V = TopoDS::Vertex(it.Value()); + if (NE.Orientation() == TopAbs_REVERSED) + V.Reverse(); + //V.Orientation(TopAbs_INTERNAL); + if (!FindParameter(V, NE, U)) { + Standard_Real f, l; + Handle(Geom_Curve) theCurve = BRep_Tool::Curve(NE, f, l); + gp_Pnt thePoint = BRep_Tool::Pnt(V); + GeomAPI_ProjectPointOnCurve Projector(thePoint, theCurve); + if (Projector.NbPoints() == 0) + Standard_ConstructionError::Raise("BRepOffset_MakeOffset::TrimEdge no projection"); + U = Projector.LowerDistanceParameter(); + } + if (U < UMin) { + UMin = U; V1 = V; + } + if (U > UMax) { + UMax = U; V2 = V; + } + } + // + if (V1.IsNull() || V2.IsNull()) { + Standard_ConstructionError::Raise("BRepOffset_MakeOffset::TrimEdge"); + } + if (!V1.IsSame(V2)) { + NE.Free( Standard_True ); + BRep_Builder B; + TopAbs_Orientation Or = NE.Orientation(); + NE.Orientation(TopAbs_FORWARD); + TopoDS_Vertex VF,VL; + TopExp::Vertices (NE,VF,VL); + B.Remove(NE,VF); + B.Remove(NE,VL); + B.Add (NE,V1.Oriented(TopAbs_FORWARD)); + B.Add (NE,V2.Oriented(TopAbs_REVERSED)); + B.Range(NE,UMin,UMax); + NE.Orientation(Or); + AsDes->Add(NE,V1.Oriented(TopAbs_FORWARD)); + AsDes->Add(NE,V2.Oriented(TopAbs_REVERSED)); + BRepLib::SameParameter(NE, aSameParTol, Standard_True); + // + bTrim = Standard_True; + } } // - Standard_Boolean bMicro; - bMicro = BOPTools_AlgoTools::IsMicroEdge(theEdge, theCtx); - if (bMicro) { - BRepAdaptor_Curve aBAC(theEdge); + if (!bTrim) { + BRepAdaptor_Curve aBAC(NE); if (aBAC.GetType() == GeomAbs_Line) { - BRep_Builder aBB; - Standard_Real aLen = CPnts_AbscissaPoint::Length(aBAC); - // - aBB.UpdateVertex(aV1, aLen/2.); - aBB.UpdateVertex(aV2, aLen/2.); + if (AsDes->HasAscendant(NE)) { + AsDes->Remove(NE); + } + } + } + else + { + if (!theETrimEInf.IsBound(NE)) { + theETrimEInf.Bind(NE, aSourceEdge); } } - // - return bMicro; } //======================================================================= -//function : ComputeBiNormal +//function : GetEnlargedFaces //purpose : //======================================================================= -Standard_Boolean ComputeBiNormal(const TopoDS_Face& theF, - const TopoDS_Edge& theE, - gp_Dir& theDB) +void GetEnlargedFaces(const TopoDS_Shape& theShape, + const BRepOffset_DataMapOfShapeOffset& theMapSF, + const TopTools_DataMapOfShapeShape& theMES, + TopTools_DataMapOfShapeShape& theFacesOrigins, + BRepAlgo_Image& theImage, + TopTools_ListOfShape& theLSF) { - Standard_Boolean bDone = Standard_False; - Standard_Real aT1, aT2, aTm; + TopExp_Explorer aExp(theShape, TopAbs_FACE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& FI = aExp.Current(); + const TopoDS_Shape& OFI = theMapSF(FI).Face(); + if (theMES.IsBound(OFI)) { + const TopoDS_Face& aLocalFace = TopoDS::Face(theMES(OFI)); + theLSF.Append(aLocalFace); + theImage.SetRoot(aLocalFace); + // + theFacesOrigins.Bind(aLocalFace, FI); + } + } +} + +//======================================================================= +//function : BuildShellsCompleteInter +//purpose : Make the shells from list of faces using MakerVolume algorithm. +// In case there will be more than just one solid, it will be +// rebuilt using only outer faces. +//======================================================================= +Standard_Boolean BuildShellsCompleteInter(const BOPCol_ListOfShape& theLF, + const BOPCol_IndexedDataMapOfShapeListOfShape& theOrigins, + BRepAlgo_Image& theImage, + TopoDS_Shape& theShells) +{ + // make solids + BOPAlgo_MakerVolume aMV1; + aMV1.SetArguments(theLF); + // we need to intersect the faces to process the tangential faces + aMV1.SetIntersect(Standard_True); + aMV1.Perform(); // - const Handle(Geom2d_Curve)& aC2d = - BRep_Tool::CurveOnSurface(theE, theF, aT1, aT2); - if (aC2d.IsNull()) { + Standard_Boolean bDone = (aMV1.ErrorStatus() == 0); + if (!bDone) { return bDone; } // - gp_Pnt2d aP2dNear; - gp_Pnt aP, aPNear; + UpdateHistory(theLF, aMV1, theImage); // - const Handle(Geom_Curve)& aC3d = - BRep_Tool::Curve(theE, aT1, aT2); + const TopoDS_Shape& aResult1 = aMV1.Shape(); + if (aResult1.ShapeType() == TopAbs_SOLID) { + // result is the alone solid, nothing to do + return GetSubShapes(aResult1, TopAbs_SHELL, theShells); + } // - aTm = (aT1 + aT2) * 0.5; - aP = aC3d->Value(aTm); + // it is necessary to rebuild the solids, avoiding internal faces // - BOPTools_AlgoTools3D::PointNearEdge(theE, theF, aTm, 1.e-5, aP2dNear, aPNear); + // map faces to solids + TopTools_IndexedDataMapOfShapeListOfShape aDMFS; + TopExp::MapShapesAndAncestors(aResult1, TopAbs_FACE, TopAbs_SOLID, aDMFS); // - gp_Vec aVB(aP, aPNear); - theDB = gp_Dir(aVB); - return !bDone; -} - -//======================================================================= -//function : CheckBiNormals -//purpose : -//======================================================================= -Standard_Boolean CheckBiNormals - (const TopoDS_Face& aFIm, - const TopoDS_Face& aFOr, - const TopTools_IndexedDataMapOfShapeListOfShape& theOrigins, - const TopTools_MapOfShape& theMFence, - Standard_Boolean& bKeep, - Standard_Boolean& bRemove, - const Standard_Boolean RemoveInvalidFaces) -{ - bKeep = Standard_True; - bRemove = Standard_False; - - Standard_Boolean bChecked; - Standard_Integer aNbEdgesChecked; - Standard_Real anAngle; - TopTools_IndexedMapOfShape aMEInv; + Standard_Integer i, aNb = aDMFS.Extent(); + bDone = (aNb > 0); + if (!bDone) { + // unable to build any solid + return bDone; + } // - aNbEdgesChecked = 0; + // get faces attached to only one solid + BOPCol_ListOfShape aLF2; + for (i = 1; i <= aNb; ++i) { + const TopTools_ListOfShape& aLS = aDMFS(i); + if (aLS.Extent() == 1) { + const TopoDS_Shape& aF = aDMFS.FindKey(i); + aLF2.Append(aF); + } + } // - const TopoDS_Wire& aWIm = BRepTools::OuterWire(aFIm); - TopExp_Explorer aExp(aWIm, TopAbs_EDGE); + // make solids from the new list + BOPAlgo_MakerVolume aMV2; + aMV2.SetArguments(aLF2); + // no need to intersect this time + aMV2.SetIntersect(Standard_False); + aMV2.Perform(); + bDone = (aMV2.ErrorStatus() == 0); + if (!bDone) { + return bDone; + } + // + const TopoDS_Shape& aResult2 = aMV2.Shape(); + if (aResult2.ShapeType() == TopAbs_SOLID) { + return GetSubShapes(aResult2, TopAbs_SHELL, theShells); + } + // + TopExp_Explorer aExp(aResult2, TopAbs_FACE); + bDone = aExp.More(); + if (!bDone) { + return bDone; + } + // + // the result is non-manifold - resolve it comparing normals + // directions of the offset faces and original faces + BOPCol_ListOfShape aLF3; for (; aExp.More(); aExp.Next()) { - const TopoDS_Edge& aEIm = *(TopoDS_Edge*)&aExp.Current(); + const TopoDS_Face& aF = TopoDS::Face(aExp.Current()); // - if (BRep_Tool::Degenerated(aEIm)) { + // check orientation + if (!theOrigins.Contains(aF)) { + aLF3.Append(aF); continue; } // - if (!theOrigins.Contains(aEIm)) { - continue; - } - // - const TopTools_ListOfShape& aLEOr = theOrigins.FindFromKey(aEIm); - const TopoDS_Shape& aSOr = aLEOr.First(); - if (aSOr.ShapeType() != TopAbs_EDGE) { - continue; - } - // - if (aLEOr.Extent() > 1) { - TopTools_MapOfShape aME, aMV; - Standard_Integer aNbE, aNbV; - // - TopTools_ListIteratorOfListOfShape aItLS(aLEOr); - for (; aItLS.More(); aItLS.Next()) { - const TopoDS_Edge& aEOr = *(TopoDS_Edge*)&aItLS.Value(); - aME.Add(aEOr); - // - TopExp_Explorer aExpE(aEOr, TopAbs_VERTEX); - for (; aExpE.More(); aExpE.Next()) { - const TopoDS_Shape& aV = aExpE.Current(); - aMV.Add(aV); - } - } - // - aNbV = aMV.Extent(); - aNbE = aME.Extent(); - // - if ((aNbE > 1) && (aNbV == 2*aNbE)) { - continue; - } - } - // - if (!RemoveInvalidFaces) { - if (theMFence.Contains(aEIm)) { - bChecked = Standard_True; - bKeep = Standard_True; - bRemove = Standard_False; - return bChecked; - } - } - // - const TopoDS_Edge& aEOr = *(TopoDS_Edge*)&aLEOr.First(); - // - TopoDS_Edge aEOrF; - if (!FindShape(aEOr, aFOr, aEOrF)) { - continue; - } - // - // compute bi-normal for face aFIm on the edge aEIm - gp_Dir aDB1; - if (!ComputeBiNormal(aFIm, aEIm, aDB1)) { - continue; - } - // - // compute bi-normal for face aFOr on the edge aEOrF - gp_Dir aDB2; - if (!ComputeBiNormal(aFOr, aEOrF, aDB2)) { - continue; - } - // - ++aNbEdgesChecked; - // - anAngle = aDB1.Angle(aDB2); - if (Abs(anAngle - M_PI) < 1.e-4) { - aMEInv.Add(aEIm); - } - } - // - bChecked = (aNbEdgesChecked > 0); - if (!bChecked) { - return bChecked; - } - // - // decide whether to remove the split face or not - // - Standard_Integer aNb = aMEInv.Extent(); - if (aNb == 0) { - return bChecked; - } - // - if (aNb == aNbEdgesChecked) { - bKeep = Standard_False; - bRemove = Standard_True; - } - // - if (!bRemove) { - for (Standard_Integer i = 1; i <= aNb; ++i) { - const TopoDS_Shape& aE = aMEInv(i); - if (theMFence.Contains(aE)) { - bKeep = Standard_False; - bRemove = Standard_True; + const TopTools_ListOfShape& aLFOr = theOrigins.FindFromKey(aF); + TopTools_ListIteratorOfListOfShape aItLF(aLFOr); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Face& aFOr = TopoDS::Face(aItLF.Value()); + if (CheckNormals(aF, aFOr)) { + aLF3.Append(aF); break; } } } // - return bChecked; + // make solid from most outer faces with correct normal direction + BOPAlgo_MakerVolume aMV3; + aMV3.SetArguments(aLF3); + aMV3.SetIntersect(Standard_False); + aMV3.Perform(); + bDone = (aMV3.ErrorStatus() == 0); + if (!bDone) { + return bDone; + } + // + const TopoDS_Shape& aResult3 = aMV3.Shape(); + return GetSubShapes(aResult3, TopAbs_SHELL, theShells); } //======================================================================= -//function : CheckBiNormals +//function : GetSubShapes //purpose : //======================================================================= -void CheckBiNormals - (TopTools_ListOfShape& theLFImages, - const TopoDS_Face& theF, - const TopTools_IndexedDataMapOfShapeListOfShape& theOrigins, - TopTools_ListOfShape& theLFKeep, - const Standard_Boolean RemoveInvalidFaces) +Standard_Boolean GetSubShapes(const TopoDS_Shape& theShape, + const TopAbs_ShapeEnum theSSType, + TopoDS_Shape& theResult) { - Standard_Boolean bChecked, bKeep, bRem; - Standard_Integer i, aNb; - TopTools_ListOfShape aLFKeep; - TopTools_MapOfShape aMEToKeep; - TopTools_IndexedDataMapOfShapeListOfShape aDMELF; - TopTools_ListIteratorOfListOfShape aItLF; - // - // collect outer edges - aItLF.Initialize(theLFImages); - for (; aItLF.More(); aItLF.Next()) { - const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLF.Value(); - TopExp::MapShapesAndAncestors(aFIm, TopAbs_EDGE, TopAbs_FACE, aDMELF); + TopExp_Explorer aExp(theShape, theSSType); + if (!aExp.More()) { + return Standard_False; } // - aNb = aDMELF.Extent(); - for (i = 1; i <= aNb; ++i) { - const TopTools_ListOfShape& aLF = aDMELF(i); - if (aLF.Extent() == 1) { - const TopoDS_Shape& aE = aDMELF.FindKey(i); - aMEToKeep.Add(aE); - } - } + TopoDS_Compound aResult; + BRep_Builder().MakeCompound(aResult); // - const TopoDS_Face& aFOr = *(TopoDS_Face*)&theOrigins.FindFromKey(theF).First(); - // - aItLF.Initialize(theLFImages); - for (; aItLF.More(); ) { - const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLF.Value(); - // - bChecked = CheckBiNormals(aFIm, aFOr, theOrigins, aMEToKeep, bKeep, bRem, RemoveInvalidFaces); - // - if (bChecked) { - if (bRem) { - theLFImages.Remove(aItLF); - } - else { - if (bKeep) { - theLFKeep.Append(aFIm); - } - aItLF.Next(); - } - } - else { - aItLF.Next(); - } + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aSS = aExp.Current(); + BRep_Builder().Add(aResult, aSS); } + theResult = aResult; + return Standard_True; } //======================================================================= //function : CheckNormals -//purpose : +//purpose : Comparing normal directions of the faces //======================================================================= Standard_Boolean CheckNormals(const TopoDS_Face& theFIm, const TopoDS_Face& theFOr) @@ -4955,51 +4235,46 @@ Standard_Boolean CheckNormals(const TopoDS_Face& theFIm, return bIsCollinear; } +//======================================================================= +//function : IsPlanar +//purpose : Checks if all the faces of the shape are planes +//======================================================================= +Standard_Boolean IsPlanar(const TopoDS_Shape& theS) +{ + TopExp_Explorer aExp(theS, TopAbs_FACE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Face& aF = *(TopoDS_Face*)&aExp.Current(); + BRepAdaptor_Surface aBAS(aF, Standard_False); + if (aBAS.GetType() != GeomAbs_Plane) { + break; + } + } + return !aExp.More(); +} + //======================================================================= //function : IsSolid -//purpose : Check if the shape is solid +//purpose : Checks if the shape is solid //======================================================================= Standard_Boolean IsSolid(const TopoDS_Shape& theS) { TopExp_Explorer aExp(theS, TopAbs_SOLID); return aExp.More(); } - -//======================================================================= -//function : UpdateHistory -//purpose : Updates the history information -//======================================================================= -void UpdateHistory(const TopTools_ListOfShape& theLF, - BOPAlgo_Builder& theGF, - BRepAlgo_Image& theImage) -{ - TopTools_ListIteratorOfListOfShape aIt(theLF); - for (; aIt.More(); aIt.Next()) { - const TopoDS_Shape& aF = aIt.Value(); - const TopTools_ListOfShape& aLFIm = theGF.Modified(aF); - if (aLFIm.Extent()) { - if (theImage.HasImage(aF)) { - theImage.Add(aF, aLFIm); - } - else { - theImage.Bind(aF, aLFIm); - } - } - } -} //======================================================================= -//function : IsPlanar -//purpose : +//function : AppendToList +//purpose : Add to a list only unique elements //======================================================================= -Standard_Boolean IsPlanar(const TopoDS_Shape& theS) +void AppendToList(TopTools_ListOfShape& theList, + const TopoDS_Shape& theShape) { - Standard_Boolean bRet; - TopExp_Explorer aExp(theS, TopAbs_FACE); - for (bRet = Standard_True; aExp.More() && bRet; aExp.Next()) { - const TopoDS_Face& aF = *(TopoDS_Face*)&aExp.Current(); - BRepAdaptor_Surface aBAS(aF, Standard_False); - bRet = (aBAS.GetType() == GeomAbs_Plane); + TopTools_ListIteratorOfListOfShape aIt(theList); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aS = aIt.Value(); + if (aS.IsSame(theShape)) { + return; + } } - return bRet; + theList.Append(theShape); } diff --git a/src/BRepOffset/BRepOffset_MakeOffset.hxx b/src/BRepOffset/BRepOffset_MakeOffset.hxx index 4af6b24c05..1fca4d4a62 100644 --- a/src/BRepOffset/BRepOffset_MakeOffset.hxx +++ b/src/BRepOffset/BRepOffset_MakeOffset.hxx @@ -53,27 +53,25 @@ public: Standard_EXPORT BRepOffset_MakeOffset(); - Standard_EXPORT BRepOffset_MakeOffset(const TopoDS_Shape& S, - const Standard_Real Offset, - const Standard_Real Tol, - const BRepOffset_Mode Mode = BRepOffset_Skin, - const Standard_Boolean Intersection = Standard_False, - const Standard_Boolean SelfInter = Standard_False, - const GeomAbs_JoinType Join = GeomAbs_Arc, + Standard_EXPORT BRepOffset_MakeOffset(const TopoDS_Shape& S, + const Standard_Real Offset, + const Standard_Real Tol, + const BRepOffset_Mode Mode = BRepOffset_Skin, + const Standard_Boolean Intersection = Standard_False, + const Standard_Boolean SelfInter = Standard_False, + const GeomAbs_JoinType Join = GeomAbs_Arc, const Standard_Boolean Thickening = Standard_False, - const Standard_Boolean RemoveIntEdges = Standard_False, - const Standard_Boolean RemoveInvalidFaces = Standard_False); + const Standard_Boolean RemoveIntEdges = Standard_False); - Standard_EXPORT void Initialize (const TopoDS_Shape& S, - const Standard_Real Offset, - const Standard_Real Tol, - const BRepOffset_Mode Mode = BRepOffset_Skin, - const Standard_Boolean Intersection = Standard_False, - const Standard_Boolean SelfInter = Standard_False, - const GeomAbs_JoinType Join = GeomAbs_Arc, + Standard_EXPORT void Initialize (const TopoDS_Shape& S, + const Standard_Real Offset, + const Standard_Real Tol, + const BRepOffset_Mode Mode = BRepOffset_Skin, + const Standard_Boolean Intersection = Standard_False, + const Standard_Boolean SelfInter = Standard_False, + const GeomAbs_JoinType Join = GeomAbs_Arc, const Standard_Boolean Thickening = Standard_False, - const Standard_Boolean RemoveIntEdges = Standard_False, - const Standard_Boolean RemoveInvalidFaces = Standard_False); + const Standard_Boolean RemoveIntEdges = Standard_False); Standard_EXPORT void Clear(); @@ -129,20 +127,13 @@ protected: private: - Standard_EXPORT void BuildOffsetByArc(); Standard_EXPORT void BuildOffsetByInter(); - //! Building splits of the offset faces by the section curves - //! between the neighboring faces. - Standard_EXPORT void BuildSplitsOfFaces(const TopTools_ListOfShape& theLF, - const Handle(BRepAlgo_AsDes)& theAsDes, - TopTools_IndexedDataMapOfShapeListOfShape& theOrigins, - BRepAlgo_Image& theImage, - TopTools_ListOfShape& theLFailed, - const Standard_Boolean bLimited); - + //! Make Offset faces + Standard_EXPORT void MakeOffsetFaces(BRepOffset_DataMapOfShapeOffset& theMapSF); + Standard_EXPORT void SelfInter (TopTools_MapOfShape& Modif); Standard_EXPORT void Intersection3D (BRepOffset_Inter3d& Inter); @@ -177,7 +168,30 @@ private: //! Removes INTERNAL edges from the result Standard_EXPORT void RemoveInternalEdges(); + //! Intersects edges + Standard_EXPORT void IntersectEdges (const TopoDS_Shape& theShape, + BRepOffset_DataMapOfShapeOffset& theMapSF, + TopTools_DataMapOfShapeShape& theMES, + TopTools_DataMapOfShapeShape& theBuild, + Handle(BRepAlgo_AsDes)& theAsDes, + Handle(BRepAlgo_AsDes)& theAsDes2d); + //! Building of the splits of the offset faces for mode Complete + //! and joint type Intersection. This method is an advanced alternative + //! for BRepOffset_MakeLoops::Build method. + //! Currently the Complete intersection mode is limited to work only on planar cases. + Standard_EXPORT void BuildSplitsOfExtendedFaces(const TopTools_ListOfShape& theLF, + Handle(BRepAlgo_AsDes)& theAsDes, + TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + TopTools_DataMapOfShapeShape& theFacesOrigins, + TopTools_DataMapOfShapeShape& theETrimEInf, + BRepAlgo_Image& theImage); + + //! Building of the splits of the already trimmed offset faces for mode Complete + //! and joint type Intersection. + Standard_EXPORT void BuildSplitsOfTrimmedFaces(const TopTools_ListOfShape& theLF, + Handle(BRepAlgo_AsDes)& theAsDes, + BRepAlgo_Image& theImage); Standard_Real myOffset; Standard_Real myTol; @@ -188,7 +202,6 @@ private: GeomAbs_JoinType myJoin; Standard_Boolean myThickening; Standard_Boolean myRemoveIntEdges; - Standard_Boolean myRemoveInvalidFaces; TopTools_DataMapOfShapeReal myFaceOffset; TopTools_IndexedMapOfShape myFaces; BRepOffset_Analyse myAnalyse; diff --git a/src/BRepOffset/BRepOffset_MakeOffset_1.cxx b/src/BRepOffset/BRepOffset_MakeOffset_1.cxx new file mode 100644 index 0000000000..68e9b0d7e3 --- /dev/null +++ b/src/BRepOffset/BRepOffset_MakeOffset_1.cxx @@ -0,0 +1,5618 @@ +// Created on: 2016 +// Created by: Eugeny MALTCHIKOV +// Copyright (c) 2016 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + + +// This is the implementation of the extension of the 3D offset algorithm +// to work in mode Complete and Join Type Intersection. +// Currently only the Planar cases are supported. + + +#include + +#include +#include + +#include +#include + +#include +#include + +#include + +#include + +#include +#include + +#include + +#include + +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + + +static + void IntersectTrimmedEdges(const TopTools_ListOfShape& theLF, + const Handle(BRepAlgo_AsDes)& theAsDes, + TopTools_DataMapOfShapeListOfShape& theOEImages, + TopTools_DataMapOfShapeListOfShape& theOEOrigins, + TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + Handle(IntTools_Context)& theCtx, + TopTools_MapOfShape& theNewEdges, + TopTools_DataMapOfShapeShape& theETrimEInf); + +static + Standard_Boolean GetEdges(const TopoDS_Face& theFace, + const Handle(BRepAlgo_AsDes)& theAsDes, + const TopTools_DataMapOfShapeListOfShape& theEImages, + const TopTools_MapOfShape& theLastInvEdges, + const TopTools_IndexedMapOfShape& theInvEdges, + Handle(IntTools_Context)& theCtx, + const TopTools_MapOfShape& theModifiedEdges, + TopoDS_Shape& theEdges, + TopTools_IndexedMapOfShape& theInv); + +static + void BuildSplitsOfFace(const TopoDS_Face& theFace, + const TopoDS_Shape& theEdges, + Standard_Boolean bTrimmed, + TopTools_DataMapOfShapeShape& theOrigins, + TopTools_ListOfShape& theLFImages); + +static + void BuildSplitsOfFaces(const TopTools_ListOfShape& theLF, + const TopTools_MapOfShape& theModifiedEdges, + const TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + Handle(BRepAlgo_AsDes)& theAsDes, + TopTools_DataMapOfShapeShape& theFacesOrigins, + TopTools_DataMapOfShapeListOfShape& theOEImages, + TopTools_DataMapOfShapeListOfShape& theOEOrigins, + TopTools_MapOfShape& theLastInvEdges, + TopTools_IndexedMapOfShape& theEdgesToAvoid, + TopTools_IndexedMapOfShape& theInvEdges, + TopTools_IndexedMapOfShape& theValidEdges, + TopTools_MapOfShape& theInvertedEdges, + TopTools_DataMapOfShapeInteger& theAlreadyInvFaces, + TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, + TopTools_DataMapOfShapeShape& theArtInvFaces, + TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + TopoDS_Shape& theSolids, + TopTools_DataMapOfShapeListOfShape& theSSInterfs); + +static + void BuildSplitsOfInvFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild, + const TopTools_MapOfShape& theModifiedEdges, + TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + TopTools_DataMapOfShapeShape& theFacesOrigins, + TopTools_DataMapOfShapeListOfShape& theOEImages, + TopTools_DataMapOfShapeListOfShape& theOEOrigins, + TopTools_MapOfShape& theLastInvEdges, + TopTools_IndexedMapOfShape& theEdgesToAvoid, + TopTools_MapOfShape& theVertsToAvoid, + TopTools_DataMapOfShapeInteger& theAlreadyInvFaces, + TopTools_IndexedMapOfShape& theValidEdges, + TopTools_DataMapOfShapeShape& theETrimEInf, + Handle(BRepAlgo_AsDes)& theAsDes); + +static + Standard_Boolean CheckIfArtificial(const TopoDS_Shape& theF, + const TopTools_ListOfShape& theLFImages, + const TopoDS_Shape& theCE, + const TopTools_IndexedMapOfShape& theMapEInv, + const TopTools_DataMapOfShapeListOfShape& theOEImages, + TopTools_MapOfShape& theMENInv, + Handle(BRepAlgo_AsDes)& theAsDes); + +static + void FindInvalidEdges(const TopoDS_Face& theF, + const TopTools_ListOfShape& theLFImages, + const TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + const TopTools_DataMapOfShapeShape& theFacesOrigins, + const TopTools_DataMapOfShapeListOfShape& theOEImages, + const TopTools_DataMapOfShapeListOfShape& theOEOrigins, + TopTools_IndexedMapOfShape& theInvEdges, + TopTools_IndexedMapOfShape& theValidEdges, + TopTools_DataMapOfShapeListOfShape& theDMFLVE, + TopTools_DataMapOfShapeListOfShape& theDMFLNE, + TopTools_DataMapOfShapeListOfShape& theDMFLIE, + TopTools_DataMapOfShapeListOfShape& theDMFLVIE, + TopTools_MapOfShape& theMEInverted, + TopTools_MapOfShape& theEdgesInvalidByVertex); + +static + void FindInvalidFaces(TopTools_ListOfShape& theLFImages, + const TopTools_IndexedMapOfShape& theInvEdges, + const TopTools_IndexedMapOfShape& theValidEdges, + const TopTools_DataMapOfShapeListOfShape& theDMFLVE, + const TopTools_DataMapOfShapeListOfShape& theDMFLIE, + const TopTools_ListOfShape& theLENeutral, + const TopTools_ListOfShape& theLEValInverted, + const TopTools_MapOfShape& theMEInverted, + const TopTools_MapOfShape& theEdgesInvalidByVertex, + TopTools_ListOfShape& theInvFaces); + +static + gp_Vec GetAverageTangent(const TopoDS_Shape& theS, + const Standard_Integer theNbP); + +static + Standard_Boolean CheckInverted(const TopoDS_Edge& theEIm, + const TopoDS_Face& theFOr, + const TopTools_DataMapOfShapeListOfShape& theOEImages, + const TopTools_DataMapOfShapeListOfShape& theOEOrigins, + const TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + const TopTools_IndexedDataMapOfShapeListOfShape& theDMEF, + const TopTools_IndexedDataMapOfShapeListOfShape& theDMVE, + const TopTools_IndexedMapOfShape& theMEdges, + TopTools_MapOfShape& theMEInverted); + + +static + void RemoveInvalidSplitsByInvertedEdges(const TopTools_MapOfShape& theMEInverted, + TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, + TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + TopTools_IndexedMapOfShape& theMERemoved); + +static + void RemoveInvalidSplitsFromValid(const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, + const TopTools_DataMapOfShapeShape& theArtInvFaces, + const TopTools_MapOfShape& theMEInverted, + TopTools_IndexedDataMapOfShapeListOfShape& theFImages); + +static + void RemoveInsideFaces(TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, + const TopTools_DataMapOfShapeShape& theArtInvFaces, + const TopTools_IndexedMapOfShape& theInvEdges, + const TopTools_IndexedMapOfShape& theMFToCheckInt, + TopTools_DataMapOfShapeListOfShape& theSSInterfs, + TopTools_IndexedMapOfShape& theMERemoved, + TopoDS_Shape& theSolids); + +static + void ShapesConnections(const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, + const TopTools_IndexedMapOfShape& theInvEdges, + const TopTools_DataMapOfShapeShape& theDMFOr, + BOPAlgo_Builder& theBuilder, + TopTools_DataMapOfShapeListOfShape& theSSInterfs); + +static + void RemoveValidSplits(const TopTools_MapOfShape& theSpRem, + TopTools_IndexedDataMapOfShapeListOfShape& theImages, + BOPAlgo_Builder& theGF, + TopTools_IndexedMapOfShape& theMERemoved); + +static + void RemoveInvalidSplits(const TopTools_MapOfShape& theSpRem, + const TopTools_DataMapOfShapeShape& theArtInvFaces, + const TopTools_IndexedMapOfShape& theInvEdges, + TopTools_IndexedDataMapOfShapeListOfShape& theImages, + BOPAlgo_Builder& theGF, + TopTools_IndexedMapOfShape& theMERemoved); + +static + void FilterEdgesImages(const TopoDS_Shape& theS, + TopTools_DataMapOfShapeListOfShape& theOEImages, + TopTools_DataMapOfShapeListOfShape& theOEOrigins); + +static + void FilterInvalidFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + const TopTools_IndexedDataMapOfShapeListOfShape& theDMFE, + TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, + TopTools_DataMapOfShapeShape& theArtInvFaces); + +static + void FilterInvalidEdges(const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, + const TopTools_DataMapOfShapeShape& theArtInvFaces, + const TopTools_DataMapOfShapeListOfShape& theDMFLIE, + const TopTools_IndexedMapOfShape& theMERemoved, + TopTools_IndexedMapOfShape& theInvEdges); + +static + void FindFacesToRebuild(const TopTools_IndexedDataMapOfShapeListOfShape& theLFImages, + const TopTools_IndexedMapOfShape& theInvEdges, + const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, + const TopTools_DataMapOfShapeListOfShape& theSSInterfs, + TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild, + TopTools_MapOfShape& theFSelfRebAvoid); + +static + void RebuildFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild, + const TopTools_MapOfShape& theFSelfRebAvoid, + const TopoDS_Shape& theSolids, + const TopTools_DataMapOfShapeListOfShape& theSSInterfs, + TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + TopTools_DataMapOfShapeShape& theFacesOrigins, + TopTools_DataMapOfShapeListOfShape& theOEImages, + TopTools_DataMapOfShapeListOfShape& theOEOrigins, + TopTools_MapOfShape& theLastInvEdges, + TopTools_IndexedMapOfShape& theEdgesToAvoid, + TopTools_IndexedMapOfShape& theInvEdges, + TopTools_IndexedMapOfShape& theValidEdges, + const TopTools_MapOfShape& theInvertedEdges, + TopTools_DataMapOfShapeInteger& theAlreadyInvFaces, + TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, + const TopTools_DataMapOfShapeShape& theArtInvFaces, + TopTools_MapOfShape& theVertsToAvoid, + TopTools_DataMapOfShapeShape& theETrimEInf, + Handle(BRepAlgo_AsDes)& theAsDes); + +static + void IntersectFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild, + const TopTools_MapOfShape& theFSelfRebAvoid, + const TopoDS_Shape& theSolids, + const TopTools_DataMapOfShapeListOfShape& theSSInterfs, + TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + TopTools_DataMapOfShapeListOfShape& theOEImages, + TopTools_DataMapOfShapeListOfShape& theOEOrigins, + TopTools_IndexedMapOfShape& theInvEdges, + TopTools_IndexedMapOfShape& theValidEdges, + const TopTools_MapOfShape& theInvertedEdges, + TopTools_IndexedMapOfShape& theEdgesToAvoid, + TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, + const TopTools_DataMapOfShapeShape& theArtInvFaces, + TopTools_MapOfShape& theVertsToAvoid, + TopTools_DataMapOfShapeShape& theETrimEInf, + TopTools_MapOfShape& theModifiedEdges, + Handle(BRepAlgo_AsDes)& theAsDes); + +static + void PrepareFacesForIntersection(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild, + const TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, + const TopTools_DataMapOfShapeShape& theArtInvFaces, + const Standard_Boolean bLookVertToAvoid, + TopTools_IndexedDataMapOfShapeListOfShape& theFLE, + TopTools_DataMapOfShapeListOfShape& theMDone, + TopTools_DataMapOfShapeListOfShape& theDMSF, + TopTools_DataMapOfShapeListOfShape& theMEInfETrim, + TopTools_DataMapOfShapeListOfShape& theDMVEFull, + TopTools_DataMapOfShapeShape& theETrimEInf, + TopTools_IndexedDataMapOfShapeListOfShape& theDMEFInv); + +static + void FindVerticesToAvoid(const TopTools_IndexedDataMapOfShapeListOfShape& theDMEFInv, + const TopTools_IndexedMapOfShape& theInvEdges, + const TopTools_IndexedMapOfShape& theValidEdges, + TopTools_DataMapOfShapeListOfShape& theDMVEFull, + TopTools_MapOfShape& theMVRInv); + +static + void FindFacesForIntersection(const TopoDS_Shape& theFInv, + const TopTools_IndexedMapOfShape& theME, + const TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + const TopTools_DataMapOfShapeListOfShape& theDMSF, + const TopTools_MapOfShape& theMVInvAll, + const TopTools_DataMapOfShapeShape& theArtInvFaces, + const Standard_Boolean theArtCase, + const TopTools_DataMapOfShapeListOfShape& theSSInterfs, + TopTools_IndexedMapOfShape& theMFAvoid, + TopTools_IndexedMapOfShape& theMFInt, + TopTools_IndexedMapOfShape& theMFIntExt, + TopTools_ListOfShape& theLFImInt); + +static + void ProcessCommonEdges(const TopTools_ListOfShape& theLEC, + const TopTools_IndexedMapOfShape& theInvEdges, + const TopTools_IndexedMapOfShape& theValidEdges, + const TopTools_IndexedMapOfShape& theME, + const TopTools_DataMapOfShapeShape& theETrimEInf, + const TopTools_DataMapOfShapeListOfShape& theMEInfETrim, + const TopTools_DataMapOfShapeListOfShape& theOEOrigins, + const Standard_Boolean theForceUse, + TopTools_IndexedMapOfShape& theMECV, + TopTools_DataMapOfShapeListOfShape& theDMEETrim, + TopTools_ListOfShape& theLFEi, + TopTools_ListOfShape& theLFEj, + TopTools_IndexedMapOfShape& theMEToInt); + +static + void UpdateIntersectedFaces(const TopoDS_Shape& theFInv, + const TopoDS_Shape& theFi, + const TopoDS_Shape& theFj, + const TopTools_ListOfShape& theLFInv, + const TopTools_ListOfShape& theLFImi, + const TopTools_ListOfShape& theLFImj, + const TopTools_ListOfShape& theLFEi, + const TopTools_ListOfShape& theLFEj, + TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + TopTools_IndexedMapOfShape& theMEToInt); + +static + void IntersectFaces(const TopoDS_Shape& theFInv, + const TopoDS_Shape& theFi, + const TopoDS_Shape& theFj, + const TopTools_ListOfShape& theLFInv, + const TopTools_ListOfShape& theLFImi, + const TopTools_ListOfShape& theLFImj, + TopTools_ListOfShape& theLFEi, + TopTools_ListOfShape& theLFEj, + TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + TopTools_IndexedMapOfShape& theMECV, + TopTools_IndexedMapOfShape& theMEToInt); + +static + void FindOrigins(const TopTools_ListOfShape& theLFIm1, + const TopTools_ListOfShape& theLFIm2, + const TopTools_IndexedMapOfShape& theME, + const TopTools_DataMapOfShapeListOfShape& theOrigins, + TopTools_ListOfShape& theLEOr); + +static + void IntersectAndTrimEdges(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild, + const TopTools_IndexedMapOfShape& theMFInt, + const TopTools_IndexedMapOfShape& theMEInt, + const TopTools_DataMapOfShapeListOfShape& theDMEETrim, + const TopTools_IndexedMapOfShape& theMSInv, + const TopTools_IndexedMapOfShape& theMVE, + const TopTools_MapOfShape& theVertsToAvoid, + const TopTools_MapOfShape& theNewVertsToAvoid, + TopTools_MapOfShape& theMVBounds, + TopTools_DataMapOfShapeListOfShape& theEImages); + +static + void GetInvalidEdges(const TopTools_MapOfShape& theVertsToAvoid, + const TopTools_MapOfShape& theMVBounds, + BOPAlgo_Builder& theGF, + TopTools_MapOfShape& theMEInv); + +static + void UpdateValidEdges(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild, + const TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + const TopTools_IndexedDataMapOfShapeListOfShape& theFLE, + const TopTools_MapOfShape& theMVBounds, + const TopoDS_Shape& theSolids, + const TopTools_IndexedMapOfShape& theInvEdges, + const TopTools_MapOfShape& theInvertedEdges, + TopTools_IndexedMapOfShape& theEdgesToAvoid, + TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + TopTools_DataMapOfShapeListOfShape& theOEImages, + TopTools_DataMapOfShapeListOfShape& theOEOrigins, + TopTools_MapOfShape& theVertsToAvoid, + TopTools_DataMapOfShapeShape& theETrimEInf, + TopTools_DataMapOfShapeListOfShape& theEImages, + TopTools_DataMapOfShapeListOfShape& theEETrim, + TopTools_MapOfShape& theModifiedEdges, + Handle(BRepAlgo_AsDes)& theAsDes); + +static + void TrimNewIntersectionEdges(const TopTools_ListOfShape& theLE, + const TopTools_DataMapOfShapeListOfShape& theEETrim, + const TopTools_MapOfShape& theMVBounds, + TopTools_DataMapOfShapeListOfShape& theEImages, + TopTools_MapOfShape& theMEB, + TopTools_MapOfShape& theMVOld, + TopTools_ListOfShape& theLENew, + BOPCol_ListOfShape& theLA, + TopTools_DataMapOfShapeListOfShape& theDMEOr); + +static + void IntersectEdges(const BOPCol_ListOfShape& theLA, + const TopTools_ListOfShape& theLE, + const TopTools_ListOfShape& theLENew, + const TopTools_MapOfShape& theMVBounds, + const TopTools_MapOfShape& theVertsToAvoid, + TopTools_DataMapOfShapeListOfShape& theEImages, + TopTools_MapOfShape& theModifiedEdges, + TopTools_DataMapOfShapeListOfShape& theDMEOr, + TopTools_MapOfShape& theMENew, + TopoDS_Shape& theSplits); + +static + void GetBounds(const TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + const TopTools_MapOfShape& theMEB, + TopoDS_Shape& theBounds); + +static + void GetBoundsToUpdate(const TopTools_ListOfShape& theLF, + const TopTools_DataMapOfShapeListOfShape& theOEImages, + const TopTools_DataMapOfShapeListOfShape& theOEOrigins, + const TopTools_MapOfShape& theMEB, + TopTools_ListOfShape& theLABounds, + TopTools_ListOfShape& theLAValid, + TopoDS_Shape& theBounds, + Handle(BRepAlgo_AsDes)& theAsDes); + +static + void GetInvalidEdgesByBounds(const TopoDS_Shape& theSplits, + const TopoDS_Shape& theBounds, + const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild, + const TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + const TopoDS_Shape& theSolids, + const TopTools_IndexedMapOfShape& theInvEdges, + const TopTools_MapOfShape& theMVOld, + const TopTools_MapOfShape& theMENew, + const TopTools_DataMapOfShapeListOfShape& theDMEOr, + const TopTools_DataMapOfShapeListOfShape& theEImages, + TopTools_MapOfShape& theVertsToAvoid, + TopTools_MapOfShape& theMEInv); + +static + void UpdateNewIntersectionEdges(const TopTools_ListOfShape& theLE, + const TopTools_DataMapOfShapeListOfShape& theMELF, + const TopTools_DataMapOfShapeListOfShape& theEImages, + const TopTools_IndexedMapOfShape& theInvEdges, + const TopTools_MapOfShape& theInvertedEdges, + TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + TopTools_DataMapOfShapeListOfShape& theOEImages, + TopTools_DataMapOfShapeListOfShape& theOEOrigins, + TopTools_DataMapOfShapeShape& theETrimEInf, + TopTools_DataMapOfShapeListOfShape& theEETrim, + TopTools_MapOfShape& theModifiedEdges, + Handle(BRepAlgo_AsDes)& theAsDes); + +static + void FillHistory(const TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + const TopTools_DataMapOfShapeListOfShape& theEImages, + BRepAlgo_Image& theImage); + +static + void UpdateOrigins(const TopTools_ListOfShape& theLA, + TopTools_DataMapOfShapeListOfShape& theOrigins, + BOPAlgo_Builder& theGF); + +static + void UpdateImages(const TopTools_ListOfShape& theLA, + TopTools_DataMapOfShapeListOfShape& theImages, + BOPAlgo_Builder& theGF, + TopTools_MapOfShape& theModified); + +static + void UpdateIntersectedEdges(const TopTools_ListOfShape& theLA, + TopTools_DataMapOfShapeShape& theETrimEInf, + BOPAlgo_Builder& theGF); + +static + Standard_Boolean ProcessMicroEdge(const TopoDS_Edge& theEdge, + const Handle(IntTools_Context)& theCtx); + +static + void FindCommonParts(const TopTools_ListOfShape& theLS1, + const TopTools_ListOfShape& theLS2, + TopTools_ListOfShape& theLSC, + const TopAbs_ShapeEnum theType = TopAbs_EDGE); + +static + Standard_Integer NbPoints(const TopoDS_Edge& theE); + +static + Standard_Boolean FindShape(const TopoDS_Shape& theSWhat, + const TopoDS_Shape& theSWhere, + TopoDS_Shape& theRes); + +static + void AppendToList(TopTools_ListOfShape& theL, + const TopoDS_Shape& theS); + +//======================================================================= +//function : BuildSplitsOfTrimmedFaces +//purpose : Building splits of already trimmed faces +//======================================================================= +void BRepOffset_MakeOffset::BuildSplitsOfTrimmedFaces(const TopTools_ListOfShape& theLF, + Handle(BRepAlgo_AsDes)& theAsDes, + BRepAlgo_Image& theImage) +{ + TopTools_DataMapOfShapeListOfShape anEImages, anEOrigins; + TopTools_IndexedDataMapOfShapeListOfShape aDMFFIm; + TopTools_IndexedMapOfShape anEmptyIM; + TopTools_DataMapOfShapeListOfShape anEmptyDMSLS; + TopTools_DataMapOfShapeShape anEmptyDMSS; + TopTools_MapOfShape aNewEdges, anEmptyM; + // + // firstly it is necessary to fuse all the edges + Handle(IntTools_Context) aCtx = new IntTools_Context(); + // + IntersectTrimmedEdges(theLF, theAsDes, anEImages, anEOrigins, anEmptyDMSLS, aCtx, aNewEdges, anEmptyDMSS); + // + TopTools_ListIteratorOfListOfShape aItLF(theLF); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Face& aF = *(TopoDS_Face*)&aItLF.Value(); + // + TopoDS_Shape aCE; + TopTools_ListOfShape aLFImages; + // + Standard_Boolean bFound = GetEdges(aF, theAsDes, anEImages, anEmptyM, + anEmptyIM, aCtx, aNewEdges, aCE, anEmptyIM); + // split the face by the edges + if (!bFound) { + if (!theImage.HasImage(aF)) { + aLFImages.Append(aF); + aDMFFIm.Add(aF, aLFImages); + } + continue; + } + // + BuildSplitsOfFace(aF, aCE, Standard_True, anEmptyDMSS, aLFImages); + aDMFFIm.Add(aF, aLFImages); + } + // Fill history for faces and edges + FillHistory(aDMFFIm, anEImages, theImage); +} + +//======================================================================= +//function : BuildSplitsOfExtendedFaces +//purpose : Building splits of not-trimmed offset faces. +// For the cases in which invalidity will be found, +// these invalidities will be rebuilt. +//======================================================================= +void BRepOffset_MakeOffset::BuildSplitsOfExtendedFaces(const TopTools_ListOfShape& theLF, + Handle(BRepAlgo_AsDes)& theAsDes, + TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + TopTools_DataMapOfShapeShape& theFacesOrigins, + TopTools_DataMapOfShapeShape& theETrimEInf, + BRepAlgo_Image& theImage) +{ + Handle(IntTools_Context) aCtx = new IntTools_Context(); + // images and origins for offset edges + TopTools_DataMapOfShapeListOfShape anOEImages, anOEOrigins; + TopTools_MapOfShape aNewEdges; + // fusing all trimmed offset edges to avoid self-intersections in the splits + IntersectTrimmedEdges(theLF, theAsDes, anOEImages, anOEOrigins, + theEdgesOrigins, aCtx, aNewEdges, theETrimEInf); + // + // valid/invalid edges + TopTools_IndexedMapOfShape anInvEdges, aValidEdges, anEdgesToAvoid; + // inverted edges + TopTools_MapOfShape anInvertedEdges; + // splits of faces + TopTools_IndexedDataMapOfShapeListOfShape aFImages; + // found invalid faces + TopTools_IndexedDataMapOfShapeListOfShape anInvFaces; + // artificially invalid faces - it will be empty here, + // but may be filled on the following rebuilding steps + TopTools_DataMapOfShapeShape anArtInvFaces; + // shapes connections for using in rebuilding + TopTools_DataMapOfShapeListOfShape aSSInterfs; + // edges to avoid on second steps + TopTools_MapOfShape aLastInvEdges; + // keep information of already invalid faces to avoid + // infinite rebuilding of the same invalid face + TopTools_DataMapOfShapeInteger anAlreadyInvFaces; + // solid build from the new splits + TopoDS_Shape aSolids; + // now we can split the faces + BuildSplitsOfFaces(theLF, aNewEdges, theEdgesOrigins, theAsDes, theFacesOrigins, + anOEImages, anOEOrigins, aLastInvEdges, anEdgesToAvoid, anInvEdges, aValidEdges, + anInvertedEdges, anAlreadyInvFaces, anInvFaces, anArtInvFaces, aFImages, aSolids, aSSInterfs); + // + // Find faces to rebuild + if (anInvFaces.Extent()) { + TopTools_IndexedDataMapOfShapeListOfShape aFToRebuild; + TopTools_MapOfShape aFSelfRebAvoid; + FindFacesToRebuild(aFImages, anInvEdges, anInvFaces, aSSInterfs, aFToRebuild, aFSelfRebAvoid); + // + if (aFToRebuild.Extent()) { + // vertices to avoid + TopTools_MapOfShape aVAEmpty; + RebuildFaces(aFToRebuild, aFSelfRebAvoid, aSolids, aSSInterfs, aFImages, theEdgesOrigins, theFacesOrigins, + anOEImages, anOEOrigins, aLastInvEdges, anEdgesToAvoid, anInvEdges, aValidEdges, anInvertedEdges, + anAlreadyInvFaces, anInvFaces, anArtInvFaces, aVAEmpty, theETrimEInf, theAsDes); + } + } + // Fill history for faces and edges + FillHistory(aFImages, anOEImages, theImage); +} + +//======================================================================= +//function : BuildSplitsOfInvFaces +//purpose : Rebuilding splits of faces with new intersection edges +//======================================================================= +void BuildSplitsOfInvFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild, + const TopTools_MapOfShape& theModifiedEdges, + TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + TopTools_DataMapOfShapeShape& theFacesOrigins, + TopTools_DataMapOfShapeListOfShape& theOEImages, + TopTools_DataMapOfShapeListOfShape& theOEOrigins, + TopTools_MapOfShape& theLastInvEdges, + TopTools_IndexedMapOfShape& theEdgesToAvoid, + TopTools_MapOfShape& theVertsToAvoid, + TopTools_DataMapOfShapeInteger& theAlreadyInvFaces, + TopTools_IndexedMapOfShape& theValidEdges, + TopTools_DataMapOfShapeShape& theETrimEInf, + Handle(BRepAlgo_AsDes)& theAsDes) +{ + Standard_Integer aNb = theFToRebuild.Extent(); + if (!aNb) { + return; + } + // + TopTools_ListOfShape aLF; + aNb = theFImages.Extent(); + for (Standard_Integer i = 1; i <= aNb; ++i) { + const TopoDS_Shape& aF = theFImages.FindKey(i); + aLF.Append(aF); + } + // + // invalid faces + TopTools_IndexedDataMapOfShapeListOfShape anInvFaces; + // artificially invalid faces + TopTools_DataMapOfShapeShape anArtInvFaces; + // invalid edges + TopTools_IndexedMapOfShape anInvEdges; + // inverted edges + TopTools_MapOfShape anInvertedEdges; + // shapes connection for using in rebuilding process + TopTools_DataMapOfShapeListOfShape aSSInterfs; + // + TopoDS_Shape aSolids; + // + BuildSplitsOfFaces(aLF, theModifiedEdges, theEdgesOrigins, theAsDes, theFacesOrigins, + theOEImages, theOEOrigins, theLastInvEdges, theEdgesToAvoid, anInvEdges, theValidEdges, + anInvertedEdges, theAlreadyInvFaces, anInvFaces, anArtInvFaces, theFImages, aSolids, aSSInterfs); + // + if (anInvFaces.Extent()) { + TopTools_IndexedDataMapOfShapeListOfShape aFToRebuild; + TopTools_MapOfShape aFSelfRebAvoid; + FindFacesToRebuild(theFImages, anInvEdges, anInvFaces, aSSInterfs, aFToRebuild, aFSelfRebAvoid); + // + if (aFToRebuild.Extent()) { + RebuildFaces(aFToRebuild, aFSelfRebAvoid, aSolids, aSSInterfs, theFImages, theEdgesOrigins, theFacesOrigins, + theOEImages, theOEOrigins, theLastInvEdges, theEdgesToAvoid, anInvEdges, theValidEdges, anInvertedEdges, + theAlreadyInvFaces, anInvFaces, anArtInvFaces, theVertsToAvoid, theETrimEInf, theAsDes); + } + } +} + +//======================================================================= +//function : BuildSplitsOfFaces +//purpose : Building the splits of offset faces and +// looking for the invalid splits +//======================================================================= +void BuildSplitsOfFaces(const TopTools_ListOfShape& theLF, + const TopTools_MapOfShape& theModifiedEdges, + const TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + Handle(BRepAlgo_AsDes)& theAsDes, + TopTools_DataMapOfShapeShape& theFacesOrigins, + TopTools_DataMapOfShapeListOfShape& theOEImages, + TopTools_DataMapOfShapeListOfShape& theOEOrigins, + TopTools_MapOfShape& theLastInvEdges, + TopTools_IndexedMapOfShape& theEdgesToAvoid, + TopTools_IndexedMapOfShape& theInvEdges, + TopTools_IndexedMapOfShape& theValidEdges, + TopTools_MapOfShape& theInvertedEdges, + TopTools_DataMapOfShapeInteger& theAlreadyInvFaces, + TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, + TopTools_DataMapOfShapeShape& theArtInvFaces, + TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + TopoDS_Shape& theSolids, + TopTools_DataMapOfShapeListOfShape& theSSInterfs) +{ + if (theLF.IsEmpty()) { + return; + } + // + BRep_Builder aBB; + Standard_Integer i, aNb; + // + // processed faces + TopTools_ListOfShape aLFDone; + // extended face - list of neutral edges, i.e. in one splits - valid and in others - invalid + TopTools_DataMapOfShapeListOfShape aDMFLNE; + // list of valid edges for each face + TopTools_DataMapOfShapeListOfShape aDMFLVE; + // list of invalid edges for each face + TopTools_DataMapOfShapeListOfShape aDMFLIE; + // map of valid inverted edges for the face + TopTools_DataMapOfShapeListOfShape aDMFLVIE; + // map of splits to check for internals + TopTools_IndexedMapOfShape aMFToCheckInt; + // map of edges created from vertex and marked as invalid + TopTools_MapOfShape aMEdgeInvalidByVertex; + // + Handle(IntTools_Context) aCtx = new IntTools_Context; + // build splits of faces + TopTools_ListIteratorOfListOfShape aItLF(theLF); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Face& aF = *(TopoDS_Face*)&aItLF.Value(); + // + TopTools_ListOfShape* pLFIm = theFImages.ChangeSeek(aF); + if (pLFIm && pLFIm->IsEmpty()) { + continue; + } + // get edges by which the face should be split + TopoDS_Shape aCE; + TopTools_IndexedMapOfShape aMapEInv; + Standard_Boolean bFound = + GetEdges(aF, theAsDes, theOEImages, theLastInvEdges, + theEdgesToAvoid, aCtx, theModifiedEdges, aCE, aMapEInv); + if (!bFound) { + continue; + } + // + // build splits + TopTools_ListOfShape aLFImages; + BuildSplitsOfFace(aF, aCE, Standard_False, theFacesOrigins, aLFImages); + // + if (aMapEInv.Extent()) { + // check if all possible faces are built + TopTools_MapOfShape aMENInv; + Standard_Boolean bArtificialCase = aLFImages.IsEmpty() || + CheckIfArtificial(aF, aLFImages, aCE, aMapEInv, theOEImages, aMENInv, theAsDes); + // + // try to build splits using invalid edges + TopoDS_Compound aCE1; + aBB.MakeCompound(aCE1); + aBB.Add(aCE1, aCE); + for (i = 1; i <= aMapEInv.Extent(); ++i) { + aBB.Add(aCE1, aMapEInv(i)); + } + // + 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; + TopTools_ListIteratorOfListOfShape aItLFIm(aLFImages1); + for (; aItLFIm.More();) { + 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 (!aExpE.More()) { + if (bAllInv) { + aMFToCheckInt.Add(aFIm); + } + aLFImages1.Remove(aItLFIm); + } + else { + aItLFIm.Next(); + } + } + // + if (bArtificialCase) { + if (aLFImages.Extent() == aLFImages1.Extent()) { + bArtificialCase = Standard_False; + } + else { + aLFImages = aLFImages1; + } + } + // + if (bArtificialCase) { + TopTools_ListOfShape aLEInv; + // make the face invalid + theArtInvFaces.Bind(aF, aCE); + // + *pLFIm = aLFImages; + TopTools_ListIteratorOfListOfShape aItLFIm(aLFImages); + for (; aItLFIm.More(); aItLFIm.Next()) { + 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)) { + theInvEdges.Add(aE); + AppendToList(aLEInv, aE); + } + else { + theValidEdges.Add(aE); + } + } + } + // + aDMFLIE.Bind(aF, aLEInv); + aLFDone.Append(aF); + // + continue; + } + } + // + // find invalid edges + FindInvalidEdges(aF, aLFImages, theEdgesOrigins, theFacesOrigins, theOEImages, + theOEOrigins, theInvEdges, theValidEdges, aDMFLVE, aDMFLNE, aDMFLIE, + aDMFLVIE, theInvertedEdges, aMEdgeInvalidByVertex); + // + // save the new splits + if (!pLFIm) { + pLFIm = &theFImages(theFImages.Add(aF, TopTools_ListOfShape())); + } + else { + pLFIm->Clear(); + } + pLFIm->Append(aLFImages); + // + aLFDone.Append(aF); + } + // + if (theInvEdges.IsEmpty() && theArtInvFaces.IsEmpty()) { + return; + } + // +#ifdef OFFSET_DEBUG + // show invalid edges + TopoDS_Compound aCEInv1; + BRep_Builder().MakeCompound(aCEInv1); + Standard_Integer aNbEInv = theInvEdges.Extent(); + for (i = 1; i <= aNbEInv; ++i) { + const TopoDS_Shape& aE = theInvEdges(i); + BRep_Builder().Add(aCEInv1, aE); + } + // + TopoDS_Compound aCEVal1; + BRep_Builder().MakeCompound(aCEVal1); + aNbEInv = theValidEdges.Extent(); + for (i = 1; i <= aNbEInv; ++i) { + const TopoDS_Shape& aE = theValidEdges(i); + BRep_Builder().Add(aCEVal1, aE); + } +#endif + // + TopTools_ListOfShape anEmptyList; + // find invalid faces + // considering faces containing only invalid edges as invalid + aItLF.Initialize(aLFDone); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Shape& aF = aItLF.Value(); + TopTools_ListOfShape& aLFImages = theFImages.ChangeFromKey(aF); + // + TopTools_ListOfShape aLFInv; + Standard_Boolean bArtificialCase = theArtInvFaces.IsBound(aF); + if (bArtificialCase) { + aLFInv = aLFImages; + } + else { + // neutral edges + TopTools_ListOfShape* pLNE = aDMFLNE.ChangeSeek(aF); + if (!pLNE) { + pLNE = &anEmptyList; + } + // valid inverted edges + TopTools_ListOfShape* pLIVE = aDMFLVIE.ChangeSeek(aF); + if (!pLIVE) { + pLIVE = &anEmptyList; + } + // + FindInvalidFaces(aLFImages, theInvEdges, theValidEdges, aDMFLVE, aDMFLIE, + *pLNE, *pLIVE, theInvertedEdges, aMEdgeInvalidByVertex, aLFInv); + } + // + if (aLFInv.Extent()) { + if (theAlreadyInvFaces.IsBound(aF)) { + if (theAlreadyInvFaces.Find(aF) > 2) { + if (aLFInv.Extent() == aLFImages.Extent() && !bArtificialCase) { + aLFImages.Clear(); + } + // + aLFInv.Clear(); + } + } + theInvFaces.Add(aF, aLFInv); + } + } + // + if (theInvFaces.IsEmpty()) { + theInvEdges.Clear(); + return; + } + // +#ifdef OFFSET_DEBUG + // show invalid faces + TopoDS_Compound aCFInv1; + BRep_Builder().MakeCompound(aCFInv1); + Standard_Integer aNbFInv = theInvFaces.Extent(); + for (i = 1; i <= aNbFInv; ++i) { + const TopTools_ListOfShape& aLFInv = theInvFaces(i); + TopTools_ListIteratorOfListOfShape aItLFInv(aLFInv); + for (; aItLFInv.More(); aItLFInv.Next()) { + const TopoDS_Shape& aFIm = aItLFInv.Value(); + BRep_Builder().Add(aCFInv1, aFIm); + } + } +#endif + // + TopTools_IndexedMapOfShape aMERemoved; + // remove invalid splits of faces using inverted edges + RemoveInvalidSplitsByInvertedEdges(theInvertedEdges, theInvFaces, theFImages, aMERemoved); + if (theInvFaces.IsEmpty()) { + theInvEdges.Clear(); + return; + } + // + // remove invalid splits from valid splits + RemoveInvalidSplitsFromValid(theInvFaces, theArtInvFaces, theInvertedEdges, theFImages); + // + // remove inside faces + RemoveInsideFaces(theFImages, theInvFaces, theArtInvFaces, + theInvEdges, aMFToCheckInt, theSSInterfs, aMERemoved, theSolids); + // + // make compound of valid splits + TopoDS_Compound aCFIm; + aBB.MakeCompound(aCFIm); + // + aNb = theFImages.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopTools_ListOfShape& aLFIm = theFImages(i); + aItLF.Initialize(aLFIm); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Shape& aFIm = aItLF.Value(); + aBB.Add(aCFIm, aFIm); + } + } + // + TopTools_IndexedDataMapOfShapeListOfShape aDMFE; + TopExp::MapShapesAndAncestors(aCFIm, TopAbs_EDGE, TopAbs_FACE, aDMFE); + // + // filter maps of images and origins + FilterEdgesImages(aCFIm, theOEImages, theOEOrigins); + // + // filter invalid faces + FilterInvalidFaces(theFImages, aDMFE, theInvFaces, theArtInvFaces); + aNb = theInvFaces.Extent(); + if (!aNb) { + theInvEdges.Clear(); + return; + } + // +#ifdef OFFSET_DEBUG + // show invalid faces + TopoDS_Compound aCFInv; + BRep_Builder().MakeCompound(aCFInv); + aNbFInv = theInvFaces.Extent(); + for (i = 1; i <= aNbFInv; ++i) { + const TopTools_ListOfShape& aLFInv = theInvFaces(i); + TopTools_ListIteratorOfListOfShape aItLFInv(aLFInv); + for (; aItLFInv.More(); aItLFInv.Next()) { + const TopoDS_Shape& aFIm = aItLFInv.Value(); + BRep_Builder().Add(aCFInv, aFIm); + } + } +#endif + // + // filter invalid edges + FilterInvalidEdges(theInvFaces, theArtInvFaces, aDMFLIE, aMERemoved, theInvEdges); + // +#ifdef OFFSET_DEBUG + // show invalid edges + TopoDS_Compound aCEInv; + BRep_Builder().MakeCompound(aCEInv); + aNbEInv = theInvEdges.Extent(); + for (i = 1; i <= aNbEInv; ++i) { + const TopoDS_Shape& aE = theInvEdges(i); + BRep_Builder().Add(aCEInv, aE); + } +#endif + // + theLastInvEdges.Clear(); + aNb = theInvEdges.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopoDS_Shape& aE = theInvEdges(i); + theEdgesToAvoid.Add(aE); + theLastInvEdges.Add(aE); + } + // + aNb = theInvFaces.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopoDS_Shape& aF = theInvFaces.FindKey(i); + if (theAlreadyInvFaces.IsBound(aF)) { + theAlreadyInvFaces.ChangeFind(aF)++; + } + else { + theAlreadyInvFaces.Bind(aF, 1); + } + } +} + +//======================================================================= +//function : IntersectTrimmedEdges +//purpose : Intersection of the trimmed edges among themselves +//======================================================================= +void IntersectTrimmedEdges(const TopTools_ListOfShape& theLF, + const Handle(BRepAlgo_AsDes)& theAsDes, + TopTools_DataMapOfShapeListOfShape& theOEImages, + TopTools_DataMapOfShapeListOfShape& theOEOrigins, + TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + Handle(IntTools_Context)& theCtx, + TopTools_MapOfShape& theNewEdges, + TopTools_DataMapOfShapeShape& theETrimEInf) +{ + if (theLF.IsEmpty()) { + return; + } + // + // get edges to intersect from descendants of the offset faces + BOPCol_ListOfShape aLS; + // + TopTools_ListIteratorOfListOfShape aItLF(theLF); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Face& aF = *(TopoDS_Face*)&aItLF.Value(); + // + const TopTools_ListOfShape& aLE = theAsDes->Descendant(aF); + TopTools_ListIteratorOfListOfShape aItLE(aLE); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Edge& aE = *(TopoDS_Edge*)&aItLE.Value(); + // + if (ProcessMicroEdge(aE, theCtx)) { + continue; + } + // + if (theNewEdges.Add(aE)) { + aLS.Append(aE); + } + } + } + // + if (aLS.Extent() < 2) { + // nothing to intersect + return; + } + // + // perform intersection of the edges + BOPAlgo_Builder aGFE; + aGFE.SetArguments(aLS); + aGFE.Perform(); + if (aGFE.ErrorStatus()) { + return; + } + // + TopTools_ListOfShape aLA; + // fill map with edges images + BOPCol_ListIteratorOfListOfShape aIt(aLS); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aE = aIt.Value(); + const TopTools_ListOfShape& aLEIm = aGFE.Modified(aE); + if (aLEIm.IsEmpty()) { + continue; + } + // + aLA.Append(aE); + // save images + theOEImages.Bind(aE, aLEIm); + // save origins + TopTools_ListIteratorOfListOfShape aItLE(aLEIm); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Shape& aEIm = aItLE.Value(); + TopTools_ListOfShape* pLEOr = theOEOrigins.ChangeSeek(aEIm); + if (!pLEOr) { + pLEOr = theOEOrigins.Bound(aEIm, TopTools_ListOfShape()); + } + AppendToList(*pLEOr, aE); + } + } + // + UpdateOrigins(aLA, theEdgesOrigins, aGFE); + UpdateIntersectedEdges(aLA, theETrimEInf, aGFE); +} + +//======================================================================= +//function : GetEdges +//purpose : Getting edges from AsDes map to build the splits of faces +//======================================================================= +Standard_Boolean GetEdges(const TopoDS_Face& theFace, + const Handle(BRepAlgo_AsDes)& theAsDes, + const TopTools_DataMapOfShapeListOfShape& theEImages, + const TopTools_MapOfShape& theLastInvEdges, + const TopTools_IndexedMapOfShape& theInvEdges, + Handle(IntTools_Context)& theCtx, + const TopTools_MapOfShape& theModifiedEdges, + TopoDS_Shape& theEdges, + TopTools_IndexedMapOfShape& theInv) +{ + // get boundary edges + TopTools_MapOfShape aMFBounds; + TopExp_Explorer aExp(theFace, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aE = aExp.Current(); + const TopTools_ListOfShape* pLEIm = theEImages.Seek(aE); + if (!pLEIm) { + aMFBounds.Add(aE); + } + else { + TopTools_ListIteratorOfListOfShape aItLE(*pLEIm); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Shape& aEIm = aItLE.Value(); + aMFBounds.Add(aEIm); + } + } + } + // + BRep_Builder aBB; + Standard_Boolean bFound(Standard_False), bUpdate(Standard_False); + // the resulting edges + TopoDS_Compound anEdges; + aBB.MakeCompound(anEdges); + // + // the edges by which the offset face should be split + const TopTools_ListOfShape& aLE = theAsDes->Descendant(theFace); + TopTools_ListIteratorOfListOfShape aItLE(aLE); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Edge& aE = TopoDS::Edge(aItLE.Value()); + // + if (!bUpdate) { + bUpdate = theModifiedEdges.Contains(aE); + } + // + const TopTools_ListOfShape* pLEIm = theEImages.Seek(aE); + if (pLEIm) { + TopTools_ListIteratorOfListOfShape aItLEIm(*pLEIm); + for (; aItLEIm.More(); aItLEIm.Next()) { + const TopoDS_Edge& aEIm = TopoDS::Edge(aItLEIm.Value()); + // + if (theInvEdges.Contains(aEIm)) { + theInv.Add(aEIm); + if (!bUpdate) { + bUpdate = theLastInvEdges.Contains(aEIm); + } + continue; + } + // check for micro edge + if (ProcessMicroEdge(aEIm, theCtx)) { + continue; + } + // + aBB.Add(anEdges, aEIm); + if (!bFound) { + bFound = !aMFBounds.Contains(aEIm); + } + // + if (!bUpdate) { + bUpdate = theModifiedEdges.Contains(aEIm); + } + } + } + else { + if (theInvEdges.Contains(aE)) { + theInv.Add(aE); + if (!bUpdate) { + bUpdate = theLastInvEdges.Contains(aE); + } + continue; + } + // + if (ProcessMicroEdge(aE, theCtx)) { + continue; + } + aBB.Add(anEdges, aE); + if (!bFound) { + bFound = !aMFBounds.Contains(aE); + } + } + } + // + theEdges = anEdges; + return bFound && bUpdate; +} + +//======================================================================= +//function : BuildSplitsOfFace +//purpose : Building the splits of offset face +//======================================================================= +void BuildSplitsOfFace(const TopoDS_Face& theFace, + const TopoDS_Shape& theEdges, + Standard_Boolean bTrimmed, + TopTools_DataMapOfShapeShape& theFacesOrigins, + TopTools_ListOfShape& theLFImages) +{ + BOPAlgo_Builder aGF; + // + aGF.AddArgument(theFace); + aGF.AddArgument(theEdges); + aGF.Perform(); + if (aGF.ErrorStatus()) { + return; + } + // + // splits of the offset shape + theLFImages = aGF.Modified(theFace); + if (theLFImages.IsEmpty()) { + return; + } + // + if (!bTrimmed) { + // get the real splits of faces by removing the faces + // containing boundaries of the extended faces + + // get edges to map + TopTools_IndexedMapOfShape aME; + TopExp::MapShapes(theEdges, TopAbs_EDGE, aME); + // + TopTools_ListIteratorOfListOfShape aItLE(theLFImages); + for (; aItLE.More();) { + const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLE.Value(); + // + TopExp_Explorer aExp(aFIm, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Edge& aE = *(TopoDS_Edge*)&aExp.Current(); + if (!aME.Contains(aE)) { + break; + } + } + // + if (!aExp.More()) { + aItLE.Next(); + } + else { + theLFImages.Remove(aItLE); + } + } + } + // update origins + TopTools_ListIteratorOfListOfShape aIt(theLFImages); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aFIm = aIt.Value(); + theFacesOrigins.Bind(aFIm, theFace); + } +} + +//======================================================================= +//function : CheckIfArtificial +//purpose : Checks if the face is artificially invalid +//======================================================================= +Standard_Boolean CheckIfArtificial(const TopoDS_Shape& theF, + const TopTools_ListOfShape& theLFImages, + const TopoDS_Shape& theCE, + const TopTools_IndexedMapOfShape& theMapEInv, + const TopTools_DataMapOfShapeListOfShape& theOEImages, + TopTools_MapOfShape& theMENInv, + Handle(BRepAlgo_AsDes)& theAsDes) +{ + // all boundary edges should be used + TopTools_IndexedMapOfShape aMEUsed; + TopTools_ListIteratorOfListOfShape aItLFIm(theLFImages); + for (; aItLFIm.More(); aItLFIm.Next()) { + const TopoDS_Shape& aFIm = aItLFIm.Value(); + TopExp::MapShapes(aFIm, TopAbs_EDGE, aMEUsed); + TopExp::MapShapes(aFIm, TopAbs_VERTEX, aMEUsed); + } + // + TopTools_IndexedDataMapOfShapeListOfShape aMVE; + TopExp::MapShapesAndAncestors(theCE, TopAbs_VERTEX, TopAbs_EDGE, aMVE); + // + Standard_Integer i, aNb = theMapEInv.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopoDS_Shape& aEInv = theMapEInv(i); + 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); + for (; aItLEInv.More(); aItLEInv.Next()) { + const TopoDS_Shape& aENInv = aItLEInv.Value(); + theMENInv.Add(aENInv); + } + } + } + } + // + if (theMENInv.IsEmpty()) { + return Standard_False; + } + // + TopTools_IndexedMapOfShape aMEFound; + TopExp::MapShapes(theCE, TopAbs_EDGE, aMEFound); + // + const TopTools_ListOfShape& aLE = theAsDes->Descendant(theF); + TopTools_ListIteratorOfListOfShape aItLE(aLE); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Edge& aE = TopoDS::Edge(aItLE.Value()); + // + if (theOEImages.IsBound(aE)) { + Standard_Boolean bChecked = Standard_False; + const TopTools_ListOfShape& aLEIm = theOEImages.Find(aE); + TopTools_ListIteratorOfListOfShape aItLEIm(aLEIm); + for (; aItLEIm.More(); aItLEIm.Next()) { + const TopoDS_Edge& aEIm = TopoDS::Edge(aItLEIm.Value()); + if (!aMEFound.Contains(aEIm) || theMENInv.Contains(aEIm)) { + continue; + } + // + bChecked = Standard_True; + if (aMEUsed.Contains(aEIm)) { + break; + } + } + // + if (bChecked && !aItLEIm.More()) { + break; + } + } + else { + if (aMEFound.Contains(aE) && !theMENInv.Contains(aE) && !aMEUsed.Contains(aE)) { + break; + } + } + } + // + return aItLE.More(); +} + +//======================================================================= +//function : FindInvalidEdges +//purpose : Looking for the invalid edges +//======================================================================= +void FindInvalidEdges(const TopoDS_Face& theF, + const TopTools_ListOfShape& theLFImages, + const TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + const TopTools_DataMapOfShapeShape& theFacesOrigins, + const TopTools_DataMapOfShapeListOfShape& theOEImages, + const TopTools_DataMapOfShapeListOfShape& theOEOrigins, + TopTools_IndexedMapOfShape& theInvEdges, + TopTools_IndexedMapOfShape& theValidEdges, + TopTools_DataMapOfShapeListOfShape& theDMFLVE, + TopTools_DataMapOfShapeListOfShape& theDMFLNE, + TopTools_DataMapOfShapeListOfShape& theDMFLIE, + TopTools_DataMapOfShapeListOfShape& theDMFLVIE, + TopTools_MapOfShape& theMEInverted, + TopTools_MapOfShape& theEdgesInvalidByVertex) +{ + // Edge is considered as invalid in the following cases: + // 1. Its orientation on the face has changed comparing to the originals edge and face; + // 2. The vertices of the edge have changed places comparing to the originals edge and face. + // + // The edges created from vertices, i.e. as intersection between two faces connected only + // by VERTEX, will also be checked on validity. For these edges the correct orientation will + // 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 + TopTools_IndexedMapOfShape aMEInv; + // valid edges + TopTools_MapOfShape aMEVal; + // internal edges + TopTools_MapOfShape aMEInt; + // + // maps for checking the inverted edges + TopTools_IndexedDataMapOfShapeListOfShape aDMVE, aDMEF; + TopTools_IndexedMapOfShape aMEdges; + // + TopTools_ListIteratorOfListOfShape aItLF(theLFImages); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLF.Value(); + // + TopExp_Explorer aExp(aFIm, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aE = aExp.Current(); + // keep all edges + aMEdges.Add(aE); + // + // keep connection from edges to faces + TopTools_ListOfShape* pLF = aDMEF.ChangeSeek(aE); + if (!pLF) { + pLF = &aDMEF(aDMEF.Add(aE, TopTools_ListOfShape())); + } + AppendToList(*pLF, aFIm); + // + // keep connection from vertices to edges + TopoDS_Iterator aItV(aE); + for (; aItV.More(); aItV.Next()) { + const TopoDS_Shape& aV = aItV.Value(); + // + TopTools_ListOfShape* pLE = aDMVE.ChangeSeek(aV); + if (!pLE) { + pLE = &aDMVE(aDMVE.Add(aV, TopTools_ListOfShape())); + } + AppendToList(*pLE, aE); + } + } + } + // + // the map will be used to find the edges on the original face + // adjacent to the same vertex. It will be filled at first necessity; + TopTools_IndexedDataMapOfShapeListOfShape aDMVEFOr; + // + aItLF.Initialize(theLFImages); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLF.Value(); + // + // valid edges for this split + TopTools_ListOfShape aLVE; + // invalid edges for this split + TopTools_ListOfShape aLIE; + // + TopExp_Explorer aExp(aFIm, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Edge& aEIm = *(TopoDS_Edge*)&aExp.Current(); + // + if (aEIm.Orientation() == TopAbs_INTERNAL) { + aMEInt.Add(aEIm); + continue; + } + // + if (!theEdgesOrigins.IsBound(aEIm)) { + continue; + } + // + const TopTools_ListOfShape& aLEOr = theEdgesOrigins.Find(aEIm); + if (aLEOr.IsEmpty()) { + continue; + } + // + Standard_Integer aNbVOr = 0; + TopTools_ListIteratorOfListOfShape aItLEO(aLEOr); + for (; aItLEO.More(); aItLEO.Next()) { + if (aItLEO.Value().ShapeType() == TopAbs_VERTEX) { + ++aNbVOr; + } + } + // + TopTools_MapOfShape aME, aMV; + Standard_Boolean bInvalid = Standard_False, bChecked = Standard_False; + Standard_Integer aNbP = NbPoints(aEIm); + aItLEO.Initialize(aLEOr); + for (; aItLEO.More(); aItLEO.Next()) { + const TopoDS_Shape& aSOr = aItLEO.Value(); + Standard_Boolean bVertex = (aSOr.ShapeType() == TopAbs_VERTEX); + // + TopoDS_Shape aEOrF; + if (bVertex) { + // for some cases it is impossible to check the validity of the edge + if (aNbVOr > 1) { + 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 + TopExp::MapShapesAndAncestors(aFOr, TopAbs_VERTEX, TopAbs_EDGE, aDMVEFOr); + } + // + TopTools_ListOfShape *pLEFOr = aDMVEFOr.ChangeSeek(aSOr); + if (pLEFOr) { + TopoDS_Compound aCEOr; + BRep_Builder().MakeCompound(aCEOr); + TopTools_ListIteratorOfListOfShape aItLEFOr(*pLEFOr); + for (; aItLEFOr.More(); aItLEFOr.Next()) { + const TopoDS_Shape& aEOr = aItLEFOr.Value(); + BRep_Builder().Add(aCEOr, aEOr); + } + aEOrF = aCEOr; + } + } + else { + FindShape(aSOr, aFOr, aEOrF); + } + // + if (aEOrF.IsNull()) { + // the edge has not been found + continue; + } + // + // Check orientations of the image edge and original edge. + // In case the 3d curves are having the same direction the orientations + // must be the same. Otherwise the orientations should also be different. + // + // get average tangent vector for each curve taking into account + // the orientations of the edges, i.e. the edge is reversed + // the vector is reversed as well + gp_Vec aVSum1 = GetAverageTangent(aEIm, aNbP); + gp_Vec aVSum2 = GetAverageTangent(aEOrF, aNbP); + // + aVSum1.Normalize(); + aVSum2.Normalize(); + // + Standard_Real aCos = aVSum1.Dot(aVSum2); + if (!bVertex) { + if (Abs(aCos) < 0.9999) { + continue; + } + // + aME.Add(aEOrF); + TopExp_Explorer aExpE(aEOrF, TopAbs_VERTEX); + for (; aExpE.More(); aExpE.Next()) { + const TopoDS_Shape& aV = aExpE.Current(); + aMV.Add(aV); + } + } + // + if (aCos < Precision::Confusion()) { + bInvalid = Standard_True; + if (bVertex) { + theEdgesInvalidByVertex.Add(aEIm); + } + } + bChecked = Standard_True; + } + // + if (!bChecked) { + continue; + } + // + Standard_Integer aNbE = aME.Extent(), aNbV = aMV.Extent(); + if ((aNbE > 1) && (aNbV == 2*aNbE)) { + continue; + } + // + if (bInvalid) { + theInvEdges.Add(aEIm); + aLIE.Append(aEIm); + aMEInv.Add(aEIm); + continue; + } + // + // check if the edge has been inverted + Standard_Boolean bInverted = CheckInverted(aEIm, aFOr, theOEImages, theOEOrigins, + theEdgesOrigins, aDMEF, aDMVE, aMEdges, theMEInverted); + // + if (!bInverted || !aNbVOr) { + theValidEdges.Add(aEIm); + aLVE.Append(aEIm); + aMEVal.Add(aEIm); + } + } + // + // valid edges + if (aLVE.Extent()) { + theDMFLVE.Bind(aFIm, aLVE); + } + // + // invalid edges + if (aLIE.Extent()) { + theDMFLIE.Bind(aFIm, aLIE); + } + } + // + // process invalid edges: + // check for the inverted edges + TopTools_ListOfShape aLVIE; + // fill neutral edges + TopTools_ListOfShape aLNE; + // + Standard_Integer i, aNbEInv = aMEInv.Extent(); + for (i = 1; i <= aNbEInv; ++i) { + const TopoDS_Shape& aEIm = aMEInv(i); + // + // neutral edges - on the splits of the same offset face + // it is valid for one split and invalid for other + if (aMEVal.Contains(aEIm)) { + aLNE.Append(aEIm); + continue; + } + // + // the inverted images of the origins of invalid edges should also be invalid + if (!theMEInverted.Contains(aEIm)) { + continue; + } + // + const TopTools_ListOfShape* pLOEOr = theOEOrigins.Seek(aEIm); + if (!pLOEOr) { + continue; + } + // + TopTools_ListIteratorOfListOfShape aItLOEOr(*pLOEOr); + for (; aItLOEOr.More(); aItLOEOr.Next()) { + const TopoDS_Shape& aOEOr = aItLOEOr.Value(); + const TopTools_ListOfShape& aLEIm1 = theOEImages.Find(aOEOr); + // + TopTools_ListIteratorOfListOfShape aItLEIm1(aLEIm1); + for (; aItLEIm1.More(); aItLEIm1.Next()) { + const TopoDS_Shape& aEIm1 = aItLEIm1.Value(); + if (aMEdges.Contains(aEIm1) && + !aMEInv.Contains(aEIm1) && !aMEInt.Contains(aEIm1) && + theMEInverted.Contains(aEIm1)) { + theInvEdges.Add(aEIm1); + aLVIE.Append(aEIm1); + } + } + } + } + // + if (aLNE.Extent()) { + theDMFLNE.Bind(theF, aLNE); + } + // + if (aLVIE.Extent()) { + theDMFLVIE.Bind(theF, aLVIE); + } +} + +//======================================================================= +//function : FindInvalidFaces +//purpose : Looking for the invalid faces by analyzing their invalid edges +//======================================================================= +void FindInvalidFaces(TopTools_ListOfShape& theLFImages, + const TopTools_IndexedMapOfShape& theInvEdges, + const TopTools_IndexedMapOfShape& theValidEdges, + const TopTools_DataMapOfShapeListOfShape& theDMFLVE, + const TopTools_DataMapOfShapeListOfShape& theDMFLIE, + const TopTools_ListOfShape& theLENeutral, + const TopTools_ListOfShape& theLEValInverted, + const TopTools_MapOfShape& theMEInverted, + const TopTools_MapOfShape& theEdgesInvalidByVertex, + TopTools_ListOfShape& theInvFaces) +{ + // The face should be considered as invalid in the following cases: + // 1. It has been reverted, i.e. at least two not connected edges + // have changed orientation (i.e. invalid). In this case all edges, + // should be invalid for that face, because edges have also been reverted; + // 2. All checked edges of the face are invalid for this face; + // The face should be removed from the splits in the following cases: + // 1. All checked edges of the face are invalid for this one, but valid for + // some other face in this list of splits. + // The face will be kept in the following cases: + // 1. Some of the edges are valid for this face. + Standard_Boolean bHasValid, bAllValid, bAllInvalid, bHasReallyInvalid, bAllInvNeutral; + Standard_Boolean bValid, bValidLoc, bInvalid, bInvalidLoc, bNeutral; + Standard_Integer i, aNbChecked; + // + // neutral edges + TopTools_MapOfShape aMEN; + TopTools_ListIteratorOfListOfShape aItLE(theLENeutral); + for (; aItLE.More(); aItLE.Next()) { + aMEN.Add(aItLE.Value()); + } + // + // valid inverted edges + TopTools_MapOfShape aMEValInverted; + aItLE.Initialize(theLEValInverted); + for (; aItLE.More(); aItLE.Next()) { + aMEValInverted.Add(aItLE.Value()); + } + // + Standard_Boolean bCheckInverted = (theLFImages.Extent() == 1); + // + // neutral edges to remove + TopTools_IndexedMapOfShape aMENRem; + // + // faces for post treat + TopTools_ListOfShape aLFPT; + // + TopTools_ListIteratorOfListOfShape aItLF(theLFImages); + for (; aItLF.More(); ) { + const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLF.Value(); + // + // valid edges for this split + TopTools_MapOfShape aMVE; + // invalid edges for this split + TopTools_MapOfShape aMIE; + // + for (i = 0; i < 2; ++i) { + TopTools_MapOfShape& aME = !i ? aMVE : aMIE; + const TopTools_ListOfShape* pLE = !i ? theDMFLVE.Seek(aFIm) : theDMFLIE.Seek(aFIm); + if (pLE) { + TopTools_ListIteratorOfListOfShape aItLE(*pLE); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Shape& aE = aItLE.Value(); + aME.Add(aE); + } + } + } + // + bHasValid = Standard_False; + bAllValid = Standard_True; + bAllInvalid = Standard_True; + bHasReallyInvalid = Standard_False; + bAllInvNeutral = Standard_True; + aNbChecked = 0; + // + const TopoDS_Wire& aWIm = BRepTools::OuterWire(aFIm); + TopExp_Explorer aExp(aWIm, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aEIm = aExp.Current(); + // + bValid = theValidEdges.Contains(aEIm); + bInvalid = theInvEdges.Contains(aEIm); + // + if (!bValid && !bInvalid) { + // edge has not been checked for some reason + continue; + } + // + ++aNbChecked; + // + bInvalidLoc = aMIE.Contains(aEIm); + bHasReallyInvalid = bInvalidLoc && !bValid && !theEdgesInvalidByVertex.Contains(aEIm); + if (bHasReallyInvalid) { + break; + } + // + bNeutral = aMEN.Contains(aEIm); + bValidLoc = aMVE.Contains(aEIm); + // + if (!bInvalid && bCheckInverted) { + bInvalid = theMEInverted.Contains(aEIm); + } + // + if (bValidLoc && (bNeutral || aMEValInverted.Contains(aEIm))) { + bHasValid = Standard_True; + } + // + bAllValid = bAllValid && bValidLoc; + bAllInvalid = bAllInvalid && bInvalid; + bAllInvNeutral = bAllInvNeutral && bAllInvalid && bNeutral; + } + // + if (!aNbChecked) { + aItLF.Next(); + continue; + } + // + if (!bHasReallyInvalid && (bAllInvNeutral && !bHasValid) && (aNbChecked > 1)) { + // remove edges from neutral + TopExp::MapShapes(aFIm, TopAbs_EDGE, aMENRem); + // remove face + theLFImages.Remove(aItLF); + continue; + } + // + if (bHasReallyInvalid || (bAllInvalid && + !(bHasValid || bAllValid) && + !(bAllInvNeutral && (aNbChecked == 1)))) { + theInvFaces.Append(aFIm); + } + // + if (!bAllInvNeutral) { + aLFPT.Append(aFIm); + } + else { + // remove edges from neutral + TopExp::MapShapes(aFIm, TopAbs_EDGE, aMENRem); + } + aItLF.Next(); + } + // + if (aLFPT.IsEmpty() || aMENRem.IsEmpty()) { + return; + } + // + Standard_Integer aNb = aMENRem.Extent(); + for (i = 1; i <= aNb; ++i) { + aMEN.Remove(aMENRem(i)); + } + // + // check the splits once more + aItLF.Initialize(aLFPT); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Face& aFIm = *(TopoDS_Face*)&aItLF.Value(); + // + // valid edges for this split + TopTools_MapOfShape aMVE; + const TopTools_ListOfShape* pLVE = theDMFLVE.Seek(aFIm); + if (pLVE) { + TopTools_ListIteratorOfListOfShape aItLE(*pLVE); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Shape& aE = aItLE.Value(); + aMVE.Add(aE); + } + } + // + bHasValid = Standard_False; + bAllValid = Standard_True; + bAllInvalid = Standard_True; + // + const TopoDS_Wire& aWIm = BRepTools::OuterWire(aFIm); + TopExp_Explorer aExp(aWIm, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aEIm = aExp.Current(); + // + bValid = theValidEdges.Contains(aEIm); + bInvalid = theInvEdges.Contains(aEIm); + bNeutral = aMEN.Contains(aEIm); + bValidLoc = aMVE.Contains(aEIm); + // + if (!bInvalid && bCheckInverted) { + bInvalid = theMEInverted.Contains(aEIm); + } + // + if (bValidLoc && (bNeutral || aMEValInverted.Contains(aEIm))) { + bHasValid = Standard_True; + } + // + bAllValid = bAllValid && bValidLoc; + bAllInvalid = bAllInvalid && bInvalid; + } + // + if (bAllInvalid && !bHasValid && !bAllValid) { + theInvFaces.Append(aFIm); + } + } +} + +//======================================================================= +//function : GetAverageTangent +//purpose : Computes average tangent vector along the curve +//======================================================================= +gp_Vec GetAverageTangent(const TopoDS_Shape& theS, + const Standard_Integer theNbP) +{ + gp_Vec aVA; + TopExp_Explorer aExp(theS, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Edge& aE = *(TopoDS_Edge*)&aExp.Current(); + // + Standard_Real aT1, aT2; + const Handle(Geom_Curve)& aC = BRep_Tool::Curve(aE, aT1, aT2); + // + gp_Pnt aP; + gp_Vec aV, aVSum; + Standard_Real aT = aT1; + Standard_Real aDt = (aT2 - aT1) / theNbP; + while (aT <= aT2) { + aC->D1(aT, aP, aV); + aVSum += aV.Normalized(); + aT += aDt; + } + // + if (aE.Orientation() == TopAbs_REVERSED) { + aVSum.Reverse(); + } + // + aVA += aVSum; + } + return aVA; +} + +//======================================================================= +//function : CheckInverted +//purpose : Checks if the edge has been inverted +//======================================================================= +Standard_Boolean CheckInverted(const TopoDS_Edge& theEIm, + const TopoDS_Face& theFOr, + const TopTools_DataMapOfShapeListOfShape& theOEImages, + const TopTools_DataMapOfShapeListOfShape& theOEOrigins, + const TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + const TopTools_IndexedDataMapOfShapeListOfShape& theDMEF, + const TopTools_IndexedDataMapOfShapeListOfShape& theDMVE, + const TopTools_IndexedMapOfShape& theMEdges, + TopTools_MapOfShape& theMEInverted) +{ + if (theDMEF.FindFromKey(theEIm).Extent() > 1) { + 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 + // will be different - the edge has been inverted. + // + TopoDS_Vertex aVI1, aVI2; // vertices on the offset edge + TopoDS_Vertex aVO1, aVO2; // vertices on the original edge + // + Standard_Integer i; + // find vertices of the offset shape + TopExp::Vertices(theEIm, aVI1, aVI2); + // + // find images + TopTools_ListOfShape aLEImages; + if (theOEOrigins.IsBound(theEIm)) { + TopoDS_Wire anImages; + BRep_Builder().MakeWire(anImages); + // + TopTools_MapOfShape aMImFence; + const TopTools_ListOfShape& aLOffsetOr = theOEOrigins.Find(theEIm); + TopTools_ListIteratorOfListOfShape aItOffset(aLOffsetOr); + for (; aItOffset.More(); aItOffset.Next()) { + const TopoDS_Shape& aEOffsetOr = aItOffset.Value(); + const TopTools_ListOfShape& aLImages = theOEImages.Find(aEOffsetOr); + // + TopTools_ListIteratorOfListOfShape aItImages(aLImages); + for (; aItImages.More(); aItImages.Next()) { + const TopoDS_Edge& anIm = *(TopoDS_Edge*)&aItImages.Value(); + if (theMEdges.Contains(anIm) && aMImFence.Add(anIm)) { + BRep_Builder().Add(anImages, anIm); + aLEImages.Append(anIm); + } + } + } + // + // find alone vertices + TopoDS_Vertex aVW1, aVW2; + TopTools_IndexedDataMapOfShapeListOfShape aDMImVE; + TopExp::MapShapesAndAncestors(anImages, TopAbs_VERTEX, TopAbs_EDGE, aDMImVE); + // + TopTools_ListOfShape aLVAlone; + Standard_Integer aNb = aDMImVE.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopTools_ListOfShape& aLImE = aDMImVE(i); + if (aLImE.Extent() == 1) { + aLVAlone.Append(aDMImVE.FindKey(i)); + } + } + // + if (aLVAlone.Extent() > 1) { + aVW1 = *(TopoDS_Vertex*)&aLVAlone.First(); + aVW2 = *(TopoDS_Vertex*)&aLVAlone.Last(); + // + // check distances + const gp_Pnt& aPI1 = BRep_Tool::Pnt(aVI1); + const gp_Pnt& aPW1 = BRep_Tool::Pnt(aVW1); + const gp_Pnt& aPW2 = BRep_Tool::Pnt(aVW2); + // + Standard_Real aDist1 = aPI1.SquareDistance(aPW1); + Standard_Real aDist2 = aPI1.SquareDistance(aPW2); + // + if (aDist1 < aDist2) { + aVI1 = aVW1; + aVI2 = aVW2; + } + else { + aVI1 = aVW2; + aVI2 = aVW1; + } + } + } + else { + aLEImages.Append(theEIm); + } + // + // Find edges connected to these vertices + const TopTools_ListOfShape& aLIE1 = theDMVE.FindFromKey(aVI1); + const TopTools_ListOfShape& aLIE2 = theDMVE.FindFromKey(aVI2); + // + // Find vertices on the original face corresponding to vertices on the offset edge + // + // find original edges for both lists + TopTools_ListOfShape aLOE1, aLOE2; + for (i = 0; i < 2; ++i) { + const TopTools_ListOfShape& aLIE = !i ? aLIE1 : aLIE2; + TopTools_ListOfShape& aLOE = !i ? aLOE1 : aLOE2; + // + TopTools_MapOfShape aMFence; + // + TopTools_ListIteratorOfListOfShape aItLIE(aLIE); + for (; aItLIE.More(); aItLIE.Next()) { + const TopoDS_Shape& aEI = aItLIE.Value(); + if (theEdgesOrigins.IsBound(aEI)) { + const TopTools_ListOfShape& aLEOrigins = theEdgesOrigins.Find(aEI); + // + TopTools_ListIteratorOfListOfShape aItLOE(aLEOrigins); + for (; aItLOE.More(); aItLOE.Next()) { + const TopoDS_Shape& aEO = aItLOE.Value(); + if (aEO.ShapeType() == TopAbs_EDGE && aMFence.Add(aEO)) { + TopoDS_Shape aEOin; + if (FindShape(aEO, theFOr, aEOin)) { + aLOE.Append(aEO); + } + } + } + } + } + } + // + if (aLOE1.Extent() < 2 || aLOE2.Extent() < 2) { + return Standard_False; + } + // + // find vertices common for all edges in the lists + for (i = 0; i < 2; ++i) { + const TopTools_ListOfShape& aLOE = !i ? aLOE1 : aLOE2; + TopoDS_Vertex& aVO = !i ? aVO1 : aVO2; + // + const TopoDS_Shape& aEO = aLOE.First(); + TopExp_Explorer aExpV(aEO, TopAbs_VERTEX); + for (; aExpV.More(); aExpV.Next()) { + const TopoDS_Vertex& aV = *(TopoDS_Vertex*)&aExpV.Current(); + // + Standard_Boolean bVertValid = Standard_True; + TopTools_ListIteratorOfListOfShape aItLOE(aLOE); + for (aItLOE.Next(); aItLOE.More(); aItLOE.Next()) { + const TopoDS_Shape& aEOx = aItLOE.Value(); + TopExp_Explorer aExpVx(aEOx, TopAbs_VERTEX); + for (; aExpVx.More(); aExpVx.Next()) { + const TopoDS_Shape& aVx = aExpVx.Current(); + if (aVx.IsSame(aV)) { + break; + } + } + // + if (!aExpVx.More()) { + bVertValid = Standard_False; + break; + } + } + // + if (bVertValid) { + aVO = aV; + break; + } + } + } + // + if (aVO1.IsNull() || aVO2.IsNull() || aVO1.IsSame(aVO2)) { + return Standard_False; + } + // + // check positions of the offset and original vertices + const gp_Pnt& aPI1 = BRep_Tool::Pnt(aVI1); + const gp_Pnt& aPI2 = BRep_Tool::Pnt(aVI2); + const gp_Pnt& aPO1 = BRep_Tool::Pnt(aVO1); + const gp_Pnt& aPO2 = BRep_Tool::Pnt(aVO2); + // + gp_Vec aVI(aPI1, aPI2); + gp_Vec aVO(aPO1, aPO2); + // + Standard_Real anAngle = aVI.Angle(aVO); + Standard_Boolean bInverted = Abs(anAngle - M_PI) < 1.e-4; + if (bInverted) { + TopTools_ListIteratorOfListOfShape aItLEIm(aLEImages); + for (; aItLEIm.More(); aItLEIm.Next()) { + const TopoDS_Shape& aEInvr = aItLEIm.Value(); + theMEInverted.Add(aEInvr); + } + } + return bInverted; +} + +//======================================================================= +//function : RemoveInvalidSplitsByInvertedEdges +//purpose : Looking for the invalid faces containing inverted edges +// that can be safely removed +//======================================================================= +void RemoveInvalidSplitsByInvertedEdges(const TopTools_MapOfShape& theMEInverted, + TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, + TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + TopTools_IndexedMapOfShape& theMERemoved) +{ + if (theMEInverted.IsEmpty()) { + return; + } + // + // check the faces on regularity, i.e. the splits of the same face + // should not be connected only by vertex. Such irregular splits + // will have to be rebuilt and cannot be removed. + // + TopTools_MapOfShape aMEAvoid; + TopTools_DataMapOfShapeListOfShape aDMVF; + Standard_Integer aNb = theFImages.Extent(), i; + for (i = 1; i <= aNb; ++i) { + const TopTools_ListOfShape& aLFIm = theFImages(i); + // + TopoDS_Compound aCFIm; + BRep_Builder().MakeCompound(aCFIm); + // + TopTools_DataMapOfShapeListOfShape aDMEF; + TopTools_ListIteratorOfListOfShape aIt(aLFIm); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aF = aIt.Value(); + BRep_Builder().Add(aCFIm, aF); + // + // make a map to use only outer edges + TopExp_Explorer aExp(aF, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aE = aExp.Current(); + // + TopTools_ListOfShape *pLF = aDMEF.ChangeSeek(aE); + if (!pLF) { + TopTools_ListOfShape aLF; + aLF.Append(aF); + aDMEF.Bind(aE, aLF); + } + else { + pLF->Append(aF); + // internal edges should not be used + aMEAvoid.Add(aE); + } + } + // + // fill connection map of the vertices of inverted edges to faces + aExp.Init(aF, TopAbs_VERTEX); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aV = aExp.Current(); + // + TopTools_ListOfShape *pLF = aDMVF.ChangeSeek(aV); + if (!pLF) { + TopTools_ListOfShape aLF; + aLF.Append(aF); + aDMVF.Bind(aV, aLF); + } + else { + AppendToList(*pLF, aF); + } + } + } + // + // for the splits to be regular they should form only one block + TopTools_ListOfShape aLCBF; + BOPTools_AlgoTools::MakeConnexityBlocks(aCFIm, TopAbs_EDGE, TopAbs_FACE, aLCBF); + // + if (aLCBF.Extent() > 1) { + // non of these edges should be removed + TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItDM(aDMEF); + for (; aItDM.More(); aItDM.Next()) { + aMEAvoid.Add(aItDM.Key()); + } + } + } + // + // all edges not included in aMEAvoid can be removed + TopTools_MapOfShape aMERem; + TopTools_MapIteratorOfMapOfShape aItM(theMEInverted); + for (; aItM.More(); aItM.Next()) { + const TopoDS_Shape& aE = aItM.Value(); + if (!aMEAvoid.Contains(aE)) { + TopoDS_Iterator aIt(aE); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aV = aIt.Value(); + const TopTools_ListOfShape *pLF = aDMVF.Seek(aV); + if (pLF && (pLF->Extent() > 3)) { + aMERem.Add(aE); + break; + } + } + } + } + // + if (aMERem.IsEmpty()) { + return; + } + // + // all invalid faces containing these edges can be removed + TopTools_IndexedDataMapOfShapeListOfShape aInvFaces; + TopTools_MapOfShape aMFRem; + TopTools_IndexedMapOfShape aMFToUpdate; + aNb = theInvFaces.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopoDS_Shape& aF = theInvFaces.FindKey(i); + TopTools_ListOfShape& aLFIm = theInvFaces(i); + // + TopTools_ListIteratorOfListOfShape aIt(aLFIm); + for (; aIt.More(); ) { + const TopoDS_Shape& aFIm = aIt.Value(); + // + // to be removed the face should have at least two not connected + // inverted edges + TopoDS_Compound aCEInv; + BRep_Builder().MakeCompound(aCEInv); + TopExp_Explorer aExp(aFIm, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aE = aExp.Current(); + // + if (aMERem.Contains(aE)) { + BRep_Builder().Add(aCEInv, aE); + } + } + // + // check connectivity + TopTools_ListOfShape aLCBE; + BOPTools_AlgoTools::MakeConnexityBlocks(aCEInv, TopAbs_VERTEX, TopAbs_EDGE, aLCBE); + // + if (aLCBE.Extent() >= 2) { + aMFToUpdate.Add(aF); + aMFRem.Add(aFIm); + aLFIm.Remove(aIt); + } + else { + aIt.Next(); + } + } + // + if (aLFIm.Extent()) { + aInvFaces.Add(aF, aLFIm); + } + } + // + if (aMFRem.IsEmpty()) { + return; + } + // + theInvFaces = aInvFaces; + // remove from splits + aNb = aMFToUpdate.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopoDS_Shape& aF = aMFToUpdate(i); + TopTools_ListOfShape& aLFIm = theFImages.ChangeFromKey(aF); + // + TopTools_ListIteratorOfListOfShape aIt(aLFIm); + for (; aIt.More(); ) { + const TopoDS_Shape& aFIm = aIt.Value(); + if (aMFRem.Contains(aFIm)) { + TopExp::MapShapes(aFIm, TopAbs_EDGE, theMERemoved); + aLFIm.Remove(aIt); + } + else { + aIt.Next(); + } + } + } +} + +//======================================================================= +//function : RemoveInvalidSplitsFromValid +//purpose : Removing invalid splits of faces from valid +//======================================================================= +void RemoveInvalidSplitsFromValid(const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, + const TopTools_DataMapOfShapeShape& theArtInvFaces, + const TopTools_MapOfShape& theMEInverted, + TopTools_IndexedDataMapOfShapeListOfShape& theFImages) +{ + // Decide whether to remove the found invalid faces or not. + // The procedure is the following: + // 1. Make connexity blocks from invalid faces; + // 2. Find free edges in this blocks; + // 3. If all free edges are valid for the faces - remove block. + // + TopTools_MapOfShape aMFence, aMFToRem; + TopoDS_Compound aCFInv; + BRep_Builder aBB; + aBB.MakeCompound(aCFInv); + TopTools_ListIteratorOfListOfShape aItLF; + // + // make compound of invalid faces + TopTools_DataMapOfShapeShape aDMIFOF; + Standard_Integer i, aNb = theInvFaces.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopoDS_Shape& aF = theInvFaces.FindKey(i); + // artificially invalid faces should not be removed + if (theArtInvFaces.IsBound(aF)) { + continue; + } + const TopTools_ListOfShape& aLFInv = theInvFaces(i); + aItLF.Initialize(aLFInv); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Shape& aFIm = aItLF.Value(); + if (aMFence.Add(aFIm)) { + aBB.Add(aCFInv, aFIm); + aDMIFOF.Bind(aFIm, aF); + } + } + } + // + // make connexity blocks + TopTools_ListOfShape aLCBInv; + BOPTools_AlgoTools::MakeConnexityBlocks(aCFInv, TopAbs_EDGE, TopAbs_FACE, aLCBInv); + // + // analyze each block + aItLF.Initialize(aLCBInv); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Shape& aCB = aItLF.Value(); + // + // if connexity block contains only one face - it should be removed; + TopExp_Explorer aExp(aCB, TopAbs_FACE); + aExp.Next(); + if (aExp.More()) { + // check if there are valid images left + aExp.Init(aCB, TopAbs_FACE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aFIm = aExp.Current(); + const TopoDS_Shape& aF = aDMIFOF.Find(aFIm); + // + const TopTools_ListOfShape& aLFIm = theFImages.FindFromKey(aF); + const TopTools_ListOfShape& aLFInv = theInvFaces.FindFromKey(aF); + // + if (aLFIm.Extent() == aLFInv.Extent()) { + break; + } + } + } + // + if (!aExp.More()) { + aExp.Init(aCB, TopAbs_FACE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aF = aExp.Current(); + aMFToRem.Add(aF); + } + continue; + } + // + // remove faces connected by inverted edges + TopTools_IndexedDataMapOfShapeListOfShape aDMEF; + TopExp::MapShapesAndAncestors(aCB, TopAbs_EDGE, TopAbs_FACE, aDMEF); + // + aExp.Init(aCB, TopAbs_FACE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aFCB = aExp.Current(); + // + TopExp_Explorer aExpE(aFCB, TopAbs_EDGE); + for (; aExpE.More(); aExpE.Next()) { + const TopoDS_Shape& aECB = aExpE.Current(); + if (aDMEF.FindFromKey(aECB).Extent() > 1) { + if (!theMEInverted.Contains(aECB)) { + break; + } + } + } + // + if (!aExpE.More()) { + aMFToRem.Add(aFCB); + } + } + } + // + if (aMFToRem.Extent()) { + // remove invalid faces from images + aNb = theInvFaces.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopoDS_Shape& aF = theInvFaces.FindKey(i); + TopTools_ListOfShape& aLFImages = theFImages.ChangeFromKey(aF); + aItLF.Initialize(aLFImages); + for (; aItLF.More();) { + const TopoDS_Shape& aFIm = aItLF.Value(); + if (aMFToRem.Contains(aFIm)) { + aLFImages.Remove(aItLF); + } + else { + aItLF.Next(); + } + } + } + } +} + +//======================================================================= +//function : RemoveInsideFaces +//purpose : Looking for the inside faces that can be safely removed +//======================================================================= +void RemoveInsideFaces(TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, + const TopTools_DataMapOfShapeShape& theArtInvFaces, + const TopTools_IndexedMapOfShape& theInvEdges, + const TopTools_IndexedMapOfShape& theMFToCheckInt, + TopTools_DataMapOfShapeListOfShape& theSSInterfs, + TopTools_IndexedMapOfShape& theMERemoved, + TopoDS_Shape& theSolids) +{ + BOPCol_ListOfShape aLS; + TopTools_MapOfShape aMFence; + TopTools_IndexedMapOfShape aMFInv; + TopTools_ListIteratorOfListOfShape aItLF; + TopTools_DataMapOfShapeShape aDMFImF; + // + Standard_Integer i, aNb = theFImages.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopoDS_Shape& aF = theFImages.FindKey(i); + // to avoid intersection of the splits of the same + // offset faces among themselves make compound of the + // splits and use it as one argument + TopoDS_Compound aCFImi; + BRep_Builder().MakeCompound(aCFImi); + // + for (Standard_Integer j = 0; j < 2; ++j) { + const TopTools_ListOfShape* pLFSp = !j ? theInvFaces.Seek(aF) : &theFImages(i); + if (!pLFSp) { + continue; + } + // + aItLF.Initialize(*pLFSp); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Shape& aFIm = aItLF.Value(); + if (aMFence.Add(aFIm)) { + BRep_Builder().Add(aCFImi, aFIm); + aDMFImF.Bind(aFIm, aF); + if (!j) { + aMFInv.Add(aFIm); + } + } + } + } + // + aLS.Append(aCFImi); + } + // + // to make the solids more complete add for intersection also the faces + // consisting only of invalid edges and not included into splits + aNb = theMFToCheckInt.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopoDS_Shape& aFSp = theMFToCheckInt(i); + if (aMFence.Add(aFSp)) { + aLS.Append(aFSp); + } + } + // + BOPAlgo_MakerVolume aMV; + aMV.SetArguments(aLS); + aMV.SetIntersect(Standard_True); + aMV.Perform(); + // + // get shapes connection for using in the rebuilding process + // for the cases in which some of the intersection left undetected + ShapesConnections(theInvFaces, theInvEdges, aDMFImF, aMV, theSSInterfs); + // + // find faces to remove + const TopoDS_Shape& aSols = aMV.Shape(); + // + TopTools_IndexedDataMapOfShapeListOfShape aDMFS; + TopExp::MapShapesAndAncestors(aSols, TopAbs_FACE, TopAbs_SOLID, aDMFS); + // + aNb = aDMFS.Extent(); + if (!aNb) { + return; + } + // + // To use the created solids for classifications, firstly, it is necessary + // to check them on validity - the created solids should be complete, + // i.e. all faces should be included. + // + // Check completeness + if (aMV.HasDeleted()) { + // perform additional check on faces + aNb = theFImages.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopTools_ListOfShape& aLFIm = theFImages(i); + if (aLFIm.IsEmpty()) { + continue; + } + // + aItLF.Initialize(aLFIm); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Shape& aFIm = aItLF.Value(); + if (!aMV.IsDeleted(aFIm)) { + break; + } + } + // + if (!aItLF.More()) { + return; + } + } + } + // + TopTools_MapOfShape aMFToRem; + aNb = aDMFS.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopTools_ListOfShape& aLSol = aDMFS(i); + if (aLSol.Extent() > 1) { + const TopoDS_Shape& aFIm = aDMFS.FindKey(i); + aMFToRem.Add(aFIm); + } + } + // + // update invalid faces with images + aNb = aMFInv.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopoDS_Shape& aFInv = aMFInv(i); + const TopTools_ListOfShape& aLFInvIm = aMV.Modified(aFInv); + TopTools_ListIteratorOfListOfShape aItLFInvIm(aLFInvIm); + for (; aItLFInvIm.More(); aItLFInvIm.Next()) { + const TopoDS_Shape& aFInvIm = aItLFInvIm.Value(); + aMFInv.Add(aFInvIm); + } + } + // + TopoDS_Compound aSolids; + BRep_Builder().MakeCompound(aSolids); + // + TopExp_Explorer aExpS(aSols, TopAbs_SOLID); + for (; aExpS.More(); aExpS.Next()) { + const TopoDS_Shape& aSol = aExpS.Current(); + // + Standard_Boolean bAllInv(Standard_True), bAllRemoved(Standard_True); + + TopExp_Explorer aExpF(aSol, TopAbs_FACE); + for (; aExpF.More(); aExpF.Next()) { + const TopoDS_Shape& aFS = aExpF.Current(); + // + if (aFS.Orientation() == TopAbs_INTERNAL) { + aMFToRem.Add(aFS); + } + // + bAllRemoved = bAllRemoved && aMFToRem.Contains(aFS); + bAllInv = bAllInv && (aMFToRem.Contains(aFS) || aMFInv.Contains(aFS)); + } + // + if (bAllInv && !bAllRemoved) { + // remove invalid faces but keep those that have already been marked for removal + TopExp_Explorer aExpF(aSol, TopAbs_FACE); + for (; aExpF.More(); aExpF.Next()) { + const TopoDS_Shape& aFS = aExpF.Current(); + // + if (aMFToRem.Contains(aFS)) { + aMFToRem.Remove(aFS); + } + else { + aMFToRem.Add(aFS); + } + } + } + else { + BRep_Builder().Add(aSolids, aSol); + theSolids = aSolids; + } + } + // + // remove newly found internal faces + RemoveValidSplits(aMFToRem, theFImages, aMV, theMERemoved); + RemoveInvalidSplits(aMFToRem, theArtInvFaces, theInvEdges, theInvFaces, aMV, theMERemoved); +} + +//======================================================================= +//function : ShapesConnections +//purpose : Looking for the connections between faces not to miss +// some necessary intersection +//======================================================================= +void ShapesConnections(const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, + const TopTools_IndexedMapOfShape& theInvEdges, + const TopTools_DataMapOfShapeShape& theDMFOr, + BOPAlgo_Builder& theBuilder, + TopTools_DataMapOfShapeListOfShape& theSSInterfs) +{ + // update invalid edges with images and keep connection to original edge + TopTools_DataMapOfShapeListOfShape aDMEOr; + Standard_Integer i, aNb = theInvEdges.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopoDS_Shape& aEInv = theInvEdges(i); + const TopTools_ListOfShape& aLEIm = theBuilder.Modified(aEInv); + if (aLEIm.IsEmpty()) { + aDMEOr.Bound(aEInv, TopTools_ListOfShape())->Append(aEInv); + continue; + } + // + TopTools_ListIteratorOfListOfShape aItLEIm(aLEIm); + for (; aItLEIm.More(); aItLEIm.Next()) { + const TopoDS_Shape& aEIm = aItLEIm.Value(); + // + TopTools_ListOfShape* pLEOr = aDMEOr.ChangeSeek(aEIm); + if (!pLEOr) { + pLEOr = aDMEOr.Bound(aEIm, TopTools_ListOfShape()); + } + AppendToList(*pLEOr, aEInv); + } + } + // + // get shapes connections for using in the rebuilding process + const BOPDS_PDS& pDS = theBuilder.PDS(); + // analyze all Face/Face intersections + const BOPDS_VectorOfInterfFF& aFFs = pDS->InterfFF(); + Standard_Integer iInt, aNbFF = aFFs.Extent(); + for (iInt = 0; iInt < aNbFF; ++iInt) { + const BOPDS_InterfFF& aFF = aFFs(iInt); + const BOPDS_VectorOfCurve& aVNC = aFF.Curves(); + Standard_Integer aNbC = aVNC.Extent(); + if (!aNbC) { + continue; + } + // + const TopoDS_Shape& aFIm1 = pDS->Shape(aFF.Index1()); + const TopoDS_Shape& aFIm2 = pDS->Shape(aFF.Index2()); + // + const TopoDS_Shape* pF1 = theDMFOr.Seek(aFIm1); + const TopoDS_Shape* pF2 = theDMFOr.Seek(aFIm2); + // + if (!pF1 || !pF2) { + continue; + } + // + if (pF1->IsSame(*pF2)) { + continue; + } + // + Standard_Boolean bInv1 = theInvFaces.Contains(*pF1); + Standard_Boolean bInv2 = theInvFaces.Contains(*pF2); + // + if (!bInv1 && !bInv2) { + continue; + } + // + // check if it is real Face/Face intersection + TopTools_MapOfShape aMEInt; + for (Standard_Integer iC = 0; iC < aNbC; ++iC) { + const BOPDS_Curve& aNC = aVNC(iC); + const BOPDS_ListOfPaveBlock& aLPB = aNC.PaveBlocks(); + BOPDS_ListIteratorOfListOfPaveBlock aItLPB(aLPB); + for (; aItLPB.More(); aItLPB.Next()) { + const Handle(BOPDS_PaveBlock)& aPB = aItLPB.Value(); + Standard_Integer nEInt; + if (aPB->HasEdge(nEInt)) { + const TopoDS_Shape& aEInt = pDS->Shape(nEInt); + aMEInt.Add(aEInt); + } + } + } + // + if (aMEInt.IsEmpty()) { + continue; + } + // + // check if invalid edges of the face are in the same splits with intersection edges + for (Standard_Integer i = 0; i < 2; ++i) { + if ((!i && !bInv1) || (i && !bInv2)) { + continue; + } + // + const TopoDS_Shape& aF = !i ? *pF1 : *pF2; + const TopoDS_Shape& aFOp = !i ? *pF2 : *pF1; + const TopoDS_Shape& aFIm = !i ? aFIm1 : aFIm2; + // + Standard_Boolean bFound = Standard_False; + // + TopTools_ListOfShape aLFIm = theBuilder.Modified(aFIm); + if (aLFIm.IsEmpty()) { + aLFIm.Append(aFIm); + } + // + TopTools_ListIteratorOfListOfShape aItLFIm(aLFIm); + for (; aItLFIm.More(); aItLFIm.Next()) { + const TopoDS_Shape& aFImIm = aItLFIm.Value(); + // + Standard_Boolean bInv(Standard_False), bInt(Standard_False); + TopExp_Explorer aExpE(aFImIm, TopAbs_EDGE); + for (; aExpE.More(); aExpE.Next()) { + const TopoDS_Shape& aE = aExpE.Current(); + if (!bInv) { + bInv = aDMEOr.IsBound(aE); + } + if (!bInt) { + bInt = aMEInt.Contains(aE); + } + if (bInv && bInt) { + break; + } + } + // + if (!bInt || !bInv) { + continue; + } + // + bFound = Standard_True; + // + // append opposite face to all invalid edges in the split + aExpE.Init(aFImIm, TopAbs_EDGE); + for (; aExpE.More(); aExpE.Next()) { + const TopoDS_Shape& aE = aExpE.Current(); + const TopTools_ListOfShape* pLEOr = aDMEOr.Seek(aE); + if (!pLEOr) { + continue; + } + // + TopTools_ListIteratorOfListOfShape aItLE(*pLEOr); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Shape& aEOr = aItLE.Value(); + TopTools_ListOfShape *pLFE = theSSInterfs.ChangeSeek(aEOr); + if (!pLFE) { + pLFE = theSSInterfs.Bound(aEOr, TopTools_ListOfShape()); + } + AppendToList(*pLFE, aFOp); + } + } + } + if (bFound) { + // save connection between offset faces + TopTools_ListOfShape *pLF = theSSInterfs.ChangeSeek(aF); + if (!pLF) { + pLF = theSSInterfs.Bound(aF, TopTools_ListOfShape()); + } + AppendToList(*pLF, aFOp); + } + } + } +} + +//======================================================================= +//function : RemoveValidSplits +//purpose : Removing valid splits according to results of intersection +//======================================================================= +void RemoveValidSplits(const TopTools_MapOfShape& theSpRem, + TopTools_IndexedDataMapOfShapeListOfShape& theImages, + BOPAlgo_Builder& theGF, + TopTools_IndexedMapOfShape& theMERemoved) +{ + Standard_Integer i, aNb = theImages.Extent(); + if (!aNb) { + return; + } + // + for (i = 1; i <= aNb; ++i) { + TopTools_ListOfShape& aLSIm = theImages(i); + TopTools_ListIteratorOfListOfShape aIt(aLSIm); + for (; aIt.More(); ) { + const TopoDS_Shape& aSIm = aIt.Value(); + if (theSpRem.Contains(aSIm)) { + TopExp::MapShapes(aSIm, TopAbs_EDGE, theMERemoved); + aLSIm.Remove(aIt); + continue; + } + // + // check if all its images are have to be removed + const TopTools_ListOfShape& aLSImIm = theGF.Modified(aSIm); + if (aLSImIm.Extent()) { + Standard_Boolean bAllRem = Standard_True; + TopTools_ListIteratorOfListOfShape aIt1(aLSImIm); + for (; aIt1.More(); aIt1.Next()) { + const TopoDS_Shape& aSImIm = aIt1.Value(); + if (theSpRem.Contains(aSImIm)) { + TopExp::MapShapes(aSImIm, TopAbs_EDGE, theMERemoved); + } + else { + bAllRem = Standard_False; + } + } + // + if (bAllRem) { + TopExp::MapShapes(aSIm, TopAbs_EDGE, theMERemoved); + aLSIm.Remove(aIt); + continue; + } + } + aIt.Next(); + } + } +} + +//======================================================================= +//function : RemoveInvalidSplits +//purpose : Removing invalid splits according to the results of intersection +//======================================================================= +void RemoveInvalidSplits(const TopTools_MapOfShape& theSpRem, + const TopTools_DataMapOfShapeShape& theArtInvFaces, + const TopTools_IndexedMapOfShape& theInvEdges, + TopTools_IndexedDataMapOfShapeListOfShape& theImages, + BOPAlgo_Builder& theGF, + TopTools_IndexedMapOfShape& theMERemoved) +{ + Standard_Integer i, aNb = theImages.Extent(); + if (!aNb) { + return; + } + // + for (i = 1; i <= aNb; ++i) { + const TopoDS_Shape& aS = theImages.FindKey(i); + Standard_Boolean bArt = theArtInvFaces.IsBound(aS); + // + TopTools_ListOfShape& aLSIm = theImages(i); + TopTools_ListIteratorOfListOfShape aIt(aLSIm); + for (; aIt.More();) { + const TopoDS_Shape& aSIm = aIt.Value(); + if (theSpRem.Contains(aSIm)) { + TopExp::MapShapes(aSIm, TopAbs_EDGE, theMERemoved); + aLSIm.Remove(aIt); + continue; + } + // + // check if all its images are have to be removed + const TopTools_ListOfShape& aLSImIm = theGF.Modified(aSIm); + if (aLSImIm.IsEmpty()) { + aIt.Next(); + continue; + } + // + Standard_Boolean bAllRem = Standard_True; + TopTools_IndexedMapOfShape aMERemoved; + TopTools_ListIteratorOfListOfShape aIt1(aLSImIm); + for (; aIt1.More(); aIt1.Next()) { + const TopoDS_Shape& aSImIm = aIt1.Value(); + if (theSpRem.Contains(aSImIm)) { + TopExp::MapShapes(aSImIm, TopAbs_EDGE, aMERemoved); + } + else { + bAllRem = Standard_False; + } + } + // + if (bAllRem) { + aLSIm.Remove(aIt); + continue; + } + // + if (bArt) { + aIt.Next(); + continue; + } + // + // remove the face from invalid if all invalid edges of this face + // have been marked for removal + TopExp_Explorer aExpE(aSIm, TopAbs_EDGE); + for (; aExpE.More(); aExpE.Next()) { + const TopoDS_Shape& aEInv = aExpE.Current(); + if (theInvEdges.Contains(aEInv) && !aMERemoved.Contains(aEInv)) { + break; + } + } + if (!aExpE.More()) { + TopExp::MapShapes(aSIm, TopAbs_EDGE, theMERemoved); + aLSIm.Remove(aIt); + } + else { + aIt.Next(); + } + } + } +} + +//======================================================================= +//function : FilterEdgesImages +//purpose : Updating the maps of images and origins of the offset edges +//======================================================================= +void FilterEdgesImages(const TopoDS_Shape& theS, + TopTools_DataMapOfShapeListOfShape& theOEImages, + TopTools_DataMapOfShapeListOfShape& theOEOrigins) +{ + // map edges + TopTools_IndexedMapOfShape aME; + TopExp::MapShapes(theS, TopAbs_EDGE, aME); + // + theOEOrigins.Clear(); + TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItDM(theOEImages); + for (; aItDM.More(); aItDM.Next()) { + const TopoDS_Shape& aE = aItDM.Key(); + TopTools_ListOfShape& aLEIm = aItDM.ChangeValue(); + // + TopTools_ListIteratorOfListOfShape aIt(aLEIm); + for (; aIt.More(); ) { + const TopoDS_Shape& aEIm = aIt.Value(); + // filter images + if (!aME.Contains(aEIm)) { + // remove the image + // edges with no images left should be kept in the map + // to avoid their usage when building the splits of faces + aLEIm.Remove(aIt); + continue; + } + // + // save origins + if (theOEOrigins.IsBound(aEIm)) { + AppendToList(theOEOrigins.ChangeFind(aEIm), aE); + } + else { + TopTools_ListOfShape aLOr; + aLOr.Append(aE); + theOEOrigins.Bind(aEIm, aLOr); + } + // + aIt.Next(); + } + } +} + +//======================================================================= +//function : FilterInvalidFaces +//purpose : Filtering of the invalid faces +//======================================================================= +void FilterInvalidFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + const TopTools_IndexedDataMapOfShapeListOfShape& theDMFE, + TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, + TopTools_DataMapOfShapeShape& theArtInvFaces) +{ + // + // filter invalid faces, considering faces having only valid + // images left with non-free edges as valid + // do not remove invalid faces if it creates free edges + // + TopTools_IndexedDataMapOfShapeListOfShape aReallyInvFaces; + TopTools_ListIteratorOfListOfShape aItLF; + // + Standard_Integer i, aNb = theInvFaces.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopoDS_Shape& aF = theInvFaces.FindKey(i); + const TopTools_ListOfShape& aLFInv = theInvFaces(i); + // + if (theArtInvFaces.IsBound(aF)) { + if (aLFInv.IsEmpty()) { + theArtInvFaces.UnBind(aF); + } + else { + aReallyInvFaces.Add(aF, aLFInv); + } + continue; + } + // + if (aLFInv.IsEmpty()) { + continue; + } + // + const TopTools_ListOfShape& aLFIm = theFImages.FindFromKey(aF); + Standard_Boolean bInvalid = aLFIm.IsEmpty(); + // + if (!bInvalid) { + // check two lists on common splits + aItLF.Initialize(aLFInv); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Shape& aFInv = aItLF.Value(); + // + TopTools_ListIteratorOfListOfShape aItLFIm(aLFIm); + for (; aItLFIm.More(); aItLFIm.Next()) { + const TopoDS_Shape& aFIm = aItLFIm.Value(); + // + if (aFInv.IsSame(aFIm)) { + break; + } + } + // + if (aItLFIm.More()) { + break; + } + } + // + bInvalid = aItLF.More(); + } + // + if (!bInvalid) { + // check for free edges + for (Standard_Integer j = 0; !bInvalid && j < 2; ++j) { + const TopTools_ListOfShape& aLI = !j ? aLFIm : aLFInv; + aItLF.Initialize(aLI); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Shape& aFIm = aItLF.Value(); + // + TopExp_Explorer aExp(aFIm, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aE = aExp.Current(); + if (theDMFE.Contains(aE)) { + const TopTools_ListOfShape& aLEF = theDMFE.FindFromKey(aE); + if (aLEF.Extent() == 1) { + break; + } + } + } + // + if (aExp.More()) { + break; + } + } + bInvalid = aItLF.More(); + } + } + // + if (bInvalid) { + aReallyInvFaces.Add(aF, aLFInv); + } + } + // + theInvFaces = aReallyInvFaces; +} + +//======================================================================= +//function : FilterInvalidEdges +//purpose : Filtering the invalid edges according to currently invalid faces +//======================================================================= +void FilterInvalidEdges(const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, + const TopTools_DataMapOfShapeShape& theArtInvFaces, + const TopTools_DataMapOfShapeListOfShape& theDMFLIE, + const TopTools_IndexedMapOfShape& theMERemoved, + TopTools_IndexedMapOfShape& theInvEdges) +{ + TopoDS_Compound aCEInv; + TopTools_IndexedMapOfShape aMEInv; + BRep_Builder aBB; + aBB.MakeCompound(aCEInv); + TopTools_ListIteratorOfListOfShape aItLF; + // + Standard_Integer i, aNb = theInvFaces.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopTools_ListOfShape& aLFInv = theInvFaces(i); + aItLF.Initialize(aLFInv); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Shape& aFIm = aItLF.Value(); + TopExp::MapShapes(aFIm, TopAbs_EDGE, aMEInv); + // + TopExp_Explorer aExpE(aFIm, TopAbs_EDGE); + for (; aExpE.More(); aExpE.Next()) { + const TopoDS_Shape& aE = aExpE.Current(); + if (theInvEdges.Contains(aE)) { + aBB.Add(aCEInv, aE); + } + } + } + } + // + // remove edges which have been marked for removal + TopTools_IndexedMapOfShape aMEInvToAvoid; + TopTools_ListOfShape aLCBE; + BOPTools_AlgoTools::MakeConnexityBlocks(aCEInv, TopAbs_VERTEX, TopAbs_EDGE, aLCBE); + // + TopTools_ListIteratorOfListOfShape aItLCBE(aLCBE); + for (; aItLCBE.More(); aItLCBE.Next()) { + const TopoDS_Shape& aCBE = aItLCBE.Value(); + TopExp_Explorer aExpCB(aCBE, TopAbs_EDGE); + for (; aExpCB.More(); aExpCB.Next()) { + const TopoDS_Shape& aE = aExpCB.Current(); + if (!theMERemoved.Contains(aE)) { + break; + } + } + // + if (!aExpCB.More()) { + TopExp::MapShapes(aCBE, TopAbs_EDGE, aMEInvToAvoid); + } + } + // + TopTools_IndexedMapOfShape aReallyInvEdges; + // + aNb = theInvFaces.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopoDS_Shape& aF = theInvFaces.FindKey(i); + if (theArtInvFaces.IsBound(aF)) { + const TopTools_ListOfShape& aLEInv = theDMFLIE.Find(aF); + aItLF.Initialize(aLEInv); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Shape& aE = aItLF.Value(); + if (aMEInv.Contains(aE) && !aMEInvToAvoid.Contains(aE)) { + aReallyInvEdges.Add(aE); + } + } + } + else { + const TopTools_ListOfShape& aLFInv = theInvFaces(i); + aItLF.Initialize(aLFInv); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Shape& aFIm = aItLF.Value(); + TopExp_Explorer aExpE(aFIm, TopAbs_EDGE); + for (; aExpE.More(); aExpE.Next()) { + const TopoDS_Shape& aE = aExpE.Current(); + if (theInvEdges.Contains(aE) && !aMEInvToAvoid.Contains(aE)) { + aReallyInvEdges.Add(aE); + } + } + } + } + } + // + theInvEdges = aReallyInvEdges; +} + +//======================================================================= +//function : FindFacesToRebuild +//purpose : Looking for the faces that have to be rebuilt: +// 1. Faces close to invalidity +// 2. Faces containing some invalid parts +//======================================================================= +void FindFacesToRebuild(const TopTools_IndexedDataMapOfShapeListOfShape& theLFImages, + const TopTools_IndexedMapOfShape& theInvEdges, + const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, + const TopTools_DataMapOfShapeListOfShape& theSSInterfs, + TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild, + TopTools_MapOfShape& theFSelfRebAvoid) +{ + Standard_Integer i, aNb = theLFImages.Extent(); + if (!aNb) { + return; + } + // + Standard_Boolean bRebuild; + TopTools_ListIteratorOfListOfShape aItLF; + TopTools_ListOfShape aLEValid; + TopTools_MapOfShape aMFence, aMEReb, aMFReb; + TopExp_Explorer aExp; + // + TopTools_DataMapOfShapeListOfShape aDMFLV; + // get edges from invalid faces + aNb = theInvFaces.Extent(); + for (i = 1; i <= aNb; i++) { + const TopoDS_Shape& aF = theInvFaces.FindKey(i); + aMFence.Clear(); + TopTools_ListOfShape aLVAvoid; + const TopTools_ListOfShape& aLFIm = theInvFaces(i); + aItLF.Initialize(aLFIm); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Shape& aFIm = aItLF.Value(); + aExp.Init(aFIm, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aE = aExp.Current(); + aMEReb.Add(aE); + if (theInvEdges.Contains(aE)) { + TopExp_Explorer aExpV(aE, TopAbs_VERTEX); + for (; aExpV.More(); aExpV.Next()) { + const TopoDS_Shape& aV = aExpV.Current(); + if (aMFence.Add(aV)) { + aLVAvoid.Append(aV); + aMEReb.Add(aV); + } + } + } + } + } + // + if (aLVAvoid.Extent()) { + aDMFLV.Bind(aF, aLVAvoid); + } + // + const TopTools_ListOfShape* pLF = theSSInterfs.Seek(aF); + if (pLF) { + TopTools_ListIteratorOfListOfShape aItLFE(*pLF); + for (; aItLFE.More(); aItLFE.Next()) { + const TopoDS_Shape& aFE = aItLFE.Value(); + aMFReb.Add(aFE); + } + } + } + // + // get face to rebuild + aNb = theLFImages.Extent(); + for (i = 1; i <= aNb; i++) { + const TopoDS_Shape& aF = theLFImages.FindKey(i); + const TopTools_ListOfShape& aLFIm = theLFImages(i); + TopTools_MapOfShape aMVAvoid; + if (aDMFLV.IsBound(aF)) { + const TopTools_ListOfShape& aLVAvoid = aDMFLV.Find(aF); + TopTools_ListIteratorOfListOfShape aItLV(aLVAvoid); + for (; aItLV.More(); aItLV.Next()) { + const TopoDS_Shape& aV = aItLV.Value(); + aMVAvoid.Add(aV); + } + } + // + bRebuild = aMFReb.Contains(aF); + aLEValid.Clear(); + aMFence.Clear(); + // + aItLF.Initialize(aLFIm); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Shape& aFIm = aItLF.Value(); + aExp.Init(aFIm, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Edge& anEIm = TopoDS::Edge(aExp.Current()); + if (!theInvEdges.Contains(anEIm)) { + if (aMFence.Add(anEIm)) { + aLEValid.Append(anEIm); + } + } + // + if (!bRebuild) { + bRebuild = aMEReb.Contains(anEIm); + } + // + if (!bRebuild) { + // check vertices + TopExp_Explorer aExpV(anEIm, TopAbs_VERTEX); + for (; aExpV.More() && !bRebuild; aExpV.Next()) { + const TopoDS_Shape& aV = aExpV.Current(); + if (!aMVAvoid.Contains(aV)) { + bRebuild = aMEReb.Contains(aV); + } + } + } + } + } + // + if (!bRebuild) { + bRebuild = aLFIm.Extent() && theInvFaces.Contains(aF); + if (bRebuild) { + theFSelfRebAvoid.Add(aF); + } + } + // + if (bRebuild) { + theFToRebuild.Add(aF, aLEValid); + } + } +} + +//======================================================================= +//function : RebuildFaces +//purpose : Rebuilding of the faces +//======================================================================= +void RebuildFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild, + const TopTools_MapOfShape& theFSelfRebAvoid, + const TopoDS_Shape& theSolids, + const TopTools_DataMapOfShapeListOfShape& theSSInterfs, + TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + TopTools_DataMapOfShapeShape& theFacesOrigins, + TopTools_DataMapOfShapeListOfShape& theOEImages, + TopTools_DataMapOfShapeListOfShape& theOEOrigins, + TopTools_MapOfShape& theLastInvEdges, + TopTools_IndexedMapOfShape& theEdgesToAvoid, + TopTools_IndexedMapOfShape& theInvEdges, + TopTools_IndexedMapOfShape& theValidEdges, + const TopTools_MapOfShape& theInvertedEdges, + TopTools_DataMapOfShapeInteger& theAlreadyInvFaces, + TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, + const TopTools_DataMapOfShapeShape& theArtInvFaces, + TopTools_MapOfShape& theVertsToAvoid, + TopTools_DataMapOfShapeShape& theETrimEInf, + Handle(BRepAlgo_AsDes)& theAsDes) +{ + TopTools_MapOfShape aModifiedEdges; + // + // 1. Intersect faces + IntersectFaces(theFToRebuild, theFSelfRebAvoid, theSolids, theSSInterfs, theFImages, theEdgesOrigins, theOEImages, + theOEOrigins, theInvEdges, theValidEdges, theInvertedEdges, theEdgesToAvoid, + theInvFaces, theArtInvFaces, theVertsToAvoid, theETrimEInf, aModifiedEdges, theAsDes); + // + // 2. Repeat steps to build the correct faces + BuildSplitsOfInvFaces(theFToRebuild, aModifiedEdges, theFImages, theEdgesOrigins, + theFacesOrigins, theOEImages, theOEOrigins, theLastInvEdges, + theEdgesToAvoid, theVertsToAvoid, theAlreadyInvFaces, theValidEdges, + theETrimEInf, theAsDes); +} + +//======================================================================= +//function : IntersectFaces +//purpose : Intersection of the faces that should be rebuild +// to resolve all invalidities +//======================================================================= +void IntersectFaces(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild, + const TopTools_MapOfShape& theFSelfRebAvoid, + const TopoDS_Shape& theSolids, + const TopTools_DataMapOfShapeListOfShape& theSSInterfs, + TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + TopTools_DataMapOfShapeListOfShape& theOEImages, + TopTools_DataMapOfShapeListOfShape& theOEOrigins, + TopTools_IndexedMapOfShape& theInvEdges, + TopTools_IndexedMapOfShape& theValidEdges, + const TopTools_MapOfShape& theInvertedEdges, + TopTools_IndexedMapOfShape& theEdgesToAvoid, + TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, + const TopTools_DataMapOfShapeShape& theArtInvFaces, + TopTools_MapOfShape& theVertsToAvoid, + TopTools_DataMapOfShapeShape& theETrimEInf, + TopTools_MapOfShape& theModifiedEdges, + Handle(BRepAlgo_AsDes)& theAsDes) +{ + Standard_Integer aNbFR = theFToRebuild.Extent(); + if (!aNbFR) { + return; + } + // + Standard_Integer i, j, k, aNbInv; + TopTools_ListIteratorOfListOfShape aItLF, aItLE; + TopExp_Explorer aExp; + // + // get vertices from invalid edges + TopTools_MapOfShape aMVInv, aMVInvAll; + aNbInv = theInvEdges.Extent(); + for (i = 1; i <= aNbInv; ++i) { + const TopoDS_Shape& aEInv = theInvEdges(i); + Standard_Boolean bValid = theValidEdges.Contains(aEInv); + aExp.Init(aEInv, TopAbs_VERTEX); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aV = aExp.Current(); + aMVInvAll.Add(aV); + if (!bValid) { + aMVInv.Add(aV); + } + } + } + // + Standard_Boolean bLookVertToAvoid = (aMVInv.Extent() > 0); + // + TopTools_DataMapOfShapeListOfShape aDMSF, aMDone, aMEInfETrim, aDMVEFull; + TopTools_IndexedDataMapOfShapeListOfShape aFLE, aDMEFInv; + // + // Add all faces to rebuild to outgoing map , + // plus link edges and vertices to the faces to + // define intersection faces + PrepareFacesForIntersection(theFToRebuild, theFImages, theInvFaces, theArtInvFaces, + bLookVertToAvoid, aFLE, aMDone, aDMSF, aMEInfETrim, + aDMVEFull, theETrimEInf, aDMEFInv); + + // Find vertices to avoid while trimming the edges. + // These vertices are taken from the invalid edges common between + // splits of different invalid, but not artificially, faces. + // Additional condition for these vertices is that all + // edges adjacent to this vertex must be either invalid + // or contained in invalid faces + TopTools_MapOfShape aMVRInv = theVertsToAvoid; + FindVerticesToAvoid(aDMEFInv, theInvEdges, theValidEdges, aDMVEFull, aMVRInv); + // + // The faces should be intersected selectively - + // intersect only faces neighboring to the same invalid face + // and connected to its invalid edges; + // 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; + TopTools_IndexedDataMapOfShapeListOfShape aDMVEVal; + // + 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(); + aExp.Init(aFInv, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aE = aExp.Current(); + if (!theInvEdges.Contains(aE) && aMFence.Add(aE)) { + TopExp::MapShapesAndAncestors(aE, TopAbs_VERTEX, TopAbs_EDGE, aDMVEVal); + } + } + } + } + // + // collect edges with free vertices + Standard_Integer aNbV = aDMVEVal.Extent(); + for (i = 1; i <= aNbV; ++i) { + const TopTools_ListOfShape& aLEV = aDMVEVal(i); + if (aLEV.Extent() == 1) { + const TopoDS_Shape& aE = aLEV.First(); + 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 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& aV = aItE.Value(); + if (aDMSF.Find(aV).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(); + // + 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); + } + } + } + } + } + // + // Bounding vertices of not trimmed edges + TopTools_MapOfShape aMVBounds; + // Save connections between not trimmed edge and its trimmed parts + TopTools_DataMapOfShapeListOfShape aDMEETrim; + // Splits of the new edges + TopTools_DataMapOfShapeListOfShape aEImages; + BRep_Builder aBB; + // + aNbInv = theInvFaces.Extent(); + for (k = 1; k <= aNbInv; ++k) { + const TopoDS_Shape& aFInv = theInvFaces.FindKey(k); + Standard_Boolean bSelfRebAvoid = theFSelfRebAvoid.Contains(aFInv); + const TopTools_ListOfShape& aLFInv = theInvFaces(k); + // + TopTools_ListOfShape aLCB; + if (aLFInv.Extent() > 1) { + // make compound of invalid faces + TopoDS_Compound aCFInv; + aBB.MakeCompound(aCFInv); + // + TopTools_ListIteratorOfListOfShape aIt(aLFInv); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aFIm = aIt.Value(); + aBB.Add(aCFInv, aFIm); + } + // + // make connexity blocks + BOPTools_AlgoTools::MakeConnexityBlocks(aCFInv, TopAbs_EDGE, TopAbs_FACE, aLCB); + } + else { + aLCB = aLFInv; + } + // + Standard_Boolean bArtificial = theArtInvFaces.IsBound(aFInv); + TopTools_ListIteratorOfListOfShape aItLCB(aLCB); + for (; aItLCB.More(); aItLCB.Next()) { + const TopoDS_Shape& aCBInv = aItLCB.Value(); + // + TopTools_MapOfShape aMEFence; + // + TopoDS_Compound aCBE; + aBB.MakeCompound(aCBE); + // + TopExp_Explorer aExp(aCBInv, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aE = aExp.Current(); + if (theInvEdges.Contains(aE) || (bArtificial && aMEAlone.Contains(aE))) { + if (aMEFence.Add(aE)) { + aBB.Add(aCBE, aE); + } + } + } + // + // make connexity blocks of edges + TopTools_ListOfShape aLCBE; + BOPTools_AlgoTools::MakeConnexityBlocks(aCBE, TopAbs_VERTEX, TopAbs_EDGE, aLCBE); + // + TopTools_ListIteratorOfListOfShape aItLCBE(aLCBE); + for (; aItLCBE.More(); aItLCBE.Next()) { + const TopoDS_Shape& aCBELoc = aItLCBE.Value(); + // + // map of edges and vertices of processing invalidity + TopTools_IndexedMapOfShape aME; + // map of vertices to trim the new edges + TopTools_IndexedMapOfShape aMECV; + TopExp::MapShapes(aCBELoc, TopAbs_EDGE, aME); + aMECV = aME; + TopExp::MapShapes(aCBELoc, TopAbs_VERTEX, aME); + // + // Using the map find chain of faces to be intersected; + // + // faces for intersection + TopTools_IndexedMapOfShape aMFInt; + // additional faces for intersection + TopTools_IndexedMapOfShape aMFIntExt; + // splits of faces for intersection + TopTools_ListOfShape aLFInt; + // faces to avoid intersection + TopTools_IndexedMapOfShape aMFAvoid; + // + FindFacesForIntersection(aFInv, aME, theFImages, aDMSF, aMVInvAll, + theArtInvFaces, bArtificial, theSSInterfs, aMFAvoid, aMFInt, aMFIntExt, aLFInt); + if (aMFInt.Extent() < 3) { + // nothing to intersect + continue; + } + // + // intersect the faces, but do not intersect the invalid ones + // among each other (except for the artificially invalid faces) + TopTools_IndexedMapOfShape aMEToInt; + Standard_Integer aNb = aMFInt.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopoDS_Face& aFi = TopoDS::Face(aMFInt(i)); + if (bSelfRebAvoid && aFi.IsSame(aFInv)) { + continue; + } + // + const TopTools_ListOfShape& aLFImi = theFImages.FindFromKey(aFi); + // + TopTools_ListOfShape& aLFEi = aFLE.ChangeFromKey(aFi); + // + TopTools_ListOfShape& aLFDone = aMDone.ChangeFind(aFi); + // + for (j = i + 1; j <= aNb; ++j) { + const TopoDS_Face& aFj = TopoDS::Face(aMFInt(j)); + if (bSelfRebAvoid && aFj.IsSame(aFInv)) { + continue; + } + // + const TopTools_ListOfShape& aLFImj = theFImages.FindFromKey(aFj); + // + TopTools_ListOfShape& aLFEj = aFLE.ChangeFromKey(aFj); + // + // if there are some common edges between faces + // we should use these edges and do not intersect again. + TopTools_ListOfShape aLEC; + FindCommonParts(aLFImi, aLFImj, aLEC); + // + if (aLEC.Extent()) { + // no need to intersect if we have common edges between faces + Standard_Boolean bForceUse = aMFIntExt.Contains(aFi) || aMFIntExt.Contains(aFj); + ProcessCommonEdges(aLEC, theInvEdges, theValidEdges, aME, theETrimEInf, aMEInfETrim, + theOEOrigins, bForceUse, aMECV, aDMEETrim, aLFEi, aLFEj, aMEToInt); + continue; + } + // + // check if both these faces are invalid and sharing edges + if (theInvFaces.Contains(aFi) && theInvFaces.Contains(aFj) && + !theArtInvFaces.IsBound(aFi) && !theArtInvFaces.IsBound(aFj)) { + continue; + } + // + // check if these two faces have already been treated + aItLE.Initialize(aLFDone); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Shape& aF = aItLE.Value(); + if (aF.IsSame(aFj)) { + break; + } + } + // + if (aItLE.More()) { + // use intersection line obtained on the previous steps + // plus, find new origins for these lines + UpdateIntersectedFaces(aFInv, aFi, aFj, aLFInv, aLFImi, aLFImj, + aLFEi, aLFEj, theEdgesOrigins, aMEToInt); + continue; + } + // + if (aMFAvoid.Contains(aFi) || aMFAvoid.Contains(aFj)) { + continue; + } + // + aLFDone.Append(aFj); + aMDone.ChangeFind(aFj).Append(aFi); + // + IntersectFaces(aFInv, aFi, aFj, aLFInv, aLFImi, aLFImj, + aLFEi, aLFEj, theEdgesOrigins, aMECV, aMEToInt); + } + } + // + // intersect and trim edges for this chain + IntersectAndTrimEdges(theFToRebuild, aMFInt, aMEToInt, aDMEETrim, + aME, aMECV, aMVInv, aMVRInv, aMVBounds, aEImages); + } + } + } + // + // filter the obtained edges + UpdateValidEdges(theFToRebuild, theFImages, aFLE, aMVBounds, theSolids, theInvEdges, + theInvertedEdges, theEdgesToAvoid, theEdgesOrigins, theOEImages, theOEOrigins, + theVertsToAvoid, theETrimEInf, aEImages, aDMEETrim, theModifiedEdges, theAsDes); +} + +//======================================================================= +//function : PrepareFacesForIntersection +//purpose : Preparation of the maps for analyzing intersections of the faces +//======================================================================= +void PrepareFacesForIntersection(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild, + const TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces, + const TopTools_DataMapOfShapeShape& theArtInvFaces, + const Standard_Boolean bLookVertToAvoid, + TopTools_IndexedDataMapOfShapeListOfShape& theFLE, + TopTools_DataMapOfShapeListOfShape& theMDone, + TopTools_DataMapOfShapeListOfShape& theDMSF, + TopTools_DataMapOfShapeListOfShape& theMEInfETrim, + TopTools_DataMapOfShapeListOfShape& theDMVEFull, + TopTools_DataMapOfShapeShape& theETrimEInf, + TopTools_IndexedDataMapOfShapeListOfShape& theDMEFInv) +{ + Standard_Integer i, aNb = theFToRebuild.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopoDS_Shape& aF = theFToRebuild.FindKey(i); + // + TopTools_ListOfShape aLE; + theFLE.Add(aF, aLE); + theMDone.Bind(aF, aLE); + // + const TopTools_ListOfShape& aLFIm = theFImages.FindFromKey(aF); + TopTools_ListIteratorOfListOfShape aItLF(aLFIm); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Shape& aFIm = aItLF.Value(); + TopExp_Explorer aExp(aFIm, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aE = aExp.Current(); + // save connection to untrimmed face + TopTools_ListOfShape *pLF = theDMSF.ChangeSeek(aE); + if (!pLF) { + pLF = theDMSF.Bound(aE, TopTools_ListOfShape()); + } + AppendToList(*pLF, aF); + // + // save connection to untrimmed edge + const TopoDS_Shape& aEInf = theETrimEInf.Find(aE); + TopTools_ListOfShape *pLETrim = theMEInfETrim.ChangeSeek(aEInf); + if (!pLETrim) { + pLETrim = theMEInfETrim.Bound(aEInf, TopTools_ListOfShape()); + } + AppendToList(*pLETrim, aE); + // + TopExp_Explorer aExpV(aE, TopAbs_VERTEX); + for (; aExpV.More(); aExpV.Next()) { + const TopoDS_Shape& aV = aExpV.Current(); + // save connection to face + TopTools_ListOfShape *pLFV = theDMSF.ChangeSeek(aV); + if (!pLFV) { + pLFV = theDMSF.Bound(aV, TopTools_ListOfShape()); + } + AppendToList(*pLFV, aF); + // + if (bLookVertToAvoid) { + // save connection to edges + TopTools_ListOfShape *pLEV = theDMVEFull.ChangeSeek(aV); + if (!pLEV) { + pLEV = theDMVEFull.Bound(aV, TopTools_ListOfShape()); + } + AppendToList(*pLEV, aE); + } + } + } + } + // + if (bLookVertToAvoid) { + // get edges of invalid faces (from invalid splits only) + const TopTools_ListOfShape *pLFInv = theInvFaces.Seek(aF); + if (!pLFInv || theArtInvFaces.IsBound(aF)) { + continue; + } + // + aItLF.Initialize(*pLFInv); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Shape& aFInv = aItLF.Value(); + TopExp_Explorer aExp(aFInv, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aE = aExp.Current(); + TopTools_ListOfShape *pLF = theDMEFInv.ChangeSeek(aE); + if (!pLF) { + pLF = &theDMEFInv(theDMEFInv.Add(aE, TopTools_ListOfShape())); + } + AppendToList(*pLF, aF); + } + } + } + } +} + +//======================================================================= +//function : FindVerticesToAvoid +//purpose : Looking for the invalid vertices +//======================================================================= +void FindVerticesToAvoid(const TopTools_IndexedDataMapOfShapeListOfShape& theDMEFInv, + const TopTools_IndexedMapOfShape& theInvEdges, + const TopTools_IndexedMapOfShape& theValidEdges, + TopTools_DataMapOfShapeListOfShape& theDMVEFull, + TopTools_MapOfShape& theMVRInv) +{ + TopTools_MapOfShape aMFence; + Standard_Integer i, aNb = theDMEFInv.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopTools_ListOfShape& aLFInv = theDMEFInv(i); + if (aLFInv.Extent() == 1) { + continue; + } + // + const TopoDS_Shape& aE = theDMEFInv.FindKey(i); + 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 (!pLE) { + theMVRInv.Add(aV); + continue; + } + // + TopTools_ListIteratorOfListOfShape aItLE(*pLE); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Shape& aEV = aItLE.Value(); + if (!theInvEdges.Contains(aEV) && !theDMEFInv.Contains(aEV)) { + break; + } + } + if (!aItLE.More()) { + theMVRInv.Add(aV); + } + } + } +} + +//======================================================================= +//function : FindFacesForIntersection +//purpose : Looking for the faces around each invalidity for intersection +//======================================================================= +void FindFacesForIntersection(const TopoDS_Shape& theFInv, + const TopTools_IndexedMapOfShape& theME, + const TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + const TopTools_DataMapOfShapeListOfShape& theDMSF, + const TopTools_MapOfShape& theMVInvAll, + const TopTools_DataMapOfShapeShape& theArtInvFaces, + const Standard_Boolean theArtCase, + const TopTools_DataMapOfShapeListOfShape& theSSInterfs, + TopTools_IndexedMapOfShape& theMFAvoid, + TopTools_IndexedMapOfShape& theMFInt, + TopTools_IndexedMapOfShape& theMFIntExt, + TopTools_ListOfShape& theLFImInt) +{ + Standard_Integer i, aNbE = theME.Extent(); + // + TopTools_IndexedMapOfShape aMShapes; + // + for (i = 1; i <= aNbE; ++i) { + const TopoDS_Shape& aS = theME(i); + if (!theDMSF.IsBound(aS)) { + continue; + } + // + // in artificial case we intersect the faces which are close to invalidity + Standard_Boolean bAvoid = theArtCase ? + ((aS.ShapeType() == TopAbs_VERTEX) && !theMVInvAll.Contains(aS)) : Standard_False; + // + const TopTools_ListOfShape& aLF = theDMSF.Find(aS); + TopTools_ListIteratorOfListOfShape aItLF(aLF); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Shape& aF = aItLF.Value(); + if (theMFInt.Contains(aF)) { + continue; + } + // + if (bAvoid && theArtInvFaces.IsBound(aF)) { + theMFAvoid.Add(aF); + } + // + theMFInt.Add(aF); + // + Standard_Boolean bUse = !aF.IsSame(theFInv); + // + const TopTools_ListOfShape& aLFIm = theFImages.FindFromKey(aF); + TopTools_ListIteratorOfListOfShape aItLFIm(aLFIm); + for (; aItLFIm.More(); aItLFIm.Next()) { + const TopoDS_Shape& aFIm = aItLFIm.Value(); + theLFImInt.Append(aFIm); + if (bUse) { + TopExp::MapShapes(aFIm, TopAbs_EDGE, aMShapes); + } + } + } + } + // + if (theArtCase) { + return; + } + // + const TopTools_ListOfShape* pLFInv = theSSInterfs.Seek(theFInv); + if (!pLFInv) { + return; + } + // + TopTools_MapOfShape aMF; + TopTools_ListIteratorOfListOfShape aItLF(*pLFInv); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Shape& aF = aItLF.Value(); + aMF.Add(aF); + } + // + // the faces should be unique in each place + TopoDS_Compound aCF; + BRep_Builder().MakeCompound(aCF); + // + TopTools_IndexedMapOfShape aMFToAdd; + TopTools_DataMapOfShapeShape aDMFOr; + // + for (i = 1; i <= aNbE; ++i) { + const TopoDS_Shape& aS = theME(i); + const TopTools_ListOfShape* pLF = theSSInterfs.Seek(aS); + if (!pLF) { + continue; + } + // + aItLF.Initialize(*pLF); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Shape& aF = aItLF.Value(); + if (theMFInt.Contains(aF) || aMFToAdd.Contains(aF) || !aMF.Contains(aF)) { + continue; + } + // + // check if the face has some connection to already added for intersection faces + const TopTools_ListOfShape& aLFIm = theFImages.FindFromKey(aF); + TopTools_ListIteratorOfListOfShape aItLFIm(aLFIm); + for (; aItLFIm.More(); aItLFIm.Next()) { + const TopoDS_Shape& aFIm = aItLFIm.Value(); + TopExp_Explorer aExp(aFIm, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + if (aMShapes.Contains(aExp.Current())) { + break; + } + } + if (aExp.More()) { + break; + } + } + if (!aItLFIm.More()) { + continue; + } + // + aMFToAdd.Add(aF); + aItLFIm.Initialize(aLFIm); + for (; aItLFIm.More(); aItLFIm.Next()) { + const TopoDS_Shape& aFIm = aItLFIm.Value(); + aDMFOr.Bind(aFIm, aF); + BRep_Builder().Add(aCF, aFIm); + } + } + } + // + if (aMFToAdd.IsEmpty()) { + return; + } + // + TopTools_ListOfShape aLCB; + BOPTools_AlgoTools::MakeConnexityBlocks(aCF, TopAbs_EDGE, TopAbs_FACE, aLCB); + // + if ((aLCB.Extent() == 1) && (aMFToAdd.Extent() > 1)) { + return; + } + // + TopTools_ListIteratorOfListOfShape aItLCB(aLCB); + for (; aItLCB.More(); aItLCB.Next()) { + const TopoDS_Shape& aCB = aItLCB.Value(); + aMFToAdd.Clear(); + TopExp_Explorer aExpF(aCB, TopAbs_FACE); + for (; aExpF.More(); aExpF.Next()) { + const TopoDS_Shape& aFIm = aExpF.Current(); + aMFToAdd.Add(aDMFOr.Find(aFIm)); + } + // + if (aMFToAdd.Extent() == 1) { + const TopoDS_Shape& aF = aMFToAdd(1); + // + theMFInt.Add(aF); + theMFIntExt.Add(aF); + // + const TopTools_ListOfShape& aLFIm = theFImages.FindFromKey(aF); + TopTools_ListIteratorOfListOfShape aItLFIm(aLFIm); + for (; aItLFIm.More(); aItLFIm.Next()) { + const TopoDS_Shape& aFIm = aItLFIm.Value(); + theLFImInt.Append(aFIm); + } + } + } +} + +//======================================================================= +//function : ProcessCommonEdges +//purpose : Analyzing the common edges between splits of offset faces +//======================================================================= +void ProcessCommonEdges(const TopTools_ListOfShape& theLEC, + const TopTools_IndexedMapOfShape& theInvEdges, + const TopTools_IndexedMapOfShape& theValidEdges, + const TopTools_IndexedMapOfShape& theME, + const TopTools_DataMapOfShapeShape& theETrimEInf, + const TopTools_DataMapOfShapeListOfShape& theMEInfETrim, + const TopTools_DataMapOfShapeListOfShape& theOEOrigins, + const Standard_Boolean theForceUse, + TopTools_IndexedMapOfShape& theMECV, + TopTools_DataMapOfShapeListOfShape& theDMEETrim, + TopTools_ListOfShape& theLFEi, + TopTools_ListOfShape& theLFEj, + TopTools_IndexedMapOfShape& theMEToInt) +{ + TopTools_ListOfShape aLEC; + // process common edges + TopTools_ListIteratorOfListOfShape aItLE(theLEC); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Shape& aEC = aItLE.Value(); + // + // check first if common edges are valid + if (theInvEdges.Contains(aEC) && !theValidEdges.Contains(aEC)) { + continue; + } + // + // common edge should have connection to current invalidity + if (theME.Contains(aEC)) { + aLEC.Append(aEC); + continue; + } + // + TopoDS_Iterator aItV(aEC); + for (; aItV.More(); aItV.Next()) { + const TopoDS_Shape& aVE = aItV.Value(); + if (theME.Contains(aVE)) { + aLEC.Append(aEC); + break; + } + } + } + // + Standard_Boolean bUseOnlyInf = (aLEC.IsEmpty() && theForceUse); + if (bUseOnlyInf) { + aLEC = theLEC; + } + // + aItLE.Initialize(aLEC); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Shape& aEC = aItLE.Value(); + // + const TopoDS_Shape& aEInt = theETrimEInf.Find(aEC); + if (!bUseOnlyInf) { + // find the edges of the same original edge + // and take their vertices as well + const TopTools_ListOfShape& aLVE = theMEInfETrim.Find(aEInt); + TopTools_ListIteratorOfListOfShape aItLVE(aLVE); + for (; aItLVE.More(); aItLVE.Next()) { + const TopoDS_Shape& aECx = aItLVE.Value(); + // + const TopTools_ListOfShape* pLEOr = theOEOrigins.Seek(aECx); + if (!pLEOr || (pLEOr->Extent() == 1)) { + TopExp::MapShapes(aECx, TopAbs_VERTEX, theMECV); + } + } + // + // bind unlimited edge to its trimmed part in face to update maps of + // images and origins in the future + TopTools_ListOfShape* pLTAdded = theDMEETrim.ChangeSeek(aEInt); + if (!pLTAdded) { + pLTAdded = theDMEETrim.Bound(aEInt, TopTools_ListOfShape()); + } + AppendToList(*pLTAdded, aEC); + } + // + AppendToList(theLFEi, aEInt); + AppendToList(theLFEj, aEInt); + theMEToInt.Add(aEInt); + } +} + +//======================================================================= +//function : UpdateIntersectedFaces +//purpose : Updating the already interfered faces +//======================================================================= +void UpdateIntersectedFaces(const TopoDS_Shape& theFInv, + const TopoDS_Shape& theFi, + const TopoDS_Shape& theFj, + const TopTools_ListOfShape& theLFInv, + const TopTools_ListOfShape& theLFImi, + const TopTools_ListOfShape& theLFImj, + const TopTools_ListOfShape& theLFEi, + const TopTools_ListOfShape& theLFEj, + TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + TopTools_IndexedMapOfShape& theMEToInt) +{ + // Find common edges in these two lists + TopTools_MapOfShape aMEi; + TopTools_ListIteratorOfListOfShape aItLE(theLFEi); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Shape& aE = aItLE.Value(); + aMEi.Add(aE); + } + // + // find origins + TopTools_IndexedMapOfShape aMEToFindOrigins; + TopTools_ListOfShape aLEToFindOrigins; + if (!theFi.IsSame(theFInv)) { + FindCommonParts(theLFImi, theLFInv, aLEToFindOrigins); + } + if (!theFj.IsSame(theFInv)) { + FindCommonParts(theLFImj, theLFInv, aLEToFindOrigins); + } + // + TopTools_ListOfShape aLEOrInit; + aItLE.Initialize(aLEToFindOrigins); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Shape& aEC = aItLE.Value(); + aMEToFindOrigins.Add(aEC); + } + // + FindOrigins(theLFImi, theLFImj, aMEToFindOrigins, theEdgesOrigins, aLEOrInit); + // + aItLE.Initialize(theLFEj); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Shape& aE = aItLE.Value(); + if (aMEi.Contains(aE)) { + theMEToInt.Add(aE); + if (aLEOrInit.Extent()) { + if (theEdgesOrigins.IsBound(aE)) { + TopTools_ListOfShape& aLEOr = theEdgesOrigins.ChangeFind(aE); + TopTools_ListIteratorOfListOfShape aItLEOr(aLEOrInit); + for (; aItLEOr.More(); aItLEOr.Next()) { + const TopoDS_Shape& aEOr = aItLEOr.Value(); + AppendToList(aLEOr, aEOr); + } + } + else { + theEdgesOrigins.Bind(aE, aLEOrInit); + } + } + } + } +} + +//======================================================================= +//function : IntersectFaces +//purpose : Intersection of the pair of faces +//======================================================================= +void IntersectFaces(const TopoDS_Shape& theFInv, + const TopoDS_Shape& theFi, + const TopoDS_Shape& theFj, + const TopTools_ListOfShape& theLFInv, + const TopTools_ListOfShape& theLFImi, + const TopTools_ListOfShape& theLFImj, + TopTools_ListOfShape& theLFEi, + TopTools_ListOfShape& theLFEj, + TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + TopTools_IndexedMapOfShape& theMECV, + TopTools_IndexedMapOfShape& theMEToInt) +{ + // intersect faces + TopAbs_State aSide = TopAbs_OUT; + TopTools_ListOfShape aLInt1, aLInt2; + TopoDS_Edge aNullEdge; + BRepOffset_Tool::Inter3D(TopoDS::Face(theFi), TopoDS::Face(theFj), aLInt1, aLInt2, aSide, aNullEdge); + // + if (aLInt1.IsEmpty()) { + return; + } + // + // find common vertices for trimming edges + TopTools_ListOfShape aLCV; + TopTools_ListIteratorOfListOfShape aItLE; + FindCommonParts(theLFImi, theLFImj, aLCV, TopAbs_VERTEX); + if (aLCV.Extent() > 1) { + aItLE.Initialize(aLCV); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Shape& aCV = aItLE.Value(); + theMECV.Add(aCV); + } + } + // + // find origins + TopTools_IndexedMapOfShape aMEToFindOrigins; + TopTools_ListOfShape aLEToFindOrigins; + if (!theFi.IsSame(theFInv)) { + FindCommonParts(theLFImi, theLFInv, aLEToFindOrigins); + } + if (!theFj.IsSame(theFInv)) { + FindCommonParts(theLFImj, theLFInv, aLEToFindOrigins); + } + TopTools_ListOfShape aLEOrInit; + aItLE.Initialize(aLEToFindOrigins); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Shape& aEC = aItLE.Value(); + aMEToFindOrigins.Add(aEC); + } + // + FindOrigins(theLFImi, theLFImj, aMEToFindOrigins, theEdgesOrigins, aLEOrInit); + // + aItLE.Initialize(aLInt1); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Shape& aEInt = aItLE.Value(); + theLFEi.Append(aEInt); + theLFEj.Append(aEInt); + // + if (aLEOrInit.Extent()) { + theEdgesOrigins.Bind(aEInt, aLEOrInit); + } + // + theMEToInt.Add(aEInt); + } +} + +//======================================================================= +//function : FindOrigins +//purpose : Looking for the origin edges +//======================================================================= +void FindOrigins(const TopTools_ListOfShape& theLFIm1, + const TopTools_ListOfShape& theLFIm2, + const TopTools_IndexedMapOfShape& theME, + const TopTools_DataMapOfShapeListOfShape& theOrigins, + TopTools_ListOfShape& theLEOr) +{ + Standard_Integer i; + TopTools_MapOfShape aMFence; + TopExp_Explorer aExp; + TopTools_ListIteratorOfListOfShape aIt, aItLE; + // + for (i = 0; i < 2; ++i) { + const TopTools_ListOfShape& aLF = !i ? theLFIm1 : theLFIm2; + aIt.Initialize(aLF); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aF = aIt.Value(); + // + aExp.Init(aF, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aE = aExp.Current(); + // + if (theME.Contains(aE) && theOrigins.IsBound(aE)) { + const TopTools_ListOfShape& aLEOr = theOrigins.Find(aE); + aItLE.Initialize(aLEOr); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Shape& aEOr = aItLE.Value(); + // + if (aMFence.Add(aEOr) && (aEOr.ShapeType() == TopAbs_EDGE)) { + theLEOr.Append(aEOr); + } + } // for (; aItLE.More(); aItLE.Next()) { + } // if (theME.Contains(aE) && theOrigins.IsBound(aE)) { + } // aExp.Init(aF, TopAbs_EDGE); + } // for (; aIt.More(); aIt.Next()) { + } // for (i = 0; i < 2; ++i) { +} + +//======================================================================= +//function : IntersectAndTrimEdges +//purpose : Intersection of the new intersection edges among themselves +//======================================================================= +void IntersectAndTrimEdges(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild, + const TopTools_IndexedMapOfShape& theMFInt, + const TopTools_IndexedMapOfShape& theMEInt, + const TopTools_DataMapOfShapeListOfShape& theDMEETrim, + const TopTools_IndexedMapOfShape& theMSInv, + const TopTools_IndexedMapOfShape& theMVE, + const TopTools_MapOfShape& theVertsToAvoid, + const TopTools_MapOfShape& theNewVertsToAvoid, + TopTools_MapOfShape& theMVBounds, + TopTools_DataMapOfShapeListOfShape& theEImages) +{ + Standard_Integer i, aNb = theMEInt.Extent(); + if (!aNb) { + return; + } + // + BOPCol_ListOfShape aLArgs; + TopTools_MapOfShape aMFence; + TopTools_ListIteratorOfListOfShape aIt, aIt1; + TopExp_Explorer aExp; + // + // get vertices from the splits of intersected faces. + // vertices are taken from the edges close to invalidity + // + TopTools_IndexedDataMapOfShapeListOfShape aDMVE; + aNb = theMFInt.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopoDS_Shape& aF = theMFInt(i); + const TopTools_ListOfShape& aLE = theFToRebuild.FindFromKey(aF); + // + aIt.Initialize(aLE); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aE = aIt.Value(); + TopExp::MapShapesAndAncestors(aE, TopAbs_VERTEX, TopAbs_EDGE, aDMVE); + // + aExp.Init(aE, TopAbs_VERTEX); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aV1 = aExp.Current(); + if (!theVertsToAvoid.Contains(aV1) && theMVE.Contains(aV1) && aMFence.Add(aV1)) { + aLArgs.Append(aV1); + } + } + } + } + // + aNb = theMSInv.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopoDS_Shape& aV = theMSInv(i); + if (aV.ShapeType() != TopAbs_VERTEX) { + continue; + } + // + TopTools_ListOfShape *pLVE = aDMVE.ChangeSeek(aV); + if (!pLVE) { + continue; + } + // + aIt.Initialize(*pLVE); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aE = aIt.Value(); + // + aExp.Init(aE, TopAbs_VERTEX); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aV1 = aExp.Current(); + if (!theVertsToAvoid.Contains(aV1) && aMFence.Add(aV1)) { + aLArgs.Append(aV1); + } + } + } + } + // + // bounding vertices of untrimmed edges + TopTools_ListOfShape aLVBounds; + // new intersection edges + TopTools_ListOfShape aLENew; + // get edges to intersect + TopTools_ListOfShape aLEInt; + aNb = theMEInt.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopoDS_Shape& aE = theMEInt(i); + if (!aMFence.Add(aE)) { + continue; + } + // + if (!theDMEETrim.IsBound(aE)) { + aLENew.Append(aE); + } + // + aLEInt.Append(aE); + aLArgs.Append(aE); + // + aExp.Init(aE, TopAbs_VERTEX); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aV = aExp.Current(); + aLVBounds.Append(aV); + } + } + // + // Intersect Edges + BOPAlgo_Builder aGF; + aGF.SetArguments(aLArgs); + aGF.Perform(); + if (aGF.ErrorStatus()) { + return; + } + // + // update vertices to avoid with SD vertices + aIt.Initialize(aLVBounds); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aV = aIt.Value(); + const TopTools_ListOfShape& aLVIm = aGF.Modified(aV); + if (aLVIm.IsEmpty()) { + theMVBounds.Add(aV); + } + else { + const TopoDS_Shape& aVIm = aLVIm.First(); + theMVBounds.Add(aVIm); + } + } + // + // find invalid splits of edges + TopTools_MapOfShape aMEInv; + GetInvalidEdges(theNewVertsToAvoid, theMVBounds, aGF, aMEInv); + // + // remove the splits containing vertices from invalid edges + aIt.Initialize(aLEInt); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aE = aIt.Value(); + // + TopTools_ListOfShape aLEIm = aGF.Modified(aE); + if (aLEIm.IsEmpty()) { + continue; + } + // + aIt1.Initialize(aLEIm); + for (; aIt1.More(); ) { + const TopoDS_Shape& aEIm = aIt1.Value(); + // + if (aMEInv.Contains(aEIm)) { + aLEIm.Remove(aIt1); + } + else { + aIt1.Next(); + } + } + // + if (aLEIm.Extent()) { + if (theEImages.IsBound(aE)) { + theEImages.ChangeFind(aE).Append(aLEIm); + } + else { + theEImages.Bind(aE, aLEIm); + } + } + } +} + +//======================================================================= +//function : GetInvalidEdges +//purpose : Looking for the invalid edges by intersecting with invalid vertices +//======================================================================= +void GetInvalidEdges(const TopTools_MapOfShape& theVertsToAvoid, + const TopTools_MapOfShape& theMVBounds, + BOPAlgo_Builder& theGF, + TopTools_MapOfShape& theMEInv) +{ + if (theVertsToAvoid.IsEmpty()) { + return; + } + // + TopTools_ListIteratorOfListOfShape aIt, aIt1; + // get vertices created with intersection edges + const TopoDS_Shape& aRes = theGF.Shape(); + TopTools_IndexedDataMapOfShapeListOfShape aDMVE; + TopExp::MapShapesAndAncestors(aRes, TopAbs_VERTEX, TopAbs_EDGE, aDMVE); + // + const BOPDS_PDS& pDS = theGF.PDS(); + // + // find invalid splits of edges + // check if the vertex is invalid: + // a. it may be the vertex SD with the vertices to avoid + // b. or it may be the vertex which is created by the intersection + // of only existing edges, i.e. no new intersection edges goes + // through this vertex + // + TopTools_MapOfShape aMVInv; + Standard_Integer i, aNb = aDMVE.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopoDS_Vertex& aV = TopoDS::Vertex(aDMVE.FindKey(i)); + if (theMVBounds.Contains(aV)) { + continue; + } + // + Standard_Integer nV = pDS->Index(aV); + if ((nV >= 0) && !pDS->IsNewShape(nV)) { + continue; + } + // + TopTools_MapIteratorOfMapOfShape aItM(theVertsToAvoid); + for (; aItM.More(); aItM.Next()) { + const TopoDS_Vertex& aVInv = *(TopoDS_Vertex*)&aItM.Value(); + Standard_Integer iFlag = BOPTools_AlgoTools::ComputeVV(aV, aVInv); + if (!iFlag) { + aMVInv.Add(aV); + break; + } + } + // + if (aItM.More()) { + const TopTools_ListOfShape& aLVE = aDMVE.FindFromKey(aV); + aIt.Initialize(aLVE); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aE = aIt.Value(); + theMEInv.Add(aE); + } + } + } +} + +//======================================================================= +//function : UpdateValidEdges +//purpose : Making the new splits and updating the maps +//======================================================================= +void UpdateValidEdges(const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild, + const TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + const TopTools_IndexedDataMapOfShapeListOfShape& theFLE, + const TopTools_MapOfShape& theMVBounds, + const TopoDS_Shape& theSolids, + const TopTools_IndexedMapOfShape& theInvEdges, + const TopTools_MapOfShape& theInvertedEdges, + TopTools_IndexedMapOfShape& theEdgesToAvoid, + TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + TopTools_DataMapOfShapeListOfShape& theOEImages, + TopTools_DataMapOfShapeListOfShape& theOEOrigins, + TopTools_MapOfShape& theVertsToAvoid, + TopTools_DataMapOfShapeShape& theETrimEInf, + TopTools_DataMapOfShapeListOfShape& theEImages, + TopTools_DataMapOfShapeListOfShape& theEETrim, + TopTools_MapOfShape& theModifiedEdges, + Handle(BRepAlgo_AsDes)& theAsDes) +{ + // update images and origins of edges, plus update AsDes + // + // new edges + TopTools_ListOfShape aLE; + // back connection from edges to faces + TopTools_DataMapOfShapeListOfShape aMELF; + // + Standard_Integer i, aNb = theFLE.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopoDS_Face& aF = TopoDS::Face(theFLE.FindKey(i)); + // + const TopTools_ListOfShape& aLEInt = theFLE(i); + TopTools_ListIteratorOfListOfShape aItLE(aLEInt); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Shape& aE = aItLE.Value(); + TopTools_ListOfShape* pLF = aMELF.ChangeSeek(aE); + if (!pLF) { + pLF = aMELF.Bound(aE, TopTools_ListOfShape()); + aLE.Append(aE); + } + pLF->Append(aF); + } + } + // + if (aLE.IsEmpty()) { + return; + } + // + // bounding edges, that are going to be replaced + TopTools_MapOfShape aMEB; + // + // new intersection edges + TopTools_ListOfShape aLENew; + TopTools_MapOfShape aMENew; + // map of old vertices + TopTools_MapOfShape aMVOld; + // back connection to untrimmed edges + TopTools_DataMapOfShapeListOfShape aDMEOr; + // + // trim the new intersection edges + BOPCol_ListOfShape aLA; + TrimNewIntersectionEdges(aLE, theEETrim, theMVBounds, theEImages, aMEB, aMVOld, aLENew, aLA, aDMEOr); + // + if (aLA.IsEmpty()) { + // update intersection edges + UpdateNewIntersectionEdges(aLE, aMELF, theEImages, theInvEdges, theInvertedEdges, theEdgesOrigins, + theOEImages, theOEOrigins, theETrimEInf, theEETrim, theModifiedEdges, theAsDes); + return; + } + // + TopoDS_Shape aSplits1; + if (aLA.Extent() > 1) { + // intersect the new splits among themselves to avoid self-intersections + IntersectEdges(aLA, aLE, aLENew, theMVBounds, theVertsToAvoid, theEImages, + theModifiedEdges, aDMEOr, aMENew, aSplits1); + } + else { + aSplits1 = aLA.First(); + } + // + // filter the new splits with bounds + TopoDS_Shape aFilterBounds; + GetBounds(theFImages, aMEB, aFilterBounds); + // + // intersect splits and bounds and remove those splits which have pure E/E intersection + TopTools_MapOfShape aMEInv; + GetInvalidEdgesByBounds(aSplits1, aFilterBounds, theFToRebuild, theFImages, theSolids, + theInvEdges, aMVOld, aMENew, aDMEOr, theEImages, theVertsToAvoid, aMEInv); + // + // get valid edges only + TopoDS_Shape aSplits; + if (aMEInv.Extent()) { + // clear images from found invalid edges + TopoDS_Compound aSp; + BRep_Builder().MakeCompound(aSp); + TopTools_MapOfShape aMFence; + // + TopTools_ListIteratorOfListOfShape aItLE(aLE); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Shape& aE = aItLE.Value(); + // + TopTools_ListOfShape* pLEIm = theEImages.ChangeSeek(aE); + if (!pLEIm) { + continue; + } + // + TopTools_ListIteratorOfListOfShape aItLEIm(*pLEIm); + for (; aItLEIm.More();) { + const TopoDS_Shape& aEIm = aItLEIm.Value(); + if (aMEInv.Contains(aEIm)) { + pLEIm->Remove(aItLEIm); + } + else { + if (aMFence.Add(aEIm)) { + BRep_Builder().Add(aSp, aEIm); + } + aItLEIm.Next(); + } + } + // + if (pLEIm->IsEmpty()) { + theEImages.UnBind(aE); + } + } + aSplits = aSp; + } + else { + aSplits = aSplits1; + } + // + // get bounds to update + // we need to update the edges of all the affected faces + TopTools_ListOfShape aLF; + // prepare the vertices from new splits of edges + TopTools_IndexedMapOfShape aMVSp; + TopExp::MapShapes(aSplits, TopAbs_VERTEX, aMVSp); + // + Standard_Integer aNbF = theFImages.Extent(); + for (i = 1; i <= aNbF; ++i) { + const TopoDS_Shape& aF = theFImages.FindKey(i); + if (theFLE.Contains(aF)) { + aLF.Append(aF); + continue; + } + // + // check the splits of faces to have vertices from splits + const TopTools_ListOfShape& aLFIm = theFImages(i); + TopTools_ListIteratorOfListOfShape aItLFIm(aLFIm); + for (; aItLFIm.More(); aItLFIm.Next()) { + const TopoDS_Shape& aFIm = aItLFIm.Value(); + // + TopExp_Explorer aExpV(aFIm, TopAbs_VERTEX); + for (; aExpV.More(); aExpV.Next()) { + const TopoDS_Shape& aV = aExpV.Current(); + if (aMVSp.Contains(aV)) { + break; + } + } + // + if (aExpV.More()) { + break; + } + } + // + if (aItLFIm.More()) { + aLF.Append(aF); + } + } + // + // get bounds from splits of faces of aLF + TopoDS_Shape aBounds; + TopTools_ListOfShape aLAValid, aLABounds; + GetBoundsToUpdate(aLF, theOEImages, theOEOrigins, aMEB, + aLABounds, aLAValid, aBounds, theAsDes); + // + // intersect valid splits with bounds and update both + BOPAlgo_Builder aGF; + aGF.AddArgument(aSplits); + aGF.AddArgument(aBounds); + aGF.Perform(); + // + // update splits + UpdateImages(aLE, theEImages, aGF, theModifiedEdges); + // + // update new intersection edges + UpdateNewIntersectionEdges(aLE, aMELF, theEImages, theInvEdges, theInvertedEdges, theEdgesOrigins, + theOEImages, theOEOrigins, theETrimEInf, theEETrim, theModifiedEdges, theAsDes); + // + // update bounds + UpdateImages(aLAValid, theOEImages, aGF, theModifiedEdges); + UpdateOrigins(aLABounds, theOEOrigins, aGF); + UpdateOrigins(aLABounds, theEdgesOrigins, aGF); + UpdateIntersectedEdges(aLABounds, theETrimEInf, aGF); + // + // update the edges to avoid with the splits + TopTools_IndexedMapOfShape aNewEdges; + const TopTools_ListOfShape* pSplitsIm = aGF.Images().Seek(aSplits); + if (pSplitsIm) { + TopTools_ListIteratorOfListOfShape aItSpIm(*pSplitsIm); + for (; aItSpIm.More(); aItSpIm.Next()) { + TopExp::MapShapes(aItSpIm.Value(), TopAbs_EDGE, aNewEdges); + } + } + // + Standard_Integer aNbE = theEdgesToAvoid.Extent(); + for (i = 1; i <= aNbE; ++i) { + const TopoDS_Shape& aE = theEdgesToAvoid(i); + const TopTools_ListOfShape& aLEIm = aGF.Modified(aE); + TopTools_ListIteratorOfListOfShape aItLEIm(aLEIm); + for (; aItLEIm.More(); aItLEIm.Next()) { + const TopoDS_Shape& aEIm = aItLEIm.Value(); + if (!aNewEdges.Contains(aEIm)) { + theEdgesToAvoid.Add(aItLEIm.Value()); + } + } + } +} + +//======================================================================= +//function : TrimNewIntersectionEdges +//purpose : +//======================================================================= +void TrimNewIntersectionEdges(const TopTools_ListOfShape& theLE, + const TopTools_DataMapOfShapeListOfShape& theEETrim, + const TopTools_MapOfShape& theMVBounds, + TopTools_DataMapOfShapeListOfShape& theEImages, + TopTools_MapOfShape& theMEB, + TopTools_MapOfShape& theMVOld, + TopTools_ListOfShape& theLENew, + BOPCol_ListOfShape& theLA, + TopTools_DataMapOfShapeListOfShape& theDMEOr) +{ + TopTools_ListIteratorOfListOfShape aIt, aIt1; + aIt.Initialize(theLE); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aE = aIt.Value(); + // + if (theEETrim.IsBound(aE)) { + const TopTools_ListOfShape& aLET = theEETrim.Find(aE); + aIt1.Initialize(aLET); + for (; aIt1.More(); aIt1.Next()) { + const TopoDS_Shape& aET = aIt1.Value(); + theMEB.Add(aET); + TopExp_Explorer aExpV(aET, TopAbs_VERTEX); + for (; aExpV.More(); aExpV.Next()) { + const TopoDS_Shape& aV = aExpV.Current(); + theMVOld.Add(aV); + } + } + } + // + if (!theEImages.IsBound(aE)) { + continue; + } + // + TopTools_ListOfShape& aLEIm = theEImages.ChangeFind(aE); + if (aLEIm.IsEmpty()) { + theEImages.UnBind(aE); + continue; + } + // + TopoDS_Shape aCEIm; + TopTools_MapOfShape aMEVBounds; + // + if (aLEIm.Extent() > 2) { + TopTools_IndexedMapOfShape aMV; + // fuse these parts + BOPAlgo_Builder aGFE; + TopTools_ListIteratorOfListOfShape aItLEIm(aLEIm); + for (; aItLEIm.More(); aItLEIm.Next()) { + const TopoDS_Shape& aEIm = aItLEIm.Value(); + aGFE.AddArgument(aEIm); + TopExp::MapShapes(aEIm, TopAbs_VERTEX, aMV); + } + // + // add two bounding vertices of this edge to the operation + TopoDS_Vertex aV1, aV2; + TopExp::Vertices(TopoDS::Edge(aE), aV1, aV2); + // + aGFE.AddArgument(aV1); + aGFE.AddArgument(aV2); + aMV.Add(aV1); + aMV.Add(aV2); + // + aGFE.Perform(); + if (!aGFE.ErrorStatus()) { + // get images of bounding vertices to remove splits containing them + // in case some of the bounding edges has been interfered + // during operation it is necessary to update their images as well + Standard_Integer iV, aNbV = aMV.Extent(); + for (iV = 1; iV <= aNbV; ++iV) { + const TopoDS_Shape& aV = aMV(iV); + if (theMVBounds.Contains(aV) || aV.IsSame(aV1) || aV.IsSame(aV2)) { + const TopTools_ListOfShape& aLVIm = aGFE.Modified(aV); + if (aLVIm.Extent()) { + aMEVBounds.Add(aLVIm.First()); + } + else { + aMEVBounds.Add(aV); + } + } + } + // + aCEIm = aGFE.Shape(); + } + } + else { + aCEIm = aLEIm.First(); + } + // + aLEIm.Clear(); + // + TopExp_Explorer aExp(aCEIm, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aEIm = aExp.Current(); + // + // check the split not to contain bounding vertices + TopoDS_Iterator aItV(aEIm); + for (; aItV.More(); aItV.Next()) { + const TopoDS_Shape& aV = aItV.Value(); + if (aMEVBounds.Contains(aV) || theMVBounds.Contains(aV)) { + break; + } + } + // + if (!aItV.More()) { + theLA.Append(aEIm); + aLEIm.Append(aEIm); + // + theDMEOr.Bound(aEIm, TopTools_ListOfShape())->Append(aE); + } + } + // + if (aLEIm.IsEmpty()) { + theEImages.UnBind(aE); + } + else { + if (!theEETrim.IsBound(aE)) { + TopTools_ListIteratorOfListOfShape aItLEIm(aLEIm); + for (; aItLEIm.More(); aItLEIm.Next()) { + const TopoDS_Shape& aEIm = aItLEIm.Value(); + theLENew.Append(aEIm); + } + } + } + } +} + +//======================================================================= +//function : IntersectEdges +//purpose : Intersecting the trimmed edges to avoid self-intersections +//======================================================================= +void IntersectEdges(const BOPCol_ListOfShape& theLA, + const TopTools_ListOfShape& theLE, + const TopTools_ListOfShape& theLENew, + const TopTools_MapOfShape& theMVBounds, + const TopTools_MapOfShape& theVertsToAvoid, + TopTools_DataMapOfShapeListOfShape& theEImages, + TopTools_MapOfShape& theModifiedEdges, + TopTools_DataMapOfShapeListOfShape& theDMEOr, + TopTools_MapOfShape& theMENew, + TopoDS_Shape& theSplits) +{ + BOPAlgo_Builder aGFA; + aGFA.SetArguments(theLA); + aGFA.Perform(); + if (aGFA.ErrorStatus()) { + // just copy input to the result + TopoDS_Compound aSp; + BRep_Builder aBB; + aBB.MakeCompound(aSp); + BOPCol_ListIteratorOfListOfShape anIt(theLA); + for (; anIt.More(); anIt.Next()) { + const TopoDS_Shape& aE = anIt.Value(); + aBB.Add(aSp, aE); + } + theSplits = aSp; + return; + } + // + UpdateImages(theLE, theEImages, aGFA, theModifiedEdges); + // + // compound of valid splits + theSplits = aGFA.Shape(); + // + // update new edges + TopTools_ListIteratorOfListOfShape aIt, aIt1; + aIt.Initialize(theLENew); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aE = aIt.Value(); + const TopTools_ListOfShape& aLEIm = aGFA.Modified(aE); + if (aLEIm.Extent()) { + aIt1.Initialize(aLEIm); + for (; aIt1.More(); aIt1.Next()) { + const TopoDS_Shape& aEIm = aIt1.Value(); + theMENew.Add(aEIm); + } + } + else { + theMENew.Add(aE); + } + } + // + TopTools_MapOfShape aMEInv; + GetInvalidEdges(theVertsToAvoid, theMVBounds, aGFA, aMEInv); + if (aMEInv.Extent()) { + // update shape + TopoDS_Compound aSp; + BRep_Builder aBB; + aBB.MakeCompound(aSp); + TopExp_Explorer aExp(theSplits, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aE = aExp.Current(); + if (!aMEInv.Contains(aE)) { + aBB.Add(aSp, aE); + } + } + theSplits = aSp; + } + // + UpdateOrigins(theLA, theDMEOr, aGFA); +} + +//======================================================================= +//function : GetBounds +//purpose : Getting edges from the splits of offset faces +//======================================================================= +void GetBounds(const TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + const TopTools_MapOfShape& theMEB, + TopoDS_Shape& theBounds) +{ + // make compound of edges contained in the splits of faces + TopoDS_Compound aBounds; + BRep_Builder aBB; + aBB.MakeCompound(aBounds); + // + TopTools_MapOfShape aMFence; + // + Standard_Integer i, aNb = theFImages.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopTools_ListOfShape& aLFIm = theFImages(i); + TopTools_ListIteratorOfListOfShape aIt(aLFIm); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aFIm = aIt.Value(); + // + TopExp_Explorer aExpE(aFIm, TopAbs_EDGE); + for (; aExpE.More(); aExpE.Next()) { + const TopoDS_Shape& aEIm = aExpE.Current(); + if (!theMEB.Contains(aEIm) && aMFence.Add(aEIm)) { + aBB.Add(aBounds, aEIm); + } + } + } + } + theBounds = aBounds; +} + +//======================================================================= +//function : GetBoundsToUpdate +//purpose : Get bounding edges that should be updated +//======================================================================= +void GetBoundsToUpdate(const TopTools_ListOfShape& theLF, + const TopTools_DataMapOfShapeListOfShape& theOEImages, + const TopTools_DataMapOfShapeListOfShape& theOEOrigins, + const TopTools_MapOfShape& theMEB, + TopTools_ListOfShape& theLABounds, + TopTools_ListOfShape& theLAValid, + TopoDS_Shape& theBounds, + Handle(BRepAlgo_AsDes)& theAsDes) +{ + // get all edges + TopoDS_Compound aBounds; + BRep_Builder aBB; + aBB.MakeCompound(aBounds); + // + TopTools_MapOfShape aMAValid, aMFence; + // + TopTools_ListIteratorOfListOfShape aItLF(theLF); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Shape& aF = aItLF.Value(); + // + TopTools_IndexedMapOfShape aMDE; + const TopTools_ListOfShape& aLFDes = theAsDes->Descendant(aF); + TopTools_ListIteratorOfListOfShape aItLFDes(aLFDes); + for (; aItLFDes.More(); aItLFDes.Next()) { + const TopoDS_Shape& aED = aItLFDes.Value(); + const TopTools_ListOfShape *pLEDIm = theOEImages.Seek(aED); + if (!pLEDIm) { + aMDE.Add(aED); + continue; + } + // + TopTools_ListIteratorOfListOfShape aItLEDIm(*pLEDIm); + for (; aItLEDIm.More(); aItLEDIm.Next()) { + const TopoDS_Shape& aEDIm = aItLEDIm.Value(); + aMDE.Add(aEDIm); + } + } + // + Standard_Integer j, aNbE = aMDE.Extent(); + for (j = 1; j <= aNbE; ++j) { + const TopoDS_Edge& aEIm = TopoDS::Edge(aMDE(j)); + // + if (!theMEB.Contains(aEIm) && aMFence.Add(aEIm)) { + aBB.Add(aBounds, aEIm); + theLABounds.Append(aEIm); + } + // + const TopTools_ListOfShape *pLO = theOEOrigins.Seek(aEIm); + if (pLO) { + TopTools_ListIteratorOfListOfShape aItLO(*pLO); + for (; aItLO.More(); aItLO.Next()) { + const TopoDS_Shape& aEO = aItLO.Value(); + // + if (aMAValid.Add(aEO)) { + theLAValid.Append(aEO); + } + } + } + else { + if (aMAValid.Add(aEIm)) { + theLAValid.Append(aEIm); + } + } + } + } + theBounds = aBounds; +} + +//======================================================================= +//function : GetInvalidEdgesByBounds +//purpose : Filter new splits by intersection with bounds +//======================================================================= +void GetInvalidEdgesByBounds(const TopoDS_Shape& theSplits, + const TopoDS_Shape& theBounds, + const TopTools_IndexedDataMapOfShapeListOfShape& theFToRebuild, + const TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + const TopoDS_Shape& theSolids, + const TopTools_IndexedMapOfShape& theInvEdges, + const TopTools_MapOfShape& theMVOld, + const TopTools_MapOfShape& theMENew, + const TopTools_DataMapOfShapeListOfShape& theDMEOr, + const TopTools_DataMapOfShapeListOfShape& theEImages, + TopTools_MapOfShape& theVertsToAvoid, + TopTools_MapOfShape& theMEInv) +{ + BOPAlgo_Section aSec; + aSec.AddArgument(theSplits); + aSec.AddArgument(theBounds); + // + aSec.Perform(); + // + // invalid vertices + TopTools_IndexedMapOfShape aMVInv; + // vertices to check additionally by classification relatively to solid + TopTools_MapOfShape aMVCheckAdd; + // collect parts for removal + const BOPDS_PDS& pDS = aSec.PDS(); + // + // check edge/edge intersections + const BOPDS_VectorOfInterfEE& aEEs = pDS->InterfEE(); + Standard_Integer i, aNb = aEEs.Extent(); + for (i = 0; i < aNb; ++i) { + const BOPDS_InterfEE& aEE = aEEs(i); + if (!aEE.HasIndexNew()) { + continue; + } + // + const TopoDS_Shape& aE1 = pDS->Shape(aEE.Index1()); + const TopoDS_Shape& aE2 = pDS->Shape(aEE.Index2()); + // + if (theInvEdges.Contains(aE2)) { + theMEInv.Add(aE1); + } + // + // add vertices of all images of this edges for checking + const TopTools_ListOfShape& aLEOr = theDMEOr.Find(aE1); + TopTools_ListIteratorOfListOfShape aItLEOr(aLEOr); + for (; aItLEOr.More(); aItLEOr.Next()) { + const TopoDS_Shape& aEOr = aItLEOr.Value(); + // + const TopTools_ListOfShape& aLEIm = theEImages.Find(aEOr); + TopTools_ListIteratorOfListOfShape aItLEIm(aLEIm); + for (; aItLEIm.More(); aItLEIm.Next()) { + const TopoDS_Shape& aEIm = aItLEIm.Value(); + // + TopoDS_Iterator aItV(aEIm); + for (; aItV.More(); aItV.Next()) { + const TopoDS_Shape& aV = aItV.Value(); + if (!theMVOld.Contains(aV)) { + aMVInv.Add(aV); + aMVCheckAdd.Add(aV); + } + } + } + } + } + // + // map to check the vertices of edges + TopTools_IndexedDataMapOfShapeListOfShape aDMVE; + TopExp::MapShapesAndAncestors(theSplits, TopAbs_VERTEX, TopAbs_EDGE, aDMVE); + // + // to avoid unnecessary filling of parts due to extra trim of the edges + // process Edge/Edge interferences of type EDGE, i.e. common blocks. + // + // all common blocks are contained in the result of SECTION operation + // between sets of edges + const TopoDS_Shape& aSecR = aSec.Shape(); + // + TopTools_IndexedMapOfShape aMSSec; + TopExp::MapShapes(aSecR, aMSSec); + // + const BOPCol_DataMapOfShapeListOfShape& anIm = aSec.Images(); + TopExp_Explorer aExp(theSplits, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aE = aExp.Current(); + if (aSec.IsDeleted(aE)) { + // no common blocks for this edge + continue; + } + // + const BOPCol_ListOfShape* pLEIm = anIm.Seek(aE); + if (!pLEIm) { + // no splits, i.e. completely coincides with some edge from boundary + continue; + } + // + BOPCol_ListIteratorOfListOfShape aItLEIm(*pLEIm); + for (; aItLEIm.More(); aItLEIm.Next()) { + const TopoDS_Shape& aEIm = aItLEIm.Value(); + if (!aMSSec.Contains(aEIm)) { + // the edge included in section only partially. + // the part not included in section may be excesssive + // + // check vertices of this edge - if one of them is new + // the edge might be removed + TopoDS_Vertex aV1, aV2; + TopExp::Vertices(TopoDS::Edge(aEIm), aV1, aV2); + if (!theMVOld.Contains(aV1) || !theMVOld.Contains(aV2)) { + // add this edge for checking + TopoDS_Vertex aV; + Standard_Real f, l; + const Handle(Geom_Curve)& aC = BRep_Tool::Curve(TopoDS::Edge(aEIm), f, l); + BRep_Builder().MakeVertex(aV, aC->Value((f+l)*0.5), Precision::Confusion()); + // + TopTools_ListOfShape aLEx; + aLEx.Append(aE); + aDMVE.Add(aV, aLEx); + aMVInv.Add(aV); + break; + } + } + } + } + // + // add for check also the vertices connected only to new edges + aNb = aDMVE.Extent(); + for (i = 1; i <= aNb; ++i) { + const TopoDS_Shape& aV = aDMVE.FindKey(i); + if (theMVOld.Contains(aV)) { + continue; + } + // + Standard_Boolean bNew = Standard_False, bOld = Standard_False; + const TopTools_ListOfShape& aLEx = aDMVE(i); + TopTools_ListIteratorOfListOfShape aIt(aLEx); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aE = aIt.Value(); + if (theMENew.Contains(aE)) { + bNew = Standard_True; + } + else { + bOld = Standard_True; + } + // + if (bNew && bOld) { + break; + } + } + // + if (!bNew || !bOld) { + aMVInv.Add(aV); + aMVCheckAdd.Remove(aV); + } + } + // + Handle(IntTools_Context) aCtx = new IntTools_Context; + // filter vertices + Standard_Integer iv, aNbIV = aMVInv.Extent(), aNbF = theFToRebuild.Extent(); + for (iv = 1; iv <= aNbIV; ++iv) { + const TopoDS_Vertex& aV = TopoDS::Vertex(aMVInv(iv)); + const gp_Pnt& aP = BRep_Tool::Pnt(aV); + Standard_Real aTolV = BRep_Tool::Tolerance(aV); + Standard_Boolean bInvalid = Standard_True; + // + for (i = 1; i <= aNbF && bInvalid; ++i) { + const TopoDS_Shape& aF = theFToRebuild.FindKey(i); + const TopTools_ListOfShape& aLFIm = theFImages.FindFromKey(aF); + // + TopTools_ListIteratorOfListOfShape aItLF(aLFIm); + for (; aItLF.More() && bInvalid; aItLF.Next()) { + const TopoDS_Face& aFIm = TopoDS::Face(aItLF.Value()); + TopExp_Explorer aExp(aFIm, TopAbs_VERTEX); + for (; aExp.More() && bInvalid; aExp.Next()) { + const TopoDS_Shape& aVF = aExp.Current(); + bInvalid = !aVF.IsSame(aV); + } + // + if (bInvalid) { + bInvalid = !aCtx->IsValidPointForFace(aP, aFIm, aTolV); + } + } + } + // + if (bInvalid && aMVCheckAdd.Contains(aV)) { + // the vertex is invalid for all faces + // check the same vertex for the solids + TopExp_Explorer aExpS(theSolids, TopAbs_SOLID); + for (; aExpS.More() && bInvalid; aExpS.Next()) { + const TopoDS_Solid& aSol = TopoDS::Solid(aExpS.Current()); + BRepClass3d_SolidClassifier& aSC = aCtx->SolidClassifier(aSol); + aSC.Perform(aP, aTolV); + bInvalid = (aSC.State() == TopAbs_OUT); + } + } + // + if (bInvalid) { + theVertsToAvoid.Add(aV); + if (aDMVE.Contains(aV)) { + const TopTools_ListOfShape& aLEInv = aDMVE.FindFromKey(aV); + TopTools_ListIteratorOfListOfShape aItLEInv(aLEInv); + for (; aItLEInv.More(); aItLEInv.Next()) { + const TopoDS_Shape& aEInv = aItLEInv.Value(); + theMEInv.Add(aEInv); + } + } + } + } +} + +//======================================================================= +//function : UpdateNewIntersectionEdges +//purpose : Updating the maps of images and origins of the offset edges +//======================================================================= +void UpdateNewIntersectionEdges(const TopTools_ListOfShape& theLE, + const TopTools_DataMapOfShapeListOfShape& theMELF, + const TopTools_DataMapOfShapeListOfShape& theEImages, + const TopTools_IndexedMapOfShape& theInvEdges, + const TopTools_MapOfShape& theInvertedEdges, + TopTools_DataMapOfShapeListOfShape& theEdgesOrigins, + TopTools_DataMapOfShapeListOfShape& theOEImages, + TopTools_DataMapOfShapeListOfShape& theOEOrigins, + TopTools_DataMapOfShapeShape& theETrimEInf, + TopTools_DataMapOfShapeListOfShape& theEETrim, + TopTools_MapOfShape& theModifiedEdges, + Handle(BRepAlgo_AsDes)& theAsDes) +{ + TopTools_ListOfShape aLEImEmpty; + TopTools_ListIteratorOfListOfShape aIt, aIt1; + // update global maps of images and origins with new splits + aIt.Initialize(theLE); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aE = aIt.Value(); + // + if (!theEImages.IsBound(aE)) { + TopTools_ListOfShape* pLET = theEETrim.ChangeSeek(aE); + if (!pLET) { + continue; + } + // + TopTools_ListIteratorOfListOfShape aItLET(*pLET); + for (; aItLET.More();) { + const TopoDS_Shape& aET = aItLET.Value(); + if (!theInvEdges.Contains(aET) && !theInvertedEdges.Contains(aET)) { + pLET->Remove(aItLET); + } + else { + aItLET.Next(); + } + } + // + if (pLET->IsEmpty()) { + continue; + } + } + // new images + const TopTools_ListOfShape& aLENew = + theEImages.IsBound(aE) ? theEImages.Find(aE) : aLEImEmpty; + // + // save connection to untrimmed edge for the next steps + aIt1.Initialize(aLENew); + for (; aIt1.More(); aIt1.Next()) { + const TopoDS_Shape& aET = aIt1.Value(); + theETrimEInf.Bind(aET, aE); + theModifiedEdges.Add(aET); + } + // + // check if it is existing edge + if (!theEETrim.IsBound(aE)) { + const TopTools_ListOfShape& aLF = theMELF.Find(aE); + // the edge is new + // add this edge to AsDes + aIt1.Initialize(aLF); + for (; aIt1.More(); aIt1.Next()) { + const TopoDS_Shape& aF = aIt1.Value(); + theAsDes->Add(aF, aE); + } + // + // add aE to the images + theOEImages.Bind(aE, aLENew); + theModifiedEdges.Add(aE); + // + // add to origins + TopTools_ListIteratorOfListOfShape aItNew(aLENew); + for (; aItNew.More(); aItNew.Next()) { + const TopoDS_Shape& aENew = aItNew.Value(); + if (theOEOrigins.IsBound(aENew)) { + TopTools_ListOfShape& aEOrigins = theOEOrigins.ChangeFind(aENew); + AppendToList(aEOrigins, aE); + } + else { + TopTools_ListOfShape aEOrigins; + aEOrigins.Append(aE); + theOEOrigins.Bind(aENew, aEOrigins); + } + } + // + // update connection to initial origins + if (theEdgesOrigins.IsBound(aE)) { + const TopTools_ListOfShape& aLEOrInit = theEdgesOrigins.Find(aE); + aIt1.Initialize(aLENew); + for (; aIt1.More(); aIt1.Next()) { + const TopoDS_Shape& aENew = aIt1.Value(); + if (theEdgesOrigins.IsBound(aENew)) { + TopTools_ListOfShape& aLENewOr = theEdgesOrigins.ChangeFind(aENew); + TopTools_ListIteratorOfListOfShape aItOrInit(aLEOrInit); + for (; aItOrInit.More(); aItOrInit.Next()) { + const TopoDS_Shape& aEOr = aItOrInit.Value(); + AppendToList(aLENewOr, aEOr); + } + } + else { + theEdgesOrigins.Bind(aENew, aLEOrInit); + } + } + } + // + continue; + } + // + // old images + const TopTools_ListOfShape& aLEOld = theEETrim.Find(aE); + // + // list of initial origins + TopTools_ListOfShape anInitOrigins; + // + // it is necessary to replace the old edges with new ones + aIt1.Initialize(aLEOld); + for (; aIt1.More(); aIt1.Next()) { + const TopoDS_Shape& aEOld = aIt1.Value(); + // + if (theOEOrigins.IsBound(aEOld)) { + // get its origins + const TopTools_ListOfShape& aEOrigins = theOEOrigins.Find(aEOld); + // + TopTools_ListIteratorOfListOfShape aItOr(aEOrigins); + for (; aItOr.More(); aItOr.Next()) { + const TopoDS_Shape& aEOr = aItOr.Value(); + // + theModifiedEdges.Add(aEOr); + // + TopTools_ListOfShape& aEImages = theOEImages.ChangeFind(aEOr); + // + // remove old edge from images + TopTools_ListIteratorOfListOfShape aItIm(aEImages); + for (; aItIm.More(); ) { + const TopoDS_Shape& aEIm = aItIm.Value(); + if (aEIm.IsSame(aEOld)) { + aEImages.Remove(aItIm); + } + else { + aItIm.Next(); + } + } + // + // add new images + TopTools_ListIteratorOfListOfShape aItNew(aLENew); + for (; aItNew.More(); aItNew.Next()) { + const TopoDS_Shape& aENew = aItNew.Value(); + AppendToList(aEImages, aENew); + if (theOEOrigins.IsBound(aENew)) { + TopTools_ListOfShape& aENewOrigins = theOEOrigins.ChangeFind(aENew); + AppendToList(aENewOrigins, aEOr); + } + else { + TopTools_ListOfShape aENewOrigins; + aENewOrigins.Append(aEOr); + theOEOrigins.Bind(aENew, aENewOrigins); + } + } + } + } + else { + // add to images + theOEImages.Bind(aEOld, aLENew); + // + theModifiedEdges.Add(aEOld); + // + // add to origins + TopTools_ListIteratorOfListOfShape aItNew(aLENew); + for (; aItNew.More(); aItNew.Next()) { + const TopoDS_Shape& aENew = aItNew.Value(); + if (theOEOrigins.IsBound(aENew)) { + TopTools_ListOfShape& aEOrigins = theOEOrigins.ChangeFind(aENew); + AppendToList(aEOrigins, aEOld); + } + else { + TopTools_ListOfShape aEOrigins; + aEOrigins.Append(aEOld); + theOEOrigins.Bind(aENew, aEOrigins); + } + } + } + // + // update connection to initial shape + if (theEdgesOrigins.IsBound(aEOld)) { + const TopTools_ListOfShape& aLEOrInit = theEdgesOrigins.Find(aEOld); + TopTools_ListIteratorOfListOfShape aItEOrInit(aLEOrInit); + for (; aItEOrInit.More(); aItEOrInit.Next()) { + const TopoDS_Shape& aEOrInit = aItEOrInit.Value(); + AppendToList(anInitOrigins, aEOrInit); + } + } + } + // + if (anInitOrigins.Extent()) { + TopTools_ListIteratorOfListOfShape aItNew(aLENew); + for (; aItNew.More(); aItNew.Next()) { + const TopoDS_Shape& aENew = aItNew.Value(); + if (theEdgesOrigins.IsBound(aENew)) { + TopTools_ListOfShape& aLENewOr = theEdgesOrigins.ChangeFind(aENew); + TopTools_ListIteratorOfListOfShape aItOrInit(anInitOrigins); + for (; aItOrInit.More(); aItOrInit.Next()) { + const TopoDS_Shape& aEOr = aItOrInit.Value(); + AppendToList(aLENewOr, aEOr); + } + } + else { + theEdgesOrigins.Bind(aENew, anInitOrigins); + } + } + } + } +} + +//======================================================================= +//function : FillHistory +//purpose : Saving obtained results in history tools +//======================================================================= +void FillHistory(const TopTools_IndexedDataMapOfShapeListOfShape& theFImages, + const TopTools_DataMapOfShapeListOfShape& theEImages, + BRepAlgo_Image& theImage) +{ + Standard_Integer i, aNb = theFImages.Extent(); + if (!aNb) { + return; + } + // + BRep_Builder aBB; + TopoDS_Compound aFaces; + aBB.MakeCompound(aFaces); + // + // Fill history for faces + for (i = 1; i <= aNb; ++i) { + const TopoDS_Shape& aF = theFImages.FindKey(i); + const TopTools_ListOfShape& aLFImages = theFImages(i); + // + if (aLFImages.Extent()) { + if (theImage.HasImage(aF)) { + theImage.Add(aF, aLFImages); + } + else { + theImage.Bind(aF, aLFImages); + } + } + // + TopTools_ListIteratorOfListOfShape aItLF(aLFImages); + for (; aItLF.More(); aItLF.Next()) { + const TopoDS_Shape& aFIm = aItLF.Value(); + aBB.Add(aFaces, aFIm); + } + } + // + // fill history for edges + TopTools_IndexedMapOfShape aMFE; + TopExp::MapShapes(aFaces, TopAbs_EDGE, aMFE); + // + TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItEIm(theEImages); + for (; aItEIm.More(); aItEIm.Next()) { + const TopoDS_Shape& aE = aItEIm.Key(); + const TopTools_ListOfShape& aLEIm = aItEIm.Value(); + // + Standard_Boolean bHasImage = theImage.HasImage(aE); + TopTools_ListIteratorOfListOfShape aItLE(aLEIm); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Shape& aEIm = aItLE.Value(); + if (aMFE.Contains(aEIm)) { + if (bHasImage) { + theImage.Add(aE, aEIm); + } + else { + theImage.Bind(aE, aEIm); + bHasImage = Standard_True; + } + } + } + } +} + +//======================================================================= +//function : ProcessMicroEdge +//purpose : Checking if the edge is micro edge +//======================================================================= +Standard_Boolean ProcessMicroEdge(const TopoDS_Edge& theEdge, + const Handle(IntTools_Context)& theCtx) +{ + TopoDS_Vertex aV1, aV2; + TopExp::Vertices(theEdge, aV1, aV2); + if (aV1.IsNull() || aV2.IsNull()) { + return Standard_False; + } + // + Standard_Boolean bMicro = BOPTools_AlgoTools::IsMicroEdge(theEdge, theCtx); + if (bMicro && BRepAdaptor_Curve(theEdge).GetType() == GeomAbs_Line) { + Standard_Real aLen = BRep_Tool::Pnt(aV1).Distance(BRep_Tool::Pnt(aV2)); + BRep_Builder().UpdateVertex(aV1, aLen / 2.); + BRep_Builder().UpdateVertex(aV2, aLen / 2.); + } + // + return bMicro; +} + +//======================================================================= +//function : UpdateOrigins +//purpose : Updating origins +//======================================================================= +void UpdateOrigins(const TopTools_ListOfShape& theLA, + TopTools_DataMapOfShapeListOfShape& theOrigins, + BOPAlgo_Builder& theGF) +{ + TopTools_ListIteratorOfListOfShape aItA(theLA); + for (; aItA.More(); aItA.Next()) { + const TopoDS_Shape& aS = aItA.Value(); + // + const TopTools_ListOfShape& aLSIm = theGF.Modified(aS); + if (aLSIm.IsEmpty()) { + continue; + } + // + TopTools_ListOfShape aLSEmpt; + TopTools_ListOfShape *pLS = theOrigins.ChangeSeek(aS); + if (!pLS) { + pLS = &aLSEmpt; + pLS->Append(aS); + } + // + TopTools_ListIteratorOfListOfShape aIt(aLSIm); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aSIm = aIt.Value(); + // + TopTools_ListOfShape *pLSOr = theOrigins.ChangeSeek(aSIm); + if (!pLSOr) { + // just bind the origins + theOrigins.Bind(aSIm, *pLS); + } + else { + // merge two lists + TopTools_ListIteratorOfListOfShape aIt1(*pLS); + for (; aIt1.More(); aIt1.Next()) { + const TopoDS_Shape& aS1 = aIt1.Value(); + AppendToList(*pLSOr, aS1); + } + } + } + } +} + +//======================================================================= +//function : UpdateImages +//purpose : Updating images of the shapes +//======================================================================= +void UpdateImages(const TopTools_ListOfShape& theLA, + TopTools_DataMapOfShapeListOfShape& theImages, + BOPAlgo_Builder& theGF, + TopTools_MapOfShape& theModified) +{ + TopTools_ListIteratorOfListOfShape aIt(theLA); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aS = aIt.Value(); + // + TopTools_ListOfShape* pLSIm = theImages.ChangeSeek(aS); + if (!pLSIm) { + const TopTools_ListOfShape& aLSIm = theGF.Modified(aS); + if (aLSIm.Extent()) { + theImages.Bind(aS, aLSIm); + theModified.Add(aS); + } + continue; + } + // + TopTools_MapOfShape aMFence; + TopTools_ListOfShape aLSImNew; + // + Standard_Boolean bModified = Standard_False; + // + // check modifications of the images + TopTools_ListIteratorOfListOfShape aIt1(*pLSIm); + for (; aIt1.More(); aIt1.Next()) { + const TopoDS_Shape& aSIm = aIt1.Value(); + const TopTools_ListOfShape& aLSIm1 = theGF.Modified(aSIm); + if (aLSIm1.IsEmpty()) { + if (aMFence.Add(aSIm)) { + aLSImNew.Append(aSIm); + } + } + else { + TopTools_ListIteratorOfListOfShape aIt2(aLSIm1); + for (; aIt2.More(); aIt2.Next()) { + const TopoDS_Shape& aSImIm = aIt2.Value(); + if (aMFence.Add(aSImIm)) { + aLSImNew.Append(aSImIm); + } + } + bModified = Standard_True; + } + } + // + if (bModified) { + *pLSIm = aLSImNew; + theModified.Add(aS); + } + } +} + +//======================================================================= +//function : UpdateIntersectedEdges +//purpose : Saving connection from trimmed edges to not trimmed ones +//======================================================================= +void UpdateIntersectedEdges(const TopTools_ListOfShape& theLA, + TopTools_DataMapOfShapeShape& theETrimEInf, + BOPAlgo_Builder& theGF) +{ + TopTools_ListIteratorOfListOfShape aItA(theLA); + for (; aItA.More(); aItA.Next()) { + const TopoDS_Shape& aS = aItA.Value(); + // + const TopoDS_Shape* pEInf = theETrimEInf.Seek(aS); + if (!pEInf) { + continue; + } + // + const TopTools_ListOfShape& aLSIm = theGF.Modified(aS); + if (aLSIm.IsEmpty()) { + continue; + } + // + TopTools_ListIteratorOfListOfShape aIt(aLSIm); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aEIm = aIt.Value(); + if (!theETrimEInf.IsBound(aEIm)) { + theETrimEInf.Bind(aEIm, *pEInf); + } + } + } +} + +//======================================================================= +//function : FindCommonParts +//purpose : Looking for the parts of type contained in both lists +//======================================================================= +void FindCommonParts(const TopTools_ListOfShape& theLS1, + const TopTools_ListOfShape& theLS2, + TopTools_ListOfShape& theLSC, + const TopAbs_ShapeEnum theType) +{ + // map shapes in the first list + TopTools_IndexedMapOfShape aMS1; + TopTools_ListIteratorOfListOfShape aIt(theLS1); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aS = aIt.Value(); + TopExp::MapShapes(aS, theType, aMS1); + } + // + if (aMS1.IsEmpty()) { + return; + } + // + TopTools_MapOfShape aMFence; + // check for such shapes in the other list + aIt.Initialize(theLS2); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aS = aIt.Value(); + // + TopExp_Explorer aExp(aS, theType); + for(; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aST = aExp.Current(); + // + if (aMS1.Contains(aST) && aMFence.Add(aST)) { + theLSC.Append(aST); + } + } + } +} + +//======================================================================= +//function : NbPoints +//purpose : Defines number of sample points to get average direction of the edge +//======================================================================= +Standard_Integer NbPoints(const TopoDS_Edge& theEdge) +{ + Standard_Integer aNbP; + BRepAdaptor_Curve aBAC(theEdge); + switch (aBAC.GetType()) { + case GeomAbs_Line: + aNbP = 1; + break; + default: + aNbP = 11; + } + // + return aNbP; +} + +//======================================================================= +//function : FindShape +//purpose : Looking for the same sub-shape in the shape +//======================================================================= +Standard_Boolean FindShape(const TopoDS_Shape& theSWhat, + const TopoDS_Shape& theSWhere, + TopoDS_Shape& theRes) +{ + Standard_Boolean bFound = Standard_False; + TopAbs_ShapeEnum aType = theSWhat.ShapeType(); + TopExp_Explorer aExp(theSWhere, aType); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aS = aExp.Current(); + if (aS.IsSame(theSWhat)) { + theRes = aS; + bFound = Standard_True; + break; + } + } + return bFound; +} + + +//======================================================================= +//function : AppendToList +//purpose : Add to a list only unique elements +//======================================================================= +void AppendToList(TopTools_ListOfShape& theList, + const TopoDS_Shape& theShape) +{ + TopTools_ListIteratorOfListOfShape aIt(theList); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aS = aIt.Value(); + if (aS.IsSame(theShape)) { + return; + } + } + theList.Append(theShape); +} diff --git a/src/BRepOffset/FILES b/src/BRepOffset/FILES index 5d8e8e2b96..c01c500bd6 100644 --- a/src/BRepOffset/FILES +++ b/src/BRepOffset/FILES @@ -21,6 +21,7 @@ BRepOffset_ListOfInterval.hxx BRepOffset_MakeLoops.cxx BRepOffset_MakeLoops.hxx BRepOffset_MakeOffset.cxx +BRepOffset_MakeOffset_1.cxx BRepOffset_MakeOffset.hxx BRepOffset_Mode.hxx BRepOffset_Offset.cxx diff --git a/src/BRepTest/BRepTest_FeatureCommands.cxx b/src/BRepTest/BRepTest_FeatureCommands.cxx index 79bf466e1a..bcf5f2e669 100644 --- a/src/BRepTest/BRepTest_FeatureCommands.cxx +++ b/src/BRepTest/BRepTest_FeatureCommands.cxx @@ -1003,13 +1003,12 @@ static Standard_Real TheTolerance = Precision::Confusion(); static Standard_Boolean TheInter = Standard_False; static GeomAbs_JoinType TheJoin = GeomAbs_Arc; static Standard_Boolean RemoveIntEdges = Standard_False; -static Standard_Boolean RemoveInvalidFaces = Standard_False; Standard_Integer offsetparameter(Draw_Interpretor& di, Standard_Integer n, const char** a) { if ( n == 1 ) { - di << " offsetparameter Tol Inter(c/p) JoinType(a/i/t) [RemoveInternalEdges(r/k) RemoveInvalidFaces(r/k)]\n"; + di << " offsetparameter Tol Inter(c/p) JoinType(a/i/t) [RemoveInternalEdges(r/k)]\n"; di << " Current Values\n"; di << " --> Tolerance : " << TheTolerance << "\n"; di << " --> TheInter : "; @@ -1034,14 +1033,6 @@ Standard_Integer offsetparameter(Draw_Interpretor& di, else { di << "Keep"; } - // - di << "\n --> Invalid Faces : "; - if (RemoveInvalidFaces) { - di << "Remove"; - } - else { - di << "Keep"; - } di << "\n"; // return 0; @@ -1057,7 +1048,6 @@ Standard_Integer offsetparameter(Draw_Interpretor& di, else if ( !strcmp(a[3],"t")) TheJoin = GeomAbs_Tangent; // RemoveIntEdges = (n >= 5) ? !strcmp(a[4], "r") : Standard_False; - RemoveInvalidFaces = (n == 6) ? !strcmp(a[5], "r") : Standard_False; // return 0; } @@ -1079,7 +1069,7 @@ Standard_Integer offsetload(Draw_Interpretor& , // Standard_Boolean Inter = Standard_True; TheOffset.Initialize(S,Of,TheTolerance,BRepOffset_Skin,TheInter,0,TheJoin, - Standard_False, RemoveIntEdges, RemoveInvalidFaces); + Standard_False, RemoveIntEdges); //------------------------------------------ // recuperation et chargement des bouchons. //---------------------------------------- @@ -2327,7 +2317,7 @@ void BRepTest::FeatureCommands (Draw_Interpretor& theCommands) __FILE__,offsetshape,g); theCommands.Add("offsetparameter", - "offsetparameter Tol Inter(c/p) JoinType(a/i/t) [RemoveInternalEdges(r/k) RemoveInvalidFaces(r/k)]", + "offsetparameter Tol Inter(c/p) JoinType(a/i/t) [RemoveInternalEdges(r/k)]", __FILE__,offsetparameter); theCommands.Add("offsetload", diff --git a/tests/bugs/modalg_6/bug27540_1 b/tests/bugs/modalg_6/bug27540_1 index ac6fc41c1f..a552fd2586 100644 --- a/tests/bugs/modalg_6/bug27540_1 +++ b/tests/bugs/modalg_6/bug27540_1 @@ -24,7 +24,7 @@ foreach f $faces { offsetperform result1 checkprops result1 -s 3.26459e+006 checkprops result1 -v 1.067e+008 -checknbshapes result1 -vertex 28 -edge 44 -wire 20 -face 19 -shell 1 -solid 1 +checknbshapes result1 -vertex 28 -edge 42 -wire 18 -face 17 -shell 1 -solid 1 # second shape @@ -42,7 +42,7 @@ foreach f $faces { offsetperform result2 checkprops result2 -s 3.26459e+006 checkprops result2 -v 1.067e+008 -checknbshapes result2 -vertex 28 -edge 44 -wire 20 -face 19 -shell 1 -solid 1 +checknbshapes result2 -vertex 28 -edge 42 -wire 18 -face 17 -shell 1 -solid 1 # compare the results diff --git a/tests/bugs/modalg_6/bug27540_2 b/tests/bugs/modalg_6/bug27540_2 index 1acf324e16..3f2448e1fb 100644 --- a/tests/bugs/modalg_6/bug27540_2 +++ b/tests/bugs/modalg_6/bug27540_2 @@ -24,7 +24,7 @@ foreach f $faces { offsetperform result1 checkprops result1 -s 3.76166e+006 checkprops result1 -v 1.74521e+008 -checknbshapes result1 -vertex 36 -edge 56 -wire 24 -face 23 -shell 1 -solid 1 +checknbshapes result1 -vertex 36 -edge 54 -wire 22 -face 21 -shell 1 -solid 1 # second shape @@ -42,7 +42,7 @@ foreach f $faces { offsetperform result2 checkprops result2 -s 3.76166e+006 checkprops result2 -v 1.74521e+008 -checknbshapes result2 -vertex 36 -edge 56 -wire 24 -face 23 -shell 1 -solid 1 +checknbshapes result2 -vertex 36 -edge 54 -wire 22 -face 21 -shell 1 -solid 1 # compare the results diff --git a/tests/bugs/modalg_6/bug27540_3 b/tests/bugs/modalg_6/bug27540_3 index 8d1437172a..94805778a6 100644 --- a/tests/bugs/modalg_6/bug27540_3 +++ b/tests/bugs/modalg_6/bug27540_3 @@ -24,7 +24,7 @@ foreach f $faces { offsetperform result1 checkprops result1 -s 464088 checkprops result1 -v 1.29909e+007 -checknbshapes result1 -vertex 48 -edge 74 -wire 32 -face 30 -shell 1 -solid 1 +checknbshapes result1 -vertex 48 -edge 72 -wire 30 -face 28 -shell 1 -solid 1 # second shape @@ -42,7 +42,7 @@ foreach f $faces { offsetperform result2 checkprops result2 -s 464088 checkprops result2 -v 1.29909e+007 -checknbshapes result2 -vertex 48 -edge 74 -wire 32 -face 30 -shell 1 -solid 1 +checknbshapes result2 -vertex 48 -edge 72 -wire 30 -face 28 -shell 1 -solid 1 # compare the results diff --git a/tests/offset/end b/tests/offset/end index 233d5a2850..62789741df 100644 --- a/tests/offset/end +++ b/tests/offset/end @@ -111,7 +111,11 @@ if { [isdraw result] && $mist == 0} { } } if { $m > 0 } { - checkview -display result -2d -path ${imagedir}/${test_image}.png + if {[info exists result_unif]} { + checkview -display result_unif -2d -path ${imagedir}/${test_image}.png + } else { + checkview -display result -2d -path ${imagedir}/${test_image}.png + } } } else { puts "Error : The offset cannot be built." diff --git a/tests/offset/shape_type_i_c/A1 b/tests/offset/shape_type_i_c/A1 index e932746008..452ccff2f2 100644 --- a/tests/offset/shape_type_i_c/A1 +++ b/tests/offset/shape_type_i_c/A1 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_box_cut_4boxes.brep] s OFFSETSHAPE 0.1 {} $calcul $type checkprops result -v 925.196 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/A2 b/tests/offset/shape_type_i_c/A2 index 2cf508d6ec..dd1fc16398 100644 --- a/tests/offset/shape_type_i_c/A2 +++ b/tests/offset/shape_type_i_c/A2 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_box_cut_4boxes.brep] s OFFSETSHAPE 0.3 {} $calcul $type checkprops result -v 1068.58 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/A3 b/tests/offset/shape_type_i_c/A3 index 6d89081ddb..1880b72763 100644 --- a/tests/offset/shape_type_i_c/A3 +++ b/tests/offset/shape_type_i_c/A3 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_box_cut_4boxes.brep] s OFFSETSHAPE 0.6 {} $calcul $type checkprops result -v 1296.86 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/A4 b/tests/offset/shape_type_i_c/A4 index d4a606170c..80d775361f 100644 --- a/tests/offset/shape_type_i_c/A4 +++ b/tests/offset/shape_type_i_c/A4 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_box_cut_4boxes.brep] s OFFSETSHAPE 0.9 {} $calcul $type checkprops result -v 1543.91 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/A5 b/tests/offset/shape_type_i_c/A5 index 9911897ede..c660bd5726 100644 --- a/tests/offset/shape_type_i_c/A5 +++ b/tests/offset/shape_type_i_c/A5 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_box_cut_4boxes.brep] s OFFSETSHAPE 1.2 {} $calcul $type checkprops result -v 1817.34 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/A6 b/tests/offset/shape_type_i_c/A6 index 57e4bde154..de413a014d 100644 --- a/tests/offset/shape_type_i_c/A6 +++ b/tests/offset/shape_type_i_c/A6 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_box_cut_4boxes.brep] s OFFSETSHAPE 1.5 {} $calcul $type checkprops result -v 2119 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/A7 b/tests/offset/shape_type_i_c/A7 index 898557e049..280e624aba 100644 --- a/tests/offset/shape_type_i_c/A7 +++ b/tests/offset/shape_type_i_c/A7 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_box_cut_4boxes.brep] s OFFSETSHAPE 1.8 {} $calcul $type checkprops result -v 2450.18 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/A8 b/tests/offset/shape_type_i_c/A8 index e943acb46d..865692477c 100644 --- a/tests/offset/shape_type_i_c/A8 +++ b/tests/offset/shape_type_i_c/A8 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_box_cut_4boxes.brep] s OFFSETSHAPE 2.1 {} $calcul $type checkprops result -v 2812.17 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/A9 b/tests/offset/shape_type_i_c/A9 index db7cefcdfb..1c8a932086 100644 --- a/tests/offset/shape_type_i_c/A9 +++ b/tests/offset/shape_type_i_c/A9 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_box_cut_4boxes.brep] s OFFSETSHAPE 2.4 {} $calcul $type checkprops result -v 3206.27 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/B1 b/tests/offset/shape_type_i_c/B1 index 2f2fa24556..bc56a9f390 100644 --- a/tests/offset/shape_type_i_c/B1 +++ b/tests/offset/shape_type_i_c/B1 @@ -2,4 +2,9 @@ restore [locate_data_file bug25926_input_slanted.brep] s OFFSETSHAPE 3 {} $calcul $type -checkprops result -v 2.00176e+007 +checkprops result -v 2.00176e+007 -s 644597 + +unifysamedom result_unif result +checknbshapes result_unif -face 24 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/B2 b/tests/offset/shape_type_i_c/B2 index ad16b2d5ae..519172f773 100644 --- a/tests/offset/shape_type_i_c/B2 +++ b/tests/offset/shape_type_i_c/B2 @@ -2,4 +2,9 @@ restore [locate_data_file bug25926_input_slanted.brep] s OFFSETSHAPE 6 {} $calcul $type -checkprops result -v 2.19865e+007 +checkprops result -v 2.19865e+007 -s 668050 + +unifysamedom result_unif result +checknbshapes result_unif -face 24 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/B3 b/tests/offset/shape_type_i_c/B3 index 7fcedf94ce..e67c6d24e1 100644 --- a/tests/offset/shape_type_i_c/B3 +++ b/tests/offset/shape_type_i_c/B3 @@ -2,4 +2,9 @@ restore [locate_data_file bug25926_input_slanted.brep] s OFFSETSHAPE 10 {} $calcul $type -checkprops result -v 2.47223e+007 +checkprops result -v 2.47223e+007 -s 699984 + +unifysamedom result_unif result +checknbshapes result_unif -face 24 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/B4 b/tests/offset/shape_type_i_c/B4 index 767005dbbf..d73fe82c14 100644 --- a/tests/offset/shape_type_i_c/B4 +++ b/tests/offset/shape_type_i_c/B4 @@ -2,4 +2,9 @@ restore [locate_data_file bug25926_input_slanted.brep] s OFFSETSHAPE 18 {} $calcul $type -checkprops result -v 3.05847e+007 +checkprops result -v 3.05847e+007 -s 766128 + +unifysamedom result_unif result +checknbshapes result_unif -face 24 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/B5 b/tests/offset/shape_type_i_c/B5 index e4e7d571c3..3d88f7bc21 100644 --- a/tests/offset/shape_type_i_c/B5 +++ b/tests/offset/shape_type_i_c/B5 @@ -2,4 +2,9 @@ restore [locate_data_file bug25926_input_slanted.brep] s OFFSETSHAPE 21 {} $calcul $type -checkprops result -v 3.29213e+007 +checkprops result -v 3.29213e+007 -s 791474 + +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/B6 b/tests/offset/shape_type_i_c/B6 index 983fe152ee..70e2ceee3b 100644 --- a/tests/offset/shape_type_i_c/B6 +++ b/tests/offset/shape_type_i_c/B6 @@ -2,4 +2,9 @@ restore [locate_data_file bug25926_input_slanted.brep] s OFFSETSHAPE 25 {} $calcul $type -checkprops result -v 3.61487e+007 +checkprops result -v 3.61487e+007 -s 823028 + +unifysamedom result_unif result +checknbshapes result_unif -face 20 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/B7 b/tests/offset/shape_type_i_c/B7 index a779476990..4c56c7fa81 100644 --- a/tests/offset/shape_type_i_c/B7 +++ b/tests/offset/shape_type_i_c/B7 @@ -2,4 +2,9 @@ restore [locate_data_file bug25926_input_slanted.brep] s OFFSETSHAPE 26 {} $calcul $type -checkprops result -v 3.6976e+007 +checkprops result -v 3.6976e+007 -s 831726 + +unifysamedom result_unif result +checknbshapes result_unif -face 20 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/B8 b/tests/offset/shape_type_i_c/B8 index c88dbee1de..7887ce3564 100644 --- a/tests/offset/shape_type_i_c/B8 +++ b/tests/offset/shape_type_i_c/B8 @@ -2,4 +2,9 @@ restore [locate_data_file bug25926_input_slanted.brep] s OFFSETSHAPE 36 {} $calcul $type -checkprops result -v 4.58112e+007 +checkprops result -v 4.58112e+007 -s 936544 + +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/B9 b/tests/offset/shape_type_i_c/B9 index 622af2be84..66237b1edf 100644 --- a/tests/offset/shape_type_i_c/B9 +++ b/tests/offset/shape_type_i_c/B9 @@ -2,4 +2,9 @@ restore [locate_data_file bug25926_input_slanted.brep] s OFFSETSHAPE 44 {} $calcul $type -checkprops result -v 5.36522e+007 +checkprops result -v 5.36522e+007 -s 1.02422e+006 + +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/C1 b/tests/offset/shape_type_i_c/C1 index c8f0bfeb05..7312beca05 100644 --- a/tests/offset/shape_type_i_c/C1 +++ b/tests/offset/shape_type_i_c/C1 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_input_shape.brep] s OFFSETSHAPE 3 {} $calcul $type checkprops result -v 5.53893e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/C2 b/tests/offset/shape_type_i_c/C2 index 0b94e3896a..b396854907 100644 --- a/tests/offset/shape_type_i_c/C2 +++ b/tests/offset/shape_type_i_c/C2 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_input_shape.brep] s OFFSETSHAPE 6 {} $calcul $type checkprops result -v 5.70329e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/C3 b/tests/offset/shape_type_i_c/C3 index 5d0201313f..9083f02f03 100644 --- a/tests/offset/shape_type_i_c/C3 +++ b/tests/offset/shape_type_i_c/C3 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_input_shape.brep] s OFFSETSHAPE 10 {} $calcul $type checkprops result -v 5.92261e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/C4 b/tests/offset/shape_type_i_c/C4 index fc7348ad55..344874ff88 100644 --- a/tests/offset/shape_type_i_c/C4 +++ b/tests/offset/shape_type_i_c/C4 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_input_shape.brep] s OFFSETSHAPE 13 {} $calcul $type checkprops result -v 6.08723e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/C5 b/tests/offset/shape_type_i_c/C5 index ecef8f91d6..898fb8c288 100644 --- a/tests/offset/shape_type_i_c/C5 +++ b/tests/offset/shape_type_i_c/C5 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_input_shape.brep] s OFFSETSHAPE 18 {} $calcul $type checkprops result -v 6.36191e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/C6 b/tests/offset/shape_type_i_c/C6 index 8a7bdbf76f..ed886d86f7 100644 --- a/tests/offset/shape_type_i_c/C6 +++ b/tests/offset/shape_type_i_c/C6 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_input_shape.brep] s OFFSETSHAPE 30 {} $calcul $type checkprops result -v 7.02144e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/C7 b/tests/offset/shape_type_i_c/C7 index 5e05d42811..3695bc459b 100644 --- a/tests/offset/shape_type_i_c/C7 +++ b/tests/offset/shape_type_i_c/C7 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_input_shape.brep] s OFFSETSHAPE 40 {} $calcul $type checkprops result -v 7.58284e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/C8 b/tests/offset/shape_type_i_c/C8 index 87af153bb8..d4af9522b8 100644 --- a/tests/offset/shape_type_i_c/C8 +++ b/tests/offset/shape_type_i_c/C8 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_input_shape.brep] s OFFSETSHAPE 50 {} $calcul $type checkprops result -v 8.16e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/C9 b/tests/offset/shape_type_i_c/C9 index 7f00b39eb7..ab55962336 100644 --- a/tests/offset/shape_type_i_c/C9 +++ b/tests/offset/shape_type_i_c/C9 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_input_shape.brep] s OFFSETSHAPE 60 {} $calcul $type checkprops result -v 8.75772e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/D1 b/tests/offset/shape_type_i_c/D1 index 8810a895a4..52a871ebef 100644 --- a/tests/offset/shape_type_i_c/D1 +++ b/tests/offset/shape_type_i_c/D1 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_input_offset_shape_tc80_2_smaller.brep] s OFFSETSHAPE 5 {} $calcul $type checkprops result -v 3.03855e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/D2 b/tests/offset/shape_type_i_c/D2 index 51365e4ae6..3535387b7c 100644 --- a/tests/offset/shape_type_i_c/D2 +++ b/tests/offset/shape_type_i_c/D2 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_input_offset_shape_tc80_2_smaller.brep] s OFFSETSHAPE 10 {} $calcul $type checkprops result -v 3.38527e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/D3 b/tests/offset/shape_type_i_c/D3 index 81698802cc..e4b461fd97 100644 --- a/tests/offset/shape_type_i_c/D3 +++ b/tests/offset/shape_type_i_c/D3 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_input_offset_shape_tc80_2_smaller.brep] s OFFSETSHAPE 15 {} $calcul $type checkprops result -v 3.68177e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/D4 b/tests/offset/shape_type_i_c/D4 index 5e9f0591ab..27bc4ec0ff 100644 --- a/tests/offset/shape_type_i_c/D4 +++ b/tests/offset/shape_type_i_c/D4 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_input_offset_shape_tc80_3_smaller.brep] s OFFSETSHAPE 5 {} $calcul $type checkprops result -v 3.13188e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/D5 b/tests/offset/shape_type_i_c/D5 index a810550cc4..f8b8d953dc 100644 --- a/tests/offset/shape_type_i_c/D5 +++ b/tests/offset/shape_type_i_c/D5 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_input_offset_shape_tc80_3_smaller.brep] s OFFSETSHAPE 10 {} $calcul $type checkprops result -v 3.44873e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/D6 b/tests/offset/shape_type_i_c/D6 index fbcafe26f3..6de559500a 100644 --- a/tests/offset/shape_type_i_c/D6 +++ b/tests/offset/shape_type_i_c/D6 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_input_offset_shape_tc80_3_smaller.brep] s OFFSETSHAPE 15 {} $calcul $type checkprops result -v 3.72139e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/D7 b/tests/offset/shape_type_i_c/D7 index 53f46bba29..bb06d3d5f1 100644 --- a/tests/offset/shape_type_i_c/D7 +++ b/tests/offset/shape_type_i_c/D7 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_shape_input_tc80.2.brep] s OFFSETSHAPE 5 {} $calcul $type checkprops result -v 1.01936e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/D8 b/tests/offset/shape_type_i_c/D8 index e9789cf419..2ad83d3f75 100644 --- a/tests/offset/shape_type_i_c/D8 +++ b/tests/offset/shape_type_i_c/D8 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_shape_input_tc80.2.brep] s OFFSETSHAPE 10 {} $calcul $type checkprops result -v 1.14248e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/D9 b/tests/offset/shape_type_i_c/D9 index 52d41ecf0e..38d3f4f317 100644 --- a/tests/offset/shape_type_i_c/D9 +++ b/tests/offset/shape_type_i_c/D9 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_shape_input_tc80.2.brep] s OFFSETSHAPE 15 {} $calcul $type checkprops result -v 1.25498e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/E1 b/tests/offset/shape_type_i_c/E1 index 4cb5fb6bb0..8336db28a2 100644 --- a/tests/offset/shape_type_i_c/E1 +++ b/tests/offset/shape_type_i_c/E1 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_shape_input_tc80.3.brep] s OFFSETSHAPE 5 {} $calcul $type checkprops result -v 1.05054e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/E2 b/tests/offset/shape_type_i_c/E2 index f9af91b888..5b8775d15a 100644 --- a/tests/offset/shape_type_i_c/E2 +++ b/tests/offset/shape_type_i_c/E2 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_shape_input_tc80.3.brep] s OFFSETSHAPE 10 {} $calcul $type checkprops result -v 1.16522e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/E3 b/tests/offset/shape_type_i_c/E3 index bdda939b0d..34fc8755d7 100644 --- a/tests/offset/shape_type_i_c/E3 +++ b/tests/offset/shape_type_i_c/E3 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_offset_shape_input_tc80.3.brep] s OFFSETSHAPE 15 {} $calcul $type checkprops result -v 1.27083e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/E4 b/tests/offset/shape_type_i_c/E4 index d6675c9024..f40ba76ec8 100644 --- a/tests/offset/shape_type_i_c/E4 +++ b/tests/offset/shape_type_i_c/E4 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_input_shape_fails.brep] s OFFSETSHAPE 5 {} $calcul $type checkprops result -v 2.1234e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/E5 b/tests/offset/shape_type_i_c/E5 index 3b560ce5b3..3f7e9cd1a0 100644 --- a/tests/offset/shape_type_i_c/E5 +++ b/tests/offset/shape_type_i_c/E5 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_input_shape_fails.brep] s OFFSETSHAPE 30 {} $calcul $type checkprops result -v 4.0384e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/E6 b/tests/offset/shape_type_i_c/E6 index 090cc0f932..91f6ace0a2 100644 --- a/tests/offset/shape_type_i_c/E6 +++ b/tests/offset/shape_type_i_c/E6 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_input_shape_fails.brep] s OFFSETSHAPE 60 {} $calcul $type checkprops result -v 7.15e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/E7 b/tests/offset/shape_type_i_c/E7 index 0e0c80b71a..fe10392b6d 100644 --- a/tests/offset/shape_type_i_c/E7 +++ b/tests/offset/shape_type_i_c/E7 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_trapezoid_1.brep] s OFFSETSHAPE 10 {} $calcul $type checkprops result -v 244837 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/E8 b/tests/offset/shape_type_i_c/E8 index 0534b7aaa1..3913b2dc46 100644 --- a/tests/offset/shape_type_i_c/E8 +++ b/tests/offset/shape_type_i_c/E8 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_spike_shape.brep] s OFFSETSHAPE 10 {} $calcul $type checkprops result -v 4.30309e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/E9 b/tests/offset/shape_type_i_c/E9 index f938da40fb..11835a9897 100644 --- a/tests/offset/shape_type_i_c/E9 +++ b/tests/offset/shape_type_i_c/E9 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_spike_shape.brep] s OFFSETSHAPE 15 {} $calcul $type checkprops result -v 4.79673e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/F1 b/tests/offset/shape_type_i_c/F1 index 5d1637d29f..3e6f5037ae 100644 --- a/tests/offset/shape_type_i_c/F1 +++ b/tests/offset/shape_type_i_c/F1 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_undercut_1.brep] s OFFSETSHAPE 5 {} $calcul $type checkprops result -v 2.7823e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/F2 b/tests/offset/shape_type_i_c/F2 index f098aaf26f..415d4ecb0f 100644 --- a/tests/offset/shape_type_i_c/F2 +++ b/tests/offset/shape_type_i_c/F2 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_undercut_1.brep] s OFFSETSHAPE 15 {} $calcul $type checkprops result -v 3.89013e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/F3 b/tests/offset/shape_type_i_c/F3 index 4b9812c969..fb943e8e1e 100644 --- a/tests/offset/shape_type_i_c/F3 +++ b/tests/offset/shape_type_i_c/F3 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_undercut_1.brep] s OFFSETSHAPE 25 {} $calcul $type checkprops result -v 5.10815e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/F4 b/tests/offset/shape_type_i_c/F4 index d5dac57e50..09012703ac 100644 --- a/tests/offset/shape_type_i_c/F4 +++ b/tests/offset/shape_type_i_c/F4 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_undercut_1.brep] s OFFSETSHAPE 30 {} $calcul $type checkprops result -v 5.7548e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/F5 b/tests/offset/shape_type_i_c/F5 index e7cfa25c86..5621a860f5 100644 --- a/tests/offset/shape_type_i_c/F5 +++ b/tests/offset/shape_type_i_c/F5 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_undercut_1.brep] s OFFSETSHAPE 40 {} $calcul $type checkprops result -v 7.1364e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/F6 b/tests/offset/shape_type_i_c/F6 index b900d3ab19..53c6cc0be1 100644 --- a/tests/offset/shape_type_i_c/F6 +++ b/tests/offset/shape_type_i_c/F6 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_unit_cell_grid.brep] s OFFSETSHAPE 5 {} $calcul $type checkprops result -v 2.46039e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/F7 b/tests/offset/shape_type_i_c/F7 index f8928869ed..cb449b50e4 100644 --- a/tests/offset/shape_type_i_c/F7 +++ b/tests/offset/shape_type_i_c/F7 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_unit_cell_grid.brep] s OFFSETSHAPE 10 {} $calcul $type checkprops result -v 2.8855e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/F8 b/tests/offset/shape_type_i_c/F8 index 2809ba67f1..10f34e2657 100644 --- a/tests/offset/shape_type_i_c/F8 +++ b/tests/offset/shape_type_i_c/F8 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_unit_cell_grid.brep] s OFFSETSHAPE 25 {} $calcul $type checkprops result -v 4.21733e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/F9 b/tests/offset/shape_type_i_c/F9 index 316b582078..00b7a6cb91 100644 --- a/tests/offset/shape_type_i_c/F9 +++ b/tests/offset/shape_type_i_c/F9 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_unit_cell_grid.brep] s OFFSETSHAPE 30 {} $calcul $type checkprops result -v 4.67244e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/G1 b/tests/offset/shape_type_i_c/G1 index 24e0e3e918..fb3cd5ea16 100644 --- a/tests/offset/shape_type_i_c/G1 +++ b/tests/offset/shape_type_i_c/G1 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_three_chimneys.brep] s OFFSETSHAPE 10 {} $calcul $type checkprops result -v 2.5576e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/G2 b/tests/offset/shape_type_i_c/G2 index 384052d84d..8b903937d1 100644 --- a/tests/offset/shape_type_i_c/G2 +++ b/tests/offset/shape_type_i_c/G2 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_three_chimneys.brep] s OFFSETSHAPE 20 {} $calcul $type checkprops result -v 3.2592e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/G3 b/tests/offset/shape_type_i_c/G3 index 3917d1ca9c..390af5827a 100644 --- a/tests/offset/shape_type_i_c/G3 +++ b/tests/offset/shape_type_i_c/G3 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_three_chimneys.brep] s OFFSETSHAPE 25 {} $calcul $type checkprops result -v 3.6439e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/G4 b/tests/offset/shape_type_i_c/G4 index 7bac220780..8f0a3beba2 100644 --- a/tests/offset/shape_type_i_c/G4 +++ b/tests/offset/shape_type_i_c/G4 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_three_chimneys.brep] s OFFSETSHAPE 50 {} $calcul $type checkprops result -v 5.9724e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/G5 b/tests/offset/shape_type_i_c/G5 index e0a4c3abf9..1a0d28e589 100644 --- a/tests/offset/shape_type_i_c/G5 +++ b/tests/offset/shape_type_i_c/G5 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_three_chimneys_duplicated.brep] s OFFSETSHAPE 10 {} $calcul $type checkprops result -v 2.11792e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/G6 b/tests/offset/shape_type_i_c/G6 index c4b2f8f473..fedeff3638 100644 --- a/tests/offset/shape_type_i_c/G6 +++ b/tests/offset/shape_type_i_c/G6 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_three_chimneys_duplicated.brep] s OFFSETSHAPE 20 {} $calcul $type checkprops result -v 2.51328e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/G7 b/tests/offset/shape_type_i_c/G7 index fc141f8f2f..77ccf1f31e 100644 --- a/tests/offset/shape_type_i_c/G7 +++ b/tests/offset/shape_type_i_c/G7 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_three_chimneys_duplicated.brep] s OFFSETSHAPE 30 {} $calcul $type checkprops result -v 2.93724e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/G8 b/tests/offset/shape_type_i_c/G8 index 76ba3b7a60..541bdca9d5 100644 --- a/tests/offset/shape_type_i_c/G8 +++ b/tests/offset/shape_type_i_c/G8 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_three_chimneys_duplicated.brep] s OFFSETSHAPE 50 {} $calcul $type checkprops result -v 3.89556e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/G9 b/tests/offset/shape_type_i_c/G9 index 9474cfb66f..693050f62c 100644 --- a/tests/offset/shape_type_i_c/G9 +++ b/tests/offset/shape_type_i_c/G9 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_three_chimneys_duplicated.brep] s OFFSETSHAPE 60 {} $calcul $type checkprops result -v 4.33344e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/H1 b/tests/offset/shape_type_i_c/H1 index da96cb47eb..add5c5723a 100644 --- a/tests/offset/shape_type_i_c/H1 +++ b/tests/offset/shape_type_i_c/H1 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_example_1_side_10_top_10.brep] s OFFSETSHAPE 10 {} $calcul $type checkprops result -v 9.6408e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/H2 b/tests/offset/shape_type_i_c/H2 index c2b868198b..4de28badd2 100644 --- a/tests/offset/shape_type_i_c/H2 +++ b/tests/offset/shape_type_i_c/H2 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_example_1_side_10_top_10.brep] s OFFSETSHAPE 15 {} $calcul $type checkprops result -v 1.07272e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/H3 b/tests/offset/shape_type_i_c/H3 index f8d2f94912..50b799fc25 100644 --- a/tests/offset/shape_type_i_c/H3 +++ b/tests/offset/shape_type_i_c/H3 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_example_2_side_26_top_0.brep] s OFFSETSHAPE 26 {} $calcul $type checkprops result -v 3.14983e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/H4 b/tests/offset/shape_type_i_c/H4 index 1ebd6dfa54..3ea0bf6373 100644 --- a/tests/offset/shape_type_i_c/H4 +++ b/tests/offset/shape_type_i_c/H4 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_example_3_side_30_top_0.brep] s OFFSETSHAPE 35 {} $calcul $type checkprops result -v 8.08679e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/H5 b/tests/offset/shape_type_i_c/H5 index 93a24319eb..c4a203d4d2 100644 --- a/tests/offset/shape_type_i_c/H5 +++ b/tests/offset/shape_type_i_c/H5 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_example_3_side_30_top_0.brep] s OFFSETSHAPE 45 {} $calcul $type checkprops result -v 9.51489e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/H6 b/tests/offset/shape_type_i_c/H6 index 6dec956c22..6e065f0ad3 100644 --- a/tests/offset/shape_type_i_c/H6 +++ b/tests/offset/shape_type_i_c/H6 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_example_4_side_30_top_10.brep] s OFFSETSHAPE 35 {} $calcul $type checkprops result -v 4.8893e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/H7 b/tests/offset/shape_type_i_c/H7 index 66ce5b2486..600b746479 100644 --- a/tests/offset/shape_type_i_c/H7 +++ b/tests/offset/shape_type_i_c/H7 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_example_4_side_30_top_10.brep] s OFFSETSHAPE 45 {} $calcul $type checkprops result -v 5.89638e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/H8 b/tests/offset/shape_type_i_c/H8 index 167b1b4cae..e489ca483b 100644 --- a/tests/offset/shape_type_i_c/H8 +++ b/tests/offset/shape_type_i_c/H8 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_b5.brep] s OFFSETSHAPE 2 {} $calcul $type checkprops result -v 4580.57 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/H9 b/tests/offset/shape_type_i_c/H9 index 048cc02945..ed8ee938fe 100644 --- a/tests/offset/shape_type_i_c/H9 +++ b/tests/offset/shape_type_i_c/H9 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_b5.brep] s OFFSETSHAPE 11 {} $calcul $type checkprops result -v 43008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/I1 b/tests/offset/shape_type_i_c/I1 index 3a73185ce1..93e5a59027 100644 --- a/tests/offset/shape_type_i_c/I1 +++ b/tests/offset/shape_type_i_c/I1 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_b1x.brep] s OFFSETSHAPE 2 {} $calcul $type checkprops result -v 1756.4 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/I2 b/tests/offset/shape_type_i_c/I2 index 047541ac8c..757c543e34 100644 --- a/tests/offset/shape_type_i_c/I2 +++ b/tests/offset/shape_type_i_c/I2 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_b1x.brep] s OFFSETSHAPE 5 {} $calcul $type checkprops result -v 6000 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/I3 b/tests/offset/shape_type_i_c/I3 index 6f450654d4..ad1fb6c7bf 100644 --- a/tests/offset/shape_type_i_c/I3 +++ b/tests/offset/shape_type_i_c/I3 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_b1.brep] s OFFSETSHAPE 1 {} $calcul $type checkprops result -v 5328 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/I4 b/tests/offset/shape_type_i_c/I4 index cbf3d79548..a079fb6510 100644 --- a/tests/offset/shape_type_i_c/I4 +++ b/tests/offset/shape_type_i_c/I4 @@ -5,3 +5,5 @@ prism s f 0 5 0 OFFSETSHAPE 0.6 {} $calcul $type checkprops result -v 216.363 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/I5 b/tests/offset/shape_type_i_c/I5 index e60c1a998a..7d0bcb6859 100644 --- a/tests/offset/shape_type_i_c/I5 +++ b/tests/offset/shape_type_i_c/I5 @@ -5,3 +5,5 @@ prism s f 0 5 0 OFFSETSHAPE 1.2 {} $calcul $type checkprops result -v 394.982 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/I6 b/tests/offset/shape_type_i_c/I6 index 9a3f039676..66ddcbee88 100644 --- a/tests/offset/shape_type_i_c/I6 +++ b/tests/offset/shape_type_i_c/I6 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_parasite_solid.brep] s OFFSETSHAPE 1 {} $calcul $type checkprops result -v 1450.99 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/I7 b/tests/offset/shape_type_i_c/I7 index 644b5b5506..83f87ff592 100644 --- a/tests/offset/shape_type_i_c/I7 +++ b/tests/offset/shape_type_i_c/I7 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_parasite_solid_s.brep] s OFFSETSHAPE 1 {} $calcul $type checkprops result -v 1304.43 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/I8 b/tests/offset/shape_type_i_c/I8 index 88e1f41a10..a423723917 100644 --- a/tests/offset/shape_type_i_c/I8 +++ b/tests/offset/shape_type_i_c/I8 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_parasite_solid_s2.brep] s OFFSETSHAPE 1 {} $calcul $type checkprops result -v 1217.22 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/I9 b/tests/offset/shape_type_i_c/I9 index 3d95d888b5..90a8cba22c 100644 --- a/tests/offset/shape_type_i_c/I9 +++ b/tests/offset/shape_type_i_c/I9 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_parasite_solid_s2.brep] s OFFSETSHAPE 5 {} $calcul $type checkprops result -v 10761.4 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/J1 b/tests/offset/shape_type_i_c/J1 new file mode 100644 index 0000000000..007206fbbe --- /dev/null +++ b/tests/offset/shape_type_i_c/J1 @@ -0,0 +1,17 @@ +restore [locate_data_file bug25926_input_slanted.brep] s + +set distance 1 +offsetparameter 1.e-7 $calcul $type +offsetload s $distance +explode s f +# s_15 s_22 +offsetonface s_15 6 +offsetonface s_22 6 +offsetperform result + +checkprops result -v 1.87868e+007 -s 627294 + +unifysamedom result_unif result +checknbshapes result_unif -face 24 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/J2 b/tests/offset/shape_type_i_c/J2 index a2957ee33e..989a750547 100644 --- a/tests/offset/shape_type_i_c/J2 +++ b/tests/offset/shape_type_i_c/J2 @@ -14,3 +14,5 @@ offsetonface s_14 0 offsetperform result checkprops result -v 2.07856e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/J3 b/tests/offset/shape_type_i_c/J3 index 5ff30f3ea8..cc9c670b3c 100644 --- a/tests/offset/shape_type_i_c/J3 +++ b/tests/offset/shape_type_i_c/J3 @@ -14,3 +14,5 @@ offsetonface s_14 0 offsetperform result checkprops result -v 3.0278e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/J4 b/tests/offset/shape_type_i_c/J4 index c82122962a..d731f47e60 100644 --- a/tests/offset/shape_type_i_c/J4 +++ b/tests/offset/shape_type_i_c/J4 @@ -14,3 +14,5 @@ offsetonface s_14 0 offsetperform result checkprops result -v 3.2025e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/J5 b/tests/offset/shape_type_i_c/J5 index 4fcc4be34f..b28bbf88e2 100644 --- a/tests/offset/shape_type_i_c/J5 +++ b/tests/offset/shape_type_i_c/J5 @@ -14,3 +14,5 @@ offsetonface s_14 0 offsetperform result checkprops result -v 3.5008e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/J6 b/tests/offset/shape_type_i_c/J6 index f133364e29..55f36f0113 100644 --- a/tests/offset/shape_type_i_c/J6 +++ b/tests/offset/shape_type_i_c/J6 @@ -14,3 +14,5 @@ offsetonface s_26 0 offsetperform result checkprops result -v 6.34674e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/J7 b/tests/offset/shape_type_i_c/J7 index 7528a994ab..b051724d55 100644 --- a/tests/offset/shape_type_i_c/J7 +++ b/tests/offset/shape_type_i_c/J7 @@ -14,3 +14,5 @@ offsetonface s_26 0 offsetperform result checkprops result -v 7.63414e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/J8 b/tests/offset/shape_type_i_c/J8 index bab727e502..e080207d6f 100644 --- a/tests/offset/shape_type_i_c/J8 +++ b/tests/offset/shape_type_i_c/J8 @@ -14,3 +14,5 @@ offsetonface s_26 0 offsetperform result checkprops result -v 7.8625e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/J9 b/tests/offset/shape_type_i_c/J9 index 62e87121d0..01f2389fb8 100644 --- a/tests/offset/shape_type_i_c/J9 +++ b/tests/offset/shape_type_i_c/J9 @@ -14,3 +14,5 @@ offsetonface s_26 0 offsetperform result checkprops result -v 8.2464e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/K1 b/tests/offset/shape_type_i_c/K1 index e98d5b5114..423c94466d 100644 --- a/tests/offset/shape_type_i_c/K1 +++ b/tests/offset/shape_type_i_c/K1 @@ -9,3 +9,5 @@ offsetonface s_3 50 offsetperform result checkprops result -v 250676 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/K2 b/tests/offset/shape_type_i_c/K2 index a0aa004d48..0f378adfb1 100644 --- a/tests/offset/shape_type_i_c/K2 +++ b/tests/offset/shape_type_i_c/K2 @@ -9,3 +9,5 @@ offsetonface s_3 20 offsetperform result checkprops result -v 250644 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/K3 b/tests/offset/shape_type_i_c/K3 index 69f959c1e7..59f82dc04f 100644 --- a/tests/offset/shape_type_i_c/K3 +++ b/tests/offset/shape_type_i_c/K3 @@ -10,3 +10,5 @@ offsetonface s_9 15 offsetperform result checkprops result -v 269568 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/K4 b/tests/offset/shape_type_i_c/K4 index eb87cdcc0f..302fe9dfd2 100644 --- a/tests/offset/shape_type_i_c/K4 +++ b/tests/offset/shape_type_i_c/K4 @@ -10,3 +10,5 @@ offsetonface s_9 20 offsetperform result checkprops result -v 269568 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/K5 b/tests/offset/shape_type_i_c/K5 index c97a057995..5a7c2f0678 100644 --- a/tests/offset/shape_type_i_c/K5 +++ b/tests/offset/shape_type_i_c/K5 @@ -10,3 +10,5 @@ offsetonface s_9 10 offsetperform result checkprops result -v 263968 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/K6 b/tests/offset/shape_type_i_c/K6 index 0a45cc9c5e..d17b303c2e 100644 --- a/tests/offset/shape_type_i_c/K6 +++ b/tests/offset/shape_type_i_c/K6 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_before_offset_small.brep] s OFFSETSHAPE 10 {} $calcul $type checkprops result -v 1.30684e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/K7 b/tests/offset/shape_type_i_c/K7 index 00c1fece1e..1c232aa0f0 100644 --- a/tests/offset/shape_type_i_c/K7 +++ b/tests/offset/shape_type_i_c/K7 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_before_offset_small.brep] s OFFSETSHAPE 30 {} $calcul $type checkprops result -v 2.20372e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/K8 b/tests/offset/shape_type_i_c/K8 index 7a1279ddf3..7adc08fecb 100644 --- a/tests/offset/shape_type_i_c/K8 +++ b/tests/offset/shape_type_i_c/K8 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_before_offset.brep] s OFFSETSHAPE 10 {} $calcul $type checkprops result -v 1.90913e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/K9 b/tests/offset/shape_type_i_c/K9 index f2b8e5cb63..d12e87d13b 100644 --- a/tests/offset/shape_type_i_c/K9 +++ b/tests/offset/shape_type_i_c/K9 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_before_offset.brep] s OFFSETSHAPE 50 {} $calcul $type checkprops result -v 3.68672e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/L1 b/tests/offset/shape_type_i_c/L1 index 9390a7a9fa..77aac7eb76 100644 --- a/tests/offset/shape_type_i_c/L1 +++ b/tests/offset/shape_type_i_c/L1 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_before_offset.brep] s OFFSETSHAPE 5 {} $calcul $type checkprops result -v 1.71595e+008 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/L2 b/tests/offset/shape_type_i_c/L2 index 58a529ff11..b6438515e3 100644 --- a/tests/offset/shape_type_i_c/L2 +++ b/tests/offset/shape_type_i_c/L2 @@ -9,3 +9,5 @@ offsetonface s_8 12 offsetperform result checkprops result -v 20944 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/L3 b/tests/offset/shape_type_i_c/L3 index 0a2f6443bb..6527b8fa0f 100644 --- a/tests/offset/shape_type_i_c/L3 +++ b/tests/offset/shape_type_i_c/L3 @@ -8,4 +8,7 @@ explode s f offsetonface s_8 15 offsetperform result -checkprops result -v 21364 +checkprops result -v 20944 +checkprops result -s 5176 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/L4 b/tests/offset/shape_type_i_c/L4 index 0ebc9a8f59..939e329de0 100644 --- a/tests/offset/shape_type_i_c/L4 +++ b/tests/offset/shape_type_i_c/L4 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_box_cut_box.brep] s OFFSETSHAPE 5 {} $calcul $type checkprops result -v 32000 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/L5 b/tests/offset/shape_type_i_c/L5 index affc3eed03..72b8740adb 100644 --- a/tests/offset/shape_type_i_c/L5 +++ b/tests/offset/shape_type_i_c/L5 @@ -9,3 +9,5 @@ offsetonface s_8 -12 offsetperform result checkprops result -v 15164 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/L6 b/tests/offset/shape_type_i_c/L6 index 2d01e26a71..c5be7159c7 100644 --- a/tests/offset/shape_type_i_c/L6 +++ b/tests/offset/shape_type_i_c/L6 @@ -9,3 +9,5 @@ offsetonface s_8 -15 offsetperform result checkprops result -v 15164 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/L7 b/tests/offset/shape_type_i_c/L7 index 613c53f5cf..7429ec9177 100644 --- a/tests/offset/shape_type_i_c/L7 +++ b/tests/offset/shape_type_i_c/L7 @@ -9,3 +9,5 @@ offsetonface s_8 -8 offsetperform result checkprops result -v 2236 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/L8 b/tests/offset/shape_type_i_c/L8 index 04ce0661be..571d237e1b 100644 --- a/tests/offset/shape_type_i_c/L8 +++ b/tests/offset/shape_type_i_c/L8 @@ -9,3 +9,5 @@ offsetonface s_8 -10 offsetperform result checkprops result -v 2236 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/L9 b/tests/offset/shape_type_i_c/L9 index 1d7c9d71e5..bf967a282c 100644 --- a/tests/offset/shape_type_i_c/L9 +++ b/tests/offset/shape_type_i_c/L9 @@ -6,3 +6,5 @@ offsetload s $distance offsetperform result checkprops result -v 53629.1 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/M1 b/tests/offset/shape_type_i_c/M1 index 8f2b71145a..0390687463 100644 --- a/tests/offset/shape_type_i_c/M1 +++ b/tests/offset/shape_type_i_c/M1 @@ -6,3 +6,5 @@ offsetload s $distance offsetperform result checkprops result -v 5.61324e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/M2 b/tests/offset/shape_type_i_c/M2 index a29b8ca5e7..b9121d4108 100644 --- a/tests/offset/shape_type_i_c/M2 +++ b/tests/offset/shape_type_i_c/M2 @@ -6,3 +6,5 @@ offsetload s $distance offsetperform result checkprops result -v 4.1141e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/M3 b/tests/offset/shape_type_i_c/M3 index 867a4a18ce..256c1ee122 100644 --- a/tests/offset/shape_type_i_c/M3 +++ b/tests/offset/shape_type_i_c/M3 @@ -7,4 +7,6 @@ offsetparameter 1.e-7 $calcul $type offsetload s $distance offsetperform result -checkprops result -v 2.23108e+007 +checkprops result -v 2.22969e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/M4 b/tests/offset/shape_type_i_c/M4 index 19b56e02bf..da12570844 100644 --- a/tests/offset/shape_type_i_c/M4 +++ b/tests/offset/shape_type_i_c/M4 @@ -7,4 +7,6 @@ offsetparameter 1.e-7 $calcul $type offsetload s $distance offsetperform result -checkprops result -v 3.23447e+007 +checkprops result -v 3.23389e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/M5 b/tests/offset/shape_type_i_c/M5 index 9ebaaac150..38631f3f8b 100644 --- a/tests/offset/shape_type_i_c/M5 +++ b/tests/offset/shape_type_i_c/M5 @@ -7,4 +7,6 @@ offsetparameter 1.e-7 $calcul $type offsetload s $distance offsetperform result -checkprops result -v 3.92994e+007 +checkprops result -v 3.92878e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/M6 b/tests/offset/shape_type_i_c/M6 index 39d3a3de23..903a065eea 100644 --- a/tests/offset/shape_type_i_c/M6 +++ b/tests/offset/shape_type_i_c/M6 @@ -7,4 +7,6 @@ offsetparameter 1.e-7 $calcul $type offsetload s $distance offsetperform result -checkprops result -v 4.37968e+007 +checkprops result -v 4.37572e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/M7 b/tests/offset/shape_type_i_c/M7 index 507c5015e0..f61e62aca8 100644 --- a/tests/offset/shape_type_i_c/M7 +++ b/tests/offset/shape_type_i_c/M7 @@ -5,4 +5,6 @@ offsetparameter 1.e-7 $calcul $type offsetload s $distance offsetperform result -checkprops result -v 2.23108e+007 +checkprops result -v 2.22969e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/M8 b/tests/offset/shape_type_i_c/M8 index 1f6394fa06..10e5e2ba82 100644 --- a/tests/offset/shape_type_i_c/M8 +++ b/tests/offset/shape_type_i_c/M8 @@ -5,4 +5,6 @@ offsetparameter 1.e-7 $calcul $type offsetload s $distance offsetperform result -checkprops result -v 3.23447e+007 +checkprops result -v 3.23389e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/M9 b/tests/offset/shape_type_i_c/M9 index c52a6f2c09..0fb1a0b442 100644 --- a/tests/offset/shape_type_i_c/M9 +++ b/tests/offset/shape_type_i_c/M9 @@ -5,4 +5,6 @@ offsetparameter 1.e-7 $calcul $type offsetload s $distance offsetperform result -checkprops result -v 3.92994e+007 +checkprops result -v 3.92878e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/N1 b/tests/offset/shape_type_i_c/N1 index a6bd3cbda2..c934c16212 100644 --- a/tests/offset/shape_type_i_c/N1 +++ b/tests/offset/shape_type_i_c/N1 @@ -5,4 +5,6 @@ offsetparameter 1.e-7 $calcul $type offsetload s $distance offsetperform result -checkprops result -v 4.37968e+007 +checkprops result -v 4.37572e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/N2 b/tests/offset/shape_type_i_c/N2 index 006e743766..538c099bf3 100644 --- a/tests/offset/shape_type_i_c/N2 +++ b/tests/offset/shape_type_i_c/N2 @@ -7,4 +7,6 @@ offsetparameter 1.e-7 $calcul $type offsetload s $distance offsetperform result -checkprops result -v 2.19752e+007 +checkprops result -v 2.19753e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/N3 b/tests/offset/shape_type_i_c/N3 index b984d593eb..77f7c9dd6c 100644 --- a/tests/offset/shape_type_i_c/N3 +++ b/tests/offset/shape_type_i_c/N3 @@ -7,4 +7,6 @@ offsetparameter 1.e-7 $calcul $type offsetload s $distance offsetperform result -checkprops result -v 2.97224e+007 +checkprops result -v 2.97225e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/N4 b/tests/offset/shape_type_i_c/N4 index 773400f84a..6259221e25 100644 --- a/tests/offset/shape_type_i_c/N4 +++ b/tests/offset/shape_type_i_c/N4 @@ -7,4 +7,6 @@ offsetparameter 1.e-7 $calcul $type offsetload s $distance offsetperform result -checkprops result -v 3.46916e+007 +checkprops result -v 3.46903e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/N5 b/tests/offset/shape_type_i_c/N5 index b975ea9f41..739d952915 100644 --- a/tests/offset/shape_type_i_c/N5 +++ b/tests/offset/shape_type_i_c/N5 @@ -7,4 +7,6 @@ offsetparameter 1.e-7 $calcul $type offsetload s $distance offsetperform result -checkprops result -v 3.77839e+007 +checkprops result -v 3.77821e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/N6 b/tests/offset/shape_type_i_c/N6 index b55b9347c1..8319f06084 100644 --- a/tests/offset/shape_type_i_c/N6 +++ b/tests/offset/shape_type_i_c/N6 @@ -5,4 +5,6 @@ offsetparameter 1.e-7 $calcul $type offsetload s $distance offsetperform result -checkprops result -v 2.19752e+007 +checkprops result -v 2.19753e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/N7 b/tests/offset/shape_type_i_c/N7 index afa5e5381a..0e3b1aa068 100644 --- a/tests/offset/shape_type_i_c/N7 +++ b/tests/offset/shape_type_i_c/N7 @@ -5,4 +5,6 @@ offsetparameter 1.e-7 $calcul $type offsetload s $distance offsetperform result -checkprops result -v 2.97224e+007 +checkprops result -v 2.97225e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/N8 b/tests/offset/shape_type_i_c/N8 index 3edd941955..ed45389386 100644 --- a/tests/offset/shape_type_i_c/N8 +++ b/tests/offset/shape_type_i_c/N8 @@ -5,4 +5,6 @@ offsetparameter 1.e-7 $calcul $type offsetload s $distance offsetperform result -checkprops result -v 3.46916e+007 +checkprops result -v 3.46903e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/N9 b/tests/offset/shape_type_i_c/N9 index 15734ce7ae..cbafb88a4a 100644 --- a/tests/offset/shape_type_i_c/N9 +++ b/tests/offset/shape_type_i_c/N9 @@ -5,4 +5,6 @@ offsetparameter 1.e-7 $calcul $type offsetload s $distance offsetperform result -checkprops result -v 3.77839e+007 +checkprops result -v 3.77821e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/O1 b/tests/offset/shape_type_i_c/O1 index 26a101957d..0b4df90597 100644 --- a/tests/offset/shape_type_i_c/O1 +++ b/tests/offset/shape_type_i_c/O1 @@ -5,4 +5,9 @@ offsetparameter 1.e-7 $calcul $type offsetload s $distance offsetperform result -checkprops result -v 814270 +checkprops result -v 815237 -s 72583.4 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 17 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/O2 b/tests/offset/shape_type_i_c/O2 index 1201c78e2c..d7efa769ac 100644 --- a/tests/offset/shape_type_i_c/O2 +++ b/tests/offset/shape_type_i_c/O2 @@ -5,4 +5,9 @@ offsetparameter 1.e-7 $calcul $type offsetload s $distance offsetperform result -checkprops result -v 883901 +checkprops result -v 885485 -s 67848.9 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 17 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/O3 b/tests/offset/shape_type_i_c/O3 index 5e567acffd..72301424f9 100644 --- a/tests/offset/shape_type_i_c/O3 +++ b/tests/offset/shape_type_i_c/O3 @@ -5,4 +5,9 @@ offsetparameter 1.e-7 $calcul $type offsetload s $distance offsetperform result -checkprops result -v 1.14694e+006 +checkprops result -v 1.14221e+006 -s 66668.3 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 10 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/O4 b/tests/offset/shape_type_i_c/O4 index a9a473130e..a6ba7cb914 100644 --- a/tests/offset/shape_type_i_c/O4 +++ b/tests/offset/shape_type_i_c/O4 @@ -1,5 +1,3 @@ -puts "TODO CR25926 ALL: Error : The volume of result shape is" - restore [locate_data_file bug25926_issue22_trimmed.brep] s set distance 5 @@ -7,4 +5,6 @@ offsetparameter 1.e-7 $calcul $type offsetload s $distance offsetperform result -checkprops result -v 0 +checkprops result -v 448800 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/O5 b/tests/offset/shape_type_i_c/O5 index f20fb90547..a90400a22b 100644 --- a/tests/offset/shape_type_i_c/O5 +++ b/tests/offset/shape_type_i_c/O5 @@ -1,5 +1,3 @@ -puts "TODO CR25926 ALL: Error : The volume of result shape is" - restore [locate_data_file bug25926_input.brep] s set distance 5 @@ -7,4 +5,6 @@ offsetparameter 1.e-7 $calcul $type offsetload s $distance offsetperform result -checkprops result -v 0 +checkprops result -v 1.9741e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/O6 b/tests/offset/shape_type_i_c/O6 index f7f19ca12b..65edaca854 100644 --- a/tests/offset/shape_type_i_c/O6 +++ b/tests/offset/shape_type_i_c/O6 @@ -6,3 +6,5 @@ offsetload s $distance offsetperform result checkprops result -v 7.9433e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/O7 b/tests/offset/shape_type_i_c/O7 index fbe4e9497b..f8c5021333 100644 --- a/tests/offset/shape_type_i_c/O7 +++ b/tests/offset/shape_type_i_c/O7 @@ -6,3 +6,5 @@ offsetload s $distance offsetperform result checkprops result -v 8.99282e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/O8 b/tests/offset/shape_type_i_c/O8 index 4fd1c02993..edcb51ef24 100644 --- a/tests/offset/shape_type_i_c/O8 +++ b/tests/offset/shape_type_i_c/O8 @@ -1,6 +1,3 @@ -puts "TODO CR25926 ALL: Error : The volume of result shape is" -puts "TODO CR25926 ALL: Faulty shapes in variables faulty_" - polyline p 0 0 0 10 0 0 10 0 7 6 0 7 6 0 3 5 0 5 0 0 5 0 0 0 mkplane f p prism s f 0 10 0 @@ -10,4 +7,6 @@ offsetparameter 1.e-7 $calcul $type offsetload s $distance offsetperform result -checkprops result -v 0 +checkprops result -v 3136 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/O9 b/tests/offset/shape_type_i_c/O9 index c6f9f4189d..670c9f1110 100644 --- a/tests/offset/shape_type_i_c/O9 +++ b/tests/offset/shape_type_i_c/O9 @@ -1,5 +1,3 @@ -puts "TODO CR25926 ALL: Error : The volume of result shape is" - polyline p 0 0 0 10 0 0 10 0 7 6 0 7 6 0 3 5 0 5 0 0 5 0 0 0 mkplane f p prism s f 0 10 0 @@ -9,4 +7,6 @@ offsetparameter 1.e-7 $calcul $type offsetload s $distance offsetperform result -checkprops result -v 0 +checkprops result -v 1152 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/P1 b/tests/offset/shape_type_i_c/P1 index 847ed00bd9..518c2e2084 100644 --- a/tests/offset/shape_type_i_c/P1 +++ b/tests/offset/shape_type_i_c/P1 @@ -1,5 +1,3 @@ -puts "TODO CR25926 ALL: Error : The volume of result shape is" - polyline p 0 0 0 4 0 0 4 0 3 3 0 3 2 0 1 1 0 3 0 0 3 0 0 0 mkplane f p prism s f 0 1 0 @@ -10,3 +8,5 @@ offsetload s $distance offsetperform result checkprops result -v 1188 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/P2 b/tests/offset/shape_type_i_c/P2 index da1bfb243f..639b4e6649 100644 --- a/tests/offset/shape_type_i_c/P2 +++ b/tests/offset/shape_type_i_c/P2 @@ -1,5 +1,3 @@ -puts "TODO CR25926 ALL: Error : The volume of result shape is" - polyline p 0 0 0 3 0 0 3 0 1 2 0 1 1 0 4 1 0 5 0 0 5 0 0 0 mkplane f p prism s f 0 1 0 @@ -11,4 +9,6 @@ explode s f offsetonface s_4 2 offsetperform result -checkprops result -v 0 +checkprops result -v 94.2982 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/P3 b/tests/offset/shape_type_i_c/P3 index 8cb82a60de..5d05747bd5 100644 --- a/tests/offset/shape_type_i_c/P3 +++ b/tests/offset/shape_type_i_c/P3 @@ -1,5 +1,3 @@ -puts "TODO CR25926 ALL: Error : The volume of result shape is" - polyline p 0 0 0 2 0 0 2 0 1 1 0 1 1 0 2 0 0 2 0 0 0 mkplane f p prism s f 0 1 0 @@ -11,4 +9,6 @@ explode s f offsetonface s_4 3 offsetperform result -checkprops result -v 0 +checkprops result -v 60 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/P4 b/tests/offset/shape_type_i_c/P4 index 2a2eb74536..a39d3054a3 100644 --- a/tests/offset/shape_type_i_c/P4 +++ b/tests/offset/shape_type_i_c/P4 @@ -6,3 +6,5 @@ offsetload s $distance offsetperform result checkprops result -v 4.9414e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/P5 b/tests/offset/shape_type_i_c/P5 index 55b47c27fb..2b0a5ee45a 100644 --- a/tests/offset/shape_type_i_c/P5 +++ b/tests/offset/shape_type_i_c/P5 @@ -6,3 +6,5 @@ offsetload s $distance offsetperform result checkprops result -v 4.9414e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/P6 b/tests/offset/shape_type_i_c/P6 index f22fcef9ff..f3ebe86af2 100644 --- a/tests/offset/shape_type_i_c/P6 +++ b/tests/offset/shape_type_i_c/P6 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_TC503.61.t3_c0.input.brep] s OFFSETSHAPE 15 {} $calcul $type checkprops result -v 1.79632e+009 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/P7 b/tests/offset/shape_type_i_c/P7 index 76a06166cc..b9284c46a1 100644 --- a/tests/offset/shape_type_i_c/P7 +++ b/tests/offset/shape_type_i_c/P7 @@ -3,3 +3,5 @@ restore [locate_data_file bug25926_TC503.51.t10_c0.input.brep] s OFFSETSHAPE 15 {} $calcul $type checkprops result -v 1.17632e+009 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/P8 b/tests/offset/shape_type_i_c/P8 new file mode 100644 index 0000000000..278e3aa7d1 --- /dev/null +++ b/tests/offset/shape_type_i_c/P8 @@ -0,0 +1,8 @@ +restore [locate_data_file bug25926_before_offset_trim1.brep] s + +OFFSETSHAPE 50 {} $calcul $type + +checkprops result -v 3.61993e+007 +checkprops result -s 696458 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/P9 b/tests/offset/shape_type_i_c/P9 new file mode 100644 index 0000000000..68230d4cce --- /dev/null +++ b/tests/offset/shape_type_i_c/P9 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_double_cave.brep] s + +OFFSETSHAPE 1 {} $calcul $type + +checkprops result -v 2088 +checkprops result -s 1092 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Q1 b/tests/offset/shape_type_i_c/Q1 new file mode 100644 index 0000000000..be4d566c09 --- /dev/null +++ b/tests/offset/shape_type_i_c/Q1 @@ -0,0 +1,7 @@ +restore [locate_data_file bug27139_offset_shape_input.brep] s + +OFFSETSHAPE 1 {} $calcul $type + +checkprops result -v 2.40965e+007 -s 1.24031e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Q2 b/tests/offset/shape_type_i_c/Q2 new file mode 100644 index 0000000000..55e729f1f7 --- /dev/null +++ b/tests/offset/shape_type_i_c/Q2 @@ -0,0 +1,7 @@ +restore [locate_data_file bug27139_offset_shape_input_trim1.brep] s + +OFFSETSHAPE 1 {} $calcul $type + +checkprops result -v 133958 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Q3 b/tests/offset/shape_type_i_c/Q3 new file mode 100644 index 0000000000..5fe56f8e98 --- /dev/null +++ b/tests/offset/shape_type_i_c/Q3 @@ -0,0 +1,7 @@ +restore [locate_data_file bug27139_offset_shape_input_trim2.brep] s + +OFFSETSHAPE 6 {} $calcul $type + +checkprops result -v 142685 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Q4 b/tests/offset/shape_type_i_c/Q4 new file mode 100644 index 0000000000..5b67e8aed3 --- /dev/null +++ b/tests/offset/shape_type_i_c/Q4 @@ -0,0 +1,7 @@ +restore [locate_data_file bug27139_offset_shape_input_trim3.brep] s + +OFFSETSHAPE 1 {} $calcul $type + +checkprops result -v 1.19774e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Q5 b/tests/offset/shape_type_i_c/Q5 new file mode 100644 index 0000000000..23545280de --- /dev/null +++ b/tests/offset/shape_type_i_c/Q5 @@ -0,0 +1,7 @@ +restore [locate_data_file bug27139_offset_shape_input_trim4.brep] s + +OFFSETSHAPE 1 {} $calcul $type + +checkprops result -v 6.27981e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Q6 b/tests/offset/shape_type_i_c/Q6 new file mode 100644 index 0000000000..38fc8ea4ad --- /dev/null +++ b/tests/offset/shape_type_i_c/Q6 @@ -0,0 +1,7 @@ +restore [locate_data_file bug27139_offset_shape_input_trim5.brep] s + +OFFSETSHAPE 1 {} $calcul $type + +checkprops result -v 37703 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Q7 b/tests/offset/shape_type_i_c/Q7 new file mode 100644 index 0000000000..7325890ff4 --- /dev/null +++ b/tests/offset/shape_type_i_c/Q7 @@ -0,0 +1,7 @@ +restore [locate_data_file bug27139_offset_shape_input_trim6.brep] s + +OFFSETSHAPE 1 {} $calcul $type + +checkprops result -v 1.2636e+007 -s 683604 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Q8 b/tests/offset/shape_type_i_c/Q8 new file mode 100644 index 0000000000..ac094db1fb --- /dev/null +++ b/tests/offset/shape_type_i_c/Q8 @@ -0,0 +1,7 @@ +restore [locate_data_file bug27139_offset_shape_input_trim7.brep] s + +OFFSETSHAPE 1 {} $calcul $type + +checkprops result -v 8.87399e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Q9 b/tests/offset/shape_type_i_c/Q9 new file mode 100755 index 0000000000..e52a699d86 --- /dev/null +++ b/tests/offset/shape_type_i_c/Q9 @@ -0,0 +1,14 @@ +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 FACE entities in shape" + +restore [locate_data_file bug25926_offset_shape_trim3.brep] s + +OFFSETSHAPE 12 {} $calcul $type + +checkprops result -v 948181 -s 66208.6 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 14 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/R1 b/tests/offset/shape_type_i_c/R1 new file mode 100644 index 0000000000..00b799fa74 --- /dev/null +++ b/tests/offset/shape_type_i_c/R1 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim1.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 1.22616e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/R2 b/tests/offset/shape_type_i_c/R2 new file mode 100644 index 0000000000..746a3ef40e --- /dev/null +++ b/tests/offset/shape_type_i_c/R2 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim2.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 852586 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/R3 b/tests/offset/shape_type_i_c/R3 new file mode 100644 index 0000000000..9adae6f21a --- /dev/null +++ b/tests/offset/shape_type_i_c/R3 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim3.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 844221 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/R4 b/tests/offset/shape_type_i_c/R4 new file mode 100644 index 0000000000..66aa820994 --- /dev/null +++ b/tests/offset/shape_type_i_c/R4 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim4.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.83245e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/R5 b/tests/offset/shape_type_i_c/R5 new file mode 100644 index 0000000000..ebff14059e --- /dev/null +++ b/tests/offset/shape_type_i_c/R5 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim5.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.10872e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/R6 b/tests/offset/shape_type_i_c/R6 new file mode 100644 index 0000000000..93973b0e41 --- /dev/null +++ b/tests/offset/shape_type_i_c/R6 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim6.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 2.55029e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/R7 b/tests/offset/shape_type_i_c/R7 new file mode 100644 index 0000000000..f98521a2f1 --- /dev/null +++ b/tests/offset/shape_type_i_c/R7 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_M2_trim7.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 1.70906e+006 -s 119883 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 35 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/R8 b/tests/offset/shape_type_i_c/R8 new file mode 100644 index 0000000000..06fe99c444 --- /dev/null +++ b/tests/offset/shape_type_i_c/R8 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim8.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 1.66234e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/R9 b/tests/offset/shape_type_i_c/R9 new file mode 100644 index 0000000000..b664e99062 --- /dev/null +++ b/tests/offset/shape_type_i_c/R9 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim9.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 1.34317e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/S1 b/tests/offset/shape_type_i_c/S1 new file mode 100644 index 0000000000..6bd1cba850 --- /dev/null +++ b/tests/offset/shape_type_i_c/S1 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim10.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 1.66075e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/S2 b/tests/offset/shape_type_i_c/S2 new file mode 100644 index 0000000000..8df63785ab --- /dev/null +++ b/tests/offset/shape_type_i_c/S2 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim11.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 1.34579e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/S3 b/tests/offset/shape_type_i_c/S3 new file mode 100644 index 0000000000..5f2496d518 --- /dev/null +++ b/tests/offset/shape_type_i_c/S3 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim12.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 1.1369e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/S4 b/tests/offset/shape_type_i_c/S4 new file mode 100644 index 0000000000..fc749795d1 --- /dev/null +++ b/tests/offset/shape_type_i_c/S4 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim13.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 1.01996e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/S5 b/tests/offset/shape_type_i_c/S5 new file mode 100644 index 0000000000..2aee116429 --- /dev/null +++ b/tests/offset/shape_type_i_c/S5 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim14.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 762358 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/S6 b/tests/offset/shape_type_i_c/S6 new file mode 100644 index 0000000000..44ff4b15a8 --- /dev/null +++ b/tests/offset/shape_type_i_c/S6 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim15.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 634826 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/S7 b/tests/offset/shape_type_i_c/S7 new file mode 100644 index 0000000000..ab1f41d72d --- /dev/null +++ b/tests/offset/shape_type_i_c/S7 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim16.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 514470 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/S8 b/tests/offset/shape_type_i_c/S8 new file mode 100644 index 0000000000..39359fa385 --- /dev/null +++ b/tests/offset/shape_type_i_c/S8 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim17.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 397694 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/S9 b/tests/offset/shape_type_i_c/S9 new file mode 100644 index 0000000000..c4cfd277d9 --- /dev/null +++ b/tests/offset/shape_type_i_c/S9 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim18.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 280542 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/T1 b/tests/offset/shape_type_i_c/T1 new file mode 100644 index 0000000000..7b49eeee78 --- /dev/null +++ b/tests/offset/shape_type_i_c/T1 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_M2_trim19.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 1.241e+006 -s 83210.4 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 31 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/T2 b/tests/offset/shape_type_i_c/T2 new file mode 100644 index 0000000000..36d83dc213 --- /dev/null +++ b/tests/offset/shape_type_i_c/T2 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim20.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 1.24613e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/T3 b/tests/offset/shape_type_i_c/T3 new file mode 100644 index 0000000000..8df33ba421 --- /dev/null +++ b/tests/offset/shape_type_i_c/T3 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim21.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 1.01973e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/T4 b/tests/offset/shape_type_i_c/T4 new file mode 100644 index 0000000000..cf475344d5 --- /dev/null +++ b/tests/offset/shape_type_i_c/T4 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim22.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 885418 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/T5 b/tests/offset/shape_type_i_c/T5 new file mode 100644 index 0000000000..7948fd941d --- /dev/null +++ b/tests/offset/shape_type_i_c/T5 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim23.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 96390.1 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/T6 b/tests/offset/shape_type_i_c/T6 new file mode 100644 index 0000000000..d4d40a7ee9 --- /dev/null +++ b/tests/offset/shape_type_i_c/T6 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim24.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 1.66075e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/T7 b/tests/offset/shape_type_i_c/T7 new file mode 100644 index 0000000000..8639996ee9 --- /dev/null +++ b/tests/offset/shape_type_i_c/T7 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim25.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 762358 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/T8 b/tests/offset/shape_type_i_c/T8 new file mode 100644 index 0000000000..60cbf8a89f --- /dev/null +++ b/tests/offset/shape_type_i_c/T8 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim26.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 634826 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/T9 b/tests/offset/shape_type_i_c/T9 new file mode 100644 index 0000000000..964fb76ddb --- /dev/null +++ b/tests/offset/shape_type_i_c/T9 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim27.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 397694 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/U1 b/tests/offset/shape_type_i_c/U1 new file mode 100644 index 0000000000..5cfed63e37 --- /dev/null +++ b/tests/offset/shape_type_i_c/U1 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_M2_trim28.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 197766 -s 32157.1 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 14 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/U2 b/tests/offset/shape_type_i_c/U2 new file mode 100644 index 0000000000..96b0848cba --- /dev/null +++ b/tests/offset/shape_type_i_c/U2 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim29.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 114117 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/U3 b/tests/offset/shape_type_i_c/U3 new file mode 100644 index 0000000000..4b7422fee8 --- /dev/null +++ b/tests/offset/shape_type_i_c/U3 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim30.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 95219.5 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/U4 b/tests/offset/shape_type_i_c/U4 new file mode 100644 index 0000000000..11f80cafc2 --- /dev/null +++ b/tests/offset/shape_type_i_c/U4 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim31.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 310499 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/U5 b/tests/offset/shape_type_i_c/U5 new file mode 100644 index 0000000000..d4aa7f524b --- /dev/null +++ b/tests/offset/shape_type_i_c/U5 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim32.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 1.05429e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/U6 b/tests/offset/shape_type_i_c/U6 new file mode 100755 index 0000000000..50afd71671 --- /dev/null +++ b/tests/offset/shape_type_i_c/U6 @@ -0,0 +1,16 @@ +##puts "TODO OCC27414 ALL: Error : The volume of result shape is" +##puts "TODO OCC27414 ALL: Error : The area of result shape is" +##puts "TODO OCC27414 ALL: Faulty shapes in variables faulty_" +##puts "TODO OCC27414 ALL: Error : The area of face" +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_M2_trim33.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 0 +checkprops result -s 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/U7 b/tests/offset/shape_type_i_c/U7 new file mode 100644 index 0000000000..633618dd6f --- /dev/null +++ b/tests/offset/shape_type_i_c/U7 @@ -0,0 +1,12 @@ +puts "TODO OCC27414 ALL: Error : The volume of result shape is" +puts "TODO OCC27414 ALL: Error : The area of result shape is" + +restore [locate_data_file bug26917_M2_trim34.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +# real volume is 255962 +checkprops result -v 0 +checkprops result -s 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/U8 b/tests/offset/shape_type_i_c/U8 new file mode 100644 index 0000000000..3851883932 --- /dev/null +++ b/tests/offset/shape_type_i_c/U8 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim35.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 201004 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/U9 b/tests/offset/shape_type_i_c/U9 new file mode 100644 index 0000000000..05aba95062 --- /dev/null +++ b/tests/offset/shape_type_i_c/U9 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim36.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 66256.1 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/V1 b/tests/offset/shape_type_i_c/V1 new file mode 100644 index 0000000000..b4751ff85d --- /dev/null +++ b/tests/offset/shape_type_i_c/V1 @@ -0,0 +1,9 @@ +polyline p 4 0 0 10 0 0 10 0 10 8 0 10 8 0 4 6 0 4 6 0 6 4 0 6 4 0 0 +mkplane f p +prism s f 0 5 0 + +OFFSETSHAPE 2 {} $calcul $type + +checkprops result -v 1116 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/V2 b/tests/offset/shape_type_i_c/V2 new file mode 100644 index 0000000000..caf252a2ad --- /dev/null +++ b/tests/offset/shape_type_i_c/V2 @@ -0,0 +1,15 @@ +polyline p 4 0 0 10 0 0 10 0 10 8 0 10 8 0 4 6 0 4 6 0 6 4 0 6 4 0 0 +mkplane f p +prism s1 f 0 5 0 +polyline p 6 0 4 6 5 4 6 2.5 5 6 0 4 +mkplane f p +prism s2 f 2 0 0 +bfuse s s1 s2 +explode s so; copy s_1 s +donly s + +OFFSETSHAPE 2 {} $calcul $type + +checkprops result -v 1116 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/V3 b/tests/offset/shape_type_i_c/V3 new file mode 100644 index 0000000000..f4be41e86d --- /dev/null +++ b/tests/offset/shape_type_i_c/V3 @@ -0,0 +1,16 @@ +polyline p 4 0 0 10 0 0 10 0 10 8 0 10 8 0 4 6 0 4 6 0 6 4 0 6 4 0 0 +mkplane f p +prism s1 f 0 5 0 +polyline p 6 0 4 6 5 4 6 2.5 3 6 0 4 +mkplane f p +prism s2 f 2 0 0 +bcut s s1 s2 +explode s so; copy s_1 s +unifysamedom s s +donly s + +OFFSETSHAPE 2 {} $calcul $type + +checkprops result -v 1116 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/V4 b/tests/offset/shape_type_i_c/V4 new file mode 100644 index 0000000000..c43abc2b09 --- /dev/null +++ b/tests/offset/shape_type_i_c/V4 @@ -0,0 +1,13 @@ +polyline p 0 0 0 5 0 0 5 0 3 3 0 3 3 0 5 0 0 5 0 0 0 +mkplane f p +prism s f 0 5 0 +explode s f +donly s +offsetparameter 1e-7 c i +offsetload s 1 +offsetonface s_4 5 +offsetperform result + +checkprops result -v 441 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/V5 b/tests/offset/shape_type_i_c/V5 new file mode 100644 index 0000000000..1a0784bafc --- /dev/null +++ b/tests/offset/shape_type_i_c/V5 @@ -0,0 +1,13 @@ +box b1 10 10 4 +polyline p 0 0.5 4 0 2.5 4 10 9.5 4 10 7.5 4 0 0.5 4 +mkplane f p +prism b2 f 0 0 4 +bfuse s b1 b2 +unifysamedom s s +donly s + +OFFSETSHAPE 3 {} $calcul $type + +checkprops result -v 3229.82 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/V6 b/tests/offset/shape_type_i_c/V6 new file mode 100644 index 0000000000..ec0ca64777 --- /dev/null +++ b/tests/offset/shape_type_i_c/V6 @@ -0,0 +1,12 @@ +restore [locate_data_file bug26917_b1_slanted.brep] s +explode s f +donly s +offsetparameter 1e-7 c i +offsetload s 1 +offsetonface s_8 3 +offsetonface s_10 3 +offsetperform result + +checkprops result -v 1007.8 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/V7 b/tests/offset/shape_type_i_c/V7 new file mode 100644 index 0000000000..5c24465b06 --- /dev/null +++ b/tests/offset/shape_type_i_c/V7 @@ -0,0 +1,12 @@ +box b1 10 6 10 +polyline p 2 0 5 2 2 5 2 3 3 2 3 10 2 0 10 2 0 5 +mkplane f p +prism b2 f 6 0 0 +bcut s b1 b2 +donly s + +OFFSETSHAPE 2.5 {} $calcul $type + +checkprops result -v 2460 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/V8 b/tests/offset/shape_type_i_c/V8 new file mode 100644 index 0000000000..cad6c4d82a --- /dev/null +++ b/tests/offset/shape_type_i_c/V8 @@ -0,0 +1,12 @@ +box b1 10 6 10 +polyline p 2 0 5 2 2 5 2 3 3 2 3 10 2 0 10 2 0 5 +mkplane f p +prism b2 f 6 0 0 +bcut s b1 b2 +donly s + +OFFSETSHAPE 4 {} $calcul $type + +checkprops result -v 4536 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/V9 b/tests/offset/shape_type_i_c/V9 new file mode 100644 index 0000000000..f05d780f81 --- /dev/null +++ b/tests/offset/shape_type_i_c/V9 @@ -0,0 +1,12 @@ +box b1 10 6 10 +polyline p 2 0 5 2 2 5 2 2.5 3 2 3 5 2 3 10 2 0 10 2 0 5 +mkplane f p +prism b2 f 6 0 0 +bcut s b1 b2 +donly s + +OFFSETSHAPE 2.5 {} $calcul $type + +checkprops result -v 2460 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/W1 b/tests/offset/shape_type_i_c/W1 new file mode 100644 index 0000000000..d601f8703f --- /dev/null +++ b/tests/offset/shape_type_i_c/W1 @@ -0,0 +1,12 @@ +box b1 10 6 10 +polyline p 2 0 5 2 2 5 2 2.5 3 2 3 5 2 3 10 2 0 10 2 0 5 +mkplane f p +prism b2 f 6 0 0 +bcut s b1 b2 +donly s + +OFFSETSHAPE 4 {} $calcul $type + +checkprops result -v 4536 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/W2 b/tests/offset/shape_type_i_c/W2 new file mode 100644 index 0000000000..c005f9a42c --- /dev/null +++ b/tests/offset/shape_type_i_c/W2 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_issue25_trimmed.brep] s + +OFFSETSHAPE 2 {} $calcul $type + +checkprops result -v 22857.5 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/W3 b/tests/offset/shape_type_i_c/W3 new file mode 100644 index 0000000000..44f4ce50c2 --- /dev/null +++ b/tests/offset/shape_type_i_c/W3 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_issue25_trimmed.brep] s + +OFFSETSHAPE 3 {} $calcul $type + +checkprops result -v 31471 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/W4 b/tests/offset/shape_type_i_c/W4 new file mode 100644 index 0000000000..58d151eff9 --- /dev/null +++ b/tests/offset/shape_type_i_c/W4 @@ -0,0 +1,9 @@ +polyline p 0 0 0 11 0 0 11 0 4 10 0 4 10 0 3 9 0 2 8 0 2 7 0 3 7 0 4 4 0 4 4 0 3 3 0 2 2 0 2 1 0 3 1 0 4 0 0 4 0 0 0 +mkplane f p +prism s f 0 5 0 + +OFFSETSHAPE 1.2 {} $calcul $type + +checkprops result -v 618.17 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/W5 b/tests/offset/shape_type_i_c/W5 new file mode 100644 index 0000000000..a8e9e16130 --- /dev/null +++ b/tests/offset/shape_type_i_c/W5 @@ -0,0 +1,9 @@ +polyline p 0 0 0 11 0 0 11 0 4 10 0 4 10 0 3 9 0 2 8 0 2 7 0 3 7 0 4 4 0 4 4 0 3 3 0 2 2 0 2 1 0 3 1 0 4 0 0 4 0 0 0 +mkplane f p +prism s f 0 5 0 + +OFFSETSHAPE 1.5 {} $calcul $type + +checkprops result -v 784 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/W6 b/tests/offset/shape_type_i_c/W6 new file mode 100644 index 0000000000..4aa3049e61 --- /dev/null +++ b/tests/offset/shape_type_i_c/W6 @@ -0,0 +1,9 @@ +polyline p 0 0 0 11 0 0 11 0 4 10 0 4 10 0 3 9 0 2 8 0 2 7 0 3 7 0 4 4 0 4 4 0 3 3 0 2 2 0 2 1 0 3 1 0 4 0 0 4 0 0 0 +mkplane f p +prism s f 0 5 0 + +OFFSETSHAPE 1.8 {} $calcul $type + +checkprops result -v 954.256 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/W7 b/tests/offset/shape_type_i_c/W7 new file mode 100644 index 0000000000..17ac9ca05d --- /dev/null +++ b/tests/offset/shape_type_i_c/W7 @@ -0,0 +1,10 @@ +polyline p 0 0 0 4 0 0 4 0 3 3 0 3 2 0 1 1 0 3 0 0 3 0 0 0 +mkplane f p +prism s f 0 1 0 +donly s + +OFFSETSHAPE 3 {} $calcul $type + +checkprops result -v 630 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/W8 b/tests/offset/shape_type_i_c/W8 new file mode 100644 index 0000000000..93e5a59027 --- /dev/null +++ b/tests/offset/shape_type_i_c/W8 @@ -0,0 +1,7 @@ +restore [locate_data_file bug25926_b1x.brep] s + +OFFSETSHAPE 2 {} $calcul $type + +checkprops result -v 1756.4 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/W9 b/tests/offset/shape_type_i_c/W9 new file mode 100644 index 0000000000..757c543e34 --- /dev/null +++ b/tests/offset/shape_type_i_c/W9 @@ -0,0 +1,7 @@ +restore [locate_data_file bug25926_b1x.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 6000 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/X1 b/tests/offset/shape_type_i_c/X1 index 60329f019f..afc9d03cab 100644 --- a/tests/offset/shape_type_i_c/X1 +++ b/tests/offset/shape_type_i_c/X1 @@ -5,3 +5,5 @@ restore [locate_data_file bug25926_b3.brep] s OFFSETSHAPE 1 {} $calcul $type checkprops result -v 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/X2 b/tests/offset/shape_type_i_c/X2 index b3097f33a3..9306a8490c 100644 --- a/tests/offset/shape_type_i_c/X2 +++ b/tests/offset/shape_type_i_c/X2 @@ -5,3 +5,5 @@ restore [locate_data_file bug25926_b3.brep] s OFFSETSHAPE 2 {} $calcul $type checkprops result -v 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/X3 b/tests/offset/shape_type_i_c/X3 index 08221cc304..665c3b3bad 100644 --- a/tests/offset/shape_type_i_c/X3 +++ b/tests/offset/shape_type_i_c/X3 @@ -5,3 +5,5 @@ restore [locate_data_file bug25926_b3x.brep] s OFFSETSHAPE 1.5 {} $calcul $type checkprops result -v 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/X4 b/tests/offset/shape_type_i_c/X4 index 78c416fb20..c20369c7a5 100644 --- a/tests/offset/shape_type_i_c/X4 +++ b/tests/offset/shape_type_i_c/X4 @@ -5,3 +5,5 @@ restore [locate_data_file bug25926_box_to_hole2.brep] s OFFSETSHAPE 1 {} $calcul $type checkprops result -v 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/X5 b/tests/offset/shape_type_i_c/X5 index a08d3e0f01..22741abf88 100644 --- a/tests/offset/shape_type_i_c/X5 +++ b/tests/offset/shape_type_i_c/X5 @@ -5,3 +5,5 @@ restore [locate_data_file bug25926_box_to_hole_valid.brep] s OFFSETSHAPE 1 {} $calcul $type checkprops result -v 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/X6 b/tests/offset/shape_type_i_c/X6 index 7e8b996896..7f3536d089 100644 --- a/tests/offset/shape_type_i_c/X6 +++ b/tests/offset/shape_type_i_c/X6 @@ -5,3 +5,5 @@ restore [locate_data_file bug25926_box_to_hole_valid.brep] s OFFSETSHAPE 2 {} $calcul $type checkprops result -v 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XA1 b/tests/offset/shape_type_i_c/XA1 new file mode 100644 index 0000000000..e2bd9abe57 --- /dev/null +++ b/tests/offset/shape_type_i_c/XA1 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom6819.input.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 1.95782e+009 +checkprops result -s 1.40488e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XA2 b/tests/offset/shape_type_i_c/XA2 new file mode 100644 index 0000000000..19b9cad86d --- /dev/null +++ b/tests/offset/shape_type_i_c/XA2 @@ -0,0 +1,11 @@ +restore [locate_data_file bug26917_rm082_input.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.7879e+007 +checkprops result -s 1.7055e+006 + +unifysamedom result_unif result +checknbshapes result_unif -face 60 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XA3 b/tests/offset/shape_type_i_c/XA3 new file mode 100644 index 0000000000..972f9b3be5 --- /dev/null +++ b/tests/offset/shape_type_i_c/XA3 @@ -0,0 +1,11 @@ +restore [locate_data_file bug26917_rm083_dom-8757.brep] s + +OFFSETSHAPE 38 {} $calcul $type + +checkprops result -v 3.82353e+008 +checkprops result -s 4.60971e+006 + +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/XA4 b/tests/offset/shape_type_i_c/XA4 new file mode 100644 index 0000000000..3ff406c0ea --- /dev/null +++ b/tests/offset/shape_type_i_c/XA4 @@ -0,0 +1,24 @@ +restore [locate_data_file bug26917_rm083_dom-8757.brep] s + +offsetparameter 1e-7 c i +offsetload s 1 + +set faces [explode s f] +foreach f $faces { + 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 32.5 + } else { + offsetonface $f 38 + } +} +offsetperform result + +checkprops result -v 3.67874e+008 +checkprops result -s 4.52001e+006 + +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/XA5 b/tests/offset/shape_type_i_c/XA5 new file mode 100644 index 0000000000..005abe0cc1 --- /dev/null +++ b/tests/offset/shape_type_i_c/XA5 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_rm083_dom-8757_trim1.brep] s + +OFFSETSHAPE 25 {} $calcul $type + +checkprops result -v 6.43076e+007 +checkprops result -s 1.16296e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XA6 b/tests/offset/shape_type_i_c/XA6 new file mode 100644 index 0000000000..2b721c8057 --- /dev/null +++ b/tests/offset/shape_type_i_c/XA6 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_rm084_dom8810.input.brep] s + +OFFSETSHAPE 15.6 {} $calcul $type + +checkprops result -v 9.96466e+008 +checkprops result -s 7.69294e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XA7 b/tests/offset/shape_type_i_c/XA7 new file mode 100644 index 0000000000..7b83f72d9d --- /dev/null +++ b/tests/offset/shape_type_i_c/XA7 @@ -0,0 +1,11 @@ +restore [locate_data_file bug26917_dom8810_2.input.brep] s + +OFFSETSHAPE 100 {} $calcul $type + +checkprops result -v 6.98714e+009 +checkprops result -s 4.89166e+007 + +unifysamedom result_unif result +checknbshapes result_unif -face 26 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XA8 b/tests/offset/shape_type_i_c/XA8 new file mode 100644 index 0000000000..1a72c090ce --- /dev/null +++ b/tests/offset/shape_type_i_c/XA8 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_rm082_input_trim1.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 1.02611e+006 +checkprops result -s 81141.2 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XA9 b/tests/offset/shape_type_i_c/XA9 new file mode 100644 index 0000000000..ca966d74b8 --- /dev/null +++ b/tests/offset/shape_type_i_c/XA9 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_rm084_dom8810.input_trim1.brep] s + +OFFSETSHAPE 15.6 {} $calcul $type + +checkprops result -v 2.72597e+007 +checkprops result -s 742046 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XB1 b/tests/offset/shape_type_i_c/XB1 new file mode 100644 index 0000000000..594ebf2cc0 --- /dev/null +++ b/tests/offset/shape_type_i_c/XB1 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom8810_2.input_trim1.brep] s + +OFFSETSHAPE 100 {} $calcul $type + +checkprops result -v 3.67674e+008 +checkprops result -s 3.2582e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XB2 b/tests/offset/shape_type_i_c/XB2 new file mode 100644 index 0000000000..b6e5482320 --- /dev/null +++ b/tests/offset/shape_type_i_c/XB2 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-8092.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 1.01003e+008 +checkprops result -s 5.29379e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XB3 b/tests/offset/shape_type_i_c/XB3 new file mode 100644 index 0000000000..9224dfc037 --- /dev/null +++ b/tests/offset/shape_type_i_c/XB3 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-8092_trim1.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 1.43479e+007 +checkprops result -s 831097 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XB4 b/tests/offset/shape_type_i_c/XB4 new file mode 100644 index 0000000000..5fc2ee4937 --- /dev/null +++ b/tests/offset/shape_type_i_c/XB4 @@ -0,0 +1,21 @@ +restore [locate_data_file bug26917_dom-8092_with_faces.brep] c + +# get the shape +explode c +copy c_1 s + +offsetparameter 1e-7 c i +offsetload s 10 + +foreach f [explode c_2 f] { + offsetonface $f 0 +} + +offsetperform result + +checkprops result -v 7.26594e+007 -s 5.19731e+006 + +unifysamedom result_unif result +checknbshapes result_unif -face 613 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XB5 b/tests/offset/shape_type_i_c/XB5 new file mode 100644 index 0000000000..849dec2785 --- /dev/null +++ b/tests/offset/shape_type_i_c/XB5 @@ -0,0 +1,19 @@ +restore [locate_data_file bug26917_dom-8092_trim1.brep] s + +offsetparameter 1e-7 $calcul $type +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 -v 9.87183e+006 -s 784012 + +unifysamedom result_unif result +checknbshapes result_unif -face 89 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XB6 b/tests/offset/shape_type_i_c/XB6 new file mode 100644 index 0000000000..d1255853f6 --- /dev/null +++ b/tests/offset/shape_type_i_c/XB6 @@ -0,0 +1,19 @@ +restore [locate_data_file bug26917_dom-8092_trim2.brep] s + +offsetparameter 1e-7 $calcul $type +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 -v 4.95561e+006 -s 378181 + +unifysamedom result_unif result +checknbshapes result_unif -face 50 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XB7 b/tests/offset/shape_type_i_c/XB7 new file mode 100644 index 0000000000..d00ec1d446 --- /dev/null +++ b/tests/offset/shape_type_i_c/XB7 @@ -0,0 +1,21 @@ +puts "TODO CR27414 ALL: Error : is WRONG because number of FACE entities in shape" + +restore [locate_data_file bug26917_dom-8092_trim3.brep] s + +offsetparameter 1e-7 $calcul $type +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 -v 2.39493e+006 -s 156207 + +unifysamedom result_unif result +checknbshapes result_unif -face 32 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XB8 b/tests/offset/shape_type_i_c/XB8 new file mode 100644 index 0000000000..1fa5bdadbf --- /dev/null +++ b/tests/offset/shape_type_i_c/XB8 @@ -0,0 +1,21 @@ +puts "TODO CR27414 ALL: Error : is WRONG because number of FACE entities in shape" + +restore [locate_data_file bug26917_dom-8092_trim4.brep] s + +offsetparameter 1e-7 $calcul $type +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 -v 678794 -s 50525.6 + +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/XB9 b/tests/offset/shape_type_i_c/XB9 new file mode 100644 index 0000000000..0b53c2669c --- /dev/null +++ b/tests/offset/shape_type_i_c/XB9 @@ -0,0 +1,22 @@ +puts "TODO CR27414 ALL: Error : is WRONG because number of FACE entities in shape" + +restore [locate_data_file bug26917_dom-8092_simple.brep] s + +offsetparameter 1e-7 $calcul $type +offsetload s 1 +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 -v 64.4702 +checkprops result -s 104.508 + +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/XC1 b/tests/offset/shape_type_i_c/XC1 new file mode 100644 index 0000000000..5f1185871b --- /dev/null +++ b/tests/offset/shape_type_i_c/XC1 @@ -0,0 +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_input.dom7742_trim1.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 486350 +checkprops result -s 43589.5 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XC2 b/tests/offset/shape_type_i_c/XC2 new file mode 100755 index 0000000000..4deae08b4d --- /dev/null +++ b/tests/offset/shape_type_i_c/XC2 @@ -0,0 +1,12 @@ +puts "TODO OCC27414 ALL: Error : The volume of result shape is" +puts "TODO OCC27414 ALL: Error : The area of result shape is" +puts "TODO OCC27414 ALL: is not equal to zero" + +restore [locate_data_file bug26917_input.dom7742_trim2.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 367339 +checkprops result -s 34789.6 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XC3 b/tests/offset/shape_type_i_c/XC3 new file mode 100644 index 0000000000..ad8a758453 --- /dev/null +++ b/tests/offset/shape_type_i_c/XC3 @@ -0,0 +1,11 @@ +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_input.dom7742_trim3.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 0 +checkprops result -s 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XC4 b/tests/offset/shape_type_i_c/XC4 new file mode 100644 index 0000000000..047fc088a8 --- /dev/null +++ b/tests/offset/shape_type_i_c/XC4 @@ -0,0 +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_input.dom7742_simple.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 2238.67 -s 1045.99 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XC5 b/tests/offset/shape_type_i_c/XC5 new file mode 100644 index 0000000000..3eabe75235 --- /dev/null +++ b/tests/offset/shape_type_i_c/XC5 @@ -0,0 +1,11 @@ +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_input.dom7742_simple.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 0 +checkprops result -s 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XC6 b/tests/offset/shape_type_i_c/XC6 new file mode 100644 index 0000000000..c966422d6f --- /dev/null +++ b/tests/offset/shape_type_i_c/XC6 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-8092_trim5.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 3.33671e+007 +checkprops result -s 1.86576e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XC7 b/tests/offset/shape_type_i_c/XC7 new file mode 100644 index 0000000000..116f0606bc --- /dev/null +++ b/tests/offset/shape_type_i_c/XC7 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom8909.brep] s + +OFFSETSHAPE 30 {} $calcul $type + +checkprops result -v 2.8244e+008 +checkprops result -s 4.14136e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XC8 b/tests/offset/shape_type_i_c/XC8 new file mode 100644 index 0000000000..7298b1a719 --- /dev/null +++ b/tests/offset/shape_type_i_c/XC8 @@ -0,0 +1,11 @@ +restore [locate_data_file bug26917_rm083_dom-8757_trim1.brep] s + +OFFSETSHAPE 38 {} $calcul $type + +checkprops result -v 8.054e+007 +checkprops result -s 1.31993e+006 + +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/XC9 b/tests/offset/shape_type_i_c/XC9 new file mode 100644 index 0000000000..99d59702dd --- /dev/null +++ b/tests/offset/shape_type_i_c/XC9 @@ -0,0 +1,11 @@ +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_ZE6_simple.brep] s + +OFFSETSHAPE 1 {} $calcul $type + +checkprops result -v 0 +checkprops result -s 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XD1 b/tests/offset/shape_type_i_c/XD1 new file mode 100644 index 0000000000..2e90e6c8d7 --- /dev/null +++ b/tests/offset/shape_type_i_c/XD1 @@ -0,0 +1,11 @@ +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_small_face.brep] s + +OFFSETSHAPE 4 {} $calcul $type + +checkprops result -v 0 +checkprops result -s 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XD2 b/tests/offset/shape_type_i_c/XD2 new file mode 100644 index 0000000000..4055bb77a8 --- /dev/null +++ b/tests/offset/shape_type_i_c/XD2 @@ -0,0 +1,11 @@ +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_small_face.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 0 +checkprops result -s 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XD3 b/tests/offset/shape_type_i_c/XD3 new file mode 100755 index 0000000000..05655de975 --- /dev/null +++ b/tests/offset/shape_type_i_c/XD3 @@ -0,0 +1,14 @@ +puts "TODO OCC27414 ALL: Error: The command cannot be built" +puts "TODO OCC27414 ALL: Tcl Exception" +puts "TODO OCC27414 ALL: TEST INCOMPLETE" + +restore [locate_data_file bug26917_25926_offset_shape_trim4.brep] s + +OFFSETSHAPE 12 {} $calcul $type + +checkprops result -v 0 -s 0 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XD4 b/tests/offset/shape_type_i_c/XD4 new file mode 100644 index 0000000000..826ca26a11 --- /dev/null +++ b/tests/offset/shape_type_i_c/XD4 @@ -0,0 +1,14 @@ +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 FACE entities in shape" + +restore [locate_data_file bug26917_box_triangle.brep] s + +OFFSETSHAPE 1 {} $calcul $type + +checkprops result -v 119.09 -s 165.708 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 12 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XD5 b/tests/offset/shape_type_i_c/XD5 new file mode 100644 index 0000000000..1282d9e053 --- /dev/null +++ b/tests/offset/shape_type_i_c/XD5 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_dom-6827_1.recipe_trim5.brep] s + +OFFSETSHAPE 9 {} $calcul $type + +checkprops result -v 644772 -s 53880.6 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 11 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XD6 b/tests/offset/shape_type_i_c/XD6 new file mode 100644 index 0000000000..73cd415c87 --- /dev/null +++ b/tests/offset/shape_type_i_c/XD6 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_dom-6827_1.recipe_trim5.brep] s + +OFFSETSHAPE 11 {} $calcul $type + +checkprops result -v 758171 -s 59557.2 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 11 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XD7 b/tests/offset/shape_type_i_c/XD7 new file mode 100644 index 0000000000..8ec0f2fee0 --- /dev/null +++ b/tests/offset/shape_type_i_c/XD7 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_input-step17_trim5.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 279714 -s 29357.2 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 5 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XD8 b/tests/offset/shape_type_i_c/XD8 new file mode 100644 index 0000000000..c072cd6ad3 --- /dev/null +++ b/tests/offset/shape_type_i_c/XD8 @@ -0,0 +1,14 @@ +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 FACE entities in shape" + +restore [locate_data_file bug26917_input-step17_trim6.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 0 -s 0 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XD9 b/tests/offset/shape_type_i_c/XD9 new file mode 100644 index 0000000000..54a2a63b40 --- /dev/null +++ b/tests/offset/shape_type_i_c/XD9 @@ -0,0 +1,14 @@ +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 FACE entities in shape" + +restore [locate_data_file bug26917_input-step17_trim6.brep] s + +OFFSETSHAPE 20 {} $calcul $type + +checkprops result -v 0 -s 0 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XE1 b/tests/offset/shape_type_i_c/XE1 new file mode 100644 index 0000000000..310b76c8c3 --- /dev/null +++ b/tests/offset/shape_type_i_c/XE1 @@ -0,0 +1,25 @@ +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 FACE entities in shape" + +restore [locate_data_file bug26917_rm084_dom8810_3.input.brep] s + +offsetparameter 1e-7 c i +offsetload s 105.8 + +set faces [explode s f] +foreach f $faces { + 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 100 + } +} +offsetperform result + +checkprops result -v 0 -s 0 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XE2 b/tests/offset/shape_type_i_c/XE2 new file mode 100644 index 0000000000..dcd1516a3c --- /dev/null +++ b/tests/offset/shape_type_i_c/XE2 @@ -0,0 +1,14 @@ +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 FACE entities in shape" + +restore [locate_data_file bug26917_rm084_dom8810_3.input.brep] s + +OFFSETSHAPE 100 {} $calcul $type + +checkprops result -v 0 -s 0 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XE3 b/tests/offset/shape_type_i_c/XE3 new file mode 100644 index 0000000000..8c3ddb5c22 --- /dev/null +++ b/tests/offset/shape_type_i_c/XE3 @@ -0,0 +1,11 @@ +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_trim1.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 0 -s 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XE4 b/tests/offset/shape_type_i_c/XE4 new file mode 100644 index 0000000000..dbdd518bbe --- /dev/null +++ b/tests/offset/shape_type_i_c/XE4 @@ -0,0 +1,11 @@ +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_trim2.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 0 -s 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XE5 b/tests/offset/shape_type_i_c/XE5 new file mode 100644 index 0000000000..005acc3ddc --- /dev/null +++ b/tests/offset/shape_type_i_c/XE5 @@ -0,0 +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_trim3.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 0 -s 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XE6 b/tests/offset/shape_type_i_c/XE6 new file mode 100644 index 0000000000..ec54beae60 --- /dev/null +++ b/tests/offset/shape_type_i_c/XE6 @@ -0,0 +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 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XE7 b/tests/offset/shape_type_i_c/XE7 new file mode 100644 index 0000000000..40a1e66eaf --- /dev/null +++ b/tests/offset/shape_type_i_c/XE7 @@ -0,0 +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_trim6.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 0 -s 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XE8 b/tests/offset/shape_type_i_c/XE8 new file mode 100644 index 0000000000..7f3a7652ef --- /dev/null +++ b/tests/offset/shape_type_i_c/XE8 @@ -0,0 +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_trim7.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 0 -s 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XE9 b/tests/offset/shape_type_i_c/XE9 new file mode 100644 index 0000000000..67979f74bc --- /dev/null +++ b/tests/offset/shape_type_i_c/XE9 @@ -0,0 +1,11 @@ +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_trim8.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 0 -s 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XF1 b/tests/offset/shape_type_i_c/XF1 new file mode 100644 index 0000000000..b609a31887 --- /dev/null +++ b/tests/offset/shape_type_i_c/XF1 @@ -0,0 +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_trim9.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 0 -s 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XF2 b/tests/offset/shape_type_i_c/XF2 new file mode 100644 index 0000000000..797b497daf --- /dev/null +++ b/tests/offset/shape_type_i_c/XF2 @@ -0,0 +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_trim10.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 0 -s 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XF3 b/tests/offset/shape_type_i_c/XF3 new file mode 100644 index 0000000000..bf19737932 --- /dev/null +++ b/tests/offset/shape_type_i_c/XF3 @@ -0,0 +1,19 @@ +restore [locate_data_file bug26917_dom-8092_simple6.brep] s + +offsetparameter 1e-7 $calcul $type +offsetload s 1 +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 -v 115.152 -s 171.74 + +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/XF4 b/tests/offset/shape_type_i_c/XF4 new file mode 100644 index 0000000000..5ad9a32000 --- /dev/null +++ b/tests/offset/shape_type_i_c/XF4 @@ -0,0 +1,19 @@ +restore [locate_data_file bug26917_dom-8092_trim6.brep] s + +offsetparameter 1e-7 $calcul $type +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 -v 7.3871e+006 -s 549219 + +unifysamedom result_unif result +checknbshapes result_unif -face 70 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XF5 b/tests/offset/shape_type_i_c/XF5 new file mode 100644 index 0000000000..5ce80a749c --- /dev/null +++ b/tests/offset/shape_type_i_c/XF5 @@ -0,0 +1,21 @@ +restore [locate_data_file bug26917_dom-8092_trim7_with_faces.brep] c + +# get the shape +explode c +copy c_1 s + +offsetparameter 1e-7 c i +offsetload s 10 + +foreach f [explode c_2 f] { + offsetonface $f 0 +} + +offsetperform result + +checkprops result -v 4.15571e+007 -s 2.96614e+006 + +unifysamedom result_unif result +checknbshapes result_unif -face 333 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XF6 b/tests/offset/shape_type_i_c/XF6 new file mode 100644 index 0000000000..13f4accc2d --- /dev/null +++ b/tests/offset/shape_type_i_c/XF6 @@ -0,0 +1,19 @@ +restore [locate_data_file bug26917_dom-8092_trim8.brep] s + +offsetparameter 1e-7 $calcul $type +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 -v 2.24922e+007 -s 1.69552e+006 + +unifysamedom result_unif result +checknbshapes result_unif -face 182 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XF7 b/tests/offset/shape_type_i_c/XF7 new file mode 100644 index 0000000000..b47649e60a --- /dev/null +++ b/tests/offset/shape_type_i_c/XF7 @@ -0,0 +1,19 @@ +restore [locate_data_file bug26917_dom-8092_trim9.brep] s + +offsetparameter 1e-7 $calcul $type +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 -v 1.44209e+007 -s 1.06577e+006 + +unifysamedom result_unif result +checknbshapes result_unif -face 120 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XF8 b/tests/offset/shape_type_i_c/XF8 new file mode 100644 index 0000000000..da45f426ad --- /dev/null +++ b/tests/offset/shape_type_i_c/XF8 @@ -0,0 +1,19 @@ +restore [locate_data_file bug26917_dom-8092_trim10.brep] s + +offsetparameter 1e-7 $calcul $type +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 -v 1.02049e+007 -s 727784 + +unifysamedom result_unif result +checknbshapes result_unif -face 83 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XF9 b/tests/offset/shape_type_i_c/XF9 new file mode 100644 index 0000000000..b853eb09a8 --- /dev/null +++ b/tests/offset/shape_type_i_c/XF9 @@ -0,0 +1,19 @@ +restore [locate_data_file bug26917_dom-8092_trim11.brep] s + +offsetparameter 1e-7 $calcul $type +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 -v 3.68147e+006 -s 205693 + +unifysamedom result_unif result +checknbshapes result_unif -face 32 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XG1 b/tests/offset/shape_type_i_c/XG1 new file mode 100644 index 0000000000..b7af2f1f96 --- /dev/null +++ b/tests/offset/shape_type_i_c/XG1 @@ -0,0 +1,18 @@ +restore [locate_data_file bug26917_dom-7724.brep] s + +offsetparameter 1e-7 c i +offsetload s 15 + +set faces [explode s f] +foreach f $faces { + 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 0 + } +} +offsetperform result + +checkprops result -v 8.52723e+008 -s 6.06025e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XG2 b/tests/offset/shape_type_i_c/XG2 new file mode 100644 index 0000000000..ad576bc57d --- /dev/null +++ b/tests/offset/shape_type_i_c/XG2 @@ -0,0 +1,23 @@ +puts "TODO CR27414 ALL: Error : is WRONG because number of FACE entities in shape" + +restore [locate_data_file bug26917_dom-7724_trim1.brep] s + +offsetparameter 1e-7 c i +offsetload s 15 + +set faces [explode s f] +foreach f $faces { + 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 0 + } +} +offsetperform result + +checkprops result -v 9.24815e+006 -s 523194 + +unifysamedom result_unif result +checknbshapes result_unif -face 27 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XG3 b/tests/offset/shape_type_i_c/XG3 new file mode 100644 index 0000000000..2475710bb6 --- /dev/null +++ b/tests/offset/shape_type_i_c/XG3 @@ -0,0 +1,18 @@ +restore [locate_data_file bug26917_dom-7724_trim8.brep] s + +offsetparameter 1e-7 c i +offsetload s 15 + +set faces [explode s f] +foreach f $faces { + 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 0 + } +} +offsetperform result + +checkprops result -v 3.60205e+006 -s 254682 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XG4 b/tests/offset/shape_type_i_c/XG4 new file mode 100644 index 0000000000..8cf5a3e1f1 --- /dev/null +++ b/tests/offset/shape_type_i_c/XG4 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_rm-095_input.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.3834e+007 -s 2.63386e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XG5 b/tests/offset/shape_type_i_c/XG5 new file mode 100644 index 0000000000..9331950ab4 --- /dev/null +++ b/tests/offset/shape_type_i_c/XG5 @@ -0,0 +1,18 @@ +restore [locate_data_file bug26917_rm-095_input_with_faces.brep] c + +# get the shape +explode c +copy c_1 s + +offsetparameter 1e-7 c i +offsetload s 5 + +foreach f [explode c_2 f] { + offsetonface $f 0 +} + +offsetperform result + +checkprops result -v 2.91628e+007 -s 2.58238e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XG6 b/tests/offset/shape_type_i_c/XG6 new file mode 100644 index 0000000000..a11429fa25 --- /dev/null +++ b/tests/offset/shape_type_i_c/XG6 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_rm-095_input_trim1.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 8.17694e+006 -s 769867 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XG7 b/tests/offset/shape_type_i_c/XG7 new file mode 100644 index 0000000000..c0ba2138ae --- /dev/null +++ b/tests/offset/shape_type_i_c/XG7 @@ -0,0 +1,18 @@ +restore [locate_data_file bug26917_rm-095_input_trim1.brep] s + +offsetparameter 1e-7 c i +offsetload s 5 + +set faces [explode s f] +foreach f $faces { + 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 -v 6.74813e+006 -s 751157 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XG8 b/tests/offset/shape_type_i_c/XG8 new file mode 100644 index 0000000000..9e5f67f34a --- /dev/null +++ b/tests/offset/shape_type_i_c/XG8 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_rm-095_input_trim2.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 2.57933e+007 -s 1.9054e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XG9 b/tests/offset/shape_type_i_c/XG9 new file mode 100644 index 0000000000..e95923ac41 --- /dev/null +++ b/tests/offset/shape_type_i_c/XG9 @@ -0,0 +1,18 @@ +restore [locate_data_file bug26917_rm-095_input_trim2_with_faces.brep] c + +# get the shape +explode c +copy c_1 s + +offsetparameter 1e-7 c i +offsetload s 5 + +foreach f [explode c_2 f] { + offsetonface $f 0 +} + +offsetperform result + +checkprops result -v 2.25226e+007 -s 1.86675e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XH1 b/tests/offset/shape_type_i_c/XH1 new file mode 100644 index 0000000000..1708523ed0 --- /dev/null +++ b/tests/offset/shape_type_i_c/XH1 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_rm-095_input_trim3.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.22726e+006 -s 247903 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XH2 b/tests/offset/shape_type_i_c/XH2 new file mode 100644 index 0000000000..b9aeede1d6 --- /dev/null +++ b/tests/offset/shape_type_i_c/XH2 @@ -0,0 +1,18 @@ +restore [locate_data_file bug26917_rm-095_input_trim3.brep] s + +offsetparameter 1e-7 c i +offsetload s 5 + +set faces [explode s f] +foreach f $faces { + 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 -v 2.83253e+006 -s 238219 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XH3 b/tests/offset/shape_type_i_c/XH3 new file mode 100644 index 0000000000..6dac9cd68f --- /dev/null +++ b/tests/offset/shape_type_i_c/XH3 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_rm-095_input_trim4.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 236367 -s 30788.4 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XH4 b/tests/offset/shape_type_i_c/XH4 new file mode 100644 index 0000000000..99ca6379c7 --- /dev/null +++ b/tests/offset/shape_type_i_c/XH4 @@ -0,0 +1,18 @@ +restore [locate_data_file bug26917_rm-095_input_trim4.brep] s + +offsetparameter 1e-7 c i +offsetload s 5 + +set faces [explode s f] +foreach f $faces { + 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 -v 210428 -s 28315.7 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XH5 b/tests/offset/shape_type_i_c/XH5 new file mode 100644 index 0000000000..4bbaa9c5ef --- /dev/null +++ b/tests/offset/shape_type_i_c/XH5 @@ -0,0 +1,13 @@ +puts "TODO CR27414 ALL: Error : The area of result shape is" +puts "TODO CR27414 ALL: Error : is WRONG because number of FACE entities in shape" + +restore [locate_data_file bug26917_M2_trim7_trim1.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 1.00013e+006 -s 66432.5 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 9 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XH6 b/tests/offset/shape_type_i_c/XH6 new file mode 100644 index 0000000000..2ddfcfbeda --- /dev/null +++ b/tests/offset/shape_type_i_c/XH6 @@ -0,0 +1,21 @@ +puts "TODO CR27414 ALL: Error : is WRONG because number of FACE entities in shape" + +restore [locate_data_file bug26917_dom-8092_simple2.brep] s + +offsetparameter 1e-7 $calcul $type +offsetload s 1 +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 -v 70.4702 -s 114.508 + +unifysamedom result_unif result +checknbshapes result_unif -face 10 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XH7 b/tests/offset/shape_type_i_c/XH7 new file mode 100644 index 0000000000..8daf612b3f --- /dev/null +++ b/tests/offset/shape_type_i_c/XH7 @@ -0,0 +1,19 @@ +restore [locate_data_file bug26917_dom-8092_simple3.brep] s + +offsetparameter 1e-7 $calcul $type +offsetload s 1 +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 -v 70.4702 -s 114.508 + +unifysamedom result_unif result +checknbshapes result_unif -face 10 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XH8 b/tests/offset/shape_type_i_c/XH8 new file mode 100644 index 0000000000..1167f16dbb --- /dev/null +++ b/tests/offset/shape_type_i_c/XH8 @@ -0,0 +1,19 @@ +restore [locate_data_file bug26917_dom-8092_simple4.brep] s + +offsetparameter 1e-7 $calcul $type +offsetload s 1 +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 -v 70.4702 -s 114.508 + +unifysamedom result_unif result +checknbshapes result_unif -face 10 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XH9 b/tests/offset/shape_type_i_c/XH9 new file mode 100644 index 0000000000..9c2ae30e0d --- /dev/null +++ b/tests/offset/shape_type_i_c/XH9 @@ -0,0 +1,19 @@ +restore [locate_data_file bug26917_dom-8092_trim12.brep] s + +offsetparameter 1e-7 $calcul $type +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 -v 4.67737e+006 -s 364455 + +unifysamedom result_unif result +checknbshapes result_unif -face 42 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XI1 b/tests/offset/shape_type_i_c/XI1 new file mode 100644 index 0000000000..25d384e8b5 --- /dev/null +++ b/tests/offset/shape_type_i_c/XI1 @@ -0,0 +1,25 @@ +restore [locate_data_file bug26917_dom-8092_with_diff_faces.brep] c + +# get the shape +explode c +copy c_1 s + +offsetparameter 1e-7 c i +offsetload s 10 + +foreach f [explode c_2 f] { + offsetonface $f 0 +} + +foreach f [explode c_3 f] { + offsetonface $f 9.96195 +} + +offsetperform result + +checkprops result -v 7.26156e+007 -s 5.19666e+006 + +unifysamedom result_unif result +checknbshapes result_unif -face 613 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XI2 b/tests/offset/shape_type_i_c/XI2 new file mode 100644 index 0000000000..098624eb58 --- /dev/null +++ b/tests/offset/shape_type_i_c/XI2 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_dom-8092.new.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 9.7511e+007 -s 5.12881e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XI3 b/tests/offset/shape_type_i_c/XI3 new file mode 100644 index 0000000000..19343c157d --- /dev/null +++ b/tests/offset/shape_type_i_c/XI3 @@ -0,0 +1,21 @@ +restore [locate_data_file bug26917_dom-8092.new_with_faces.brep] c + +# get the shape +explode c +copy c_1 s + +offsetparameter 1e-7 c i +offsetload s 10 + +foreach f [explode c_2 f] { + offsetonface $f 0 +} + +offsetperform result + +checkprops result -v 6.99928e+007 -s 5.03322e+006 + +unifysamedom result_unif result +checknbshapes result_unif -face 613 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XI4 b/tests/offset/shape_type_i_c/XI4 new file mode 100755 index 0000000000..7faaedb3b8 --- /dev/null +++ b/tests/offset/shape_type_i_c/XI4 @@ -0,0 +1,28 @@ +puts "TODO CR27414 ALL: Error : is WRONG because number of FACE entities in shape" +puts "TODO OCC27414 ALL: the resulting shape is negative" + +restore [locate_data_file bug26917_dom-8092.new_with_faces.brep] c + +# get the shape +explode c +copy c_1 s + +offsetparameter 1e-7 c i +offsetload s 10 + +foreach f [explode c_2 f] { + offsetonface $f 0 +} + +foreach f [explode c_3 f] { + offsetonface $f 9.96195 +} + +offsetperform result + +checkprops result -v 6.99508e+007 -s 5.03259e+006 + +unifysamedom result_unif result +checknbshapes result_unif -face 613 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XI5 b/tests/offset/shape_type_i_c/XI5 new file mode 100644 index 0000000000..867c5df0c1 --- /dev/null +++ b/tests/offset/shape_type_i_c/XI5 @@ -0,0 +1,25 @@ +restore [locate_data_file bug26917_dom-8092.new_trim1_with_faces.brep] c + +# get the shape +explode c +copy c_1 s + +offsetparameter 1e-7 c i +offsetload s 10 + +foreach f [explode c_2 f] { + offsetonface $f 0 +} + +foreach f [explode c_3 f] { + offsetonface $f 9.96195 +} + +offsetperform result + +checkprops result -v 4.00462e+007 -s 2.87488e+006 + +unifysamedom result_unif result +checknbshapes result_unif -face 333 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XI6 b/tests/offset/shape_type_i_c/XI6 new file mode 100644 index 0000000000..76863f0f01 --- /dev/null +++ b/tests/offset/shape_type_i_c/XI6 @@ -0,0 +1,28 @@ +puts "TODO CR27414 ALL: Error : is WRONG because number of FACE entities in shape" +puts "TODO OCC27414 ALL: the resulting shape is negative" + +restore [locate_data_file bug26917_dom-8092.new_trim2_with_faces.brep] c + +# get the shape +explode c +copy c_1 s + +offsetparameter 1e-7 c i +offsetload s 10 + +foreach f [explode c_2 f] { + offsetonface $f 0 +} + +foreach f [explode c_3 f] { + offsetonface $f 9.96195 +} + +offsetperform result + +checkprops result -v 3.01916e+007 -s 2.24322e+006 + +unifysamedom result_unif result +checknbshapes result_unif -face 280 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XI7 b/tests/offset/shape_type_i_c/XI7 new file mode 100644 index 0000000000..f3028adf03 --- /dev/null +++ b/tests/offset/shape_type_i_c/XI7 @@ -0,0 +1,25 @@ +restore [locate_data_file bug26917_dom-8092.new_trim3_with_faces.brep] c + +# get the shape +explode c +copy c_1 s + +offsetparameter 1e-7 c i +offsetload s 10 + +foreach f [explode c_2 f] { + offsetonface $f 0 +} + +foreach f [explode c_3 f] { + offsetonface $f 9.96195 +} + +offsetperform result + +checkprops result -v 4.8408e+007 -s 3.4436e+006 + +unifysamedom result_unif result +checknbshapes result_unif -face 410 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XI8 b/tests/offset/shape_type_i_c/XI8 new file mode 100644 index 0000000000..346b70b45a --- /dev/null +++ b/tests/offset/shape_type_i_c/XI8 @@ -0,0 +1,28 @@ +puts "TODO CR27414 ALL: Error : is WRONG because number of FACE entities in shape" +puts "TODO OCC27414 ALL: the resulting shape is negative" + +restore [locate_data_file bug26917_dom-8092.new_trim4_with_faces.brep] c + +# get the shape +explode c +copy c_1 s + +offsetparameter 1e-7 c i +offsetload s 10 + +foreach f [explode c_2 f] { + offsetonface $f 0 +} + +foreach f [explode c_3 f] { + offsetonface $f 9.96195 +} + +offsetperform result + +checkprops result -v 2.26105e+007 -s 1.76469e+006 + +unifysamedom result_unif result +checknbshapes result_unif -face 223 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XI9 b/tests/offset/shape_type_i_c/XI9 new file mode 100644 index 0000000000..402f71a356 --- /dev/null +++ b/tests/offset/shape_type_i_c/XI9 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_dom-8092.t6c1.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 9.7511e+007 -s 5.12881e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/XJ1 b/tests/offset/shape_type_i_c/XJ1 new file mode 100644 index 0000000000..9594e8ce5f --- /dev/null +++ b/tests/offset/shape_type_i_c/XJ1 @@ -0,0 +1,21 @@ +restore [locate_data_file bug26917_dom-8092.t6c1_with_faces.brep] c + +# get the shape +explode c +copy c_1 s + +offsetparameter 1e-7 c i +offsetload s 10 + +foreach f [explode c_2 f] { + offsetonface $f 0 +} + +offsetperform result + +checkprops result -v 6.99928e+007 -s 5.03322e+006 + +unifysamedom result_unif result +checknbshapes result_unif -face 613 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XJ2 b/tests/offset/shape_type_i_c/XJ2 new file mode 100755 index 0000000000..f4e41e7175 --- /dev/null +++ b/tests/offset/shape_type_i_c/XJ2 @@ -0,0 +1,29 @@ +puts "TODO OCC27414 ALL: Error: The command cannot be built" +puts "TODO OCC27414 ALL: Tcl Exception" +puts "TODO OCC27414 ALL: TEST INCOMPLETE" + +restore [locate_data_file bug26917_dom-8092.t6c1_with_faces.brep] c + +# get the shape +explode c +copy c_1 s + +offsetparameter 1e-7 c i +offsetload s 10 + +foreach f [explode c_2 f] { + offsetonface $f 0 +} + +foreach f [explode c_3 f] { + offsetonface $f 9.96195 +} + +offsetperform result + +checkprops result -v 0 -s 0 + +unifysamedom result_unif result +checknbshapes result_unif -face 1 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XJ3 b/tests/offset/shape_type_i_c/XJ3 new file mode 100644 index 0000000000..c5137cec8f --- /dev/null +++ b/tests/offset/shape_type_i_c/XJ3 @@ -0,0 +1,25 @@ +restore [locate_data_file bug26917_dom-8092.t6c1_trim1_with_faces.brep] c + +# get the shape +explode c +copy c_1 s + +offsetparameter 1e-7 c i +offsetload s 10 + +foreach f [explode c_2 f] { + offsetonface $f 0 +} + +foreach f [explode c_3 f] { + offsetonface $f 9.96195 +} + +offsetperform result + +checkprops result -v 3.15651e+007 -s 2.29267e+006 + +unifysamedom result_unif result +checknbshapes result_unif -face 278 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XJ4 b/tests/offset/shape_type_i_c/XJ4 new file mode 100644 index 0000000000..eaca5c36d9 --- /dev/null +++ b/tests/offset/shape_type_i_c/XJ4 @@ -0,0 +1,29 @@ +puts "TODO OCC27414 ALL: Error: The command cannot be built" +puts "TODO OCC27414 ALL: Tcl Exception" +puts "TODO OCC27414 ALL: TEST INCOMPLETE" + +restore [locate_data_file bug26917_dom-8092.t6c1_trim2_with_faces.brep] c + +# get the shape +explode c +copy c_1 s + +offsetparameter 1e-7 c i +offsetload s 10 + +foreach f [explode c_2 f] { + offsetonface $f 0 +} + +foreach f [explode c_3 f] { + offsetonface $f 9.96195 +} + +offsetperform result + +checkprops result -v 0 -s 0 + +unifysamedom result_unif result +checknbshapes result_unif -face 1 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XJ5 b/tests/offset/shape_type_i_c/XJ5 new file mode 100644 index 0000000000..33b7be9df0 --- /dev/null +++ b/tests/offset/shape_type_i_c/XJ5 @@ -0,0 +1,29 @@ +puts "TODO OCC27414 ALL: Error: The command cannot be built" +puts "TODO OCC27414 ALL: Tcl Exception" +puts "TODO OCC27414 ALL: TEST INCOMPLETE" + +restore [locate_data_file bug26917_dom-8092.t6c1_trim3_with_faces.brep] c + +# get the shape +explode c +copy c_1 s + +offsetparameter 1e-7 c i +offsetload s 10 + +foreach f [explode c_2 f] { + offsetonface $f 0 +} + +foreach f [explode c_3 f] { + offsetonface $f 9.96195 +} + +offsetperform result + +checkprops result -v 0 -s 0 + +unifysamedom result_unif result +checknbshapes result_unif -face 1 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XJ6 b/tests/offset/shape_type_i_c/XJ6 new file mode 100644 index 0000000000..78b3de4b84 --- /dev/null +++ b/tests/offset/shape_type_i_c/XJ6 @@ -0,0 +1,29 @@ +puts "TODO OCC27414 ALL: Error: The command cannot be built" +puts "TODO OCC27414 ALL: Tcl Exception" +puts "TODO OCC27414 ALL: TEST INCOMPLETE" + +restore [locate_data_file bug26917_dom-8092.t6c1_trim4_with_faces.brep] c + +# get the shape +explode c +copy c_1 s + +offsetparameter 1e-7 c i +offsetload s 10 + +foreach f [explode c_2 f] { + offsetonface $f 0 +} + +foreach f [explode c_3 f] { + offsetonface $f 9.96195 +} + +offsetperform result + +checkprops result -v 0 -s 0 + +unifysamedom result_unif result +checknbshapes result_unif -face 1 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XJ7 b/tests/offset/shape_type_i_c/XJ7 new file mode 100644 index 0000000000..3d8ab32dce --- /dev/null +++ b/tests/offset/shape_type_i_c/XJ7 @@ -0,0 +1,29 @@ +puts "TODO OCC27414 ALL: Error: The command cannot be built" +puts "TODO OCC27414 ALL: Tcl Exception" +puts "TODO OCC27414 ALL: TEST INCOMPLETE" + +restore [locate_data_file bug26917_dom-8092.t6c1_trim5_with_faces.brep] c + +# get the shape +explode c +copy c_1 s + +offsetparameter 1e-7 c i +offsetload s 10 + +foreach f [explode c_2 f] { + offsetonface $f 0 +} + +foreach f [explode c_3 f] { + offsetonface $f 9.96195 +} + +offsetperform result + +checkprops result -v 0 -s 0 + +unifysamedom result_unif result +checknbshapes result_unif -face 1 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XJ8 b/tests/offset/shape_type_i_c/XJ8 new file mode 100644 index 0000000000..85a655b568 --- /dev/null +++ b/tests/offset/shape_type_i_c/XJ8 @@ -0,0 +1,25 @@ +restore [locate_data_file bug26917_dom-8092.new_with_faces.brep] c + +# get the shape +explode c +copy c_1 s + +offsetparameter 1e-7 c i +offsetload s 10 + +foreach f [explode c_2 f] { + offsetonface $f 0 +} + +foreach f [explode c_3 f] { + offsetonface $f 9.961946980917456 +} + +offsetperform result + +checkprops result -v 6.99508e+007 -s 5.03259e+006 + +unifysamedom result_unif result +checknbshapes result_unif -face 571 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XJ9 b/tests/offset/shape_type_i_c/XJ9 new file mode 100644 index 0000000000..dc573f38cd --- /dev/null +++ b/tests/offset/shape_type_i_c/XJ9 @@ -0,0 +1,25 @@ +restore [locate_data_file bug26917_dom-8092.t6c1_with_faces.brep] c + +# get the shape +explode c +copy c_1 s + +offsetparameter 1e-7 c i +offsetload s 10 + +foreach f [explode c_2 f] { + offsetonface $f 0 +} + +foreach f [explode c_3 f] { + offsetonface $f 9.961946980917456 +} + +offsetperform result + +checkprops result -v 6.99508e+007 -s 5.03259e+006 + +unifysamedom result_unif result +checknbshapes result_unif -face 571 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XK1 b/tests/offset/shape_type_i_c/XK1 new file mode 100644 index 0000000000..0c262b8483 --- /dev/null +++ b/tests/offset/shape_type_i_c/XK1 @@ -0,0 +1,25 @@ +restore [locate_data_file bug26917_dom-8092.new_trim5_with_faces.brep] c + +# get the shape +explode c +copy c_1 s + +offsetparameter 1e-7 c i +offsetload s 10 + +foreach f [explode c_2 f] { + offsetonface $f 0 +} + +foreach f [explode c_3 f] { + offsetonface $f 9.961946980917456 +} + +offsetperform result + +checkprops result -v 1.45342e+007 -s 1.07942e+006 + +unifysamedom result_unif result +checknbshapes result_unif -face 122 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/XK2 b/tests/offset/shape_type_i_c/XK2 new file mode 100644 index 0000000000..0ce908d478 --- /dev/null +++ b/tests/offset/shape_type_i_c/XK2 @@ -0,0 +1,25 @@ +restore [locate_data_file bug26917_dom-8092.new_trim6_with_faces.brep] c + +# get the shape +explode c +copy c_1 s + +offsetparameter 1e-7 c i +offsetload s 10 + +foreach f [explode c_2 f] { + offsetonface $f 0 +} + +foreach f [explode c_3 f] { + offsetonface $f 9.961946980917456 +} + +offsetperform result + +checkprops result -v 5.099e+006 -s 360528 + +unifysamedom result_unif result +checknbshapes result_unif -face 46 -shell 1 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/Y1 b/tests/offset/shape_type_i_c/Y1 new file mode 100644 index 0000000000..ef62eac6ac --- /dev/null +++ b/tests/offset/shape_type_i_c/Y1 @@ -0,0 +1,9 @@ +polyline p 0 0 0 10 0 0 10 0 7 6 0 7 6 0 3 5 0 5 0 0 5 0 0 0 +mkplane f p +prism s f 0 10 0 + +OFFSETSHAPE 1 {} $calcul $type + +checkprops result -v 1152 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Y2 b/tests/offset/shape_type_i_c/Y2 new file mode 100644 index 0000000000..adb31672aa --- /dev/null +++ b/tests/offset/shape_type_i_c/Y2 @@ -0,0 +1,9 @@ +polyline p 0 0 0 10 0 0 10 0 7 6 0 7 6 0 3 5 0 5 0 0 5 0 0 0 +mkplane f p +prism s f 0 10 0 + +OFFSETSHAPE 3 {} $calcul $type + +checkprops result -v 3136 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Y3 b/tests/offset/shape_type_i_c/Y3 new file mode 100644 index 0000000000..2029a160be --- /dev/null +++ b/tests/offset/shape_type_i_c/Y3 @@ -0,0 +1,13 @@ +polyline p 0 0 0 4 0 0 4 0 2 2 0 4 0 0 4 0 0 0 +mkplane f p +prism s f 0 5 0 +explode s f +donly s +offsetparameter 1e-7 c i +offsetload s 1 +offsetonface s_3 5 +offsetperform result + +checkprops result -v 252 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Y4 b/tests/offset/shape_type_i_c/Y4 new file mode 100644 index 0000000000..5dbe57afd8 --- /dev/null +++ b/tests/offset/shape_type_i_c/Y4 @@ -0,0 +1,13 @@ +polyline p 0 0 0 4 0 0 4 0 2 2 0 4 0 0 4 0 0 0 +mkplane f p +prism s f 0 5 0 +explode s f +donly s +offsetparameter 1e-7 c i +offsetload s 1 +offsetonface s_2 5 +offsetperform result + +checkprops result -v 269.397 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Y5 b/tests/offset/shape_type_i_c/Y5 new file mode 100644 index 0000000000..45230ebc50 --- /dev/null +++ b/tests/offset/shape_type_i_c/Y5 @@ -0,0 +1,13 @@ +polyline p 0 0 0 4 0 0 4 0 1 2 0 1 1 0 3 1 0 4 0 0 4 0 0 0 +mkplane f p +prism s f 0 5 0 +explode s f +donly s +offsetparameter 1e-7 c i +offsetload s 1 +offsetonface s_4 3 +offsetperform result + +checkprops result -v 233.186 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Y6 b/tests/offset/shape_type_i_c/Y6 new file mode 100644 index 0000000000..52ea28afad --- /dev/null +++ b/tests/offset/shape_type_i_c/Y6 @@ -0,0 +1,12 @@ +polyline p 0 0 0 4 0 0 4 0 1 2 0 1 1 0 3 1 0 4 0 0 4 0 0 0 +mkplane f p +prism s f 0 5 0 +explode s f +offsetparameter 1e-7 c i +offsetload s 1 +offsetonface s_4 3.5 +offsetperform result + +checkprops result -v 243.731 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Y7 b/tests/offset/shape_type_i_c/Y7 new file mode 100644 index 0000000000..c4bc07172d --- /dev/null +++ b/tests/offset/shape_type_i_c/Y7 @@ -0,0 +1,13 @@ +polyline p 0 0 0 5 0 0 5 0 1 1 0 1 5 0 5 0 0 5 0 0 0 +mkplane f p +prism s f 0 5 0 +explode s f +donly s +offsetparameter 1e-7 c i +offsetload s 1 +offsetonface s_4 4 +offsetperform result + +checkprops result -v 455 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Y8 b/tests/offset/shape_type_i_c/Y8 new file mode 100644 index 0000000000..292ef8c7ae --- /dev/null +++ b/tests/offset/shape_type_i_c/Y8 @@ -0,0 +1,13 @@ +polyline p 0 0 0 5 0 0 5 0 1 1 0 1 5 0 5 0 0 5 0 0 0 +mkplane f p +prism s f 0 5 0 +explode s f +donly s +offsetparameter 1e-7 c i +offsetload s 1 +offsetonface s_4 6 +offsetperform result + +checkprops result -v 587.279 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Y9 b/tests/offset/shape_type_i_c/Y9 new file mode 100644 index 0000000000..f2f425a6e0 --- /dev/null +++ b/tests/offset/shape_type_i_c/Y9 @@ -0,0 +1,13 @@ +restore [locate_data_file bug26917_double_cave_2.brep] s + +offsetparameter 1e-7 c i +offsetload s 1 +explode s f +offsetonface s_6 6 +offsetonface s_12 6 +offsetperform result + +checkprops result -v 2376 +checkprops result -s 1140 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Z1 b/tests/offset/shape_type_i_c/Z1 new file mode 100644 index 0000000000..c95210c5d8 --- /dev/null +++ b/tests/offset/shape_type_i_c/Z1 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim1.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 1.4954e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Z2 b/tests/offset/shape_type_i_c/Z2 new file mode 100644 index 0000000000..1c5c2b21e2 --- /dev/null +++ b/tests/offset/shape_type_i_c/Z2 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim2.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 1.05462e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Z3 b/tests/offset/shape_type_i_c/Z3 new file mode 100644 index 0000000000..e2c94fc88b --- /dev/null +++ b/tests/offset/shape_type_i_c/Z3 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim3.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 1.04443e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Z4 b/tests/offset/shape_type_i_c/Z4 new file mode 100644 index 0000000000..708afe4351 --- /dev/null +++ b/tests/offset/shape_type_i_c/Z4 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim4.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 4.65244e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Z5 b/tests/offset/shape_type_i_c/Z5 new file mode 100644 index 0000000000..cfced92bcb --- /dev/null +++ b/tests/offset/shape_type_i_c/Z5 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim5.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 3.79891e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Z6 b/tests/offset/shape_type_i_c/Z6 new file mode 100644 index 0000000000..778e708d57 --- /dev/null +++ b/tests/offset/shape_type_i_c/Z6 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim6.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 3.17639e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Z7 b/tests/offset/shape_type_i_c/Z7 new file mode 100644 index 0000000000..b759eb9547 --- /dev/null +++ b/tests/offset/shape_type_i_c/Z7 @@ -0,0 +1,12 @@ +puts "TODO CR27414 ALL: Error : is WRONG because number of FACE entities in shape" + +restore [locate_data_file bug26917_M2_trim7.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 2.08264e+006 -s 129633 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 30 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/Z8 b/tests/offset/shape_type_i_c/Z8 new file mode 100644 index 0000000000..f0c1acfc20 --- /dev/null +++ b/tests/offset/shape_type_i_c/Z8 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim8.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 2.05947e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/Z9 b/tests/offset/shape_type_i_c/Z9 new file mode 100644 index 0000000000..ce1006c303 --- /dev/null +++ b/tests/offset/shape_type_i_c/Z9 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim9.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 1.69324e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZA1 b/tests/offset/shape_type_i_c/ZA1 new file mode 100644 index 0000000000..5e725a9aa8 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZA1 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim10.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 2.00962e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZA2 b/tests/offset/shape_type_i_c/ZA2 new file mode 100644 index 0000000000..1b62e3966d --- /dev/null +++ b/tests/offset/shape_type_i_c/ZA2 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim11.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 1.62816e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZA3 b/tests/offset/shape_type_i_c/ZA3 new file mode 100644 index 0000000000..741d9838e9 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZA3 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim12.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 1.38812e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZA4 b/tests/offset/shape_type_i_c/ZA4 new file mode 100644 index 0000000000..3dfa759068 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZA4 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim13.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 1.25727e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZA5 b/tests/offset/shape_type_i_c/ZA5 new file mode 100644 index 0000000000..d34dd202ff --- /dev/null +++ b/tests/offset/shape_type_i_c/ZA5 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim14.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 974376 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZA6 b/tests/offset/shape_type_i_c/ZA6 new file mode 100644 index 0000000000..89f68d5c93 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZA6 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim15.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 828156 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZA7 b/tests/offset/shape_type_i_c/ZA7 new file mode 100644 index 0000000000..19a7ea92cc --- /dev/null +++ b/tests/offset/shape_type_i_c/ZA7 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim16.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 690977 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZA8 b/tests/offset/shape_type_i_c/ZA8 new file mode 100644 index 0000000000..2cc4ed4789 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZA8 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim17.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 556376 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZA9 b/tests/offset/shape_type_i_c/ZA9 new file mode 100644 index 0000000000..cec4863aab --- /dev/null +++ b/tests/offset/shape_type_i_c/ZA9 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim18.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 401748 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZB1 b/tests/offset/shape_type_i_c/ZB1 new file mode 100644 index 0000000000..84efad0136 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZB1 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_M2_trim19.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 1.50286e+006 -s 91555.8 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 25 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZB2 b/tests/offset/shape_type_i_c/ZB2 new file mode 100644 index 0000000000..2ba9540687 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZB2 @@ -0,0 +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_M2_trim20.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 1.5516e+006 -s 88978 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZB3 b/tests/offset/shape_type_i_c/ZB3 new file mode 100644 index 0000000000..7da95b1702 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZB3 @@ -0,0 +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_M2_trim21.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 1.28505e+006 -s 75557.2 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZB4 b/tests/offset/shape_type_i_c/ZB4 new file mode 100644 index 0000000000..63cfa23845 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZB4 @@ -0,0 +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_M2_trim22.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 1.1318e+006 -s 69137.2 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZB5 b/tests/offset/shape_type_i_c/ZB5 new file mode 100644 index 0000000000..469edbb400 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZB5 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim23.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 156212 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZB6 b/tests/offset/shape_type_i_c/ZB6 new file mode 100644 index 0000000000..bec62e371f --- /dev/null +++ b/tests/offset/shape_type_i_c/ZB6 @@ -0,0 +1,9 @@ +puts "TODO CR27414 ALL: Error : The volume of result shape is" + +restore [locate_data_file bug26917_M2_trim24.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZB7 b/tests/offset/shape_type_i_c/ZB7 new file mode 100644 index 0000000000..faf85dd6cc --- /dev/null +++ b/tests/offset/shape_type_i_c/ZB7 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim25.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 974376 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZB8 b/tests/offset/shape_type_i_c/ZB8 new file mode 100644 index 0000000000..7c50e803cb --- /dev/null +++ b/tests/offset/shape_type_i_c/ZB8 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim26.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 828156 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZB9 b/tests/offset/shape_type_i_c/ZB9 new file mode 100644 index 0000000000..6e5d896171 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZB9 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim27.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 556376 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZC1 b/tests/offset/shape_type_i_c/ZC1 new file mode 100644 index 0000000000..336ea34453 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZC1 @@ -0,0 +1,12 @@ +puts "TODO CR27414 ALL: Error : is WRONG because number of FACE entities in shape" + +restore [locate_data_file bug26917_M2_trim28.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 301147 -s 37303.1 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 12 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZC2 b/tests/offset/shape_type_i_c/ZC2 new file mode 100644 index 0000000000..cb4e042900 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZC2 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim29.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 193026 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZC3 b/tests/offset/shape_type_i_c/ZC3 new file mode 100644 index 0000000000..fd42e9d1c0 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZC3 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim30.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 161664 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZC4 b/tests/offset/shape_type_i_c/ZC4 new file mode 100644 index 0000000000..e9a1f535a3 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZC4 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim31.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 435343 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZC5 b/tests/offset/shape_type_i_c/ZC5 new file mode 100644 index 0000000000..5d12f647c8 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZC5 @@ -0,0 +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_M2_trim32.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 1.27733e+006 +checkprops result -s 79757.5 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZC6 b/tests/offset/shape_type_i_c/ZC6 new file mode 100644 index 0000000000..7ac9472b19 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZC6 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim33.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 434203 -s 43436.6 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZC7 b/tests/offset/shape_type_i_c/ZC7 new file mode 100644 index 0000000000..eb86413722 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZC7 @@ -0,0 +1,11 @@ +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_M2_trim34.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZC8 b/tests/offset/shape_type_i_c/ZC8 new file mode 100644 index 0000000000..ad84f9346c --- /dev/null +++ b/tests/offset/shape_type_i_c/ZC8 @@ -0,0 +1,11 @@ +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_M2_trim35.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZC9 b/tests/offset/shape_type_i_c/ZC9 new file mode 100644 index 0000000000..d6d717702c --- /dev/null +++ b/tests/offset/shape_type_i_c/ZC9 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim36.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 117176 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZD1 b/tests/offset/shape_type_i_c/ZD1 new file mode 100644 index 0000000000..a448d8e9a9 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZD1 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_M2_trim1.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 2.1938e+006 -s 108076 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 16 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZD2 b/tests/offset/shape_type_i_c/ZD2 new file mode 100644 index 0000000000..87fa201da9 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZD2 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_M2_trim2.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 1.60096e+006 -s 85212.6 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 12 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZD3 b/tests/offset/shape_type_i_c/ZD3 new file mode 100644 index 0000000000..678edac071 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZD3 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_M2_trim3.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 1.58761e+006 -s 84716.7 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 12 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZD4 b/tests/offset/shape_type_i_c/ZD4 new file mode 100644 index 0000000000..461edc4483 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZD4 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_M2_trim4.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 6.49981e+006 +checkprops result -s 266495 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZD5 b/tests/offset/shape_type_i_c/ZD5 new file mode 100644 index 0000000000..21db96f9b8 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZD5 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim5.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 5.34468e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZD6 b/tests/offset/shape_type_i_c/ZD6 new file mode 100644 index 0000000000..cc04db8c80 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZD6 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim6.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 4.84412e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZD7 b/tests/offset/shape_type_i_c/ZD7 new file mode 100644 index 0000000000..35dd17ea94 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZD7 @@ -0,0 +1,12 @@ +puts "TODO CR27414 ALL: Error : is WRONG because number of FACE entities in shape" + +restore [locate_data_file bug26917_M2_trim7.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 2.9919e+006 -s 138455 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 16 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZD8 b/tests/offset/shape_type_i_c/ZD8 new file mode 100644 index 0000000000..ace7747915 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZD8 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_M2_trim8.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 3.27183e+006 -s 214411 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 17 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZD9 b/tests/offset/shape_type_i_c/ZD9 new file mode 100755 index 0000000000..7a00c42db1 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZD9 @@ -0,0 +1,9 @@ +puts "TODO CR27414 ALL: Error : The command is not valid. The volume is 0." + +restore [locate_data_file bug26917_M2_trim9.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZE1 b/tests/offset/shape_type_i_c/ZE1 new file mode 100644 index 0000000000..52ea82743e --- /dev/null +++ b/tests/offset/shape_type_i_c/ZE1 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_M2_trim10.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 2.86758e+006 -s 132343 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 16 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZE2 b/tests/offset/shape_type_i_c/ZE2 new file mode 100644 index 0000000000..44067ad560 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZE2 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_M2_trim11.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 2.35558e+006 +checkprops result -s 113213 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZE3 b/tests/offset/shape_type_i_c/ZE3 new file mode 100644 index 0000000000..f8d1d8abc1 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZE3 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim12.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 2.039e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZE4 b/tests/offset/shape_type_i_c/ZE4 new file mode 100644 index 0000000000..a64005c4eb --- /dev/null +++ b/tests/offset/shape_type_i_c/ZE4 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim13.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 1.87334e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZE5 b/tests/offset/shape_type_i_c/ZE5 new file mode 100644 index 0000000000..5f6b13fec2 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZE5 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim14.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 1.53693e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZE6 b/tests/offset/shape_type_i_c/ZE6 new file mode 100644 index 0000000000..74252a67d2 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZE6 @@ -0,0 +1,9 @@ +puts "TODO CR27414 ALL: Error : The volume of result shape is" + +restore [locate_data_file bug26917_M2_trim15.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZE7 b/tests/offset/shape_type_i_c/ZE7 new file mode 100644 index 0000000000..992768cfd6 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZE7 @@ -0,0 +1,9 @@ +puts "TODO CR27414 ALL: Error : The volume of result shape is" + +restore [locate_data_file bug26917_M2_trim16.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZE8 b/tests/offset/shape_type_i_c/ZE8 new file mode 100644 index 0000000000..0b1cc7551f --- /dev/null +++ b/tests/offset/shape_type_i_c/ZE8 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim17.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 977601 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZE9 b/tests/offset/shape_type_i_c/ZE9 new file mode 100644 index 0000000000..ef89c4b52f --- /dev/null +++ b/tests/offset/shape_type_i_c/ZE9 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim18.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 748491 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZF1 b/tests/offset/shape_type_i_c/ZF1 new file mode 100644 index 0000000000..059dbee618 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZF1 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_M2_trim19.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 2.18735e+006 -s 106891 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 14 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZF2 b/tests/offset/shape_type_i_c/ZF2 new file mode 100644 index 0000000000..9a3643980c --- /dev/null +++ b/tests/offset/shape_type_i_c/ZF2 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim20.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 2.15206e+006 -s 104716 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZF3 b/tests/offset/shape_type_i_c/ZF3 new file mode 100644 index 0000000000..dd9bfd9783 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZF3 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim21.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 1.80154e+006 -s 92297.3 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZF4 b/tests/offset/shape_type_i_c/ZF4 new file mode 100644 index 0000000000..e4eab7f818 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZF4 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim22.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 1.61981e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZF5 b/tests/offset/shape_type_i_c/ZF5 new file mode 100644 index 0000000000..0177393264 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZF5 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_M2_trim23.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 357987 +checkprops result -s 35362.4 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZF6 b/tests/offset/shape_type_i_c/ZF6 new file mode 100644 index 0000000000..709abd82b2 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZF6 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_M2_trim24.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 2.86758e+006 -s 132343 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 16 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZF7 b/tests/offset/shape_type_i_c/ZF7 new file mode 100644 index 0000000000..88ef759743 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZF7 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim25.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 1.53693e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZF8 b/tests/offset/shape_type_i_c/ZF8 new file mode 100644 index 0000000000..62c8c19314 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZF8 @@ -0,0 +1,9 @@ +puts "TODO CR27414 ALL: Error : The volume of result shape is" + +restore [locate_data_file bug26917_M2_trim26.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZF9 b/tests/offset/shape_type_i_c/ZF9 new file mode 100644 index 0000000000..3e31d67363 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZF9 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim27.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 977601 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZG1 b/tests/offset/shape_type_i_c/ZG1 new file mode 100644 index 0000000000..e5be42da7f --- /dev/null +++ b/tests/offset/shape_type_i_c/ZG1 @@ -0,0 +1,13 @@ +puts "TODO CR27414 ALL: Error : The area of result shape is" +puts "TODO CR27414 ALL: Error : is WRONG because number of FACE entities in shape" + +restore [locate_data_file bug26917_M2_trim28.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 599808 -s 50247.4 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 9 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZG2 b/tests/offset/shape_type_i_c/ZG2 new file mode 100644 index 0000000000..4a7a957584 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZG2 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim29.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 432971 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZG3 b/tests/offset/shape_type_i_c/ZG3 new file mode 100644 index 0000000000..414babc5aa --- /dev/null +++ b/tests/offset/shape_type_i_c/ZG3 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim30.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 360182 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZG4 b/tests/offset/shape_type_i_c/ZG4 new file mode 100644 index 0000000000..3aac097914 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZG4 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_M2_trim31.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 815560 -s 64052.4 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 7 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZG5 b/tests/offset/shape_type_i_c/ZG5 new file mode 100644 index 0000000000..beb2671fe8 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZG5 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_M2_trim32.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 1.87061e+006 +checkprops result -s 95780.7 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZG6 b/tests/offset/shape_type_i_c/ZG6 new file mode 100644 index 0000000000..e06176c8b5 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZG6 @@ -0,0 +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_M2_trim33.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 779008 -s 57287.4 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZG7 b/tests/offset/shape_type_i_c/ZG7 new file mode 100644 index 0000000000..48873c4443 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZG7 @@ -0,0 +1,9 @@ +puts "TODO CR27414 ALL: Error : The volume of result shape is" + +restore [locate_data_file bug26917_M2_trim34.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZG8 b/tests/offset/shape_type_i_c/ZG8 new file mode 100644 index 0000000000..d89964590b --- /dev/null +++ b/tests/offset/shape_type_i_c/ZG8 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim35.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 518244 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZG9 b/tests/offset/shape_type_i_c/ZG9 new file mode 100644 index 0000000000..899834c5b6 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZG9 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_M2_trim36.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 300148 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZH1 b/tests/offset/shape_type_i_c/ZH1 new file mode 100644 index 0000000000..b06282c7fc --- /dev/null +++ b/tests/offset/shape_type_i_c/ZH1 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_rm37_input_3.brep] s + +OFFSETSHAPE 20 {} $calcul $type + +checkprops result -v 2.46955e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZH2 b/tests/offset/shape_type_i_c/ZH2 new file mode 100644 index 0000000000..8f0c903e2c --- /dev/null +++ b/tests/offset/shape_type_i_c/ZH2 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_rm37_input.brep] s + +OFFSETSHAPE 20 {} $calcul $type + +checkprops result -v 4.41962e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZH3 b/tests/offset/shape_type_i_c/ZH3 new file mode 100644 index 0000000000..6dcef1bab6 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZH3 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_rm37_input_5.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 3.5068e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZH4 b/tests/offset/shape_type_i_c/ZH4 new file mode 100644 index 0000000000..ec68367fde --- /dev/null +++ b/tests/offset/shape_type_i_c/ZH4 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_center.input.brep] s + +OFFSETSHAPE 1 {} $calcul $type + +checkprops result -v 3.00178e+007 +checkprops result -s 1.65736e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZH5 b/tests/offset/shape_type_i_c/ZH5 new file mode 100644 index 0000000000..d494a5a830 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZH5 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_center.input.brep] s + +OFFSETSHAPE 4 {} $calcul $type + +checkprops result -v 3.50011e+007 +checkprops result -s 1.66483e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZH6 b/tests/offset/shape_type_i_c/ZH6 new file mode 100644 index 0000000000..aaa2b62498 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZH6 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_center.input.brep] s + +OFFSETSHAPE 6 {} $calcul $type + +checkprops result -v 3.83362e+007 +checkprops result -s 1.67082e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZH7 b/tests/offset/shape_type_i_c/ZH7 new file mode 100644 index 0000000000..8b66066ced --- /dev/null +++ b/tests/offset/shape_type_i_c/ZH7 @@ -0,0 +1,11 @@ +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_fills_center.input.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 0 +checkprops result -s 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZH8 b/tests/offset/shape_type_i_c/ZH8 new file mode 100644 index 0000000000..3fb0c8b6d4 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZH8 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_center.input_trim1.brep] s + +OFFSETSHAPE 1 {} $calcul $type + +checkprops result -v 1.57879e+007 +checkprops result -s 913277 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZH9 b/tests/offset/shape_type_i_c/ZH9 new file mode 100644 index 0000000000..f21fd2ed5c --- /dev/null +++ b/tests/offset/shape_type_i_c/ZH9 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_center.input_trim1.brep] s + +OFFSETSHAPE 4 {} $calcul $type + +checkprops result -v 1.85458e+007 +checkprops result -s 925480 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZI1 b/tests/offset/shape_type_i_c/ZI1 new file mode 100644 index 0000000000..b8a6a97b6d --- /dev/null +++ b/tests/offset/shape_type_i_c/ZI1 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_center.input_trim1.brep] s + +OFFSETSHAPE 6 {} $calcul $type + +checkprops result -v 2.0404e+007 +checkprops result -s 933824 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZI2 b/tests/offset/shape_type_i_c/ZI2 new file mode 100644 index 0000000000..2ea95d18dd --- /dev/null +++ b/tests/offset/shape_type_i_c/ZI2 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_center.input_trim2.brep] s + +OFFSETSHAPE 1 {} $calcul $type + +checkprops result -v 2.47496e+006 +checkprops result -s 210148 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZI3 b/tests/offset/shape_type_i_c/ZI3 new file mode 100644 index 0000000000..a402b8ab70 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZI3 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_center.input_trim2.brep] s + +OFFSETSHAPE 4 {} $calcul $type + +checkprops result -v 3.1206e+006 +checkprops result -s 220438 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZI4 b/tests/offset/shape_type_i_c/ZI4 new file mode 100644 index 0000000000..aa2c97409d --- /dev/null +++ b/tests/offset/shape_type_i_c/ZI4 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_center.input_trim2.brep] s + +OFFSETSHAPE 6 {} $calcul $type + +checkprops result -v 3.56869e+006 +checkprops result -s 227700 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZI5 b/tests/offset/shape_type_i_c/ZI5 new file mode 100644 index 0000000000..acbf955f1b --- /dev/null +++ b/tests/offset/shape_type_i_c/ZI5 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_center.input_trim3.brep] s + +OFFSETSHAPE 1 {} $calcul $type + +checkprops result -v 1.17846e+007 +checkprops result -s 568858 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZI6 b/tests/offset/shape_type_i_c/ZI6 new file mode 100644 index 0000000000..29fb3ad07f --- /dev/null +++ b/tests/offset/shape_type_i_c/ZI6 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_center.input_trim3.brep] s + +OFFSETSHAPE 4 {} $calcul $type + +checkprops result -v 1.35173e+007 +checkprops result -s 586135 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZI7 b/tests/offset/shape_type_i_c/ZI7 new file mode 100644 index 0000000000..6ecf51effb --- /dev/null +++ b/tests/offset/shape_type_i_c/ZI7 @@ -0,0 +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_fills_center.input_trim3.brep] s + +OFFSETSHAPE 6 {} $calcul $type + +checkprops result -v 0 +checkprops result -s 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZI8 b/tests/offset/shape_type_i_c/ZI8 new file mode 100644 index 0000000000..08e996517c --- /dev/null +++ b/tests/offset/shape_type_i_c/ZI8 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_center.input_trim4.brep] s + +OFFSETSHAPE 1 {} $calcul $type + +checkprops result -v 3.80942e+006 +checkprops result -s 324961 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZI9 b/tests/offset/shape_type_i_c/ZI9 new file mode 100644 index 0000000000..5e23701332 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZI9 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_center.input_trim4.brep] s + +OFFSETSHAPE 4 {} $calcul $type + +checkprops result -v 4.79692e+006 +checkprops result -s 333591 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZJ1 b/tests/offset/shape_type_i_c/ZJ1 new file mode 100644 index 0000000000..b79c8a51dc --- /dev/null +++ b/tests/offset/shape_type_i_c/ZJ1 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_center.input_trim4.brep] s + +OFFSETSHAPE 6 {} $calcul $type + +checkprops result -v 5.47027e+006 +checkprops result -s 339810 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZJ2 b/tests/offset/shape_type_i_c/ZJ2 new file mode 100644 index 0000000000..8ad55faa5b --- /dev/null +++ b/tests/offset/shape_type_i_c/ZJ2 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_M4_trim2.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 5.16422e+006 +checkprops result -s 353116 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZJ3 b/tests/offset/shape_type_i_c/ZJ3 new file mode 100644 index 0000000000..c3fc5ed073 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZJ3 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_M4_trim2.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 6.2463e+006 +checkprops result -s 367400 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZJ4 b/tests/offset/shape_type_i_c/ZJ4 new file mode 100644 index 0000000000..270562e6e7 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZJ4 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_M4_trim2.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 8.66985e+006 -s 347407 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 25 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZJ5 b/tests/offset/shape_type_i_c/ZJ5 new file mode 100644 index 0000000000..fa2988cf46 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZJ5 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_M4_trim1.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 2.26758e+007 +checkprops result -s 1.48174e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZJ6 b/tests/offset/shape_type_i_c/ZJ6 new file mode 100644 index 0000000000..3fe54cfcdc --- /dev/null +++ b/tests/offset/shape_type_i_c/ZJ6 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_M4_trim1.brep] s + +OFFSETSHAPE 8 {} $calcul $type + +checkprops result -v 2.71827e+007 +checkprops result -s 1.51518e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZJ7 b/tests/offset/shape_type_i_c/ZJ7 new file mode 100644 index 0000000000..f55d9d990d --- /dev/null +++ b/tests/offset/shape_type_i_c/ZJ7 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_M4_trim1.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 3.6481e+007 +checkprops result -s 1.23723e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZJ8 b/tests/offset/shape_type_i_c/ZJ8 new file mode 100644 index 0000000000..d07b73b328 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZJ8 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input_dom7761_1.brep] s + +OFFSETSHAPE 25 {} $calcul $type + +checkprops result -v 2.34736e+007 +checkprops result -s 562100 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZJ9 b/tests/offset/shape_type_i_c/ZJ9 new file mode 100644 index 0000000000..f43c6cc294 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZJ9 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input_dom7761_1.brep] s + +OFFSETSHAPE 30 {} $calcul $type + +checkprops result -v 2.6346e+007 +checkprops result -s 568100 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZK1 b/tests/offset/shape_type_i_c/ZK1 new file mode 100644 index 0000000000..7609bad877 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZK1 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input_dom7761_1.brep] s + +OFFSETSHAPE 45 {} $calcul $type + +checkprops result -v 3.5754e+007 +checkprops result -s 688100 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZK2 b/tests/offset/shape_type_i_c/ZK2 new file mode 100644 index 0000000000..1b0adfd7ae --- /dev/null +++ b/tests/offset/shape_type_i_c/ZK2 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_outside.bad.brep] s + +OFFSETSHAPE 2 {} $calcul $type + +checkprops result -v 5.18828e+007 +checkprops result -s 1.79884e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZK3 b/tests/offset/shape_type_i_c/ZK3 new file mode 100644 index 0000000000..495ceeed50 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZK3 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_outside.bad.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 5.7394e+007 +checkprops result -s 1.8753e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZK4 b/tests/offset/shape_type_i_c/ZK4 new file mode 100644 index 0000000000..f5c852d1a1 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZK4 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_outside.bad.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 6.45048e+007 +checkprops result -s 1.4087e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZK5 b/tests/offset/shape_type_i_c/ZK5 new file mode 100644 index 0000000000..d0005937a5 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZK5 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_outside.bad_trim1.brep] s + +OFFSETSHAPE 2 {} $calcul $type + +checkprops result -v 1.92643e+007 +checkprops result -s 625460 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZK6 b/tests/offset/shape_type_i_c/ZK6 new file mode 100644 index 0000000000..4d4c37bfaa --- /dev/null +++ b/tests/offset/shape_type_i_c/ZK6 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_outside.bad_trim1.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 2.1184e+007 +checkprops result -s 654445 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZK7 b/tests/offset/shape_type_i_c/ZK7 new file mode 100644 index 0000000000..bd37821a24 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZK7 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_outside.bad_trim1.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 2.40907e+007 +checkprops result -s 592868 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZK8 b/tests/offset/shape_type_i_c/ZK8 new file mode 100644 index 0000000000..142feab46e --- /dev/null +++ b/tests/offset/shape_type_i_c/ZK8 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_outside.bad_trim2.brep] s + +OFFSETSHAPE 2 {} $calcul $type + +checkprops result -v 3.26867e+007 +checkprops result -s 1.21039e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZK9 b/tests/offset/shape_type_i_c/ZK9 new file mode 100644 index 0000000000..1b6010f755 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZK9 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_outside.bad_trim2.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.64028e+007 +checkprops result -s 1.26707e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZL1 b/tests/offset/shape_type_i_c/ZL1 new file mode 100644 index 0000000000..b6a7d19464 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZL1 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_outside.bad_trim2.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 4.11508e+007 +checkprops result -s 941694 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZL2 b/tests/offset/shape_type_i_c/ZL2 new file mode 100644 index 0000000000..0c4e0e6147 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZL2 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_outside.good.brep] s + +OFFSETSHAPE 2 {} $calcul $type + +checkprops result -v 5.18828e+007 +checkprops result -s 1.79884e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZL3 b/tests/offset/shape_type_i_c/ZL3 new file mode 100644 index 0000000000..2011f05fb0 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZL3 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_outside.good.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 5.7394e+007 +checkprops result -s 1.8753e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZL4 b/tests/offset/shape_type_i_c/ZL4 new file mode 100644 index 0000000000..7ab6d75bea --- /dev/null +++ b/tests/offset/shape_type_i_c/ZL4 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_fills_outside.good.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 6.45048e+007 +checkprops result -s 1.4087e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZL5 b/tests/offset/shape_type_i_c/ZL5 new file mode 100644 index 0000000000..d4dad6e4cc --- /dev/null +++ b/tests/offset/shape_type_i_c/ZL5 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input_dom6820_2.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.57194e+007 +checkprops result -s 1.93747e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZL6 b/tests/offset/shape_type_i_c/ZL6 new file mode 100644 index 0000000000..6389282084 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZL6 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input_dom6820_2.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 4.41031e+007 +checkprops result -s 1.61801e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZL7 b/tests/offset/shape_type_i_c/ZL7 new file mode 100644 index 0000000000..47f4b577e8 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZL7 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input_dom6820_2.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 5.24959e+007 +checkprops result -s 1.7393e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZL8 b/tests/offset/shape_type_i_c/ZL8 new file mode 100644 index 0000000000..d5fe7b397f --- /dev/null +++ b/tests/offset/shape_type_i_c/ZL8 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input_dom6806_8.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.41034e+007 +checkprops result -s 1.46326e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZL9 b/tests/offset/shape_type_i_c/ZL9 new file mode 100644 index 0000000000..c1f7e82fb1 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZL9 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input_dom6806_8.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 4.14054e+007 +checkprops result -s 1.47744e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZM1 b/tests/offset/shape_type_i_c/ZM1 new file mode 100644 index 0000000000..0ee49737ee --- /dev/null +++ b/tests/offset/shape_type_i_c/ZM1 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input_dom6806_8.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 4.80822e+007 +checkprops result -s 1.30141e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZM2 b/tests/offset/shape_type_i_c/ZM2 new file mode 100644 index 0000000000..a64204c95f --- /dev/null +++ b/tests/offset/shape_type_i_c/ZM2 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input_dom6806_8_trim1.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 2.44799e+007 +checkprops result -s 1.13837e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZM3 b/tests/offset/shape_type_i_c/ZM3 new file mode 100644 index 0000000000..f13e0e7a01 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZM3 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input_dom6806_8_trim1.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 3.0126e+007 +checkprops result -s 1.13863e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZM4 b/tests/offset/shape_type_i_c/ZM4 new file mode 100644 index 0000000000..38c4e9dadc --- /dev/null +++ b/tests/offset/shape_type_i_c/ZM4 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input_dom6806_8_trim1.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 3.51351e+007 +checkprops result -s 963709 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZM5 b/tests/offset/shape_type_i_c/ZM5 new file mode 100644 index 0000000000..afc5dc54c5 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZM5 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input_dom6806_8_trim2.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 1.20376e+006 +checkprops result -s 99243.4 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZM6 b/tests/offset/shape_type_i_c/ZM6 new file mode 100644 index 0000000000..d0d6bf6d0a --- /dev/null +++ b/tests/offset/shape_type_i_c/ZM6 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input_dom6806_8_trim2.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 1.73931e+006 +checkprops result -s 116356 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZM7 b/tests/offset/shape_type_i_c/ZM7 new file mode 100644 index 0000000000..76e7e74ae4 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZM7 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input_dom6806_8_trim2.brep] s + +OFFSETSHAPE 12 {} $calcul $type + +checkprops result -v 1.96981e+006 +checkprops result -s 103555 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZM8 b/tests/offset/shape_type_i_c/ZM8 new file mode 100644 index 0000000000..36d7b96f58 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZM8 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input_dom6806_8_trim2.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 2.29484e+006 +checkprops result -s 113204 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZM9 b/tests/offset/shape_type_i_c/ZM9 new file mode 100644 index 0000000000..560fde1f9e --- /dev/null +++ b/tests/offset/shape_type_i_c/ZM9 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input_dom6806_8_trim2.brep] s + +OFFSETSHAPE 20 {} $calcul $type + +checkprops result -v 2.90296e+006 +checkprops result -s 130246 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZN1 b/tests/offset/shape_type_i_c/ZN1 new file mode 100644 index 0000000000..09bc7c3804 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZN1 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_32.input.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.74428e+007 +checkprops result -s 2.06949e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZN2 b/tests/offset/shape_type_i_c/ZN2 new file mode 100644 index 0000000000..fae86b7938 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZN2 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_32.input.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 4.65202e+007 +checkprops result -s 1.66989e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZN3 b/tests/offset/shape_type_i_c/ZN3 new file mode 100644 index 0000000000..c83eece13c --- /dev/null +++ b/tests/offset/shape_type_i_c/ZN3 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_32.input.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 5.51738e+007 +checkprops result -s 1.79175e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZN4 b/tests/offset/shape_type_i_c/ZN4 new file mode 100644 index 0000000000..a44c77f028 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZN4 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_32.input_trim1.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 2.64721e+007 +checkprops result -s 1.36783e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZN5 b/tests/offset/shape_type_i_c/ZN5 new file mode 100644 index 0000000000..b52fe11179 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZN5 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_32.input_trim1.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 3.26641e+007 +checkprops result -s 1.16916e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZN6 b/tests/offset/shape_type_i_c/ZN6 new file mode 100644 index 0000000000..00ab646de6 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZN6 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_32.input_trim1.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 3.8735e+007 +checkprops result -s 1.25942e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZN7 b/tests/offset/shape_type_i_c/ZN7 new file mode 100644 index 0000000000..2e60a9aeac --- /dev/null +++ b/tests/offset/shape_type_i_c/ZN7 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_32.input_trim2.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 6.17183e+006 +checkprops result -s 345990 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZN8 b/tests/offset/shape_type_i_c/ZN8 new file mode 100644 index 0000000000..748aa0045f --- /dev/null +++ b/tests/offset/shape_type_i_c/ZN8 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_32.input_trim2.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 7.8039e+006 +checkprops result -s 321244 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZN9 b/tests/offset/shape_type_i_c/ZN9 new file mode 100644 index 0000000000..1d795defaa --- /dev/null +++ b/tests/offset/shape_type_i_c/ZN9 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_32.input_trim2.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 9.49715e+006 +checkprops result -s 356830 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZO1 b/tests/offset/shape_type_i_c/ZO1 new file mode 100644 index 0000000000..27c6b4c872 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZO1 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_32.input_trim3.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 5.02138e+006 +checkprops result -s 418816 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZO2 b/tests/offset/shape_type_i_c/ZO2 new file mode 100644 index 0000000000..ff6efd8143 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZO2 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_32.input_trim3.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 6.76301e+006 +checkprops result -s 296335 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZO3 b/tests/offset/shape_type_i_c/ZO3 new file mode 100644 index 0000000000..accd9a30c5 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZO3 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_32.input_trim3.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 8.32594e+006 +checkprops result -s 329078 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZO4 b/tests/offset/shape_type_i_c/ZO4 new file mode 100644 index 0000000000..286c084ffd --- /dev/null +++ b/tests/offset/shape_type_i_c/ZO4 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_32.input_trim4.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 5.62025e+006 +checkprops result -s 304647 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZO5 b/tests/offset/shape_type_i_c/ZO5 new file mode 100644 index 0000000000..a8d8de293e --- /dev/null +++ b/tests/offset/shape_type_i_c/ZO5 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_32.input_trim4.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 7.09931e+006 +checkprops result -s 299449 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZO6 b/tests/offset/shape_type_i_c/ZO6 new file mode 100644 index 0000000000..5dc85ca079 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZO6 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_32.input_trim4.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 8.68147e+006 +checkprops result -s 333739 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZO7 b/tests/offset/shape_type_i_c/ZO7 new file mode 100644 index 0000000000..6041542b1c --- /dev/null +++ b/tests/offset/shape_type_i_c/ZO7 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_32.input_trim5.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 4.5933e+006 +checkprops result -s 238531 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZO8 b/tests/offset/shape_type_i_c/ZO8 new file mode 100644 index 0000000000..3a02142377 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZO8 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_32.input_trim5.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 5.81035e+006 +checkprops result -s 249031 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZO9 b/tests/offset/shape_type_i_c/ZO9 new file mode 100644 index 0000000000..752df25cfe --- /dev/null +++ b/tests/offset/shape_type_i_c/ZO9 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_32.input_trim5.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 7.12993e+006 +checkprops result -s 279084 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZP1 b/tests/offset/shape_type_i_c/ZP1 new file mode 100644 index 0000000000..7feeae753e --- /dev/null +++ b/tests/offset/shape_type_i_c/ZP1 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_input_dom6820_1.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.59138e+007 -s 1.93504e+006 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 256 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZP2 b/tests/offset/shape_type_i_c/ZP2 new file mode 100644 index 0000000000..7186c6f5e7 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZP2 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_input_dom6820_1.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 4.43005e+007 -s 1.61972e+006 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 42 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZP3 b/tests/offset/shape_type_i_c/ZP3 new file mode 100644 index 0000000000..296d33decc --- /dev/null +++ b/tests/offset/shape_type_i_c/ZP3 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_input_dom6820_1.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 5.27018e+007 -s 1.74101e+006 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 42 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZP4 b/tests/offset/shape_type_i_c/ZP4 new file mode 100644 index 0000000000..81e1f992b7 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZP4 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_input_dom6820_1_trim1.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 2.21604e+007 -s 1.17663e+006 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 172 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZP5 b/tests/offset/shape_type_i_c/ZP5 new file mode 100644 index 0000000000..d59253cae9 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZP5 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_input_dom6820_1_trim1.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 2.73476e+007 -s 1.00976e+006 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 29 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZP6 b/tests/offset/shape_type_i_c/ZP6 new file mode 100644 index 0000000000..7cf3792454 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZP6 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_input_dom6820_1_trim1.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 3.25964e+007 -s 1.08996e+006 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 29 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZP7 b/tests/offset/shape_type_i_c/ZP7 new file mode 100644 index 0000000000..0d279c2ee3 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZP7 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_input_dom6820_1_trim2.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 9.04792e+006 -s 440273 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 59 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZP8 b/tests/offset/shape_type_i_c/ZP8 new file mode 100644 index 0000000000..7dcddeaf97 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZP8 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_input_dom6820_1_trim2.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 1.11857e+007 -s 437085 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 18 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZP9 b/tests/offset/shape_type_i_c/ZP9 new file mode 100644 index 0000000000..187d4be803 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZP9 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_input_dom6820_1_trim2.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 1.34793e+007 -s 480796 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 18 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZQ1 b/tests/offset/shape_type_i_c/ZQ1 new file mode 100644 index 0000000000..aeb163456d --- /dev/null +++ b/tests/offset/shape_type_i_c/ZQ1 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_dom-6820_0.recipe.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.72476e+007 -s 2.002e+006 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 280 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZQ2 b/tests/offset/shape_type_i_c/ZQ2 new file mode 100644 index 0000000000..dcf1f91871 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZQ2 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_0.recipe.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.82329e+007 +checkprops result -s 2.15719e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZQ3 b/tests/offset/shape_type_i_c/ZQ3 new file mode 100644 index 0000000000..99ba56ab19 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZQ3 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_1.recipe.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.88724e+007 +checkprops result -s 2.14567e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZQ4 b/tests/offset/shape_type_i_c/ZQ4 new file mode 100644 index 0000000000..5ce3aaa7e6 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZQ4 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_12.recipe.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.67018e+007 +checkprops result -s 2.08278e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZQ5 b/tests/offset/shape_type_i_c/ZQ5 new file mode 100644 index 0000000000..0644c20877 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZQ5 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_14.recipe.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.93383e+007 +checkprops result -s 2.14966e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZQ6 b/tests/offset/shape_type_i_c/ZQ6 new file mode 100644 index 0000000000..9335dea466 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZQ6 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_16.recipe.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.88724e+007 +checkprops result -s 2.14567e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZQ7 b/tests/offset/shape_type_i_c/ZQ7 new file mode 100644 index 0000000000..77888dc9d8 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZQ7 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_18.recipe.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.76832e+007 +checkprops result -s 2.16631e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZQ8 b/tests/offset/shape_type_i_c/ZQ8 new file mode 100644 index 0000000000..9c95d483e0 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZQ8 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_19.recipe.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.82314e+007 +checkprops result -s 2.07479e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZQ9 b/tests/offset/shape_type_i_c/ZQ9 new file mode 100644 index 0000000000..15202473c8 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZQ9 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_27.recipe.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.71562e+007 +checkprops result -s 2.08037e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZR1 b/tests/offset/shape_type_i_c/ZR1 new file mode 100644 index 0000000000..047b1362b1 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZR1 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_28.recipe.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.70779e+007 +checkprops result -s 2.07431e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZR2 b/tests/offset/shape_type_i_c/ZR2 new file mode 100644 index 0000000000..5ebdcea34d --- /dev/null +++ b/tests/offset/shape_type_i_c/ZR2 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_29.recipe.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.82329e+007 +checkprops result -s 2.15719e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZR3 b/tests/offset/shape_type_i_c/ZR3 new file mode 100644 index 0000000000..d159334881 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZR3 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-7491.brep] s + +OFFSETSHAPE 1 {} $calcul $type + +checkprops result -v 2.37178e+007 +checkprops result -s 1.26461e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZR4 b/tests/offset/shape_type_i_c/ZR4 new file mode 100644 index 0000000000..4d5baff828 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZR4 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6820_1.recipe.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.70437e+007 +checkprops result -s 2.0041e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZR5 b/tests/offset/shape_type_i_c/ZR5 new file mode 100644 index 0000000000..fa4f8b4539 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZR5 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_dom-6827_1.recipe.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.87021e+007 -s 2.07859e+006 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 289 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZR6 b/tests/offset/shape_type_i_c/ZR6 new file mode 100644 index 0000000000..dbf049cea4 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZR6 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_10.recipe.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.83785e+007 +checkprops result -s 2.14935e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZR7 b/tests/offset/shape_type_i_c/ZR7 new file mode 100644 index 0000000000..fe9f29c22d --- /dev/null +++ b/tests/offset/shape_type_i_c/ZR7 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_13.recipe.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.91845e+007 +checkprops result -s 2.14332e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZR8 b/tests/offset/shape_type_i_c/ZR8 new file mode 100644 index 0000000000..598fd40706 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZR8 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-6849_26.recipe.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.80776e+007 +checkprops result -s 2.0707e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZR9 b/tests/offset/shape_type_i_c/ZR9 new file mode 100644 index 0000000000..40b69a9742 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZR9 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-7259.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 7.09283e+007 +checkprops result -s 4.49093e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZS1 b/tests/offset/shape_type_i_c/ZS1 new file mode 100644 index 0000000000..2aeebfc79e --- /dev/null +++ b/tests/offset/shape_type_i_c/ZS1 @@ -0,0 +1,11 @@ +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.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 8.95633e+008 -s 6.22693e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZS2 b/tests/offset/shape_type_i_c/ZS2 new file mode 100644 index 0000000000..ddf8a563b3 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZS2 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_dom-6820_0.recipe_trim1.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 1.12903e+007 -s 717150 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 93 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZS3 b/tests/offset/shape_type_i_c/ZS3 new file mode 100644 index 0000000000..86c4f23a5f --- /dev/null +++ b/tests/offset/shape_type_i_c/ZS3 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_dom-6820_0.recipe_trim2.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 2.61249e+007 -s 1.32973e+006 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 191 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZS4 b/tests/offset/shape_type_i_c/ZS4 new file mode 100644 index 0000000000..21a7a06839 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZS4 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_dom-6820_0.recipe_trim3.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 4.58096e+006 -s 247335 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 54 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZS5 b/tests/offset/shape_type_i_c/ZS5 new file mode 100644 index 0000000000..2c821347a5 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZS5 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_dom-6820_0.recipe_trim4.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 7.09306e+006 -s 594789 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 48 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZS6 b/tests/offset/shape_type_i_c/ZS6 new file mode 100644 index 0000000000..2cfed3aa2c --- /dev/null +++ b/tests/offset/shape_type_i_c/ZS6 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_dom-7491_trim1.brep] s + +OFFSETSHAPE 1 {} $calcul $type + +checkprops result -v 97182.3 -s 17648.3 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 15 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZS7 b/tests/offset/shape_type_i_c/ZS7 new file mode 100644 index 0000000000..5d2be40f10 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZS7 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-7491_trim2.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 76254.4 +checkprops result -s 11907.1 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZS8 b/tests/offset/shape_type_i_c/ZS8 new file mode 100644 index 0000000000..4cfc1d5aca --- /dev/null +++ b/tests/offset/shape_type_i_c/ZS8 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_dom-6827_1.recipe_trim1.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 1.59088e+007 -s 922700 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 133 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZS9 b/tests/offset/shape_type_i_c/ZS9 new file mode 100644 index 0000000000..0942f8d8bd --- /dev/null +++ b/tests/offset/shape_type_i_c/ZS9 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_dom-6827_1.recipe_trim2.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 7.21325e+006 -s 324219 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 37 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZT1 b/tests/offset/shape_type_i_c/ZT1 new file mode 100644 index 0000000000..220505806a --- /dev/null +++ b/tests/offset/shape_type_i_c/ZT1 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_dom-6827_1.recipe_trim3.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 1.59147e+007 -s 921616 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 131 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZT2 b/tests/offset/shape_type_i_c/ZT2 new file mode 100644 index 0000000000..d743c0964f --- /dev/null +++ b/tests/offset/shape_type_i_c/ZT2 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_dom-6827_1.recipe_trim4.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 4.17586e+006 -s 244403 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 37 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZT3 b/tests/offset/shape_type_i_c/ZT3 new file mode 100644 index 0000000000..acae4d8f66 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZT3 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom7772.input.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.16252e+007 +checkprops result -s 1.74461e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZT4 b/tests/offset/shape_type_i_c/ZT4 new file mode 100644 index 0000000000..0d83e7b546 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZT4 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom6884.t3c0.input.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.69758e+007 +checkprops result -s 2.07457e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZT5 b/tests/offset/shape_type_i_c/ZT5 new file mode 100644 index 0000000000..2528fe8001 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZT5 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_dom-6820_0.recipe_trim5.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 283511 -s 39150.9 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 15 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZT6 b/tests/offset/shape_type_i_c/ZT6 new file mode 100644 index 0000000000..fb08ab7a87 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZT6 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom7772.input_simple.brep] s + +OFFSETSHAPE 1 {} $calcul $type + +checkprops result -v 176.308 +checkprops result -s 218.729 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZT7 b/tests/offset/shape_type_i_c/ZT7 new file mode 100644 index 0000000000..8d207431d4 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZT7 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_input_dom6820_1_trim3.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 1.08733e+007 -s 692538 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 88 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZT8 b/tests/offset/shape_type_i_c/ZT8 new file mode 100644 index 0000000000..2ee9d4d0d4 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZT8 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_input_dom6820_1_trim4.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 9.20163e+006 -s 572981 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 75 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZT9 b/tests/offset/shape_type_i_c/ZT9 new file mode 100644 index 0000000000..c616604314 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZT9 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_input-step17_trim4.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 2.76771e+006 -s 141436 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 7 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZU1 b/tests/offset/shape_type_i_c/ZU1 new file mode 100644 index 0000000000..76adc7ba99 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZU1 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input-step17.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 3.18132e+007 +checkprops result -s 1.98704e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZU2 b/tests/offset/shape_type_i_c/ZU2 new file mode 100644 index 0000000000..729299765a --- /dev/null +++ b/tests/offset/shape_type_i_c/ZU2 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_input-step17.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 4.02375e+007 -s 1.59238e+006 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 65 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZU3 b/tests/offset/shape_type_i_c/ZU3 new file mode 100644 index 0000000000..c5c23557b9 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZU3 @@ -0,0 +1,21 @@ +restore [locate_data_file bug26917_input-step17.brep] s + +offsetparameter 1e-7 c i +offsetload s 5 + +# set offset 2 for top faces (normal direction 0 0 1) +set faces [explode s f] +foreach f $faces { + 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 2 + } +} + +offsetperform result + +checkprops result -v 2.95041e+007 +checkprops result -s 1.96287e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZU4 b/tests/offset/shape_type_i_c/ZU4 new file mode 100644 index 0000000000..22be2aabcd --- /dev/null +++ b/tests/offset/shape_type_i_c/ZU4 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input-step17_trim1.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 1.92793e+006 +checkprops result -s 185382 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZU5 b/tests/offset/shape_type_i_c/ZU5 new file mode 100644 index 0000000000..43015f719b --- /dev/null +++ b/tests/offset/shape_type_i_c/ZU5 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input-step17_trim2.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 2.99457e+007 +checkprops result -s 1.82036e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZU6 b/tests/offset/shape_type_i_c/ZU6 new file mode 100644 index 0000000000..3e3243a543 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZU6 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input-step17_trim2.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 3.78029e+007 +checkprops result -s 1.50768e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZU7 b/tests/offset/shape_type_i_c/ZU7 new file mode 100644 index 0000000000..85bb6e0cab --- /dev/null +++ b/tests/offset/shape_type_i_c/ZU7 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input-step17_trim3.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 6.73873e+006 +checkprops result -s 555298 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZU8 b/tests/offset/shape_type_i_c/ZU8 new file mode 100644 index 0000000000..d21ccf6cf7 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZU8 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_input-step17_trim3.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 8.89259e+006 -s 388784 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 26 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZU9 b/tests/offset/shape_type_i_c/ZU9 new file mode 100644 index 0000000000..761d7898fc --- /dev/null +++ b/tests/offset/shape_type_i_c/ZU9 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_input-step3.brep] s + +OFFSETSHAPE 22 {} $calcul $type + +checkprops result -v 9.15368e+007 -s 2.59391e+006 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 57 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZV1 b/tests/offset/shape_type_i_c/ZV1 new file mode 100644 index 0000000000..d4d4f4151f --- /dev/null +++ b/tests/offset/shape_type_i_c/ZV1 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-7259_trim1.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 6.64061e+007 +checkprops result -s 4.02575e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZV2 b/tests/offset/shape_type_i_c/ZV2 new file mode 100644 index 0000000000..f0f0c45416 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZV2 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-7259_trim2.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 3.67479e+007 +checkprops result -s 1.23956e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZV3 b/tests/offset/shape_type_i_c/ZV3 new file mode 100644 index 0000000000..8d081e106e --- /dev/null +++ b/tests/offset/shape_type_i_c/ZV3 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_dom-7259_trim3.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 3.99934e+007 -s 2.0166e+006 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 420 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZV4 b/tests/offset/shape_type_i_c/ZV4 new file mode 100644 index 0000000000..2f687724b6 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZV4 @@ -0,0 +1,11 @@ +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-7259_trim3.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 0 +checkprops result -s 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZV5 b/tests/offset/shape_type_i_c/ZV5 new file mode 100644 index 0000000000..e1d7005f37 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZV5 @@ -0,0 +1,11 @@ +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-7259_trim3.brep] s + +OFFSETSHAPE 20 {} $calcul $type + +checkprops result -v 0 +checkprops result -s 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZV6 b/tests/offset/shape_type_i_c/ZV6 new file mode 100644 index 0000000000..d11e311c66 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZV6 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-7259_trim4.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 4.14625e+007 +checkprops result -s 2.56822e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZV7 b/tests/offset/shape_type_i_c/ZV7 new file mode 100644 index 0000000000..9512290949 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZV7 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-7259_trim5.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 1.44383e+007 +checkprops result -s 1.15897e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZV8 b/tests/offset/shape_type_i_c/ZV8 new file mode 100644 index 0000000000..a8472ef042 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZV8 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-7259_trim5.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 2.03268e+007 +checkprops result -s 1.19747e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZV9 b/tests/offset/shape_type_i_c/ZV9 new file mode 100644 index 0000000000..ca630c2bf6 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZV9 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom-7259_trim6.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 7.05257e+006 +checkprops result -s 545249 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZW1 b/tests/offset/shape_type_i_c/ZW1 new file mode 100644 index 0000000000..ed536b138f --- /dev/null +++ b/tests/offset/shape_type_i_c/ZW1 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom8036.input.brep] s + +OFFSETSHAPE 43.7 {} $calcul $type + +checkprops result -v 2.70147e+009 +checkprops result -s 1.63922e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZW2 b/tests/offset/shape_type_i_c/ZW2 new file mode 100644 index 0000000000..de81d16f66 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZW2 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom8036.input_trim1.brep] s + +OFFSETSHAPE 43.7 {} $calcul $type + +checkprops result -v 4.55952e+006 +checkprops result -s 178524 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZW3 b/tests/offset/shape_type_i_c/ZW3 new file mode 100644 index 0000000000..5f784419dc --- /dev/null +++ b/tests/offset/shape_type_i_c/ZW3 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom8036.input_trim3.brep] s + +OFFSETSHAPE 14 {} $calcul $type + +checkprops result -v 702756 +checkprops result -s 58381.3 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZW4 b/tests/offset/shape_type_i_c/ZW4 new file mode 100644 index 0000000000..cae34a8e19 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZW4 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom8036.input_trim3.brep] s + +OFFSETSHAPE 43.7 {} $calcul $type + +checkprops result -v 3.77467e+006 +checkprops result -s 155537 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZW5 b/tests/offset/shape_type_i_c/ZW5 new file mode 100644 index 0000000000..61a523eaf2 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZW5 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom8036.input_art1.brep] s + +OFFSETSHAPE 4 {} $calcul $type + +checkprops result -v 3771.44 +checkprops result -s 1506.76 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZW6 b/tests/offset/shape_type_i_c/ZW6 new file mode 100644 index 0000000000..ce6fc96dc4 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZW6 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom8036.input_art4.brep] s + +OFFSETSHAPE 5 {} $calcul $type + +checkprops result -v 5453.96 +checkprops result -s 1912.14 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZW7 b/tests/offset/shape_type_i_c/ZW7 new file mode 100644 index 0000000000..1ae6cf9138 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZW7 @@ -0,0 +1,12 @@ +restore [locate_data_file bug26917_dom8036.input_art4.brep] s + +offsetparameter 1e-7 c i +offsetload s 5 +explode s f +offsetonface s_6 7 +offsetperform result + +checkprops result -v 5530.7 +checkprops result -s 1919.49 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZW8 b/tests/offset/shape_type_i_c/ZW8 new file mode 100644 index 0000000000..b47a2963e5 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZW8 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom8036.input_art2.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 48955.7 +checkprops result -s 8048.95 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZW9 b/tests/offset/shape_type_i_c/ZW9 new file mode 100644 index 0000000000..c97b3d69f7 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZW9 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_dom8036.input_art5.brep] s + +OFFSETSHAPE 6 {} $calcul $type + +checkprops result -v 7543.63 +checkprops result -s 2359.85 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZX1 b/tests/offset/shape_type_i_c/ZX1 new file mode 100644 index 0000000000..3910b68835 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZX1 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_t104_c1.recipe.brep] s + +OFFSETSHAPE 43 {} $calcul $type + +checkprops result -v 7.05903e+008 +checkprops result -s 5.59084e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZX2 b/tests/offset/shape_type_i_c/ZX2 new file mode 100644 index 0000000000..6bd9877625 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZX2 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_t107_c1.recipe.brep] s + +OFFSETSHAPE 35 {} $calcul $type + +checkprops result -v 7.94674e+008 +checkprops result -s 6.11963e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZX3 b/tests/offset/shape_type_i_c/ZX3 new file mode 100644 index 0000000000..5936be0e29 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZX3 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_t11_c1.recipe.brep] s + +OFFSETSHAPE 43 {} $calcul $type + +checkprops result -v 7.05903e+008 +checkprops result -s 5.59084e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZX4 b/tests/offset/shape_type_i_c/ZX4 new file mode 100644 index 0000000000..de7b0afebb --- /dev/null +++ b/tests/offset/shape_type_i_c/ZX4 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_t111_c2.recipe.brep] s + +OFFSETSHAPE 43 {} $calcul $type + +checkprops result -v 9.12393e+008 +checkprops result -s 7.01321e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZX5 b/tests/offset/shape_type_i_c/ZX5 new file mode 100644 index 0000000000..9f7f54bf5a --- /dev/null +++ b/tests/offset/shape_type_i_c/ZX5 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_t112_c1.recipe.brep] s + +OFFSETSHAPE 6 {} $calcul $type + +checkprops result -v 5.70228e+008 -s 5.04268e+006 + +unifysamedom result_unif result +checknbshapes result_unif -face 39 -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 new file mode 100644 index 0000000000..49bb858112 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZX6 @@ -0,0 +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 + +checkprops result -v 7.93275e+008 +checkprops result -s 6.15377e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZX7 b/tests/offset/shape_type_i_c/ZX7 new file mode 100644 index 0000000000..4b84273e40 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZX7 @@ -0,0 +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 + +checkprops result -v 7.93275e+008 +checkprops result -s 6.15377e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZX8 b/tests/offset/shape_type_i_c/ZX8 new file mode 100644 index 0000000000..6ec303d8a0 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZX8 @@ -0,0 +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 + +checkprops result -v 8.96742e+008 +checkprops result -s 6.85555e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZX9 b/tests/offset/shape_type_i_c/ZX9 new file mode 100644 index 0000000000..86445e1bea --- /dev/null +++ b/tests/offset/shape_type_i_c/ZX9 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_t121_c1.recipe.brep] s + +OFFSETSHAPE 43 {} $calcul $type + +checkprops result -v 5.23391e+008 +checkprops result -s 4.7898e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZY1 b/tests/offset/shape_type_i_c/ZY1 new file mode 100644 index 0000000000..070bfda432 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZY1 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_t129_c1.recipe.brep] s + +OFFSETSHAPE 43 {} $calcul $type + +checkprops result -v 1.58077e+009 +checkprops result -s 1.04396e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZY2 b/tests/offset/shape_type_i_c/ZY2 new file mode 100644 index 0000000000..3d262407b3 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZY2 @@ -0,0 +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 + +checkprops result -v 6.89789e+008 +checkprops result -s 5.45195e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZY3 b/tests/offset/shape_type_i_c/ZY3 new file mode 100644 index 0000000000..63a4e3017b --- /dev/null +++ b/tests/offset/shape_type_i_c/ZY3 @@ -0,0 +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 + +checkprops result -v 8.96742e+008 +checkprops result -s 6.85555e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZY4 b/tests/offset/shape_type_i_c/ZY4 new file mode 100644 index 0000000000..c96b9e09e7 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZY4 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_t138_c2.recipe.brep] s + +OFFSETSHAPE 43 {} $calcul $type + +checkprops result -v 2.09462e+009 +checkprops result -s 1.32364e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZY5 b/tests/offset/shape_type_i_c/ZY5 new file mode 100644 index 0000000000..a6b5f5d523 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZY5 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_t139_c2.recipe.brep] s + +OFFSETSHAPE 43 {} $calcul $type + +checkprops result -v 7.05903e+008 +checkprops result -s 5.59084e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZY6 b/tests/offset/shape_type_i_c/ZY6 new file mode 100644 index 0000000000..0b63ea5457 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZY6 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_t143_c1.recipe.brep] s + +OFFSETSHAPE 43 {} $calcul $type + +checkprops result -v 5.23391e+008 +checkprops result -s 4.7898e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZY7 b/tests/offset/shape_type_i_c/ZY7 new file mode 100644 index 0000000000..a93a4246a1 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZY7 @@ -0,0 +1,7 @@ +restore [locate_data_file bug26917_t112_c1.recipe_trim1.brep] s + +OFFSETSHAPE 6 {} $calcul $type + +checkprops result -v 813077 -s 70451.1 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZY8 b/tests/offset/shape_type_i_c/ZY8 new file mode 100644 index 0000000000..d97a14107f --- /dev/null +++ b/tests/offset/shape_type_i_c/ZY8 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_t112_c1.recipe_art.brep] s + +OFFSETSHAPE 3 {} $calcul $type + +checkprops result -v 4422.98 +checkprops result -s 1736.95 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZY9 b/tests/offset/shape_type_i_c/ZY9 new file mode 100644 index 0000000000..119631939a --- /dev/null +++ b/tests/offset/shape_type_i_c/ZY9 @@ -0,0 +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 + +checkprops result -v 475 +checkprops result -s 454.58 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZZ1 b/tests/offset/shape_type_i_c/ZZ1 new file mode 100755 index 0000000000..afa9394e28 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZZ1 @@ -0,0 +1,12 @@ +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" + +restore [locate_data_file bug26917_input_segfault.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 0 +checkprops result -s 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZZ2 b/tests/offset/shape_type_i_c/ZZ2 new file mode 100755 index 0000000000..40a461796c --- /dev/null +++ b/tests/offset/shape_type_i_c/ZZ2 @@ -0,0 +1,13 @@ +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 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZZ3 b/tests/offset/shape_type_i_c/ZZ3 new file mode 100644 index 0000000000..2072226772 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZZ3 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input.TC504.9.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 5.83441e+007 +checkprops result -s 1.61063e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZZ4 b/tests/offset/shape_type_i_c/ZZ4 new file mode 100644 index 0000000000..9debe2b994 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZZ4 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input.TC506.73.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 4.50915e+008 +checkprops result -s 1.13645e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZZ5 b/tests/offset/shape_type_i_c/ZZ5 new file mode 100644 index 0000000000..911278b339 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZZ5 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input.TC508.3.brep] s + +OFFSETSHAPE 22 {} $calcul $type + +checkprops result -v 1.14538e+008 +checkprops result -s 3.2344e+006 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZZ6 b/tests/offset/shape_type_i_c/ZZ6 new file mode 100644 index 0000000000..b95d6ace51 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZZ6 @@ -0,0 +1,10 @@ +restore [locate_data_file bug26917_input.TC505.1.brep] s + +OFFSETSHAPE 10 {} $calcul $type + +checkprops result -v 6.68116e+007 -s 3.03706e+006 + +unifysamedom result_unif result +checknbshapes result_unif -shell 1 -face 116 + +checkview -display result_unif -2d -path ${imagedir}/${test_image}.png diff --git a/tests/offset/shape_type_i_c/ZZ7 b/tests/offset/shape_type_i_c/ZZ7 new file mode 100644 index 0000000000..4c8d349505 --- /dev/null +++ b/tests/offset/shape_type_i_c/ZZ7 @@ -0,0 +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_input.dom7742.brep] s + +OFFSETSHAPE 15 {} $calcul $type + +checkprops result -v 0 +checkprops result -s 0 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZZ8 b/tests/offset/shape_type_i_c/ZZ8 new file mode 100644 index 0000000000..f8669eb1ff --- /dev/null +++ b/tests/offset/shape_type_i_c/ZZ8 @@ -0,0 +1,8 @@ +restore [locate_data_file bug26917_input.TC501.43.brep] s + +OFFSETSHAPE 12 {} $calcul $type + +checkprops result -v 9.59005e+008 +checkprops result -s 3.05311e+007 + +checknbshapes result -shell 1 diff --git a/tests/offset/shape_type_i_c/ZZ9 b/tests/offset/shape_type_i_c/ZZ9 new file mode 100644 index 0000000000..5b5baeedbb --- /dev/null +++ b/tests/offset/shape_type_i_c/ZZ9 @@ -0,0 +1,11 @@ +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_t114_c2.recipe_art2.brep] s + +OFFSETSHAPE 2 {} $calcul $type + +checkprops result -v 484.855 +checkprops result -s 458.883 + +checknbshapes result -shell 1