diff --git a/src/BRepFill/BRepFill_Generator.cxx b/src/BRepFill/BRepFill_Generator.cxx index d71ba4d910..79d59d1fea 100644 --- a/src/BRepFill/BRepFill_Generator.cxx +++ b/src/BRepFill/BRepFill_Generator.cxx @@ -503,13 +503,37 @@ void CreateKPart(const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2, Surf = surface; } +//======================================================================= +//function : CreateNewEdge +//purpose : +//======================================================================= +static TopoDS_Edge CreateNewEdge(const TopoDS_Edge& theEdge, TopTools_DataMapOfShapeShape& theCopiedEdges, + const TopoDS_Wire& theWire, TopTools_IndexedMapOfShape& theModifWires) +{ + BRep_Builder aBuilder; + TopoDS_Edge aNewEdge; + aNewEdge = TopoDS::Edge(theEdge.EmptyCopied()); + TopoDS_Iterator anIterator(theEdge); + for (; anIterator.More(); anIterator.Next()) + { + aBuilder.Add(aNewEdge, anIterator.Value()); + } + theCopiedEdges.Bind(theEdge, aNewEdge); + + if (!theModifWires.Contains(theWire)) + { + theModifWires.Add(theWire); + } + return aNewEdge; +} //======================================================================= //function : BRepFill_Generator //purpose : //======================================================================= -BRepFill_Generator::BRepFill_Generator() +BRepFill_Generator::BRepFill_Generator(): + myMutableInput (Standard_True) { } @@ -541,9 +565,11 @@ void BRepFill_Generator::Perform() B.MakeShell(myShell); Standard_Integer Nb = myWires.Length(); + TopTools_IndexedMapOfShape aModifWires; //indexed map for debugging BRepTools_WireExplorer ex1,ex2; + Standard_Boolean aFirstWire = Standard_True; Standard_Boolean wPoint1, wPoint2, uClosed = Standard_False, DegenFirst = Standard_False, DegenLast = Standard_False; for ( Standard_Integer i = 1; i <= Nb-1; i++) { @@ -580,47 +606,51 @@ void BRepFill_Generator::Perform() Standard_Boolean tantque = ex1.More() && ex2.More(); - while ( tantque ) { + while (tantque) + { + TopoDS_Vertex V1f, V1l, V2f, V2l, Vf_toMap, Vl_toMap; + const TopoDS_Edge& anOrEdge1 = TopoDS::Edge(ex1.Current()); + const TopoDS_Edge& anOrEdge2 = TopoDS::Edge(ex2.Current()); - TopoDS_Vertex V1f,V1l,V2f,V2l, Vf_toMap, Vl_toMap; + Standard_Boolean degen1 = BRep_Tool::Degenerated(anOrEdge1); + Standard_Boolean degen2 = BRep_Tool::Degenerated(anOrEdge2); - Standard_Boolean degen1 - = BRep_Tool::Degenerated(TopoDS::Edge(ex1.Current())); - Standard_Boolean degen2 - = BRep_Tool::Degenerated(TopoDS::Edge(ex2.Current())); - - if ( degen1 ) { - TopoDS_Shape aLocalShape = ex1.Current().EmptyCopied(); - Edge1 = TopoDS::Edge(aLocalShape); -// Edge1 = TopoDS::Edge(ex1.Current().EmptyCopied()); -// aLocalShape = ex1.Current(); -// TopExp::Vertices(TopoDS::Edge(aLocalShape),V1f,V1l); - TopExp::Vertices(TopoDS::Edge(ex1.Current()),V1f,V1l); - V1f.Orientation(TopAbs_FORWARD); - B.Add(Edge1,V1f); - V1l.Orientation(TopAbs_REVERSED); - B.Add(Edge1,V1l); - B.Range(Edge1,0,1); + if (degen1) + { + TopoDS_Shape aLocalShape = anOrEdge1.EmptyCopied(); + Edge1 = TopoDS::Edge(aLocalShape); + // Edge1 = TopoDS::Edge(ex1.Current().EmptyCopied()); + // aLocalShape = ex1.Current(); + // TopExp::Vertices(TopoDS::Edge(aLocalShape),V1f,V1l); + TopExp::Vertices(anOrEdge1, V1f, V1l); + V1f.Orientation(TopAbs_FORWARD); + B.Add(Edge1,V1f); + V1l.Orientation(TopAbs_REVERSED); + B.Add(Edge1,V1l); + B.Range(Edge1,0,1); + myOldNewShapes.Bind(anOrEdge1, Edge1); } - else { - TopoDS_Shape aLocalShape = ex1.Current(); - Edge1 = TopoDS::Edge(aLocalShape); -// Edge1 = TopoDS::Edge(ex1.Current()); + else + { + Edge1 = anOrEdge1; } - if ( degen2 ) { - TopoDS_Shape aLocalShape = ex2.Current().EmptyCopied(); - Edge2 = TopoDS::Edge(aLocalShape); -// Edge2 = TopoDS::Edge(ex2.Current().EmptyCopied()); - TopExp::Vertices(TopoDS::Edge(ex2.Current()),V2f,V2l); - V2f.Orientation(TopAbs_FORWARD); - B.Add(Edge2,V2f); - V2l.Orientation(TopAbs_REVERSED); - B.Add(Edge2,V2l); - B.Range(Edge2,0,1); + if (degen2) + { + TopoDS_Shape aLocalShape = anOrEdge2.EmptyCopied(); + Edge2 = TopoDS::Edge(aLocalShape); + // Edge2 = TopoDS::Edge(ex2.Current().EmptyCopied()); + TopExp::Vertices(anOrEdge2, V2f, V2l); + V2f.Orientation(TopAbs_FORWARD); + B.Add(Edge2,V2f); + V2l.Orientation(TopAbs_REVERSED); + B.Add(Edge2,V2l); + B.Range(Edge2,0,1); + myOldNewShapes.Bind(anOrEdge2, Edge2); } - else { - Edge2 = TopoDS::Edge(ex2.Current()); + else + { + Edge2 = anOrEdge2; } Standard_Boolean Periodic = (BRep_Tool::IsClosed(Edge1) || degen1) && @@ -821,32 +851,36 @@ void BRepFill_Generator::Perform() Map.Bind(Vl_toMap, Edge4); } - // make the wire - - TopoDS_Wire W; - B.MakeWire(W); - - if (! (degen1 && IType == 4)) - B.Add(W,Edge1); - B.Add(W,Edge4); - if (! (degen2 && IType == 4)) - B.Add(W,Edge2.Reversed()); - B.Add(W,Edge3); - - B.Add(Face,W); - - B.Add(myShell,Face); + if (!myMutableInput) + { + if (!degen1) //if true=>already empty-copied + { + const TopoDS_Shape* aNewEd1 = myOldNewShapes.Seek(Edge1); + if (aNewEd1) + { + Edge1 = TopoDS::Edge(*aNewEd1); + } + else if (aFirstWire && (IType != 4 || BRep_Tool::SameParameter(Edge1) || BRep_Tool::SameRange(Edge1))) + { + //if such expression is true and mutableInput is false => pre-copy the edge to prevent a following modifying (see code below) + Edge1 = CreateNewEdge(Edge1, myOldNewShapes, Wire1, aModifWires); + } + } + if (!degen2) + { + const TopoDS_Shape* aNewEd2 = myOldNewShapes.Seek(Edge2); + if (aNewEd2) + { + Edge2 = TopoDS::Edge(*aNewEd2); + } + else if (IType != 4 || BRep_Tool::SameParameter(Edge2) || BRep_Tool::SameRange(Edge2)) + { + Edge2 = CreateNewEdge(Edge2, myOldNewShapes, Wire2, aModifWires); + } + } + } - // complete myMap for edge1 - if (! (degen1 && IType == 4)) - { - TopTools_ListOfShape Empty; - if (!myMap.IsBound(Edge1)) myMap.Bind(Edge1,Empty); - myMap(Edge1).Append(Face); - } - // set the pcurves - Standard_Real T = Precision::Confusion(); if (IType != 4) //not plane @@ -933,17 +967,98 @@ void BRepFill_Generator::Perform() B.SameRange(Edge3,Standard_False); B.SameRange(Edge4,Standard_False); + // make the wire + TopoDS_Wire aWire; + B.MakeWire(aWire); + + if (!(degen1 && IType == 4)) + { + B.Add(aWire,Edge1); + } + B.Add(aWire,Edge4); + if (!(degen2 && IType == 4)) + { + B.Add(aWire,Edge2.Reversed()); + } + B.Add(aWire,Edge3); + + B.Add(Face,aWire); + B.Add(myShell,Face); + + // complete myMap for edge1 + if (! (degen1 && IType == 4)) + { + TopoDS_Edge aREd = anOrEdge1; + if (degen1) + { + aREd = Edge1; + } + + if (!myMap.IsBound(aREd)) + { + TopTools_ListOfShape Empty; + myMap.Bind(aREd,Empty); + } + myMap(aREd).Append(Face); + } + tantque = ex1.More() && ex2.More(); if (wPoint1) tantque = ex2.More(); if (wPoint2) tantque = ex1.More(); } + aFirstWire = Standard_False; + } + + //all vertices from myShell are the part of orig. section wires + if (myMutableInput) + { + BRepLib::SameParameter(myShell); + } + else + { + TopTools_DataMapIteratorOfDataMapOfShapeShape aMapIt(myOldNewShapes); + for (;aMapIt.More();aMapIt.Next()) + { + const TopoDS_Shape& aK = aMapIt.Key(); + const TopoDS_Shape& aVal = aMapIt.Value(); + myReshaper.Replace(aK, aVal); + } + BRepLib::SameParameter(myShell, myReshaper); + myShell = TopoDS::Shell(myReshaper.Apply(myShell)); } - BRepLib::SameParameter(myShell); if (uClosed && DegenFirst && DegenLast) + { myShell.Closed(Standard_True); -} + } + //update wire's history + TopoDS_Iterator anItEdge; + for (int i = 1; i <= aModifWires.Extent(); i++) + { + const TopoDS_Shape& aCurWire = aModifWires(i); + TopoDS_Wire aNewWire; + B.MakeWire(aNewWire); + + anItEdge.Initialize(aCurWire); + for (;anItEdge.More();anItEdge.Next()) + { + const TopoDS_Shape& aCurEdge = anItEdge.Value(); //edges only + const TopoDS_Shape& aNewEdge = ResultShape(aCurEdge); + B.Add(aNewWire, aNewEdge); + } + + aNewWire.Free(aCurWire.Free()); + aNewWire.Modified(aCurWire.Modified()); + aNewWire.Checked(aCurWire.Checked()); + aNewWire.Orientable(aCurWire.Orientable()); + aNewWire.Closed(aCurWire.Closed()); + aNewWire.Infinite(aCurWire.Infinite()); + aNewWire.Convex(aCurWire.Convex()); + + myOldNewShapes.Bind(aCurWire, aNewWire); + } +} //======================================================================= //function : GeneratedShapes @@ -972,4 +1087,38 @@ const TopTools_DataMapOfShapeListOfShape& BRepFill_Generator::Generated() const return myMap; } +//======================================================================= +//function : ResultShape +//purpose : +//======================================================================= +TopoDS_Shape BRepFill_Generator::ResultShape (const TopoDS_Shape& theShape) const +{ + const TopoDS_Shape* aShape = myOldNewShapes.Seek(theShape); + TopoDS_Shape aNewShape = aShape ? *aShape : theShape; + TopoDS_Shape aPrevShape; + do + { + aPrevShape = aNewShape; + aNewShape = myReshaper.Value(aNewShape); + } + while (aNewShape != aPrevShape); + return aNewShape; +} +//======================================================================= +//function : SetMutableInput +//purpose : +//======================================================================= +void BRepFill_Generator::SetMutableInput(const Standard_Boolean theIsMutableInput) +{ + myMutableInput = theIsMutableInput; +} + +//======================================================================= +//function : IsMutableInput +//purpose : +//======================================================================= +Standard_Boolean BRepFill_Generator::IsMutableInput() const +{ + return myMutableInput; +} diff --git a/src/BRepFill/BRepFill_Generator.hxx b/src/BRepFill/BRepFill_Generator.hxx index cb842869ab..39b2bfc9db 100644 --- a/src/BRepFill/BRepFill_Generator.hxx +++ b/src/BRepFill/BRepFill_Generator.hxx @@ -24,11 +24,12 @@ #include #include #include +#include #include +#include class TopoDS_Wire; class TopoDS_Shape; - //! Compute a topological surface ( a shell) using //! generating wires. The face of the shell will be //! ruled surfaces passing by the wires. @@ -56,31 +57,31 @@ public: //! of a section. Standard_EXPORT const TopTools_ListOfShape& GeneratedShapes (const TopoDS_Shape& SSection) const; + //! Returns a modified shape in the constructed shell, + //! If shape is not changed (replaced) during operation => returns the same shape + Standard_EXPORT TopoDS_Shape ResultShape (const TopoDS_Shape& theShape) const; - + //! Sets the mutable input state + //! If true then the input profile can be modified + //! inside the operation. Default value is true. + Standard_EXPORT void SetMutableInput(const Standard_Boolean theIsMutableInput); + + //! Returns the current mutable input state + Standard_EXPORT Standard_Boolean IsMutableInput() const; protected: - - - - private: - - TopTools_SequenceOfShape myWires; TopoDS_Shell myShell; TopTools_DataMapOfShapeListOfShape myMap; - + TopTools_DataMapOfShapeShape myOldNewShapes; + BRepTools_ReShape myReshaper; + Standard_Boolean myMutableInput; }; - #include - - - - #endif // _BRepFill_Generator_HeaderFile diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx b/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx index 745eba1f38..5129308edf 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -87,6 +88,8 @@ #include #include #include +#include +#include #include #include #include @@ -253,6 +256,7 @@ BRepOffsetAPI_ThruSections::BRepOffsetAPI_ThruSections(const Standard_Boolean is myDegen1(Standard_False), myDegen2(Standard_False) { myWCheck = Standard_True; + myMutableInput = Standard_True; //---------------------------- myParamType = Approx_ChordLength; myDegMax = 8; @@ -276,6 +280,7 @@ void BRepOffsetAPI_ThruSections::Init(const Standard_Boolean isSolid, const Stan myIsRuled = ruled; myPres3d = pres3d; myWCheck = Standard_True; + myMutableInput = Standard_True; //---------------------------- myParamType = Approx_ChordLength; myDegMax = 6; @@ -341,6 +346,7 @@ void BRepOffsetAPI_ThruSections::CheckCompatibility(const Standard_Boolean check void BRepOffsetAPI_ThruSections::Build(const Message_ProgressRange& /*theRange*/) { + myBFGenerator.Nullify(); //Check set of section for right configuration of punctual sections Standard_Integer i; TopExp_Explorer explo; @@ -508,14 +514,16 @@ void BRepOffsetAPI_ThruSections::Build(const Message_ProgressRange& /*theRange*/ void BRepOffsetAPI_ThruSections::CreateRuled() { Standard_Integer nbSects = myWires.Length(); - BRepFill_Generator aGene; + myBFGenerator = new BRepFill_Generator(); + myBFGenerator->SetMutableInput(IsMutableInput()); // for (Standard_Integer i=1; i<=nbSects; i++) { Standard_Integer i; - for (i=1; i<=nbSects; i++) { - aGene.AddWire(TopoDS::Wire(myWires(i))); + for (i=1; i<=nbSects; i++) + { + myBFGenerator->AddWire(TopoDS::Wire(myWires(i))); } - aGene.Perform(); - TopoDS_Shell shell = aGene.Shell(); + myBFGenerator->Perform(); + TopoDS_Shell shell = myBFGenerator->Shell(); if (myIsSolid) { @@ -524,7 +532,7 @@ void BRepOffsetAPI_ThruSections::CreateRuled() if (vClosed) { - TopoDS_Solid solid; + TopoDS_Solid solid; BRep_Builder B; B.MakeSolid(solid); B.Add(solid, shell); @@ -543,9 +551,10 @@ void BRepOffsetAPI_ThruSections::CreateRuled() } else { + //myBFGenerator stores the same 'myWires' + TopoDS_Wire wire1 = TopoDS::Wire(myBFGenerator->ResultShape(myWires.First())); + TopoDS_Wire wire2 = TopoDS::Wire(myBFGenerator->ResultShape(myWires.Last())); - TopoDS_Wire wire1 = TopoDS::Wire(myWires.First()); - TopoDS_Wire wire2 = TopoDS::Wire(myWires.Last()); myShape = MakeSolid(shell, wire1, wire2, myPres3d, myFirst, myLast); } @@ -585,30 +594,37 @@ void BRepOffsetAPI_ThruSections::CreateRuled() Standard_Boolean degen2 = BRep_Tool::Degenerated(anExp2.Current()); TopTools_MapOfShape MapFaces; - if (degen2){ - TopoDS_Vertex Vdegen = TopExp::FirstVertex(TopoDS::Edge(edge2)); - for (it.Initialize(MV.FindFromKey(Vdegen)); it.More(); it.Next()) { + if (degen2) + { + TopoDS_Vertex Vdegen = TopoDS::Vertex(myBFGenerator->ResultShape(TopExp::FirstVertex(TopoDS::Edge(edge2)))); + for (it.Initialize(MV.FindFromKey(Vdegen)); it.More(); it.Next()) + { MapFaces.Add(it.Value()); } } - else { - for (it.Initialize(M.FindFromKey(edge2)); it.More(); it.Next()) { + else + { + for (it.Initialize(M.FindFromKey(myBFGenerator->ResultShape(edge2))); it.More(); it.Next()) + { MapFaces.Add(it.Value()); } } - if (degen1) { - TopoDS_Vertex Vdegen = TopExp::FirstVertex(TopoDS::Edge(edge1)); - for (it.Initialize(MV.FindFromKey(Vdegen)); it.More(); it.Next()) { + if (degen1) + { + TopoDS_Vertex Vdegen = TopoDS::Vertex(myBFGenerator->ResultShape(TopExp::FirstVertex(TopoDS::Edge(edge1)))); + for (it.Initialize(MV.FindFromKey(Vdegen)); it.More(); it.Next()) + { const TopoDS_Shape& Face = it.Value(); - if (MapFaces.Contains(Face)) { + if (MapFaces.Contains(Face)) + { myEdgeFace.Bind(edge1, Face); break; } } } else { - for (it.Initialize(M.FindFromKey(edge1)); it.More(); it.Next()) { + for (it.Initialize(M.FindFromKey(myBFGenerator->ResultShape(edge1))); it.More(); it.Next()) { const TopoDS_Shape& Face = it.Value(); if (MapFaces.Contains(Face)) { myEdgeFace.Bind(edge1, Face); @@ -930,14 +946,65 @@ void BRepOffsetAPI_ThruSections::CreateSmoothed() Done(); } - TopExp_Explorer ex(myShape,TopAbs_EDGE); - while (ex.More()) { - const TopoDS_Edge& CurE = TopoDS::Edge(ex.Current()); - B.SameRange(CurE, Standard_False); - B.SameParameter(CurE, Standard_False); - Standard_Real tol = BRep_Tool::Tolerance(CurE); - BRepLib::SameParameter(CurE,tol); - ex.Next(); + TopTools_DataMapOfShapeReal aVertexToleranceMap; + TopExp_Explorer aTopExplorer(myShape,TopAbs_EDGE); + while (aTopExplorer.More()) + { + const TopoDS_Edge& aCurEdge = TopoDS::Edge(aTopExplorer.Current()); + B.SameRange(aCurEdge, Standard_False); + B.SameParameter(aCurEdge, Standard_False); + Standard_Real aTolerance = BRep_Tool::Tolerance(aCurEdge); + if (myMutableInput) + { + BRepLib::SameParameter(aCurEdge,aTolerance); + } + else + { + //all edges from myShape can be safely updated/changed + //all vertices from myShape are the part of the original wires + Standard_Real aNewTolerance = -1; + BRepLib::SameParameter(aCurEdge, aTolerance, aNewTolerance, Standard_True); + if (aNewTolerance > 0) + { + TopoDS_Vertex aVertex1, aVertex2; + TopExp::Vertices(aCurEdge,aVertex1,aVertex2); + if (!aVertex1.IsNull()) + { + const Standard_Real* anOldTolerance = aVertexToleranceMap.Seek(aVertex1); + if (!anOldTolerance || (anOldTolerance && *anOldTolerance < aNewTolerance)) + { + aVertexToleranceMap.Bind(aVertex1,aNewTolerance); + } + } + if (!aVertex2.IsNull()) + { + const Standard_Real* anOldTolerance = aVertexToleranceMap.Seek(aVertex2); + if (!anOldTolerance || (anOldTolerance && *anOldTolerance < aNewTolerance)) + { + aVertexToleranceMap.Bind(aVertex2,aNewTolerance); + } + } + } + } + aTopExplorer.Next(); + } + + if (!myMutableInput) + { + BRepTools_ReShape aReshaper; + TopTools_DataMapIteratorOfDataMapOfShapeReal aMapIterator(aVertexToleranceMap); + for (;aMapIterator.More();aMapIterator.Next()) + { + const TopoDS_Vertex& aVertex = TopoDS::Vertex(aMapIterator.Key()); + Standard_Real aNewTolerance = aMapIterator.Value(); + if (BRep_Tool::Tolerance(aVertex) < aNewTolerance) + { + TopoDS_Vertex aNnewVertex = TopoDS::Vertex(aVertex.EmptyCopied()); + B.UpdateVertex(aNnewVertex, aNewTolerance); + aReshaper.Replace(aVertex, aNnewVertex); + } + } + myShape = aReshaper.Apply(myShape); } } @@ -1245,11 +1312,17 @@ BRepOffsetAPI_ThruSections::Generated(const TopoDS_Shape& S) //we return the whole bunch of longitudinal edges TopExp::MapShapesAndAncestors(myShape, TopAbs_VERTEX, TopAbs_EDGE, VEmap); TopTools_IndexedMapOfShape Emap; - const TopTools_ListOfShape& Elist = VEmap.FindFromKey(S); - TopTools_ListIteratorOfListOfShape itl(Elist); - for (; itl.More(); itl.Next()) + TopoDS_Shape aNewShape = S; + if ((myIsRuled || !myMutableInput) && !myBFGenerator.IsNull()) { - const TopoDS_Edge& anEdge = TopoDS::Edge(itl.Value()); + aNewShape = myBFGenerator->ResultShape(S); + } + + const TopTools_ListOfShape& anEdgeList = VEmap.FindFromKey(aNewShape); + TopTools_ListIteratorOfListOfShape aListIterator(anEdgeList); + for (; aListIterator.More(); aListIterator.Next()) + { + const TopoDS_Edge& anEdge = TopoDS::Edge(aListIterator.Value()); if (!BRep_Tool::Degenerated(anEdge)) { TopoDS_Vertex VV [2]; @@ -1257,9 +1330,11 @@ BRepOffsetAPI_ThruSections::Generated(const TopoDS_Shape& S) //Comprehensive check for possible case of //one vertex for start and end degenerated sections: //we must take only outgoing or only ingoing edges - if ((IsDegen[0] && S.IsSame(VV[0])) || - (IsDegen[1] && S.IsSame(VV[1]))) + if ((IsDegen[0] && aNewShape.IsSame(VV[0])) || + (IsDegen[1] && aNewShape.IsSame(VV[1]))) + { Emap.Add(anEdge); + } } } for (Standard_Integer j = 1; j <= Emap.Extent(); j++) @@ -1276,11 +1351,16 @@ BRepOffsetAPI_ThruSections::Generated(const TopoDS_Shape& S) TopExp::LastVertex(anEdge) : TopExp::FirstVertex(anEdge); const TopTools_ListOfShape& EElist = VEmap.FindFromKey(aVertex); TopTools_IndexedMapOfShape EmapOfSection; - TopExp::MapShapes(myWires(IndOfSec), TopAbs_EDGE, EmapOfSection); - TopoDS_Edge NextEdge; - for (itl.Initialize(EElist); itl.More(); itl.Next()) + TopoDS_Shape aWireSection = myWires(IndOfSec); + if ((myIsRuled || !myMutableInput) && !myBFGenerator.IsNull()) { - NextEdge = TopoDS::Edge(itl.Value()); + aWireSection = myBFGenerator->ResultShape(aWireSection); + } + TopExp::MapShapes(aWireSection, TopAbs_EDGE, EmapOfSection); + TopoDS_Edge NextEdge; + for (aListIterator.Initialize(EElist); aListIterator.More(); aListIterator.Next()) + { + NextEdge = TopoDS::Edge(aListIterator.Value()); if (!NextEdge.IsSame(anEdge) && !EmapOfSection.Contains(NextEdge)) break; @@ -1296,17 +1376,6 @@ BRepOffsetAPI_ThruSections::Generated(const TopoDS_Shape& S) Standard_Integer Eindex = myVertexIndex(S); Standard_Integer Vindex = (Eindex > 0)? 0 : 1; Eindex = Abs(Eindex); - const TopoDS_Wire& FirstSection = TopoDS::Wire(myWires(1)); - TopoDS_Edge FirstEdge; - TopoDS_Vertex FirstVertexOfFirstEdge; - BRepTools_WireExplorer wexp(FirstSection); - for (Standard_Integer inde = 1; wexp.More(); wexp.Next(),inde++) - { - FirstEdge = wexp.Current(); - FirstVertexOfFirstEdge = wexp.CurrentVertex(); - if (inde == Eindex) - break; - } //Find the first longitudinal edge TopoDS_Face FirstFace = TopoDS::Face(AllFaces(Eindex)); @@ -1329,6 +1398,24 @@ BRepOffsetAPI_ThruSections::Generated(const TopoDS_Shape& S) } else { + TopoDS_Edge FirstEdge; + TopoDS_Vertex FirstVertexOfFirstEdge; + const TopoDS_Wire& FirstSection = TopoDS::Wire(myWires(1)); + BRepTools_WireExplorer aWireExplorer(FirstSection); + for (Standard_Integer i = 1; aWireExplorer.More(); aWireExplorer.Next(), i++) + { + FirstEdge = aWireExplorer.Current(); + if (i == Eindex) + { + if ((myIsRuled || !myMutableInput) && !myBFGenerator.IsNull()) + { + FirstEdge = TopoDS::Edge(myBFGenerator->ResultShape(FirstEdge)); + } + FirstVertexOfFirstEdge = aWireExplorer.CurrentVertex(); + break; + } + } + TopoDS_Shape FirstEdgeInFace; FirstEdgeInFace = Explo.Current(); TopoDS_Vertex VV [2]; @@ -1366,7 +1453,7 @@ BRepOffsetAPI_ThruSections::Generated(const TopoDS_Shape& S) { FirstVertex = TopExp::LastVertex(anEdge); const TopTools_ListOfShape& Elist1 = VEmap.FindFromKey(FirstVertex); - FirstEdge = (anEdge.IsSame(Elist1.First()))? + TopoDS_Edge FirstEdge = (anEdge.IsSame(Elist1.First()))? TopoDS::Edge(Elist1.Last()) : TopoDS::Edge(Elist1.First()); Eindex += myNbEdgesInSection; FirstFace = TopoDS::Face(AllFaces(Eindex)); @@ -1504,7 +1591,23 @@ Standard_Boolean BRepOffsetAPI_ThruSections::UseSmoothing () const return myUseSmoothing; } - +//======================================================================= +//function : SetMutableInput +//purpose : +//======================================================================= +void BRepOffsetAPI_ThruSections::SetMutableInput(const Standard_Boolean theIsMutableInput) +{ + myMutableInput = theIsMutableInput; +} + +//======================================================================= +//function : IsMutableInput +//purpose : +//======================================================================= +Standard_Boolean BRepOffsetAPI_ThruSections::IsMutableInput() const +{ + return myMutableInput; +} diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.hxx b/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.hxx index 6211461380..dbe90ba5ee 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.hxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.hxx @@ -33,11 +33,13 @@ #include #include #include +#include + class TopoDS_Wire; class TopoDS_Vertex; class TopoDS_Shape; class Geom_BSplineSurface; - +class BRepFill_Generator; //! Describes functions to build a loft. This is a shell or a //! solid passing through a set of sections in a given @@ -144,6 +146,11 @@ public: //! Returns the Face generated by each edge of the first wire Standard_EXPORT TopoDS_Shape GeneratedFace (const TopoDS_Shape& Edge) const; + //! Sets the mutable input state. + //! If true then the input profile can be modified inside + //! the thrusection operation. Default value is true. + Standard_EXPORT void SetMutableInput(const Standard_Boolean theIsMutableInput); + //! Returns a list of new shapes generated from the shape //! S by the shell-generating algorithm. //! This function is redefined from BRepBuilderAPI_MakeShape::Generated. @@ -155,7 +162,9 @@ public: { return myInputWires; } - + //! Returns the current mutable input state + Standard_EXPORT Standard_Boolean IsMutableInput() const; + protected: @@ -197,7 +206,8 @@ private: Standard_Integer myDegMax; Standard_Real myCritWeights[3]; Standard_Boolean myUseSmoothing; - + Standard_Boolean myMutableInput; + NCollection_Handle myBFGenerator; }; diff --git a/src/BRepTest/BRepTest_SweepCommands.cxx b/src/BRepTest/BRepTest_SweepCommands.cxx index be6dce7a25..3cf1503ee1 100644 --- a/src/BRepTest/BRepTest_SweepCommands.cxx +++ b/src/BRepTest/BRepTest_SweepCommands.cxx @@ -470,10 +470,15 @@ Standard_Integer thrusections(Draw_Interpretor&, Standard_Integer n, const char* Generator = 0; } Generator = new BRepOffsetAPI_ThruSections(issolid, isruled); - + Standard_Boolean IsMutableInput = Standard_True; Standard_Integer NbEdges = 0; Standard_Boolean IsFirstWire = Standard_False; for (Standard_Integer i = index + 2; i <= n - 1; i++) { + if (!strcmp(a[i], "-safe")) + { + IsMutableInput = Standard_False; + continue; + } Standard_Boolean IsWire = Standard_True; Shape = DBRep::Get(a[i], TopAbs_WIRE); if (!Shape.IsNull()) @@ -507,6 +512,8 @@ Standard_Integer thrusections(Draw_Interpretor&, Standard_Integer n, const char* } + Generator->SetMutableInput(IsMutableInput); + check = (check || !samenumber); Generator->CheckCompatibility(check); @@ -1001,7 +1008,9 @@ void BRepTest::SweepCommands(Draw_Interpretor& theCommands) theCommands.Add("gener", "gener result wire1 wire2 [..wire..]", __FILE__, gener, g); - theCommands.Add("thrusections", "thrusections [-N] result issolid isruled shape1 shape2 [..shape..], the option -N means no check on wires, shapes must be wires or vertices (only first or last)", + theCommands.Add("thrusections", "thrusections [-N] result issolid isruled shape1 shape2 [..shape..] [-safe],\n" + "\t\tthe option -N means no check on wires, shapes must be wires or vertices (only first or last),\n" + "\t\t-safe option allows to prevent the modifying of input shapes", __FILE__, thrusections, g); theCommands.Add("mksweep", "mksweep wire", diff --git a/tests/thrusection/grids.list b/tests/thrusection/grids.list index 2d2da6b56c..cb68540472 100644 --- a/tests/thrusection/grids.list +++ b/tests/thrusection/grids.list @@ -2,4 +2,6 @@ 002 not_solids 003 specific 004 bugs - +005 not_solids_locked +006 solids_locked +007 specific_locked \ No newline at end of file diff --git a/tests/thrusection/not_solids_locked/A1 b/tests/thrusection/not_solids_locked/A1 new file mode 100644 index 0000000000..91b288036f --- /dev/null +++ b/tests/thrusection/not_solids_locked/A1 @@ -0,0 +1,7 @@ +restore [locate_data_file D1] w1 +restore [locate_data_file D1] w2 +ttranslate w2 0 20 0 +setflags w1 locked +setflags w2 locked +thrusections result 0 0 w1 w2 -safe +checkprops result -s 200 diff --git a/tests/thrusection/not_solids_locked/B1 b/tests/thrusection/not_solids_locked/B1 new file mode 100644 index 0000000000..f3d0ab2a38 --- /dev/null +++ b/tests/thrusection/not_solids_locked/B1 @@ -0,0 +1,7 @@ +restore [locate_data_file D2] w1 +restore [locate_data_file D4] w2 +ttranslate w2 0 20 0 +setflags w1 locked +setflags w2 locked +thrusections result 0 0 w1 w2 -safe +checkprops result -s 161.603 diff --git a/tests/thrusection/not_solids_locked/C1 b/tests/thrusection/not_solids_locked/C1 new file mode 100644 index 0000000000..18614eb808 --- /dev/null +++ b/tests/thrusection/not_solids_locked/C1 @@ -0,0 +1,7 @@ +restore [locate_data_file D4] w1 +restore [locate_data_file D1] w2 +ttranslate w2 0 20 0 +setflags w1 locked +setflags w2 locked +thrusections result 0 0 w1 w2 -safe +checkprops result -s 200 diff --git a/tests/thrusection/not_solids_locked/D1 b/tests/thrusection/not_solids_locked/D1 new file mode 100644 index 0000000000..6258d60a54 --- /dev/null +++ b/tests/thrusection/not_solids_locked/D1 @@ -0,0 +1,7 @@ +restore [locate_data_file D5] w1 +restore [locate_data_file D4] w2 +ttranslate w2 0 20 0 +setflags w1 locked +setflags w2 locked +thrusections result 0 0 w1 w2 -safe +checkprops result -s 161.603 diff --git a/tests/thrusection/not_solids_locked/F1 b/tests/thrusection/not_solids_locked/F1 new file mode 100644 index 0000000000..9d2da63359 --- /dev/null +++ b/tests/thrusection/not_solids_locked/F1 @@ -0,0 +1,7 @@ +restore [locate_data_file C2] w1 +restore [locate_data_file C1] w2 +ttranslate w2 0 0 40 +setflags w1 locked +setflags w2 locked +thrusections result 0 0 w1 w2 -safe +checkprops result -s 2513.27 diff --git a/tests/thrusection/not_solids_locked/G1 b/tests/thrusection/not_solids_locked/G1 new file mode 100644 index 0000000000..62ac4b45b2 --- /dev/null +++ b/tests/thrusection/not_solids_locked/G1 @@ -0,0 +1,7 @@ +restore [locate_data_file C3] w1 +restore [locate_data_file C1] w2 +ttranslate w2 0 0 40 +setflags w1 locked +setflags w2 locked +thrusections result 0 0 w1 w2 -safe +checkprops result -s 2196.82 diff --git a/tests/thrusection/not_solids_locked/H1 b/tests/thrusection/not_solids_locked/H1 new file mode 100644 index 0000000000..6f9a0396fa --- /dev/null +++ b/tests/thrusection/not_solids_locked/H1 @@ -0,0 +1,7 @@ +restore [locate_data_file C4] w1 +restore [locate_data_file C1] w2 +ttranslate w2 0 0 40 +setflags w1 locked +setflags w2 locked +thrusections result 0 0 w1 w2 -safe +checkprops result -s 2513.27 diff --git a/tests/thrusection/not_solids_locked/I1 b/tests/thrusection/not_solids_locked/I1 new file mode 100644 index 0000000000..2d588a4b64 --- /dev/null +++ b/tests/thrusection/not_solids_locked/I1 @@ -0,0 +1,7 @@ +restore [locate_data_file C5] w1 +restore [locate_data_file C1] w2 +ttranslate w2 0 0 40 +setflags w1 locked +setflags w2 locked +thrusections result 0 0 w1 w2 -safe +checkprops result -s 2513.27 diff --git a/tests/thrusection/not_solids_locked/J1 b/tests/thrusection/not_solids_locked/J1 new file mode 100644 index 0000000000..7e549d5722 --- /dev/null +++ b/tests/thrusection/not_solids_locked/J1 @@ -0,0 +1,7 @@ +restore [locate_data_file C6] w1 +restore [locate_data_file C1] w2 +ttranslate w2 0 0 40 +setflags w1 locked +setflags w2 locked +thrusections result 0 0 w1 w2 -safe +checkprops result -s 2196.82 diff --git a/tests/thrusection/not_solids_locked/K1 b/tests/thrusection/not_solids_locked/K1 new file mode 100644 index 0000000000..de685a6751 --- /dev/null +++ b/tests/thrusection/not_solids_locked/K1 @@ -0,0 +1,7 @@ +restore [locate_data_file C7] w1 +restore [locate_data_file C1] w2 +ttranslate w2 0 0 40 +setflags w1 locked +setflags w2 locked +thrusections result 0 0 w1 w2 -safe +checkprops result -s 2020.65 diff --git a/tests/thrusection/not_solids_locked/L1 b/tests/thrusection/not_solids_locked/L1 new file mode 100644 index 0000000000..d91b0e5092 --- /dev/null +++ b/tests/thrusection/not_solids_locked/L1 @@ -0,0 +1,7 @@ +restore [locate_data_file C8] w1 +restore [locate_data_file C1] w2 +ttranslate w2 0 0 40 +setflags w1 locked +setflags w2 locked +thrusections result 0 0 w1 w2 -safe +checkprops result -s 2020.65 diff --git a/tests/thrusection/not_solids_locked/M1 b/tests/thrusection/not_solids_locked/M1 new file mode 100644 index 0000000000..1891756d93 --- /dev/null +++ b/tests/thrusection/not_solids_locked/M1 @@ -0,0 +1,7 @@ +restore [locate_data_file C9] w1 +restore [locate_data_file C1] w2 +ttranslate w2 0 0 40 +setflags w1 locked +setflags w2 locked +thrusections result 0 0 w1 w2 -safe +checkprops result -s 1834.5 diff --git a/tests/thrusection/not_solids_locked/N1 b/tests/thrusection/not_solids_locked/N1 new file mode 100644 index 0000000000..02316db242 --- /dev/null +++ b/tests/thrusection/not_solids_locked/N1 @@ -0,0 +1,7 @@ +restore [locate_data_file C10] w1 +restore [locate_data_file C1] w2 +ttranslate w2 0 0 40 +setflags w1 locked +setflags w2 locked +thrusections result 0 0 w1 w2 -safe +checkprops result -s 2020.65 diff --git a/tests/thrusection/not_solids_locked/O1 b/tests/thrusection/not_solids_locked/O1 new file mode 100644 index 0000000000..b907157c6d --- /dev/null +++ b/tests/thrusection/not_solids_locked/O1 @@ -0,0 +1,7 @@ +restore [locate_data_file C11] w1 +restore [locate_data_file C1] w2 +ttranslate w2 0 0 40 +setflags w1 locked +setflags w2 locked +thrusections result 0 0 w1 w2 -safe +checkprops result -s 2020.65 diff --git a/tests/thrusection/not_solids_locked/P1 b/tests/thrusection/not_solids_locked/P1 new file mode 100644 index 0000000000..42d1ab3008 --- /dev/null +++ b/tests/thrusection/not_solids_locked/P1 @@ -0,0 +1,7 @@ +restore [locate_data_file C12] w1 +restore [locate_data_file C1] w2 +ttranslate w2 0 0 40 +setflags w1 locked +setflags w2 locked +thrusections result 0 0 w1 w2 -safe +checkprops result -s 1834.5 diff --git a/tests/thrusection/not_solids_locked/Q1 b/tests/thrusection/not_solids_locked/Q1 new file mode 100644 index 0000000000..7de395109e --- /dev/null +++ b/tests/thrusection/not_solids_locked/Q1 @@ -0,0 +1,6 @@ +restore [locate_data_file C13] w1 +restore [locate_data_file C1] w2 +setflags w1 locked +setflags w2 locked +thrusections result 0 0 w1 w2 -safe +checkprops result -s 1295.31 diff --git a/tests/thrusection/not_solids_locked/R1 b/tests/thrusection/not_solids_locked/R1 new file mode 100644 index 0000000000..e2f822a21a --- /dev/null +++ b/tests/thrusection/not_solids_locked/R1 @@ -0,0 +1,7 @@ +restore [locate_data_file C1] w1 +restore [locate_data_file C10] w2 +ttranslate w2 0 0 40 +setflags w1 locked +setflags w2 locked +thrusections result 0 0 w1 w2 -safe +checkprops result -s 2020.65 diff --git a/tests/thrusection/not_solids_locked/S1 b/tests/thrusection/not_solids_locked/S1 new file mode 100644 index 0000000000..ebf2a14bb8 --- /dev/null +++ b/tests/thrusection/not_solids_locked/S1 @@ -0,0 +1,7 @@ +restore [locate_data_file C3] w1 +restore [locate_data_file C11] w2 +ttranslate w2 0 0 40 +setflags w1 locked +setflags w2 locked +thrusections result 0 0 w1 w2 -safe +checkprops result -s 1690.09 diff --git a/tests/thrusection/not_solids_locked/T1 b/tests/thrusection/not_solids_locked/T1 new file mode 100644 index 0000000000..89245176ed --- /dev/null +++ b/tests/thrusection/not_solids_locked/T1 @@ -0,0 +1,7 @@ +restore [locate_data_file C5] w1 +restore [locate_data_file C12] w2 +ttranslate w2 0 0 40 +setflags w1 locked +setflags w2 locked +thrusections result 0 0 w1 w2 -safe +checkprops result -s 1834.5 diff --git a/tests/thrusection/not_solids_locked/U1 b/tests/thrusection/not_solids_locked/U1 new file mode 100644 index 0000000000..286814b8bf --- /dev/null +++ b/tests/thrusection/not_solids_locked/U1 @@ -0,0 +1,6 @@ +restore [locate_data_file C7] w1 +restore [locate_data_file C13] w2 +setflags w1 locked +setflags w2 locked +thrusections result 0 0 w1 w2 -safe +checkprops result -s 762.417 diff --git a/tests/thrusection/not_solids_locked/V1 b/tests/thrusection/not_solids_locked/V1 new file mode 100644 index 0000000000..8972a93298 --- /dev/null +++ b/tests/thrusection/not_solids_locked/V1 @@ -0,0 +1,7 @@ +restore [locate_data_file C10] w1 +restore [locate_data_file C10] w2 +ttranslate w2 0 0 40 +setflags w1 locked +setflags w2 locked +thrusections result 0 0 w1 w2 -safe +checkprops result -s 1507.96 diff --git a/tests/thrusection/not_solids_locked/W1 b/tests/thrusection/not_solids_locked/W1 new file mode 100644 index 0000000000..ce47c9e2ec --- /dev/null +++ b/tests/thrusection/not_solids_locked/W1 @@ -0,0 +1,7 @@ +restore [locate_data_file C12] w1 +restore [locate_data_file C11] w2 +ttranslate w2 0 0 40 +setflags w1 locked +setflags w2 locked +thrusections result 0 0 w1 w2 -safe +checkprops result -s 1314 diff --git a/tests/thrusection/not_solids_locked/W8 b/tests/thrusection/not_solids_locked/W8 new file mode 100644 index 0000000000..6c597250ff --- /dev/null +++ b/tests/thrusection/not_solids_locked/W8 @@ -0,0 +1,6 @@ +dall +restore [locate_data_file buc60318.rle] w +explode w W +setflags w locked +thrusections result 0 0 w_1 w_2 w_3 w_4 w_5 -safe +checkprops result -s 254109 diff --git a/tests/thrusection/solids_locked/A1 b/tests/thrusection/solids_locked/A1 new file mode 100644 index 0000000000..2d904b7428 --- /dev/null +++ b/tests/thrusection/solids_locked/A1 @@ -0,0 +1,11 @@ +restore [locate_data_file cts21295_1.brep] f1 +restore [locate_data_file cts21295_2.brep] f2 +restore [locate_data_file cts21295_3.brep] f3 +explode f1 w +explode f2 w +explode f3 w +setflags f1_1 locked +setflags f2_1 locked +setflags f3_1 locked +thrusections result 1 0 f1_1 f2_1 f3_1 -safe +checkprops result -s 49757.1 diff --git a/tests/thrusection/solids_locked/A2 b/tests/thrusection/solids_locked/A2 new file mode 100644 index 0000000000..f2cb0a91c9 --- /dev/null +++ b/tests/thrusection/solids_locked/A2 @@ -0,0 +1,6 @@ +restore [locate_data_file cts21570_1.rle] w1 +restore [locate_data_file cts21570_2.rle] w2 +setflags w1 locked +setflags w2 locked +thrusections result 1 0 w1 w2 -safe +checkprops result -s 29817.5 diff --git a/tests/thrusection/solids_locked/A3 b/tests/thrusection/solids_locked/A3 new file mode 100644 index 0000000000..94c7cb78db --- /dev/null +++ b/tests/thrusection/solids_locked/A3 @@ -0,0 +1,6 @@ +restore [locate_data_file cts21570_1.rle] w1 +restore [locate_data_file cts21570_2.rle] w2 +setflags w1 locked +setflags w2 locked +thrusections result 1 0 w2 w1 -safe +checkprops result -s 29817.5 diff --git a/tests/thrusection/solids_locked/A4 b/tests/thrusection/solids_locked/A4 new file mode 100644 index 0000000000..32a3e9624e --- /dev/null +++ b/tests/thrusection/solids_locked/A4 @@ -0,0 +1,7 @@ +restore [locate_data_file cts21570_1.rle] w1 +restore [locate_data_file cts21570_2.rle] w2 +orientation w1 F +setflags w1 locked +setflags w2 locked +thrusections result 1 0 w1 w2 -safe +checkprops result -s 29817.5 diff --git a/tests/thrusection/solids_locked/A5 b/tests/thrusection/solids_locked/A5 new file mode 100644 index 0000000000..b6c5120934 --- /dev/null +++ b/tests/thrusection/solids_locked/A5 @@ -0,0 +1,7 @@ +restore [locate_data_file cts21570_1.rle] w1 +restore [locate_data_file cts21570_2.rle] w2 +orientation w1 F +setflags w1 locked +setflags w2 locked +thrusections result 1 0 w2 w1 -safe +checkprops result -s 29817.5 diff --git a/tests/thrusection/solids_locked/A6 b/tests/thrusection/solids_locked/A6 new file mode 100644 index 0000000000..6a8b0a773c --- /dev/null +++ b/tests/thrusection/solids_locked/A6 @@ -0,0 +1,8 @@ +restore [locate_data_file cts21570_1.rle] w1 +restore [locate_data_file cts21570_2.rle] w2 +orientation w1 F +orientation w2 R +setflags w1 locked +setflags w2 locked +thrusections result 1 0 w1 w2 -safe +checkprops result -s 29817.5 diff --git a/tests/thrusection/solids_locked/A7 b/tests/thrusection/solids_locked/A7 new file mode 100644 index 0000000000..a76184fca5 --- /dev/null +++ b/tests/thrusection/solids_locked/A7 @@ -0,0 +1,8 @@ +restore [locate_data_file cts21570_1.rle] w1 +restore [locate_data_file cts21570_2.rle] w2 +orientation w1 F +orientation w2 R +setflags w1 locked +setflags w2 locked +thrusections result 1 0 w2 w1 -safe +checkprops result -s 29817.5 diff --git a/tests/thrusection/solids_locked/A8 b/tests/thrusection/solids_locked/A8 new file mode 100644 index 0000000000..a24d8473f3 --- /dev/null +++ b/tests/thrusection/solids_locked/A8 @@ -0,0 +1,9 @@ +restore [locate_data_file cts21570_1.rle] w1 +restore [locate_data_file cts21570_2.rle] w2 +orientation w1 F +orientation w2 R +orientation w1 R +setflags w1 locked +setflags w2 locked +thrusections result 1 0 w1 w2 -safe +checkprops result -s 29817.5 diff --git a/tests/thrusection/solids_locked/A9 b/tests/thrusection/solids_locked/A9 new file mode 100644 index 0000000000..3fafcc58c2 --- /dev/null +++ b/tests/thrusection/solids_locked/A9 @@ -0,0 +1,9 @@ +restore [locate_data_file cts21570_1.rle] w1 +restore [locate_data_file cts21570_2.rle] w2 +orientation w1 F +orientation w2 R +orientation w1 R +setflags w1 locked +setflags w2 locked +thrusections result 1 0 w2 w1 -safe +checkprops result -s 29817.5 diff --git a/tests/thrusection/specific/N5 b/tests/thrusection/specific/N5 new file mode 100644 index 0000000000..0c4f9e463c --- /dev/null +++ b/tests/thrusection/specific/N5 @@ -0,0 +1,15 @@ +puts "========" +puts "OCC28642: BRepOffsetAPI_ThruSections/BRepFill_Generator are modifying the input shape sections" +puts "========" +puts "" + +#check "closed" thrusection (first profile is same as the last) +polyline p1 0 0 0 1 0 0 +polyline p2 2 1 0 2 2 0 +polyline p3 3 0 0 4 0 0 +polyline p4 2 -1 0 2 -2 0 +thrusections result 0 0 p1 p2 p3 p4 p1 + +checkprops result -s 10.1587 +checknbshapes result -vertex 2 -edge 3 -wire 1 -face 1 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 8 + diff --git a/tests/thrusection/specific/N6 b/tests/thrusection/specific/N6 new file mode 100644 index 0000000000..add54429e3 --- /dev/null +++ b/tests/thrusection/specific/N6 @@ -0,0 +1,15 @@ +puts "========" +puts "OCC28642: BRepOffsetAPI_ThruSections/BRepFill_Generator are modifying the input shape sections" +puts "========" +puts "" + +#check "closed" thrusection (first profile is same as the last) +polyline p1 0 0 0 1 0 0 +polyline p2 2 1 0 2 2 0 +polyline p3 3 0 0 4 0 0 +polyline p4 2 -1 0 2 -2 0 +thrusections result 0 1 p1 p2 p3 p4 p1 + +checkprops result -s 6 +checknbshapes result -vertex 8 -edge 12 -wire 4 -face 4 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 29 + diff --git a/tests/thrusection/specific_locked/A1 b/tests/thrusection/specific_locked/A1 new file mode 100644 index 0000000000..d1bd049316 --- /dev/null +++ b/tests/thrusection/specific_locked/A1 @@ -0,0 +1,55 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +# +# * v3 +# | \ +# | \ +# | \ +# | \ +# | /* v2 +# | / +# | / * v4, v5 +# | / +# * +# v1 +# + +vertex v1 0 0 0 +vertex v2 5 5 0 +vertex v3 0 10 0 + +vertex v4 5 2.5 20 +vertex v5 5 2.5 -20 + +edge e1 v1 v2 +edge e2 v2 v3 +edge e3 v3 v1 + +wire w1 e1 e2 e3 + +set issolid 0 +set isruled 1 +setflags w1 locked +setflags v4 locked +setflags v5 locked + +thrusections result ${issolid} ${isruled} v4 w1 v5 -safe + + +checkprops result -s 490.101 + +checknbshapes result -vertex 5 -edge 9 -wire 6 -face 6 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 27 +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" +} + + diff --git a/tests/thrusection/specific_locked/A2 b/tests/thrusection/specific_locked/A2 new file mode 100644 index 0000000000..67c60d1b49 --- /dev/null +++ b/tests/thrusection/specific_locked/A2 @@ -0,0 +1,59 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +# +# * v3 +# | \ +# | \ +# | \ +# | \ +# | /* v2 +# | / +# | / * v4, v5 +# | / +# * +# v1 +# + +vertex v1 0 0 0 +vertex v2 5 5 0 +vertex v3 0 10 0 + +vertex v4 5 2.5 20 +vertex v5 5 2.5 -20 + +edge e1 v1 v2 +edge e2 v2 v3 +edge e3 v3 v1 + +wire w1 e1 e2 e3 + +setflags w1 locked +setflags v4 locked +setflags v5 locked + +set issolid 1 +set isruled 1 +thrusections result ${issolid} ${isruled} v4 w1 v5 -safe + + +checkprops result -s 490.101 + + +checknbshapes result -vertex 5 -edge 9 -wire 6 -face 6 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 28 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/A3 b/tests/thrusection/specific_locked/A3 new file mode 100644 index 0000000000..188bea4597 --- /dev/null +++ b/tests/thrusection/specific_locked/A3 @@ -0,0 +1,59 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +# +# * v3 +# | \ +# | \ +# | \ +# | \ +# | /* v2 +# | / +# | / * v4, v5 +# | / +# * +# v1 +# + +vertex v1 0 0 0 +vertex v2 5 5 0 +vertex v3 0 10 0 + +vertex v4 5 2.5 20 +vertex v5 5 2.5 -20 + +edge e1 v1 v2 +edge e2 v2 v3 +edge e3 v3 v1 + +wire w1 e1 e2 e3 + +set issolid 0 +set isruled 0 + +setflags w1 locked +setflags v4 locked +setflags v5 locked + +thrusections result ${issolid} ${isruled} v4 w1 v5 -safe + + +checkprops result -s 651.466 + +checknbshapes result -vertex 2 -edge 9 -wire 3 -face 3 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 18 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/A4 b/tests/thrusection/specific_locked/A4 new file mode 100644 index 0000000000..52a1e8e672 --- /dev/null +++ b/tests/thrusection/specific_locked/A4 @@ -0,0 +1,60 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +# +# * v3 +# | \ +# | \ +# | \ +# | \ +# | /* v2 +# | / +# | / * v4, v5 +# | / +# * +# v1 +# + +vertex v1 0 0 0 +vertex v2 5 5 0 +vertex v3 0 10 0 + +vertex v4 5 2.5 20 +vertex v5 5 2.5 -20 + +edge e1 v1 v2 +edge e2 v2 v3 +edge e3 v3 v1 + +wire w1 e1 e2 e3 + +setflags w1 locked +setflags v4 locked +setflags v5 locked + + +set issolid 1 +set isruled 0 +thrusections result ${issolid} ${isruled} v4 w1 v5 -safe + + +checkprops result -s 651.466 + + +checknbshapes result -vertex 2 -edge 9 -wire 3 -face 3 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 19 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/A6 b/tests/thrusection/specific_locked/A6 new file mode 100644 index 0000000000..a5e87f9f15 --- /dev/null +++ b/tests/thrusection/specific_locked/A6 @@ -0,0 +1,55 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +# +# * v2 +# / \ +# / \ +# / * \ +# / v4, v5 \ +# *----------------* v3 +# v1 +# + +vertex v1 0 0 0 +vertex v2 5 5 0 +vertex v3 10 0 0 + +vertex v4 5 2.5 20 +vertex v5 5 2.5 -20 + +edge e1 v1 v2 +edge e2 v2 v3 +edge e3 v3 v1 + +wire w1 e1 e2 e3 + +setflags w1 locked +setflags v4 locked +setflags v5 locked + +set issolid 1 +set isruled 1 +thrusections result ${issolid} ${isruled} v4 w1 v5 -safe + + +checkprops result -s 485.502 + + +checknbshapes result -vertex 5 -edge 9 -wire 6 -face 6 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 28 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/A7 b/tests/thrusection/specific_locked/A7 new file mode 100644 index 0000000000..645e9bc26c --- /dev/null +++ b/tests/thrusection/specific_locked/A7 @@ -0,0 +1,55 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +# +# * v2 +# / \ +# / \ +# / * \ +# / v4, v5 \ +# *----------------* v3 +# v1 +# + +vertex v1 0 0 0 +vertex v2 5 5 0 +vertex v3 10 0 0 + +vertex v4 5 2.5 20 +vertex v5 5 2.5 -20 + +edge e1 v1 v2 +edge e2 v2 v3 +edge e3 v3 v1 + +wire w1 e1 e2 e3 + +set issolid 0 +set isruled 0 + +setflags w1 locked +setflags v4 locked +setflags v5 locked + +thrusections result ${issolid} ${isruled} v4 w1 v5 -safe + + +checkprops result -s 646.621 + +checknbshapes result -vertex 2 -edge 9 -wire 3 -face 3 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 18 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/A8 b/tests/thrusection/specific_locked/A8 new file mode 100644 index 0000000000..2ba4a370da --- /dev/null +++ b/tests/thrusection/specific_locked/A8 @@ -0,0 +1,55 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +# +# * v2 +# / \ +# / \ +# / * \ +# / v4, v5 \ +# *----------------* v3 +# v1 +# + +vertex v1 0 0 0 +vertex v2 5 5 0 +vertex v3 10 0 0 + +vertex v4 5 2.5 20 +vertex v5 5 2.5 -20 + +edge e1 v1 v2 +edge e2 v2 v3 +edge e3 v3 v1 + +wire w1 e1 e2 e3 + +setflags w1 locked +setflags v4 locked +setflags v5 locked + +set issolid 1 +set isruled 0 +thrusections result ${issolid} ${isruled} v4 w1 v5 -safe + + +checkprops result -s 646.621 + + +checknbshapes result -vertex 2 -edge 9 -wire 3 -face 3 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 19 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/B1 b/tests/thrusection/specific_locked/B1 new file mode 100644 index 0000000000..e32c7fee99 --- /dev/null +++ b/tests/thrusection/specific_locked/B1 @@ -0,0 +1,39 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +circle c1 0 0 0 10 +mkedge e1 c1 +wire w1 e1 + +vertex v1 0 0 20 +vertex v2 0 0 -20 + +set issolid 1 +set isruled 1 +setflags w1 locked +setflags v1 locked +setflags v2 locked + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe} + + +checkprops result -s 1404.96 + + +checknbshapes result -vertex 3 -edge 5 -wire 2 -face 2 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 14 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/B2 b/tests/thrusection/specific_locked/B2 new file mode 100644 index 0000000000..b2d991bf23 --- /dev/null +++ b/tests/thrusection/specific_locked/B2 @@ -0,0 +1,39 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +circle c1 0 0 0 10 +mkedge e1 c1 +wire w1 e1 + +vertex v1 0 0 20 +vertex v2 0 0 -20 + +set issolid 0 +set isruled 0 + +setflags w1 locked +setflags v1 locked +setflags v2 locked + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe} + + +checkprops result -s 1829.23 + +checknbshapes result -vertex 2 -edge 3 -wire 1 -face 1 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 8 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/B3 b/tests/thrusection/specific_locked/B3 new file mode 100644 index 0000000000..fe3d2a128d --- /dev/null +++ b/tests/thrusection/specific_locked/B3 @@ -0,0 +1,40 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +circle c1 0 0 0 10 +mkedge e1 c1 +wire w1 e1 + +vertex v1 0 0 20 +vertex v2 0 0 -20 + +set issolid 1 +set isruled 0 + +setflags w1 locked +setflags v1 locked +setflags v2 locked + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe} + + +checkprops result -s 1829.23 + + +checknbshapes result -vertex 2 -edge 3 -wire 1 -face 1 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 9 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/B5 b/tests/thrusection/specific_locked/B5 new file mode 100644 index 0000000000..1b7446026f --- /dev/null +++ b/tests/thrusection/specific_locked/B5 @@ -0,0 +1,41 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +circle c1 0 0 0 10 +mkedge e1 c1 +wire w1 e1 + +vertex v1 40 0 20 +vertex v2 40 0 -20 + +set issolid 1 +set isruled 1 + +setflags w1 locked +setflags v1 locked +setflags v2 locked + + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe} + + +checkprops result -s 2160.94 + + +checknbshapes result -vertex 3 -edge 5 -wire 2 -face 2 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 14 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/B6 b/tests/thrusection/specific_locked/B6 new file mode 100644 index 0000000000..2f17105d3e --- /dev/null +++ b/tests/thrusection/specific_locked/B6 @@ -0,0 +1,39 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +circle c1 0 0 0 10 +mkedge e1 c1 +wire w1 e1 + +vertex v1 40 0 20 +vertex v2 40 0 -20 + +set issolid 0 +set isruled 0 + +setflags w1 locked +setflags v1 locked +setflags v2 locked + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe} + + +checkprops result -s 2556.25 + +checknbshapes result -vertex 2 -edge 3 -wire 1 -face 1 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 8 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/B7 b/tests/thrusection/specific_locked/B7 new file mode 100644 index 0000000000..54fae39339 --- /dev/null +++ b/tests/thrusection/specific_locked/B7 @@ -0,0 +1,40 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +circle c1 0 0 0 10 +mkedge e1 c1 +wire w1 e1 + +vertex v1 40 0 20 +vertex v2 40 0 -20 + +set issolid 1 +set isruled 0 + +setflags w1 locked +setflags v1 locked +setflags v2 locked + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe} + + +checkprops result -s 2556.25 + + +checknbshapes result -vertex 2 -edge 3 -wire 1 -face 1 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 9 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/B9 b/tests/thrusection/specific_locked/B9 new file mode 100644 index 0000000000..12c7c081de --- /dev/null +++ b/tests/thrusection/specific_locked/B9 @@ -0,0 +1,40 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +ellipse ellipse1 0 0 0 10 5 +mkedge e1 ellipse1 +wire w1 e1 + +vertex v1 0 0 20 +vertex v2 0 0 -20 + +set issolid 1 +set isruled 1 + +setflags w1 locked +setflags v1 locked +setflags v2 locked + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe} + + +checkprops result -s 1021.13 + + +checknbshapes result -vertex 3 -edge 5 -wire 2 -face 2 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 14 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/C1 b/tests/thrusection/specific_locked/C1 new file mode 100644 index 0000000000..5fafb9107a --- /dev/null +++ b/tests/thrusection/specific_locked/C1 @@ -0,0 +1,36 @@ +puts "============" +puts "OCC7166" +puts "============" +####################################################################### +# Improvement of API of ThruSection +####################################################################### +set BugNumber OCC7166 + +ellipse ellipse1 0 0 0 10 5 +mkedge e1 ellipse1 +wire w1 e1 + +vertex v1 0 0 20 +vertex v2 0 0 -20 + +set issolid 0 +set isruled 0 +setflags w1 locked +setflags v1 locked +setflags v2 locked + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe} + + +checkprops result -s 1346.42 + +checknbshapes result -vertex 2 -edge 3 -wire 1 -face 1 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 8 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/C2 b/tests/thrusection/specific_locked/C2 new file mode 100644 index 0000000000..400cc3852c --- /dev/null +++ b/tests/thrusection/specific_locked/C2 @@ -0,0 +1,40 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +ellipse ellipse1 0 0 0 10 5 +mkedge e1 ellipse1 +wire w1 e1 + +vertex v1 0 0 20 +vertex v2 0 0 -20 + +set issolid 1 +set isruled 0 + +setflags w1 locked +setflags v1 locked +setflags v2 locked + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe } + + +checkprops result -s 1346.42 + + +checknbshapes result -vertex 2 -edge 3 -wire 1 -face 1 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 9 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/C4 b/tests/thrusection/specific_locked/C4 new file mode 100644 index 0000000000..cec06960db --- /dev/null +++ b/tests/thrusection/specific_locked/C4 @@ -0,0 +1,40 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +ellipse ellipse1 0 0 0 10 5 +mkedge e1 ellipse1 +wire w1 e1 + +vertex v1 40 0 20 +vertex v2 40 0 -20 + +set issolid 1 +set isruled 1 + +setflags w1 locked +setflags v1 locked +setflags v2 locked + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe} + + +checkprops result -s 1353.78 + + +checknbshapes result -vertex 3 -edge 5 -wire 2 -face 2 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 14 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/C5 b/tests/thrusection/specific_locked/C5 new file mode 100644 index 0000000000..ed09ff1bcc --- /dev/null +++ b/tests/thrusection/specific_locked/C5 @@ -0,0 +1,39 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +ellipse ellipse1 0 0 0 10 5 +mkedge e1 ellipse1 +wire w1 e1 + +vertex v1 40 0 20 +vertex v2 40 0 -20 + +set issolid 0 +set isruled 0 + +setflags w1 locked +setflags v1 locked +setflags v2 locked + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe} + + +checkprops result -s 1683.87 + +checknbshapes result -vertex 2 -edge 3 -wire 1 -face 1 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 8 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/C6 b/tests/thrusection/specific_locked/C6 new file mode 100644 index 0000000000..7d55cef302 --- /dev/null +++ b/tests/thrusection/specific_locked/C6 @@ -0,0 +1,40 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +ellipse ellipse1 0 0 0 10 5 +mkedge e1 ellipse1 +wire w1 e1 + +vertex v1 40 0 20 +vertex v2 40 0 -20 + +set issolid 1 +set isruled 0 + +setflags w1 locked +setflags v1 locked +setflags v2 locked + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe} + + +checkprops result -s 1683.87 + + +checknbshapes result -vertex 2 -edge 3 -wire 1 -face 1 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 9 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/C8 b/tests/thrusection/specific_locked/C8 new file mode 100644 index 0000000000..bbc0d65a05 --- /dev/null +++ b/tests/thrusection/specific_locked/C8 @@ -0,0 +1,41 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +beziercurve bc1 5 5 5 0 5 -5 0 -5 -5 0 -5 5 0 5 5 0 +mkedge e1 bc1 +wire w1 e1 + +vertex v1 0 0 20 +vertex v2 0 0 -20 + +set issolid 1 +set isruled 1 + +setflags w1 locked +setflags v1 locked +setflags v2 locked + + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe} + + +checkprops result -s 449.295 + + +checknbshapes result -vertex 3 -edge 5 -wire 2 -face 2 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 14 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/C9 b/tests/thrusection/specific_locked/C9 new file mode 100644 index 0000000000..27b4ca1a1d --- /dev/null +++ b/tests/thrusection/specific_locked/C9 @@ -0,0 +1,39 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +beziercurve bc1 5 5 5 0 5 -5 0 -5 -5 0 -5 5 0 5 5 0 +mkedge e1 bc1 +wire w1 e1 + +vertex v1 0 0 20 +vertex v2 0 0 -20 + +set issolid 0 +set isruled 0 + +setflags w1 locked +setflags v1 locked +setflags v2 locked + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe} + + +checkprops result -s 597.473 + +checknbshapes result -vertex 2 -edge 3 -wire 1 -face 1 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 8 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/D1 b/tests/thrusection/specific_locked/D1 new file mode 100644 index 0000000000..910d8e822f --- /dev/null +++ b/tests/thrusection/specific_locked/D1 @@ -0,0 +1,39 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +beziercurve bc1 5 5 5 0 5 -5 0 -5 -5 0 -5 5 0 5 5 0 +mkedge e1 bc1 +wire w1 e1 + +vertex v1 0 0 20 +vertex v2 0 0 -20 + +set issolid 1 +set isruled 0 +setflags w1 locked +setflags v1 locked +setflags v2 locked + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe } + + +checkprops result -s 597.473 + + +checknbshapes result -vertex 2 -edge 3 -wire 1 -face 1 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 9 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/D3 b/tests/thrusection/specific_locked/D3 new file mode 100644 index 0000000000..62ad151469 --- /dev/null +++ b/tests/thrusection/specific_locked/D3 @@ -0,0 +1,40 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +beziercurve bc1 5 5 5 0 5 -5 0 -5 -5 0 -5 5 0 5 5 0 +mkedge e1 bc1 +wire w1 e1 + +vertex v1 40 0 20 +vertex v2 40 0 -20 + +set issolid 1 +set isruled 1 + +setflags w1 locked +setflags v1 locked +setflags v2 locked + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe} + + +checkprops result -s 740.079 + + +checknbshapes result -vertex 3 -edge 5 -wire 2 -face 2 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 14 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/D4 b/tests/thrusection/specific_locked/D4 new file mode 100644 index 0000000000..22b503b55f --- /dev/null +++ b/tests/thrusection/specific_locked/D4 @@ -0,0 +1,39 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +beziercurve bc1 5 5 5 0 5 -5 0 -5 -5 0 -5 5 0 5 5 0 +mkedge e1 bc1 +wire w1 e1 + +vertex v1 40 0 20 +vertex v2 40 0 -20 + +set issolid 0 +set isruled 0 + +setflags w1 locked +setflags v1 locked +setflags v2 locked + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe} + + +checkprops result -s 881.045 + +checknbshapes result -vertex 2 -edge 3 -wire 1 -face 1 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 8 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/D5 b/tests/thrusection/specific_locked/D5 new file mode 100644 index 0000000000..38124d179e --- /dev/null +++ b/tests/thrusection/specific_locked/D5 @@ -0,0 +1,38 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +beziercurve bc1 5 5 5 0 5 -5 0 -5 -5 0 -5 5 0 5 5 0 +mkedge e1 bc1 +wire w1 e1 + +vertex v1 40 0 20 +vertex v2 40 0 -20 + +set issolid 1 +set isruled 0 + +setflags w1 locked +setflags v1 locked +setflags v2 locked + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe} + + +checkprops result -s 881.045 + + +checknbshapes result -vertex 2 -edge 3 -wire 1 -face 1 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 9 +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/D7 b/tests/thrusection/specific_locked/D7 new file mode 100644 index 0000000000..02481fb28e --- /dev/null +++ b/tests/thrusection/specific_locked/D7 @@ -0,0 +1,40 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +pbsplinecurve pbc1 3 9 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 -1 0 0 1 -2 2 0 1 0 1 0 1 2 2 0 1 1 0 0 1 2 -2 0 1 0 -1 0 1 -2 -2 0 1 +mkedge e1 pbc1 +wire w1 e1 + +vertex v1 0 0 20 +vertex v2 0 0 -20 + +set issolid 1 +set isruled 1 + +setflags w1 locked +setflags v1 locked +setflags v2 locked + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe} + + +checkprops result -s 245.485 + + +checknbshapes result -vertex 3 -edge 5 -wire 2 -face 2 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 14 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/D8 b/tests/thrusection/specific_locked/D8 new file mode 100644 index 0000000000..61dc388fc8 --- /dev/null +++ b/tests/thrusection/specific_locked/D8 @@ -0,0 +1,39 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +pbsplinecurve pbc1 3 9 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 -1 0 0 1 -2 2 0 1 0 1 0 1 2 2 0 1 1 0 0 1 2 -2 0 1 0 -1 0 1 -2 -2 0 1 +mkedge e1 pbc1 +wire w1 e1 + +vertex v1 0 0 20 +vertex v2 0 0 -20 + +set issolid 0 +set isruled 0 + +setflags w1 locked +setflags v1 locked +setflags v2 locked + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe} + + +checkprops result -s 327.161 + +checknbshapes result -vertex 2 -edge 3 -wire 1 -face 1 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 8 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/D9 b/tests/thrusection/specific_locked/D9 new file mode 100644 index 0000000000..51ab82724a --- /dev/null +++ b/tests/thrusection/specific_locked/D9 @@ -0,0 +1,40 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +pbsplinecurve pbc1 3 9 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 -1 0 0 1 -2 2 0 1 0 1 0 1 2 2 0 1 1 0 0 1 2 -2 0 1 0 -1 0 1 -2 -2 0 1 +mkedge e1 pbc1 +wire w1 e1 + +vertex v1 0 0 20 +vertex v2 0 0 -20 + +set issolid 1 +set isruled 0 + +setflags w1 locked +setflags v1 locked +setflags v2 locked + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe} + + +checkprops result -s 327.161 + + +checknbshapes result -vertex 2 -edge 3 -wire 1 -face 1 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 9 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/E1 b/tests/thrusection/specific_locked/E1 new file mode 100644 index 0000000000..76590a9af2 --- /dev/null +++ b/tests/thrusection/specific_locked/E1 @@ -0,0 +1,38 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +pbsplinecurve pbc1 3 9 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 -1 0 0 1 -2 2 0 1 0 1 0 1 2 2 0 1 1 0 0 1 2 -2 0 1 0 -1 0 1 -2 -2 0 1 +mkedge e1 pbc1 +wire w1 e1 + +vertex v1 40 0 20 +vertex v2 40 0 -20 + +set issolid 0 +set isruled 1 +setflags w1 locked +setflags v1 locked +setflags v2 locked + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe} + + +checkprops result -s 400.925 + +checknbshapes result -vertex 3 -edge 5 -wire 2 -face 2 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 13 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/E2 b/tests/thrusection/specific_locked/E2 new file mode 100644 index 0000000000..68bedc9811 --- /dev/null +++ b/tests/thrusection/specific_locked/E2 @@ -0,0 +1,40 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +pbsplinecurve pbc1 3 9 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 -1 0 0 1 -2 2 0 1 0 1 0 1 2 2 0 1 1 0 0 1 2 -2 0 1 0 -1 0 1 -2 -2 0 1 +mkedge e1 pbc1 +wire w1 e1 + +vertex v1 40 0 20 +vertex v2 40 0 -20 + +set issolid 1 +set isruled 1 + +setflags w1 locked +setflags v1 locked +setflags v2 locked + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe} + + +checkprops result -s 400.925 + + +checknbshapes result -vertex 3 -edge 5 -wire 2 -face 2 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 14 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/E3 b/tests/thrusection/specific_locked/E3 new file mode 100644 index 0000000000..c570bcd71a --- /dev/null +++ b/tests/thrusection/specific_locked/E3 @@ -0,0 +1,39 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +pbsplinecurve pbc1 3 9 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 -1 0 0 1 -2 2 0 1 0 1 0 1 2 2 0 1 1 0 0 1 2 -2 0 1 0 -1 0 1 -2 -2 0 1 +mkedge e1 pbc1 +wire w1 e1 + +vertex v1 40 0 20 +vertex v2 40 0 -20 + +set issolid 0 +set isruled 0 + +setflags w1 locked +setflags v1 locked +setflags v2 locked + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe} + + +checkprops result -s 478.063 + +checknbshapes result -vertex 2 -edge 3 -wire 1 -face 1 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 8 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/E4 b/tests/thrusection/specific_locked/E4 new file mode 100644 index 0000000000..471209cc43 --- /dev/null +++ b/tests/thrusection/specific_locked/E4 @@ -0,0 +1,42 @@ +puts "TODO OCC7166 ALL: Error : The area of result shape is" + +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +pbsplinecurve pbc1 3 9 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 -1 0 0 1 -2 2 0 1 0 1 0 1 2 2 0 1 1 0 0 1 2 -2 0 1 0 -1 0 1 -2 -2 0 1 +mkedge e1 pbc1 +wire w1 e1 + +vertex v1 40 0 20 +vertex v2 40 0 -20 + +set issolid 1 +set isruled 0 + +setflags w1 locked +setflags v1 locked +setflags v2 locked + +catch {thrusections result ${issolid} ${isruled} v1 w1 v2 -safe} + + +checkprops result -s 422.859 + + +checknbshapes result -vertex 2 -edge 3 -wire 1 -face 1 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 9 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/E6 b/tests/thrusection/specific_locked/E6 new file mode 100644 index 0000000000..85c8034d35 --- /dev/null +++ b/tests/thrusection/specific_locked/E6 @@ -0,0 +1,156 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +# +# +# +# +# +# v22 v21 +# *----------------------* +# / \ +# / \ +# / v12 v11 \ +# / *---------------------* \ +# / | | \ +# / | | \ +# * v23 | * v3 | v28 * +# | | | \ | | +# | | | \ | | +# | | | \ | | +# | | | \ | | +# | | | /* v2 | | +# | | | / | | +# | | | / | | * v4, v5 +# | | | / | | +# | | * | | +# | | v1 | | +# | | | | +# | | | | +# * v24 | | v27 * +# \ | | / +# \ *---------------------* / +# \ v13 v14 / +# \ / +# \ / +# \ v25 v26 / +# *----------------------* +# +# +# + +set z1 40 +set z2 20 +set z3 0 +set z4 100 + +# begining vertex +vertex v4 55 2.5 ${z4} +# ending vertex +vertex v5 55 2.5 -${z4} + +# top triangle +vertex v1 0 0 ${z1} +vertex v2 5 5 ${z1} +vertex v3 0 10 ${z1} + +edge e1 v1 v2 +edge e2 v2 v3 +edge e3 v3 v1 + +wire w1 e1 e2 e3 + +# top quadrangle +vertex v11 15 15 ${z2} +vertex v12 -15 15 ${z2} +vertex v13 -15 -15 ${z2} +vertex v14 15 -15 ${z2} + +edge e11 v11 v12 +edge e12 v12 v13 +edge e13 v13 v14 +edge e14 v14 v11 + +wire w11 e11 e12 e13 e14 + +# top octagon +vertex v21 25 25 ${z3} +vertex v22 -25 25 ${z3} +vertex v23 -30 10 ${z3} +vertex v24 -30 -10 ${z3} +vertex v25 -25 -25 ${z3} +vertex v26 25 -25 ${z3} +vertex v27 30 -10 ${z3} +vertex v28 30 10 ${z3} + +edge e21 v21 v22 +edge e22 v22 v23 +edge e23 v23 v24 +edge e24 v24 v25 +edge e25 v25 v26 +edge e26 v26 v27 +edge e27 v27 v28 +edge e28 v28 v21 + +wire w21 e21 e22 e23 e24 e25 e26 e27 e28 + +# bottom quadrangle +vertex v111 15 15 -${z2} +vertex v112 -15 15 -${z2} +vertex v113 -15 -15 -${z2} +vertex v114 15 -15 -${z2} + +edge e111 v111 v112 +edge e112 v112 v113 +edge e113 v113 v114 +edge e114 v114 v111 + +wire w111 e111 e112 e113 e114 + +# bottom triangle +vertex v101 0 0 -${z1} +vertex v102 5 5 -${z1} +vertex v103 0 10 -${z1} + +edge e101 v101 v102 +edge e102 v102 v103 +edge e103 v103 v101 + +wire w101 e101 e102 e103 + + +# +set issolid 1 +set isruled 1 + +setflags w1 locked +setflags v4 locked +setflags w11 locked +setflags w21 locked +setflags w111 locked +setflags w101 locked +setflags v5 locked + +thrusections result ${issolid} ${isruled} v4 w1 w11 w21 w111 w101 v5 -safe + + +checkprops result -s 12651.5 + + +checknbshapes result -vertex 57 -edge 121 -wire 66 -face 66 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 312 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/E7 b/tests/thrusection/specific_locked/E7 new file mode 100644 index 0000000000..02170a4856 --- /dev/null +++ b/tests/thrusection/specific_locked/E7 @@ -0,0 +1,155 @@ +puts "TODO OCC7166 ALL: Error : The area of result shape is" + +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +# +# +# +# +# +# v22 v21 +# *----------------------* +# / \ +# / \ +# / v12 v11 \ +# / *---------------------* \ +# / | | \ +# / | | \ +# * v23 | * v3 | v28 * +# | | | \ | | +# | | | \ | | +# | | | \ | | +# | | | \ | | +# | | | /* v2 | | +# | | | / | | +# | | | / | | * v4, v5 +# | | | / | | +# | | * | | +# | | v1 | | +# | | | | +# | | | | +# * v24 | | v27 * +# \ | | / +# \ *---------------------* / +# \ v13 v14 / +# \ / +# \ / +# \ v25 v26 / +# *----------------------* +# +# +# + +set z1 40 +set z2 20 +set z3 0 +set z4 100 + +# begining vertex +vertex v4 55 2.5 ${z4} +# ending vertex +vertex v5 55 2.5 -${z4} + +# top triangle +vertex v1 0 0 ${z1} +vertex v2 5 5 ${z1} +vertex v3 0 10 ${z1} + +edge e1 v1 v2 +edge e2 v2 v3 +edge e3 v3 v1 + +wire w1 e1 e2 e3 + +# top quadrangle +vertex v11 15 15 ${z2} +vertex v12 -15 15 ${z2} +vertex v13 -15 -15 ${z2} +vertex v14 15 -15 ${z2} + +edge e11 v11 v12 +edge e12 v12 v13 +edge e13 v13 v14 +edge e14 v14 v11 + +wire w11 e11 e12 e13 e14 + +# top octagon +vertex v21 25 25 ${z3} +vertex v22 -25 25 ${z3} +vertex v23 -30 10 ${z3} +vertex v24 -30 -10 ${z3} +vertex v25 -25 -25 ${z3} +vertex v26 25 -25 ${z3} +vertex v27 30 -10 ${z3} +vertex v28 30 10 ${z3} + +edge e21 v21 v22 +edge e22 v22 v23 +edge e23 v23 v24 +edge e24 v24 v25 +edge e25 v25 v26 +edge e26 v26 v27 +edge e27 v27 v28 +edge e28 v28 v21 + +wire w21 e21 e22 e23 e24 e25 e26 e27 e28 + +# bottom quadrangle +vertex v111 15 15 -${z2} +vertex v112 -15 15 -${z2} +vertex v113 -15 -15 -${z2} +vertex v114 15 -15 -${z2} + +edge e111 v111 v112 +edge e112 v112 v113 +edge e113 v113 v114 +edge e114 v114 v111 + +wire w111 e111 e112 e113 e114 + +# bottom triangle +vertex v101 0 0 -${z1} +vertex v102 5 5 -${z1} +vertex v103 0 10 -${z1} + +edge e101 v101 v102 +edge e102 v102 v103 +edge e103 v103 v101 + +wire w101 e101 e102 e103 + +setflags v4 locked +setflags w1 locked +setflags w11 locked +setflags w21 locked +setflags w111 locked +setflags w101 locked +setflags v5 locked + +# +set issolid 0 +set isruled 0 +thrusections result ${issolid} ${isruled} v4 w1 w11 w21 w111 w101 v5 -safe + + +checkprops result -s 56691.9 + +checknbshapes result -vertex 2 -edge 33 -wire 11 -face 11 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 58 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/E8 b/tests/thrusection/specific_locked/E8 new file mode 100644 index 0000000000..f691491927 --- /dev/null +++ b/tests/thrusection/specific_locked/E8 @@ -0,0 +1,156 @@ +puts "TODO OCC7166 ALL: Error : The area of result shape is" + +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +# +# +# +# +# +# v22 v21 +# *----------------------* +# / \ +# / \ +# / v12 v11 \ +# / *---------------------* \ +# / | | \ +# / | | \ +# * v23 | * v3 | v28 * +# | | | \ | | +# | | | \ | | +# | | | \ | | +# | | | \ | | +# | | | /* v2 | | +# | | | / | | +# | | | / | | * v4, v5 +# | | | / | | +# | | * | | +# | | v1 | | +# | | | | +# | | | | +# * v24 | | v27 * +# \ | | / +# \ *---------------------* / +# \ v13 v14 / +# \ / +# \ / +# \ v25 v26 / +# *----------------------* +# +# +# + +set z1 40 +set z2 20 +set z3 0 +set z4 100 + +# begining vertex +vertex v4 55 2.5 ${z4} +# ending vertex +vertex v5 55 2.5 -${z4} + +# top triangle +vertex v1 0 0 ${z1} +vertex v2 5 5 ${z1} +vertex v3 0 10 ${z1} + +edge e1 v1 v2 +edge e2 v2 v3 +edge e3 v3 v1 + +wire w1 e1 e2 e3 + +# top quadrangle +vertex v11 15 15 ${z2} +vertex v12 -15 15 ${z2} +vertex v13 -15 -15 ${z2} +vertex v14 15 -15 ${z2} + +edge e11 v11 v12 +edge e12 v12 v13 +edge e13 v13 v14 +edge e14 v14 v11 + +wire w11 e11 e12 e13 e14 + +# top octagon +vertex v21 25 25 ${z3} +vertex v22 -25 25 ${z3} +vertex v23 -30 10 ${z3} +vertex v24 -30 -10 ${z3} +vertex v25 -25 -25 ${z3} +vertex v26 25 -25 ${z3} +vertex v27 30 -10 ${z3} +vertex v28 30 10 ${z3} + +edge e21 v21 v22 +edge e22 v22 v23 +edge e23 v23 v24 +edge e24 v24 v25 +edge e25 v25 v26 +edge e26 v26 v27 +edge e27 v27 v28 +edge e28 v28 v21 + +wire w21 e21 e22 e23 e24 e25 e26 e27 e28 + +# bottom quadrangle +vertex v111 15 15 -${z2} +vertex v112 -15 15 -${z2} +vertex v113 -15 -15 -${z2} +vertex v114 15 -15 -${z2} + +edge e111 v111 v112 +edge e112 v112 v113 +edge e113 v113 v114 +edge e114 v114 v111 + +wire w111 e111 e112 e113 e114 + +# bottom triangle +vertex v101 0 0 -${z1} +vertex v102 5 5 -${z1} +vertex v103 0 10 -${z1} + +edge e101 v101 v102 +edge e102 v102 v103 +edge e103 v103 v101 + +wire w101 e101 e102 e103 + +setflags v4 locked +setflags w1 locked +setflags w11 locked +setflags w21 locked +setflags w111 locked +setflags w101 locked +setflags v5 locked + +# +set issolid 1 +set isruled 0 +thrusections result ${issolid} ${isruled} v4 w1 w11 w21 w111 w101 v5 -safe + + +checkprops result -s 56691.9 + + +checknbshapes result -vertex 2 -edge 33 -wire 11 -face 11 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 59 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/F1 b/tests/thrusection/specific_locked/F1 new file mode 100644 index 0000000000..a83c817328 --- /dev/null +++ b/tests/thrusection/specific_locked/F1 @@ -0,0 +1,155 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +# +# +# +# +# +# v22 v21 +# *----------------------* +# / \ +# / \ +# / v12 v11 \ +# / *---------------------* \ +# / | | \ +# / | | \ +# * v23 | * v3 | v28 * +# | | | \ | | +# | | | \ | | +# | | | \ | | +# | | | \ | | +# | | | /* v2 | | +# | | | / | | +# | | | / | | * v4, v5 +# | | | / | | +# | | * | | +# | | v1 | | +# | | | | +# | | | | +# * v24 | | v27 * +# \ | | / +# \ *---------------------* / +# \ v13 v14 / +# \ / +# \ / +# \ v25 v26 / +# *----------------------* +# +# +# + +set z1 40 +set z2 20 +set z3 0 +set z4 100 + +# begining vertex +vertex v4 2.5 5 ${z4} +# ending vertex +vertex v5 2.5 5 -${z4} + +# top triangle +vertex v1 0 0 ${z1} +vertex v2 5 5 ${z1} +vertex v3 0 10 ${z1} + +edge e1 v1 v2 +edge e2 v2 v3 +edge e3 v3 v1 + +wire w1 e1 e2 e3 + +# top quadrangle +vertex v11 15 15 ${z2} +vertex v12 -15 15 ${z2} +vertex v13 -15 -15 ${z2} +vertex v14 15 -15 ${z2} + +edge e11 v11 v12 +edge e12 v12 v13 +edge e13 v13 v14 +edge e14 v14 v11 + +wire w11 e11 e12 e13 e14 + +# top octagon +vertex v21 25 25 ${z3} +vertex v22 -25 25 ${z3} +vertex v23 -30 10 ${z3} +vertex v24 -30 -10 ${z3} +vertex v25 -25 -25 ${z3} +vertex v26 25 -25 ${z3} +vertex v27 30 -10 ${z3} +vertex v28 30 10 ${z3} + +edge e21 v21 v22 +edge e22 v22 v23 +edge e23 v23 v24 +edge e24 v24 v25 +edge e25 v25 v26 +edge e26 v26 v27 +edge e27 v27 v28 +edge e28 v28 v21 + +wire w21 e21 e22 e23 e24 e25 e26 e27 e28 + +# bottom quadrangle +vertex v111 15 15 -${z2} +vertex v112 -15 15 -${z2} +vertex v113 -15 -15 -${z2} +vertex v114 15 -15 -${z2} + +edge e111 v111 v112 +edge e112 v112 v113 +edge e113 v113 v114 +edge e114 v114 v111 + +wire w111 e111 e112 e113 e114 + +# bottom triangle +vertex v101 0 0 -${z1} +vertex v102 5 5 -${z1} +vertex v103 0 10 -${z1} + +edge e101 v101 v102 +edge e102 v102 v103 +edge e103 v103 v101 + +wire w101 e101 e102 e103 + +setflags v4 locked +setflags w1 locked +setflags w11 locked +setflags w21 locked +setflags w111 locked +setflags w101 locked +setflags v5 locked + + +# +set issolid 1 +set isruled 1 +thrusections result ${issolid} ${isruled} v4 w1 w11 w21 w111 w101 v5 -safe + + +checkprops result -s 12301.8 + + +checknbshapes result -vertex 57 -edge 121 -wire 66 -face 66 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 312 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/F2 b/tests/thrusection/specific_locked/F2 new file mode 100644 index 0000000000..7319643954 --- /dev/null +++ b/tests/thrusection/specific_locked/F2 @@ -0,0 +1,156 @@ +puts "TODO OCC7166 ALL: Error : The area of result shape is" + +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +# +# +# +# +# +# v22 v21 +# *----------------------* +# / \ +# / \ +# / v12 v11 \ +# / *---------------------* \ +# / | | \ +# / | | \ +# * v23 | * v3 | v28 * +# | | | \ | | +# | | | \ | | +# | | | \ | | +# | | | \ | | +# | | | /* v2 | | +# | | | / | | +# | | | / | | * v4, v5 +# | | | / | | +# | | * | | +# | | v1 | | +# | | | | +# | | | | +# * v24 | | v27 * +# \ | | / +# \ *---------------------* / +# \ v13 v14 / +# \ / +# \ / +# \ v25 v26 / +# *----------------------* +# +# +# + +set z1 40 +set z2 20 +set z3 0 +set z4 100 + +# begining vertex +vertex v4 2.5 5 ${z4} +# ending vertex +vertex v5 2.5 5 -${z4} + +# top triangle +vertex v1 0 0 ${z1} +vertex v2 5 5 ${z1} +vertex v3 0 10 ${z1} + +edge e1 v1 v2 +edge e2 v2 v3 +edge e3 v3 v1 + +wire w1 e1 e2 e3 + +# top quadrangle +vertex v11 15 15 ${z2} +vertex v12 -15 15 ${z2} +vertex v13 -15 -15 ${z2} +vertex v14 15 -15 ${z2} + +edge e11 v11 v12 +edge e12 v12 v13 +edge e13 v13 v14 +edge e14 v14 v11 + +wire w11 e11 e12 e13 e14 + +# top octagon +vertex v21 25 25 ${z3} +vertex v22 -25 25 ${z3} +vertex v23 -30 10 ${z3} +vertex v24 -30 -10 ${z3} +vertex v25 -25 -25 ${z3} +vertex v26 25 -25 ${z3} +vertex v27 30 -10 ${z3} +vertex v28 30 10 ${z3} + +edge e21 v21 v22 +edge e22 v22 v23 +edge e23 v23 v24 +edge e24 v24 v25 +edge e25 v25 v26 +edge e26 v26 v27 +edge e27 v27 v28 +edge e28 v28 v21 + +wire w21 e21 e22 e23 e24 e25 e26 e27 e28 + +# bottom quadrangle +vertex v111 15 15 -${z2} +vertex v112 -15 15 -${z2} +vertex v113 -15 -15 -${z2} +vertex v114 15 -15 -${z2} + +edge e111 v111 v112 +edge e112 v112 v113 +edge e113 v113 v114 +edge e114 v114 v111 + +wire w111 e111 e112 e113 e114 + +# bottom triangle +vertex v101 0 0 -${z1} +vertex v102 5 5 -${z1} +vertex v103 0 10 -${z1} + +edge e101 v101 v102 +edge e102 v102 v103 +edge e103 v103 v101 + +wire w101 e101 e102 e103 + +setflags v4 locked +setflags w1 locked +setflags w11 locked +setflags w21 locked +setflags w111 locked +setflags w101 locked +setflags v5 locked + + +# +set issolid 0 +set isruled 0 +thrusections result ${issolid} ${isruled} v4 w1 w11 w21 w111 w101 v5 -safe + + +checkprops result -s 37693.9 + +checknbshapes result -vertex 2 -edge 33 -wire 11 -face 11 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 58 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/F3 b/tests/thrusection/specific_locked/F3 new file mode 100644 index 0000000000..0008b0cfba --- /dev/null +++ b/tests/thrusection/specific_locked/F3 @@ -0,0 +1,157 @@ +puts "TODO OCC7166 ALL: Error : The area of result shape is" + +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +# +# +# +# +# +# v22 v21 +# *----------------------* +# / \ +# / \ +# / v12 v11 \ +# / *---------------------* \ +# / | | \ +# / | | \ +# * v23 | * v3 | v28 * +# | | | \ | | +# | | | \ | | +# | | | \ | | +# | | | \ | | +# | | | /* v2 | | +# | | | / | | +# | | | / | | * v4, v5 +# | | | / | | +# | | * | | +# | | v1 | | +# | | | | +# | | | | +# * v24 | | v27 * +# \ | | / +# \ *---------------------* / +# \ v13 v14 / +# \ / +# \ / +# \ v25 v26 / +# *----------------------* +# +# +# + +set z1 40 +set z2 20 +set z3 0 +set z4 100 + +# begining vertex +vertex v4 2.5 5 ${z4} +# ending vertex +vertex v5 2.5 5 -${z4} + +# top triangle +vertex v1 0 0 ${z1} +vertex v2 5 5 ${z1} +vertex v3 0 10 ${z1} + +edge e1 v1 v2 +edge e2 v2 v3 +edge e3 v3 v1 + +wire w1 e1 e2 e3 + +# top quadrangle +vertex v11 15 15 ${z2} +vertex v12 -15 15 ${z2} +vertex v13 -15 -15 ${z2} +vertex v14 15 -15 ${z2} + +edge e11 v11 v12 +edge e12 v12 v13 +edge e13 v13 v14 +edge e14 v14 v11 + +wire w11 e11 e12 e13 e14 + +# top octagon +vertex v21 25 25 ${z3} +vertex v22 -25 25 ${z3} +vertex v23 -30 10 ${z3} +vertex v24 -30 -10 ${z3} +vertex v25 -25 -25 ${z3} +vertex v26 25 -25 ${z3} +vertex v27 30 -10 ${z3} +vertex v28 30 10 ${z3} + +edge e21 v21 v22 +edge e22 v22 v23 +edge e23 v23 v24 +edge e24 v24 v25 +edge e25 v25 v26 +edge e26 v26 v27 +edge e27 v27 v28 +edge e28 v28 v21 + +wire w21 e21 e22 e23 e24 e25 e26 e27 e28 + +# bottom quadrangle +vertex v111 15 15 -${z2} +vertex v112 -15 15 -${z2} +vertex v113 -15 -15 -${z2} +vertex v114 15 -15 -${z2} + +edge e111 v111 v112 +edge e112 v112 v113 +edge e113 v113 v114 +edge e114 v114 v111 + +wire w111 e111 e112 e113 e114 + +# bottom triangle +vertex v101 0 0 -${z1} +vertex v102 5 5 -${z1} +vertex v103 0 10 -${z1} + +edge e101 v101 v102 +edge e102 v102 v103 +edge e103 v103 v101 + +wire w101 e101 e102 e103 + +setflags v4 locked +setflags w1 locked +setflags w11 locked +setflags w21 locked +setflags w111 locked +setflags w101 locked +setflags v5 locked + + +# +set issolid 1 +set isruled 0 +thrusections result ${issolid} ${isruled} v4 w1 w11 w21 w111 w101 v5 -safe + + +checkprops result -s 37693.9 + + +checknbshapes result -vertex 2 -edge 33 -wire 11 -face 11 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 59 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/F5 b/tests/thrusection/specific_locked/F5 new file mode 100644 index 0000000000..cdf66fe9fe --- /dev/null +++ b/tests/thrusection/specific_locked/F5 @@ -0,0 +1,50 @@ +puts "TODO OCC7166 ALL: Error : is WRONG because number of " + +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +pbsplinecurve pbc1 3 9 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 -1 0 0 1 -2 2 0 1 0 1 0 1 2 2 0 1 1 0 0 1 2 -2 0 1 0 -1 0 1 -2 -2 0 1 +mkedge e1 pbc1 +wire w1 e1 + +#vertex v1 0 0 20 +#vertex v2 0 0 -20 +circle c1 0 0 20 0 0 -1 -1 1 0 0.1 +mkedge ec1 c1 +wire wc1 ec1 + +circle c2 0 0 -20 0 0 -1 -1 1 0 0.1 +mkedge ec2 c2 +wire wc2 ec2 + +set issolid 1 +set isruled 1 + +setflags wc1 locked +setflags w1 locked +setflags wc2 locked + +#catch {thrusections result ${issolid} ${isruled} v1 w1 v2} +catch {thrusections result ${issolid} ${isruled} wc1 w1 wc2 -safe} + + +checkprops result -s 256.875 + + +checknbshapes result -vertex 6 -edge 10 -wire 6 -face 6 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 30 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/F6 b/tests/thrusection/specific_locked/F6 new file mode 100644 index 0000000000..f9acb74d97 --- /dev/null +++ b/tests/thrusection/specific_locked/F6 @@ -0,0 +1,50 @@ +puts "TODO OCC7166 ALL: Faulty OCC7166 : result is not Closed shape" +puts "TODO OCC7166 ALL: Error : is WRONG because number of " + +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +pbsplinecurve pbc1 3 9 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 -1 0 0 1 -2 2 0 1 0 1 0 1 2 2 0 1 1 0 0 1 2 -2 0 1 0 -1 0 1 -2 -2 0 1 +mkedge e1 pbc1 +wire w1 e1 + +#vertex v1 0 0 20 +#vertex v2 0 0 -20 +circle c1 0 0 20 0 0 -1 -1 1 0 0.1 +mkedge ec1 c1 +wire wc1 ec1 + +circle c2 0 0 -20 0 0 -1 -1 1 0 0.1 +mkedge ec2 c2 +wire wc2 ec2 + +set issolid 0 +set isruled 0 + +setflags wc1 locked +setflags w1 locked +setflags wc2 locked + +#catch {thrusections result ${issolid} ${isruled} v1 w1 v2} +catch {thrusections result ${issolid} ${isruled} wc1 w1 wc2 -safe} + + +checkprops result -s 332.724 + +checknbshapes result -vertex 4 -edge 6 -wire 2 -face 2 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 15 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/F7 b/tests/thrusection/specific_locked/F7 new file mode 100644 index 0000000000..f41a5824d3 --- /dev/null +++ b/tests/thrusection/specific_locked/F7 @@ -0,0 +1,51 @@ +puts "TODO OCC7166 ALL: Error : is WRONG because number of " +puts "TODO OCC7166 ALL: Error : The area of result shape is" + +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +pbsplinecurve pbc1 3 9 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 -1 0 0 1 -2 2 0 1 0 1 0 1 2 2 0 1 1 0 0 1 2 -2 0 1 0 -1 0 1 -2 -2 0 1 +mkedge e1 pbc1 +wire w1 e1 + +##vertex v1 0 0 20 +#vertex v2 0 0 -20 +circle c1 0 0 20 0 0 -1 -1 1 0 0.1 +mkedge ec1 c1 +wire wc1 ec1 + +circle c2 0 0 -20 0 0 -1 -1 1 0 0.1 +mkedge ec2 c2 +wire wc2 ec2 + +set issolid 1 +set isruled 0 + +setflags wc1 locked +setflags w1 locked +setflags wc2 locked + +#catch {thrusections result ${issolid} ${isruled} v1 w1 v2 } +catch {thrusections result ${issolid} ${isruled} wc1 w1 wc2 -safe} + + +checkprops result -s 314.974 + + +checknbshapes result -vertex 2 -edge 3 -wire 1 -face 1 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 9 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/F9 b/tests/thrusection/specific_locked/F9 new file mode 100644 index 0000000000..ae4da3d21f --- /dev/null +++ b/tests/thrusection/specific_locked/F9 @@ -0,0 +1,51 @@ +puts "TODO OCC7166 ALL: Error : is WRONG because number of " + +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +pbsplinecurve pbc1 3 9 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 -1 0 0 1 -2 2 0 1 0 1 0 1 2 2 0 1 1 0 0 1 2 -2 0 1 0 -1 0 1 -2 -2 0 1 +mkedge e1 pbc1 +wire w1 e1 + +#vertex v1 40 0 20 +#vertex v2 40 0 -20 +circle c1 40 0 20 0 0 -1 -1 1 0 0.1 +mkedge ec1 c1 +wire wc1 ec1 + +circle c2 40 0 -20 0 0 -1 -1 1 0 0.1 +mkedge ec2 c2 +wire wc2 ec2 + +set issolid 1 +set isruled 1 + +setflags wc1 locked +setflags w1 locked +setflags wc2 locked + + +#catch {thrusections result ${issolid} ${isruled} v1 w1 v2} +catch {thrusections result ${issolid} ${isruled} wc1 w1 wc2 -safe} + + +checkprops result -s 419.166 + + +checknbshapes result -vertex 6 -edge 10 -wire 6 -face 6 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 30 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/G1 b/tests/thrusection/specific_locked/G1 new file mode 100644 index 0000000000..e384592adb --- /dev/null +++ b/tests/thrusection/specific_locked/G1 @@ -0,0 +1,51 @@ +puts "TODO OCC7166 ALL: Faulty OCC7166 : result is not Closed shape" +puts "TODO OCC7166 ALL: Error : is WRONG because number of " +puts "TODO OCC7166 ALL: Error : The area of result shape is" + +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +pbsplinecurve pbc1 3 9 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 -1 0 0 1 -2 2 0 1 0 1 0 1 2 2 0 1 1 0 0 1 2 -2 0 1 0 -1 0 1 -2 -2 0 1 +mkedge e1 pbc1 +wire w1 e1 + +#vertex v1 40 0 20 +#vertex v2 40 0 -20 +circle c1 40 0 20 0 0 -1 -1 1 0 0.1 +mkedge ec1 c1 +wire wc1 ec1 + +circle c2 40 0 -20 0 0 -1 -1 1 0 0.1 +mkedge ec2 c2 +wire wc2 ec2 + +set issolid 0 +set isruled 0 + +setflags wc1 locked +setflags w1 locked +setflags wc2 locked + +#catch {thrusections result ${issolid} ${isruled} v1 w1 v2} +catch {thrusections result ${issolid} ${isruled} wc1 w1 wc2 -safe} + + +checkprops result -s 702.858 + +checknbshapes result -vertex 4 -edge 6 -wire 2 -face 2 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 15 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/G2 b/tests/thrusection/specific_locked/G2 new file mode 100644 index 0000000000..3f6bac6866 --- /dev/null +++ b/tests/thrusection/specific_locked/G2 @@ -0,0 +1,51 @@ +puts "TODO OCC7166 ALL: Error : is WRONG because number of " +puts "TODO OCC7166 ALL: Error : The area of result shape is" + +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +pbsplinecurve pbc1 3 9 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 -1 0 0 1 -2 2 0 1 0 1 0 1 2 2 0 1 1 0 0 1 2 -2 0 1 0 -1 0 1 -2 -2 0 1 +mkedge e1 pbc1 +wire w1 e1 + +#vertex v1 40 0 20 +#vertex v2 40 0 -20 +circle c1 40 0 20 0 0 -1 -1 1 0 0.1 +mkedge ec1 c1 +wire wc1 ec1 + +circle c2 40 0 -20 0 0 -1 -1 1 0 0.1 +mkedge ec2 c2 +wire wc2 ec2 + +set issolid 1 +set isruled 0 + +setflags wc1 locked +setflags w1 locked +setflags wc2 locked + +#catch {thrusections result ${issolid} ${isruled} v1 w1 v2 } +catch {thrusections result ${issolid} ${isruled} wc1 w1 wc2 -safe} + + +checkprops result -s 702.921 + + +checknbshapes result -vertex 4 -edge 6 -wire 4 -face 4 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 20 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/G4 b/tests/thrusection/specific_locked/G4 new file mode 100644 index 0000000000..bf823e5460 --- /dev/null +++ b/tests/thrusection/specific_locked/G4 @@ -0,0 +1,183 @@ +puts "TODO OCC7166 ALL: Error : is WRONG because number of " + +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +# +# +# +# +# +# v22 v21 +# *----------------------* +# / \ +# / \ +# / v12 v11 \ +# / *---------------------* \ +# / | | \ +# / | | \ +# * v23 | * v3 | v28 * +# | | | \ | | +# | | | \ | | +# | | | \ | | +# | | | \ | | +# | | | /* v2 | | +# | | | / | | +# | | | / | | * v4, v5 +# | | | / | | +# | | * | | +# | | v1 | | +# | | | | +# | | | | +# * v24 | | v27 * +# \ | | / +# \ *---------------------* / +# \ v13 v14 / +# \ / +# \ / +# \ v25 v26 / +# *----------------------* +# +# +# + +set z1 40 +set z2 20 +set z3 0 +set z4 100 +set z5 30 +set z6 10 + +# begining vertex +vertex v4 55 2.5 ${z4} +# ending vertex +vertex v5 55 2.5 -${z4} + +# top triangle +vertex v1 0 0 ${z1} +vertex v2 5 5 ${z1} +vertex v3 0 10 ${z1} + +edge e1 v1 v2 +edge e2 v2 v3 +edge e3 v3 v1 + +wire w1 e1 e2 e3 + +# top beziercurve +beziercurve bzc1 5 5 5 ${z5} 5 -5 ${z5} -5 -5 ${z5} -5 5 ${z5} 5 5 ${z5} +mkedge ebzc1 bzc1 +wire wbzc1 ebzc1 + +# top quadrangle +vertex v11 15 15 ${z2} +vertex v12 -15 15 ${z2} +vertex v13 -15 -15 ${z2} +vertex v14 15 -15 ${z2} + +edge e11 v11 v12 +edge e12 v12 v13 +edge e13 v13 v14 +edge e14 v14 v11 + +wire w11 e11 e12 e13 e14 + +# top pbsplinecurve +pbsplinecurve pbc1 3 9 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 -1 0 ${z6} 1 -2 2 ${z6} 1 0 1 ${z6} 1 2 2 ${z6} 1 1 0 ${z6} 1 2 -2 ${z6} 1 0 -1 ${z6} 1 -2 -2 ${z6} 1 +mkedge epbc1 pbc1 +wire wpbc1 epbc1 + +# octagon +vertex v21 25 25 ${z3} +vertex v22 -25 25 ${z3} +vertex v23 -30 10 ${z3} +vertex v24 -30 -10 ${z3} +vertex v25 -25 -25 ${z3} +vertex v26 25 -25 ${z3} +vertex v27 30 -10 ${z3} +vertex v28 30 10 ${z3} + +edge e21 v21 v22 +edge e22 v22 v23 +edge e23 v23 v24 +edge e24 v24 v25 +edge e25 v25 v26 +edge e26 v26 v27 +edge e27 v27 v28 +edge e28 v28 v21 + +wire w21 e21 e22 e23 e24 e25 e26 e27 e28 + +# bottom pbsplinecurve +pbsplinecurve pbc2 3 9 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 -1 0 -${z6} 1 -2 2 -${z6} 1 0 1 -${z6} 1 2 2 -${z6} 1 1 0 -${z6} 1 2 -2 -${z6} 1 0 -1 -${z6} 1 -2 -2 -${z6} 1 +mkedge epbc2 pbc2 +wire wpbc2 epbc2 + +# bottom quadrangle +vertex v111 15 15 -${z2} +vertex v112 -15 15 -${z2} +vertex v113 -15 -15 -${z2} +vertex v114 15 -15 -${z2} + +edge e111 v111 v112 +edge e112 v112 v113 +edge e113 v113 v114 +edge e114 v114 v111 + +wire w111 e111 e112 e113 e114 + +# bottom beziercurve +beziercurve bzc2 5 5 5 -${z5} 5 -5 -${z5} -5 -5 -${z5} -5 5 -${z5} 5 5 -${z5} +mkedge ebzc2 bzc2 +wire wbzc2 ebzc2 + +# bottom triangle +vertex v101 0 0 -${z1} +vertex v102 5 5 -${z1} +vertex v103 0 10 -${z1} + +edge e101 v101 v102 +edge e102 v102 v103 +edge e103 v103 v101 + +wire w101 e101 e102 e103 + +setflags v4 locked +setflags w1 locked +setflags wbzc1 locked +setflags w11 locked +setflags wpbc1 locked +setflags wpbc2 locked +setflags w111 locked +setflags wbzc2 locked +setflags w101 locked +setflags v5 locked +setflags w21 locked + +# +set issolid 1 +set isruled 1 +#thrusections result ${issolid} ${isruled} v4 w1 w11 w21 w111 w101 v5 +thrusections result ${issolid} ${isruled} v4 w1 wbzc1 w11 wpbc1 w21 wpbc2 w111 wbzc2 w101 v5 -safe + + +checkprops result -s 12786.5 + + +checknbshapes result -vertex 101 -edge 209 -wire 110 -face 110 -shell 1 -solid 2 -compsolid 0 -compound 0 -shape 532 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/G6 b/tests/thrusection/specific_locked/G6 new file mode 100644 index 0000000000..ea646acc36 --- /dev/null +++ b/tests/thrusection/specific_locked/G6 @@ -0,0 +1,181 @@ +puts "============" +puts "OCC7166" +puts "============" +puts "" +####################################################################### +# Improvement of API of ThruSection +####################################################################### + +set BugNumber OCC7166 + +# +# +# +# +# +# v22 v21 +# *----------------------* +# / \ +# / \ +# / v12 v11 \ +# / *---------------------* \ +# / | | \ +# / | | \ +# * v23 | * v3 | v28 * +# | | | \ | | +# | | | \ | | +# | | | \ | | +# | | | \ | | +# | | | /* v2 | | +# | | | / | | +# | | | / | | * v4, v5 +# | | | / | | +# | | * | | +# | | v1 | | +# | | | | +# | | | | +# * v24 | | v27 * +# \ | | / +# \ *---------------------* / +# \ v13 v14 / +# \ / +# \ / +# \ v25 v26 / +# *----------------------* +# +# +# + +set z1 40 +set z2 20 +set z3 0 +set z4 100 +set z5 30 +set z6 10 + +# begining vertex +vertex v4 2.5 5 ${z4} +# ending vertex +vertex v5 2.5 5 -${z4} + +# top triangle +vertex v1 0 0 ${z1} +vertex v2 5 5 ${z1} +vertex v3 0 10 ${z1} + +edge e1 v1 v2 +edge e2 v2 v3 +edge e3 v3 v1 + +wire w1 e1 e2 e3 + +# top beziercurve +beziercurve bzc1 5 5 5 ${z5} 5 -5 ${z5} -5 -5 ${z5} -5 5 ${z5} 5 5 ${z5} +mkedge ebzc1 bzc1 +wire wbzc1 ebzc1 + +# top quadrangle +vertex v11 15 15 ${z2} +vertex v12 -15 15 ${z2} +vertex v13 -15 -15 ${z2} +vertex v14 15 -15 ${z2} + +edge e11 v11 v12 +edge e12 v12 v13 +edge e13 v13 v14 +edge e14 v14 v11 + +wire w11 e11 e12 e13 e14 + +# top pbsplinecurve +pbsplinecurve pbc1 3 9 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 -1 0 ${z6} 1 -2 2 ${z6} 1 0 1 ${z6} 1 2 2 ${z6} 1 1 0 ${z6} 1 2 -2 ${z6} 1 0 -1 ${z6} 1 -2 -2 ${z6} 1 +mkedge epbc1 pbc1 +wire wpbc1 epbc1 + +# octagon +vertex v21 25 25 ${z3} +vertex v22 -25 25 ${z3} +vertex v23 -30 10 ${z3} +vertex v24 -30 -10 ${z3} +vertex v25 -25 -25 ${z3} +vertex v26 25 -25 ${z3} +vertex v27 30 -10 ${z3} +vertex v28 30 10 ${z3} + +edge e21 v21 v22 +edge e22 v22 v23 +edge e23 v23 v24 +edge e24 v24 v25 +edge e25 v25 v26 +edge e26 v26 v27 +edge e27 v27 v28 +edge e28 v28 v21 + +wire w21 e21 e22 e23 e24 e25 e26 e27 e28 + +# bottom pbsplinecurve +pbsplinecurve pbc2 3 9 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 -1 0 -${z6} 1 -2 2 -${z6} 1 0 1 -${z6} 1 2 2 -${z6} 1 1 0 -${z6} 1 2 -2 -${z6} 1 0 -1 -${z6} 1 -2 -2 -${z6} 1 +mkedge epbc2 pbc2 +wire wpbc2 epbc2 + +# bottom quadrangle +vertex v111 15 15 -${z2} +vertex v112 -15 15 -${z2} +vertex v113 -15 -15 -${z2} +vertex v114 15 -15 -${z2} + +edge e111 v111 v112 +edge e112 v112 v113 +edge e113 v113 v114 +edge e114 v114 v111 + +wire w111 e111 e112 e113 e114 + +# bottom beziercurve +beziercurve bzc2 5 5 5 -${z5} 5 -5 -${z5} -5 -5 -${z5} -5 5 -${z5} 5 5 -${z5} +mkedge ebzc2 bzc2 +wire wbzc2 ebzc2 + +# bottom triangle +vertex v101 0 0 -${z1} +vertex v102 5 5 -${z1} +vertex v103 0 10 -${z1} + +edge e101 v101 v102 +edge e102 v102 v103 +edge e103 v103 v101 + +wire w101 e101 e102 e103 + +setflags v4 locked +setflags w1 locked +setflags wbzc1 locked +setflags w11 locked +setflags wpbc1 locked +setflags w21 locked +setflags wpbc2 locked +setflags w111 locked +setflags wbzc2 locked +setflags w101 locked +setflags v5 locked + +# +set issolid 1 +set isruled 1 +#thrusections result ${issolid} ${isruled} v4 w1 w11 w21 w111 w101 v5 +thrusections result ${issolid} ${isruled} v4 w1 wbzc1 w11 wpbc1 w21 wpbc2 w111 wbzc2 w101 v5 -safe + + +checkprops result -s 12436.8 + + +checknbshapes result -vertex 101 -edge 209 -wire 110 -face 110 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 532 + + +set index [lsearch [whatis result] Closed] +if {$index == -1} { + puts "Faulty ${BugNumber} : result is not Closed shape" + +} + + diff --git a/tests/thrusection/specific_locked/N5 b/tests/thrusection/specific_locked/N5 new file mode 100644 index 0000000000..64cf89dfaf --- /dev/null +++ b/tests/thrusection/specific_locked/N5 @@ -0,0 +1,24 @@ +puts "========" +puts "OCC28642" +puts "========" +puts "" +######################################### +# BRepOffsetAPI_ThruSections/BRepFill_Generator are modifying the input shape sections +######################################### + +#check "closed" thrusection (first profile is same as the last) +polyline p1 0 0 0 1 0 0 +polyline p2 2 1 0 2 2 0 +polyline p3 3 0 0 4 0 0 +polyline p4 2 -1 0 2 -2 0 + +setflags p1 locked +setflags p2 locked +setflags p3 locked +setflags p4 locked + +thrusections result 0 0 p1 p2 p3 p4 p1 -safe + +checkprops result -s 10.1587 +checknbshapes result -vertex 2 -edge 3 -wire 1 -face 1 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 8 + diff --git a/tests/thrusection/specific_locked/N6 b/tests/thrusection/specific_locked/N6 new file mode 100644 index 0000000000..9b32f14dfd --- /dev/null +++ b/tests/thrusection/specific_locked/N6 @@ -0,0 +1,24 @@ +puts "========" +puts "OCC28642" +puts "========" +puts "" +######################################### +# BRepOffsetAPI_ThruSections/BRepFill_Generator are modifying the input shape sections +######################################### + +#check "closed" thrusection (first profile is same as the last) +polyline p1 0 0 0 1 0 0 +polyline p2 2 1 0 2 2 0 +polyline p3 3 0 0 4 0 0 +polyline p4 2 -1 0 2 -2 0 + +setflags p1 locked +setflags p2 locked +setflags p3 locked +setflags p4 locked + +thrusections result 0 1 p1 p2 p3 p4 p1 -safe + +checkprops result -s 6 +checknbshapes result -vertex 8 -edge 12 -wire 4 -face 4 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 29 +