From: jgv Date: Tue, 24 Jan 2017 13:27:13 +0000 (+0300) Subject: 0026150: BRepOffsetAPI_ThruSections doesn't implement history method Generated(). X-Git-Tag: V7_2_0_beta~232 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=50258e776ae080dbcad9c7d5f0f420ae5c2c6201;p=occt-copy.git 0026150: BRepOffsetAPI_ThruSections doesn't implement history method Generated(). Virtual method Generated is redefined. Now it returns: - chain of generated faces for sub-edge of a profile; - chain of generated edges for sub-vertex of a profile; - bunch of chains of generated edges for start or end vertex if it is degenerated section. Correction according to the remarks. Fix compiler's warnings and add 4 new test cases. Correction of mistake. Compilation warnings are gone. --- diff --git a/src/BRepFill/BRepFill_CompatibleWires.cxx b/src/BRepFill/BRepFill_CompatibleWires.cxx index 3a24479ab6..26c73185fc 100644 --- a/src/BRepFill/BRepFill_CompatibleWires.cxx +++ b/src/BRepFill/BRepFill_CompatibleWires.cxx @@ -745,6 +745,24 @@ const TopTools_ListOfShape& BRepFill_CompatibleWires::GeneratedShapes } } +//========================================================================== +//function : IsDegeneratedFirstSection +//purpose : +//========================================================================== +Standard_Boolean BRepFill_CompatibleWires::IsDegeneratedFirstSection() const +{ + return myDegen1; +} + +//========================================================================= +//function : IsDegeneratedLastSection +//purpose : +//========================================================================= +Standard_Boolean BRepFill_CompatibleWires::IsDegeneratedLastSection() const +{ + return myDegen2; +} + //======================================================================= //function : Perform @@ -1223,7 +1241,22 @@ void BRepFill_CompatibleWires:: } // blocking sections? - if (vClosed) myWork(myWork.Length()) = myWork(1); + if (vClosed) + { + TopoDS_Iterator iter1(myWork(myWork.Length())), iter2(myWork(1)); + for (; iter1.More(); iter1.Next(), iter2.Next()) + { + const TopoDS_Shape& anEdge = iter1.Value(); + const TopoDS_Shape& aNewEdge = iter2.Value(); + if (!anEdge.IsSame(aNewEdge)) + { + TopTools_SequenceOfShape aSeq; + aSeq.Append(aNewEdge); + EdgeNewEdges.Bind(anEdge, aSeq); + } + } + myWork(myWork.Length()) = myWork(1); + } // check the number of edges for debug Standard_Integer nbmax=0, nbmin=0; @@ -1442,7 +1475,8 @@ void BRepFill_CompatibleWires::SameNumberByACR(const Standard_Boolean report) } // blocking sections ? - if (vClosed) myWork(myWork.Length()) = myWork(1); + if (vClosed) + myWork(myWork.Length()) = myWork(1); // check the number of edges for debug nbmax = 0; @@ -2028,7 +2062,8 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean /*polar*/ ) #endif // blocking sections ? - if (vClosed) myWork(myWork.Length()) = myWork(1); + if (vClosed) + myWork(myWork.Length()) = myWork(1); } //======================================================================= @@ -2190,5 +2225,6 @@ void BRepFill_CompatibleWires::SearchOrigin() } // blocking sections ? - if (vClosed) myWork(myWork.Length()) = myWork(1); + if (vClosed) + myWork(myWork.Length()) = myWork(1); } diff --git a/src/BRepFill/BRepFill_CompatibleWires.hxx b/src/BRepFill/BRepFill_CompatibleWires.hxx index c55bbc3c34..1369b11817 100644 --- a/src/BRepFill/BRepFill_CompatibleWires.hxx +++ b/src/BRepFill/BRepFill_CompatibleWires.hxx @@ -64,6 +64,9 @@ public: Standard_EXPORT const TopTools_DataMapOfShapeListOfShape& Generated() const; + Standard_EXPORT Standard_Boolean IsDegeneratedFirstSection() const; + + Standard_EXPORT Standard_Boolean IsDegeneratedLastSection() const; diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx b/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx index fa39fff236..9e70cfebd9 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx @@ -89,6 +89,7 @@ #include #include #include +#include //======================================================================= //function : PreciseUpar @@ -243,9 +244,13 @@ static TopoDS_Solid MakeSolid(TopoDS_Shell& shell, const TopoDS_Wire& wire1, //purpose : //======================================================================= -BRepOffsetAPI_ThruSections::BRepOffsetAPI_ThruSections(const Standard_Boolean isSolid, const Standard_Boolean ruled, - const Standard_Real pres3d): -myIsSolid(isSolid), myIsRuled(ruled), myPres3d(pres3d) +BRepOffsetAPI_ThruSections::BRepOffsetAPI_ThruSections(const Standard_Boolean isSolid, + const Standard_Boolean ruled, + const Standard_Real pres3d): + myNbEdgesInSection(0), + myIsSolid(isSolid), myIsRuled(ruled), + myPres3d(pres3d), + myDegen1(Standard_False), myDegen2(Standard_False) { myWCheck = Standard_True; //---------------------------- @@ -361,6 +366,8 @@ void BRepOffsetAPI_ThruSections::Build() throw Standard_Failure("Wrong usage of punctual sections"); } + myNbEdgesInSection = 0; + if (myWCheck) { // compute origin and orientation on wires to avoid twisted results // and update wires to have same number of edges @@ -377,8 +384,94 @@ void BRepOffsetAPI_ThruSections::Build() if (Georges.IsDone()) { WorkingSections = Georges.Shape(); WorkingMap = Georges.Generated(); + myDegen1 = Georges.IsDegeneratedFirstSection(); + myDegen2 = Georges.IsDegeneratedLastSection(); + //For each sub-edge of each section + //we save its splits + Standard_Integer IndFirstSec = 1; + if (Georges.IsDegeneratedFirstSection()) + IndFirstSec = 2; + TopoDS_Shape aWorkingSection = WorkingSections(IndFirstSec); + TopoDS_Iterator itw(aWorkingSection); + for (; itw.More(); itw.Next()) + myNbEdgesInSection++; + for (Standard_Integer ii = 1; ii <= myWires.Length(); ii++) + { + TopExp_Explorer Explo(myWires(ii), TopAbs_EDGE); + for (; Explo.More(); Explo.Next()) + { + const TopoDS_Edge& anEdge = TopoDS::Edge(Explo.Current()); + Standard_Integer aSign = 1; + TopoDS_Vertex Vfirst, Vlast; + TopExp::Vertices(anEdge, Vfirst, Vlast); + TopTools_ListOfShape aNewEdges = Georges.GeneratedShapes(anEdge); + TColStd_ListOfInteger IList; + aWorkingSection = WorkingSections(ii); + Standard_Integer NbNewEdges = aNewEdges.Extent(); + TopTools_ListIteratorOfListOfShape itl(aNewEdges); + for (Standard_Integer kk = 1; itl.More(); itl.Next(),kk++) + { + const TopoDS_Edge& aNewEdge = TopoDS::Edge(itl.Value()); + Standard_Integer inde = 1; + for (itw.Initialize(aWorkingSection); itw.More(); itw.Next(),inde++) + { + const TopoDS_Shape& aWorkingEdge = itw.Value(); + if (aWorkingEdge.IsSame(aNewEdge)) + { + aSign = (aWorkingEdge.Orientation() == TopAbs_FORWARD)? 1 : -1; + break; + } + } + IList.Append(inde); + if (kk == 1 || kk == NbNewEdges) + { + //For each sub-vertex of each section + //we save its index of new edge + TopoDS_Vertex NewVfirst, NewVlast; + TopExp::Vertices(aNewEdge, NewVfirst, NewVlast); + if (NewVfirst.IsSame(Vfirst) && !myVertexIndex.IsBound(Vfirst)) + myVertexIndex.Bind(Vfirst, aSign*inde); + if (NewVlast.IsSame(Vlast) && !myVertexIndex.IsBound(Vlast)) + myVertexIndex.Bind(Vlast, aSign*(-inde)); + } + } + myEdgeNewIndices.Bind(anEdge, IList); + } + } } myWires = WorkingSections; + } //if (myWCheck) + else //no check + { + TopoDS_Edge anEdge; + for (Standard_Integer ii = 1; ii <= myWires.Length(); ii++) + { + TopExp_Explorer Explo(myWires(ii), TopAbs_EDGE); + Standard_Integer inde = 1; + for (; Explo.More(); Explo.Next(),inde++) + { + anEdge = TopoDS::Edge(Explo.Current()); + TColStd_ListOfInteger IList; + IList.Append(inde); + myEdgeNewIndices.Bind(anEdge, IList); + TopoDS_Vertex V1, V2; + TopExp::Vertices(anEdge, V1, V2); + if (!myVertexIndex.IsBound(V1)) + myVertexIndex.Bind(V1, inde); + if (!myVertexIndex.IsBound(V2)) + myVertexIndex.Bind(V2, -inde); + } + inde--; + if (inde > myNbEdgesInSection) + myNbEdgesInSection = inde; + if (inde == 1 && BRep_Tool::Degenerated(anEdge)) + { + if (ii == 1) + myDegen1 = Standard_True; + else + myDegen2 = Standard_True; + } + } } try { @@ -504,7 +597,7 @@ void BRepOffsetAPI_ThruSections::CreateRuled() for (it.Initialize(MV.FindFromKey(Vdegen)); it.More(); it.Next()) { const TopoDS_Shape& Face = it.Value(); if (MapFaces.Contains(Face)) { - myGenerated.Bind(edge1, Face); + myEdgeFace.Bind(edge1, Face); break; } } @@ -513,7 +606,7 @@ void BRepOffsetAPI_ThruSections::CreateRuled() for (it.Initialize(M.FindFromKey(edge1)); it.More(); it.Next()) { const TopoDS_Shape& Face = it.Value(); if (MapFaces.Contains(Face)) { - myGenerated.Bind(edge1, Face); + myEdgeFace.Bind(edge1, Face); break; } } @@ -793,7 +886,7 @@ void BRepOffsetAPI_ThruSections::CreateSmoothed() BW2.Add(newW2, edge22); // history - myGenerated.Bind(firstEdge, face); + myEdgeFace.Bind(firstEdge, face); } if (uClosed && w1Point && w2Point) @@ -1070,6 +1163,206 @@ const TopoDS_Shape& BRepOffsetAPI_ThruSections::LastShape() const return myLast; } +//======================================================================= +//function : Generated +//purpose : +//======================================================================= +const TopTools_ListOfShape& +BRepOffsetAPI_ThruSections::Generated(const TopoDS_Shape& S) +{ + myGenerated.Clear(); + + TopTools_SequenceOfShape AllFaces; + TopExp_Explorer Explo(myShape, TopAbs_FACE); + for (; Explo.More(); Explo.Next()) + AllFaces.Append(Explo.Current()); + + if (S.ShapeType() == TopAbs_EDGE) + { + if (!myEdgeNewIndices.IsBound(S)) + return myGenerated; + + const TColStd_ListOfInteger& Indices = myEdgeNewIndices(S); + //Append the faces corresponding to + //These faces "grow" from the first section + TColStd_ListIteratorOfListOfInteger itl(Indices); + for (; itl.More(); itl.Next()) + { + Standard_Integer IndOfFace = itl.Value(); + myGenerated.Append(AllFaces(IndOfFace)); + } + + if (myIsRuled) + //Append the next faces corresponding to + for (Standard_Integer i = 2; i < myWires.Length(); i++) + for (itl.Initialize(Indices); itl.More(); itl.Next()) + { + Standard_Integer IndOfFace = itl.Value(); + IndOfFace += (i-1)*myNbEdgesInSection; + myGenerated.Append(AllFaces(IndOfFace)); + } + } + else if (S.ShapeType() == TopAbs_VERTEX) + { + if (!myVertexIndex.IsBound(S)) + return myGenerated; + + TopTools_IndexedDataMapOfShapeListOfShape VEmap; + + Standard_Boolean IsDegen [2] = {Standard_False, Standard_False}; + if (myDegen1 || myDegen2) + { + TopoDS_Shape EndSections [2]; + EndSections[0] = myWires(1); + EndSections[1] = myWires(myWires.Length()); + for (Standard_Integer i = 0; i < 2; i++) + { + if (i == 0 && !myDegen1) + continue; + if (i == 1 && !myDegen2) + continue; + + Explo.Init(EndSections[i], TopAbs_VERTEX); + const TopoDS_Shape& aVertex = Explo.Current(); + if (S.IsSame(aVertex)) + { + IsDegen[i] = Standard_True; + break; + } + } + } + // Only one of can be True: + // in case of one vertex for start and end degenerated sections + // IsDegen[0] is True; + if (IsDegen[0] || IsDegen[1]) + { + //For start or end degenerated section + //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()) + { + const TopoDS_Edge& anEdge = TopoDS::Edge(itl.Value()); + if (!BRep_Tool::Degenerated(anEdge)) + { + TopoDS_Vertex VV [2]; + TopExp::Vertices(anEdge, VV[0], VV[1]); + //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]))) + Emap.Add(anEdge); + } + } + for (Standard_Integer j = 1; j <= Emap.Extent(); j++) + { + TopoDS_Edge anEdge = TopoDS::Edge(Emap(j)); + myGenerated.Append(anEdge); + if (myIsRuled) + { + Standard_Integer i,k; + for (i = 2,k = myWires.Length()-1; i < myWires.Length(); i++,k--) + { + Standard_Integer IndOfSec = (IsDegen[0])? i : k; + TopoDS_Vertex aVertex = (IsDegen[0])? + 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()) + { + NextEdge = TopoDS::Edge(itl.Value()); + if (!NextEdge.IsSame(anEdge) && + !EmapOfSection.Contains(NextEdge)) + break; + } + myGenerated.Append(NextEdge); + anEdge = NextEdge; + } + } + } + return myGenerated; + } //end of if (IsDegen[0] || IsDegen[1]) + + Standard_Integer Eindex = myVertexIndex(S); + Standard_Integer Vindex = (Eindex > 0)? 0 : 1; + Eindex = Abs(Eindex); + const TopoDS_Shape& FirstSection = myWires(1); + TopoDS_Edge FirstEdge; + TopoDS_Iterator itw(FirstSection); + for (Standard_Integer inde = 1; itw.More(); itw.Next(),inde++) + { + FirstEdge = TopoDS::Edge(itw.Value()); + if (inde == Eindex) + break; + } + + //Find the first longitudinal edge + TopoDS_Face FirstFace = TopoDS::Face(AllFaces(Eindex)); + FirstFace.Orientation(TopAbs_FORWARD); + Explo.Init(FirstFace, TopAbs_EDGE); + TopoDS_Edge anEdge; + BRepAdaptor_Surface BAsurf(FirstFace, Standard_False); + TopoDS_Vertex FirstVertex; + TopExp::MapShapesAndAncestors(FirstFace, TopAbs_VERTEX, TopAbs_EDGE, VEmap); + if (myDegen1 && BAsurf.GetType() == GeomAbs_Plane) + { + //There are only 3 edges in the face in this case: + //we take 1-st or 3-rd edge + if (Vindex == 0) + { + Explo.Next(); + Explo.Next(); + } + anEdge = TopoDS::Edge(Explo.Current()); + } + else + { + TopoDS_Shape FirstEdgeInFace; + FirstEdgeInFace = Explo.Current(); + TopoDS_Vertex VV [2]; + TopExp::Vertices(FirstEdge, VV[0], VV[1]); + FirstVertex = VV[Vindex]; + const TopTools_ListOfShape& Elist = VEmap.FindFromKey(FirstVertex); + TopTools_ListIteratorOfListOfShape itl(Elist); + TopAbs_Orientation anEdgeOr = (Vindex == 0)? TopAbs_REVERSED : TopAbs_FORWARD; + for (; itl.More(); itl.Next()) + { + anEdge = TopoDS::Edge(itl.Value()); + if (!anEdge.IsSame(FirstEdgeInFace) && + !BRep_Tool::Degenerated(anEdge) && + anEdge.Orientation() == anEdgeOr) + break; + } + } + myGenerated.Append(anEdge); + if (myIsRuled) + //Find the chain of longitudinal edges from first to last + for (Standard_Integer i = 2; i < myWires.Length(); i++) + { + FirstVertex = TopExp::LastVertex(anEdge); + const TopTools_ListOfShape& Elist1 = VEmap.FindFromKey(FirstVertex); + FirstEdge = (anEdge.IsSame(Elist1.First()))? + TopoDS::Edge(Elist1.Last()) : TopoDS::Edge(Elist1.First()); + Eindex += myNbEdgesInSection; + FirstFace = TopoDS::Face(AllFaces(Eindex)); + FirstFace.Orientation(TopAbs_FORWARD); + VEmap.Clear(); + TopExp::MapShapesAndAncestors(FirstFace, TopAbs_VERTEX, TopAbs_EDGE, VEmap); + const TopTools_ListOfShape& Elist2 = VEmap.FindFromKey(FirstVertex); + anEdge = (FirstEdge.IsSame(Elist2.First()))? + TopoDS::Edge(Elist2.Last()) : TopoDS::Edge(Elist2.First()); + myGenerated.Append(anEdge); + } + } + + return myGenerated; +} + //======================================================================= //function : GeneratedFace //purpose : @@ -1078,8 +1371,8 @@ const TopoDS_Shape& BRepOffsetAPI_ThruSections::LastShape() const TopoDS_Shape BRepOffsetAPI_ThruSections::GeneratedFace(const TopoDS_Shape& edge) const { TopoDS_Shape bid; - if (myGenerated.IsBound(edge)) { - return myGenerated(edge); + if (myEdgeFace.IsBound(edge)) { + return myEdgeFace(edge); } else { return bid; diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.hxx b/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.hxx index a58c994e4f..6de1f091f5 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.hxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.hxx @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include #include #include @@ -143,6 +145,11 @@ public: //! Returns the Face generated by each edge of the first wire Standard_EXPORT TopoDS_Shape GeneratedFace (const TopoDS_Shape& Edge) const; + //! Returns a list of new shapes generated from the shape + //! S by the shell-generating algorithm. + //! This function is redefined from BRepBuilderAPI_MakeShape::Generated. + //! S can be an edge or a vertex of a given Profile (see methods AddWire and AddVertex). + Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S) Standard_OVERRIDE; @@ -159,17 +166,27 @@ private: Standard_EXPORT void CreateSmoothed(); - Standard_EXPORT Handle(Geom_BSplineSurface) TotalSurf (const TopTools_Array1OfShape& shapes, const Standard_Integer NbSect, const Standard_Integer NbEdges, const Standard_Boolean w1Point, const Standard_Boolean w2Point, const Standard_Boolean vClosed) const; + Standard_EXPORT Handle(Geom_BSplineSurface) TotalSurf (const TopTools_Array1OfShape& shapes, + const Standard_Integer NbSect, + const Standard_Integer NbEdges, + const Standard_Boolean w1Point, + const Standard_Boolean w2Point, + const Standard_Boolean vClosed) const; TopTools_SequenceOfShape myWires; + TopTools_DataMapOfShapeListOfInteger myEdgeNewIndices; + TopTools_DataMapOfShapeInteger myVertexIndex; + Standard_Integer myNbEdgesInSection; Standard_Boolean myIsSolid; Standard_Boolean myIsRuled; Standard_Boolean myWCheck; Standard_Real myPres3d; TopoDS_Face myFirst; TopoDS_Face myLast; - TopTools_DataMapOfShapeShape myGenerated; + Standard_Boolean myDegen1; + Standard_Boolean myDegen2; + TopTools_DataMapOfShapeShape myEdgeFace; GeomAbs_Shape myContinuity; Approx_ParametrizationType myParamType; Standard_Integer myDegMax; diff --git a/src/BRepTest/BRepTest_SweepCommands.cxx b/src/BRepTest/BRepTest_SweepCommands.cxx index eb869eea8b..2cd7a1c06c 100644 --- a/src/BRepTest/BRepTest_SweepCommands.cxx +++ b/src/BRepTest/BRepTest_SweepCommands.cxx @@ -43,6 +43,7 @@ #include static BRepOffsetAPI_MakePipeShell* Sweep= 0; +static BRepOffsetAPI_ThruSections* Generator = 0; #include #include @@ -323,19 +324,19 @@ Standard_Integer gener(Draw_Interpretor&, Standard_Integer n, const char** a) TopoDS_Shape Shape; - BRepFill_Generator Generator; + BRepFill_Generator aGenerator; for ( Standard_Integer i = 2; i<= n-1 ; i++) { Shape = DBRep::Get(a[i],TopAbs_WIRE); if ( Shape.IsNull()) return 1; - Generator.AddWire(TopoDS::Wire(Shape)); + aGenerator.AddWire(TopoDS::Wire(Shape)); } - Generator.Perform(); + aGenerator.Perform(); - TopoDS_Shell Shell = Generator.Shell(); + TopoDS_Shell Shell = aGenerator.Shell(); DBRep::Set(a[1], Shell); @@ -368,7 +369,12 @@ Standard_Integer thrusections(Draw_Interpretor&, Standard_Integer n, const char* Standard_Boolean issolid = ( Draw::Atoi(a[index]) == 1 ); Standard_Boolean isruled = ( Draw::Atoi(a[index+1]) == 1 ); - BRepOffsetAPI_ThruSections Generator(issolid,isruled); + if (Generator != 0) + { + delete Generator; + Generator = 0; + } + Generator = new BRepOffsetAPI_ThruSections(issolid,isruled); Standard_Integer NbEdges = 0; Standard_Boolean IsFirstWire = Standard_False; @@ -377,7 +383,7 @@ Standard_Integer thrusections(Draw_Interpretor&, Standard_Integer n, const char* Shape = DBRep::Get(a[i], TopAbs_WIRE); if (!Shape.IsNull()) { - Generator.AddWire(TopoDS::Wire(Shape)); + Generator->AddWire(TopoDS::Wire(Shape)); if (!IsFirstWire) IsFirstWire = Standard_True; else @@ -388,7 +394,7 @@ Standard_Integer thrusections(Draw_Interpretor&, Standard_Integer n, const char* Shape = DBRep::Get(a[i], TopAbs_VERTEX); IsWire = Standard_False; if (!Shape.IsNull()) - Generator.AddVertex(TopoDS::Vertex(Shape)); + Generator->AddVertex(TopoDS::Vertex(Shape)); else return 1; } @@ -407,12 +413,12 @@ Standard_Integer thrusections(Draw_Interpretor&, Standard_Integer n, const char* } check = (check || !samenumber); - Generator.CheckCompatibility(check); + Generator->CheckCompatibility(check); - Generator.Build(); + Generator->Build(); - if (Generator.IsDone()) { - TopoDS_Shape Shell = Generator.Shape(); + if (Generator->IsDone()) { + TopoDS_Shape Shell = Generator->Shape(); DBRep::Set(a[index-1], Shell); } else { @@ -421,6 +427,55 @@ Standard_Integer thrusections(Draw_Interpretor&, Standard_Integer n, const char* return 0; } +//============================================================================ +//function : genthrus +//purpose : returns generated shape for subshape of a section of thrusections +// Thrusections must be done previously +//============================================================================ +static Standard_Integer genthrus(Draw_Interpretor& di, + Standard_Integer n, const char** a) +{ + if (n != 3) + { + di << "genthrus: it is called after thrusections command\n"; + di << "returns:\n"; + di << "- chain of generated faces for sub-edge of a profile;\n"; + di << "- chain of generated edges for sub-vertex of a profile;\n"; + di << "- bunch of chains of generated edges for start or end vertex if it is degenerated section.\n"; + di << "Usage: genthrus res subshape_of_profile, thrusections must be done\n"; + return 1; + } + if (Generator == 0) + { + di << "You have forgotten the <> command !\n"; + return 1; + } + if (!Generator->IsDone()) + { + di << "Thrusections is not done\n"; + return 1; + } + TopoDS_Shape aShape = DBRep::Get(a[2]); + if (aShape.IsNull()) + { + cout<<"Null subshape"<Generated(aShape); + TopoDS_Compound aCompound; + BRep_Builder BB; + BB.MakeCompound(aCompound); + TopTools_ListIteratorOfListOfShape iter(Edges); + for (; iter.More(); iter.Next()) + { + const TopoDS_Shape& anEdge = iter.Value(); + BB.Add(aCompound, anEdge); + } + + DBRep::Set(a[1], aCompound); + return 0; +} + //======================================================================= // mksweep //======================================================================= @@ -920,6 +975,8 @@ void BRepTest::SweepCommands(Draw_Interpretor& theCommands) 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)", __FILE__,thrusections,g); + theCommands.Add("genthrus", "genthrus res subshape_of_profile", + __FILE__,genthrus,g); theCommands.Add("mksweep", "mksweep wire", __FILE__,mksweep,g); diff --git a/tests/bugs/modalg_6/bug26150_1 b/tests/bugs/modalg_6/bug26150_1 new file mode 100644 index 0000000000..499ecd97fa --- /dev/null +++ b/tests/bugs/modalg_6/bug26150_1 @@ -0,0 +1,75 @@ +puts "============" +puts "OCC26150" +puts "============" +puts "" +######################################################################### +# BRepOffsetAPI_ThruSections doesn't implement history method Generated() +######################################################################### + +polyline w1 -10 -10 0 10 -10 0 10 10 0 -10 10 0 -10 -10 0 +polyline w2 0 -10 20 -10 7 20 10 8 20 0 -10 20 +circle w3 0 0 40 10 +mkedge w3 w3 +wire w3 w3 + +explode w1 +explode w2 +explode w3 + +thrusections r 1 1 w1 w2 w3 + +genthrus r1 w1_1 +genthrus r2 w1_2 +genthrus r3 w1_3 +genthrus r4 w1_4 +genthrus r5 w2_1 +genthrus r6 w2_2 +genthrus r7 w2_3 +genthrus r8 w3_1 + +checknbshapes r1 -face 4 +checkprops r1 -s 668.19 +checknbshapes r2 -face 6 +checkprops r2 -s 650.955 +checknbshapes r3 -face 2 +checkprops r3 -s 590.746 +checknbshapes r4 -face 4 +checkprops r4 -s 650.315 +checknbshapes r5 -face 4 +checkprops r5 -s 835.461 +checknbshapes r6 -face 6 +checkprops r6 -s 852.53 +checknbshapes r7 -face 6 +checkprops r7 -s 872.216 +checknbshapes r8 -face 16 +checkprops r8 -s 2560.21 + +explode w1 v +explode w2 v +explode w3 v + +genthrus r9 w1_1 +genthrus r10 w1_2 +genthrus r11 w1_3 +genthrus r12 w1_4 +genthrus r13 w2_1 +genthrus r14 w2_2 +genthrus r15 w2_3 +genthrus r16 w3_1 + +checknbshapes r9 -edge 2 +checkprops r9 -l 42.6998 +checknbshapes r10 -edge 2 +checkprops r10 -l 42.8761 +checknbshapes r11 -edge 2 +checkprops r11 -l 40.5019 +checknbshapes r12 -edge 2 +checkprops r12 -l 40.7504 +checknbshapes r13 -edge 2 +checkprops r13 -l 40.0002 +checknbshapes r14 -edge 2 +checkprops r14 -l 40.2389 +checknbshapes r15 -edge 2 +checkprops r15 -l 40.2965 +checknbshapes r16 -edge 2 +checkprops r16 -l 40.7511 diff --git a/tests/bugs/modalg_6/bug26150_10 b/tests/bugs/modalg_6/bug26150_10 new file mode 100644 index 0000000000..1c71ce6163 --- /dev/null +++ b/tests/bugs/modalg_6/bug26150_10 @@ -0,0 +1,84 @@ +puts "============" +puts "OCC26150" +puts "============" +puts "" +######################################################################### +# BRepOffsetAPI_ThruSections doesn't implement history method Generated() +######################################################################### + +restore [locate_data_file bug27386_pr1.brep] pr1 +restore [locate_data_file bug27386_pr2.brep] pr2 +restore [locate_data_file bug27386_pr3.brep] pr3 +beziercurve c1 3 0 50 -45 5 50 -50 0 50 -55 +beziercurve c2 3 0 50 -45 -5 50 -50 0 50 -55 +mkedge e1 c1 +mkedge e2 c2 +orientation e2 R +wire pr4 e1 e2 +donly pr1 pr2 pr3 pr4 + +explode pr1 +explode pr2 +explode pr3 +explode pr4 + +thrusections r 1 0 pr1 pr2 pr3 pr4 pr1 + +genthrus r1 pr1_1 +genthrus r2 pr1_2 +genthrus r3 pr1_3 +genthrus r4 pr1_4 +genthrus r5 pr2_1 +genthrus r6 pr2_2 +genthrus r7 pr2_3 +genthrus r8 pr3_1 +genthrus r9 pr4_1 +genthrus r10 pr4_2 + +checknbshapes r1 -face 2 +checkprops r1 -s 2254.99 +checknbshapes r2 -face 2 +checkprops r2 -s 2416.89 +checknbshapes r3 -face 2 +checkprops r3 -s 2792.66 +checknbshapes r4 -face 3 +checkprops r4 -s 2422.18 +checknbshapes r5 -face 3 +checkprops r5 -s 3484.47 +checknbshapes r6 -face 2 +checkprops r6 -s 3479.17 +checknbshapes r7 -face 4 +checkprops r7 -s 2923.08 +checknbshapes r8 -face 9 +checkprops r8 -s 9886.72 +checknbshapes r9 -face 5 +checkprops r9 -s 4946.01 +checknbshapes r10 -face 4 +checkprops r10 -s 4940.71 + +explode pr1 v +explode pr2 v +explode pr3 v +explode pr4 v + +genthrus r11 pr1_1 +genthrus r12 pr1_2 +genthrus r13 pr1_3 +genthrus r14 pr1_4 +genthrus r15 pr2_1 +genthrus r16 pr2_2 +genthrus r17 pr2_3 +genthrus r18 pr3_1 +genthrus r19 pr4_1 +genthrus r20 pr4_2 + +checkprops r11 -l 305.61 +checkprops r12 -l 305.61 +checkprops r13 -l 347.48 +checkprops r14 -l 347.48 +checkprops r15 -l 309.372 +checkprops r16 -l 362.824 +checkprops r17 -l 309.372 +checkprops r18 -l 327.615 +checkprops r19 -l 296.856 +checkprops r20 -l 362.824 diff --git a/tests/bugs/modalg_6/bug26150_11 b/tests/bugs/modalg_6/bug26150_11 new file mode 100644 index 0000000000..6a2d47cbbb --- /dev/null +++ b/tests/bugs/modalg_6/bug26150_11 @@ -0,0 +1,71 @@ +puts "============" +puts "OCC26150" +puts "============" +puts "" +######################################################################### +# BRepOffsetAPI_ThruSections doesn't implement history method Generated() +######################################################################### + +restore [locate_data_file bug27386_pr2.brep] pr2 +restore [locate_data_file bug27386_pr3.brep] pr3 +beziercurve c1 3 0 50 -45 5 50 -50 0 50 -55 +beziercurve c2 3 0 50 -45 -5 50 -50 0 50 -55 +mkedge e1 c1 +mkedge e2 c2 +orientation e2 R +wire pr4 e1 e2 +vertex vv 0 0 0 +donly vv pr2 pr3 pr4 + +explode pr2 +explode pr3 +explode pr4 + +thrusections r 1 1 vv pr2 pr3 pr4 vv + +genthrus r1 pr2_1 +genthrus r2 pr2_2 +genthrus r3 pr2_3 +genthrus r4 pr3_1 +genthrus r5 pr4_1 +genthrus r6 pr4_2 + +checknbshapes r1 -face 8 +checkprops r1 -s 1659.7 +checknbshapes r2 -face 4 +checkprops r2 -s 1660.96 +checknbshapes r3 -face 8 +checkprops r3 -s 1671.28 +checknbshapes r4 -face 20 +checkprops r4 -s 4991.94 +checknbshapes r5 -face 12 +checkprops r5 -s 2495.34 +checknbshapes r6 -face 8 +checkprops r6 -s 2496.6 + +explode pr2 v +explode pr3 v +explode pr4 v + +genthrus r7 vv +genthrus r8 pr2_1 +genthrus r9 pr2_2 +genthrus r10 pr2_3 +genthrus r11 pr3_1 +genthrus r12 pr4_1 +genthrus r13 pr4_2 + +checknbshapes r7 -edge 20 +checkprops r7 -l 1386.75 +checknbshapes r8 -edge 4 +checkprops r8 -l 269.926 +checknbshapes r9 -edge 4 +checkprops r9 -l 304.224 +checknbshapes r10 -edge 4 +checkprops r10 -l 269.926 +checknbshapes r11 -edge 4 +checkprops r11 -l 280.861 +checknbshapes r12 -edge 4 +checkprops r12 -l 261.815 +checknbshapes r13 -edge 4 +checkprops r13 -l 304.224 diff --git a/tests/bugs/modalg_6/bug26150_12 b/tests/bugs/modalg_6/bug26150_12 new file mode 100644 index 0000000000..ff255b96e2 --- /dev/null +++ b/tests/bugs/modalg_6/bug26150_12 @@ -0,0 +1,65 @@ +puts "============" +puts "OCC26150" +puts "============" +puts "" +######################################################################### +# BRepOffsetAPI_ThruSections doesn't implement history method Generated() +######################################################################### + +restore [locate_data_file bug27386_pr2.brep] pr2 +restore [locate_data_file bug27386_pr3.brep] pr3 +beziercurve c1 3 0 50 -45 5 50 -50 0 50 -55 +beziercurve c2 3 0 50 -45 -5 50 -50 0 50 -55 +mkedge e1 c1 +mkedge e2 c2 +orientation e2 R +wire pr4 e1 e2 +vertex vv 0 0 0 +donly vv pr2 pr3 pr4 + +explode pr2 +explode pr3 +explode pr4 + +thrusections r 1 0 vv pr2 pr3 pr4 vv + +genthrus r1 pr2_1 +genthrus r2 pr2_2 +genthrus r3 pr2_3 +genthrus r4 pr3_1 +genthrus r5 pr4_1 +genthrus r6 pr4_2 + +checknbshapes r1 -face 2 +checkprops r1 -s 2756.24 +checknbshapes r2 -face 1 +checkprops r2 -s 2749.35 +checknbshapes r3 -face 2 +checkprops r3 -s 2322.62 +checknbshapes r4 -face 5 +checkprops r4 -s 7828.21 +checknbshapes r5 -face 3 +checkprops r5 -s 3917.55 +checknbshapes r6 -face 2 +checkprops r6 -s 3910.66 + +explode pr2 v +explode pr3 v +explode pr4 v + +genthrus r7 vv +genthrus r8 pr2_1 +genthrus r9 pr2_2 +genthrus r10 pr2_3 +genthrus r11 pr3_1 +genthrus r12 pr4_1 +genthrus r13 pr4_2 + +checknbshapes r7 -edge 5 +checkprops r7 -l 1618.63 +checkprops r8 -l 313.428 +checkprops r9 -l 360.862 +checkprops r10 -l 313.428 +checkprops r11 -l 328.857 +checkprops r12 -l 302.052 +checkprops r13 -l 360.862 diff --git a/tests/bugs/modalg_6/bug26150_13 b/tests/bugs/modalg_6/bug26150_13 new file mode 100644 index 0000000000..c560df28b6 --- /dev/null +++ b/tests/bugs/modalg_6/bug26150_13 @@ -0,0 +1,73 @@ +puts "============" +puts "OCC26150" +puts "============" +puts "" +######################################################################### +# BRepOffsetAPI_ThruSections doesn't implement history method Generated() +######################################################################### + +polyline w1 -10 10 0 -10 -10 0 10 -10 0 10 10 0 +polyline w2 10 8 20 0 -10 20 -10 7 20 +circle w3 0 0 40 10 +trim w3 w3 pi 2*pi +mkedge w3 w3 +wire w3 w3 + +explode w1 +explode w2 +explode w3 + +thrusections r 0 1 w1 w2 w3 + +genthrus r1 w1_1 +genthrus r2 w1_2 +genthrus r3 w1_3 +genthrus r4 w2_1 +genthrus r5 w2_2 +genthrus r6 w3_1 + +checknbshapes r1 -face 2 +checkprops r1 -s 577.142 +checknbshapes r2 -face 4 +checkprops r2 -s 541.715 +checknbshapes r3 -face 2 +checkprops r3 -s 578.464 +checknbshapes r4 -face 4 +checkprops r4 -s 866.24 +checknbshapes r5 -face 4 +checkprops r5 -s 831.08 +checknbshapes r6 -face 8 +checkprops r6 -s 1697.32 + +explode w1 v +explode w2 v +explode w3 v + +genthrus r7 w1_1 +genthrus r8 w1_2 +genthrus r9 w1_3 +genthrus r10 w1_4 +genthrus r11 w2_1 +genthrus r12 w2_2 +genthrus r13 w2_3 +genthrus r14 w3_1 +genthrus r15 w3_2 + +checknbshapes r7 -edge 2 +checkprops r7 -l 41.4134 +checknbshapes r8 -edge 2 +checkprops r8 -l 42.3039 +checknbshapes r9 -edge 2 +checkprops r9 -l 42.5986 +checknbshapes r10 -edge 2 +checkprops r10 -l 41.6404 +checknbshapes r11 -edge 2 +checkprops r11 -l 41.6404 +checknbshapes r12 -edge 2 +checkprops r12 -l 40.0133 +checknbshapes r13 -edge 2 +checkprops r13 -l 41.4134 +checknbshapes r14 -edge 2 +checkprops r14 -l 41.4134 +checknbshapes r15 -edge 2 +checkprops r15 -l 41.6404 diff --git a/tests/bugs/modalg_6/bug26150_14 b/tests/bugs/modalg_6/bug26150_14 new file mode 100644 index 0000000000..8ad9ca78db --- /dev/null +++ b/tests/bugs/modalg_6/bug26150_14 @@ -0,0 +1,64 @@ +puts "============" +puts "OCC26150" +puts "============" +puts "" +######################################################################### +# BRepOffsetAPI_ThruSections doesn't implement history method Generated() +######################################################################### + +polyline w1 -10 10 0 -10 -10 0 10 -10 0 10 10 0 +polyline w2 10 8 20 0 -10 20 -10 7 20 +circle w3 0 0 40 10 +trim w3 w3 pi 2*pi +mkedge w3 w3 +wire w3 w3 + +explode w1 +explode w2 +explode w3 + +thrusections r 0 0 w1 w2 w3 + +genthrus r1 w1_1 +genthrus r2 w1_2 +genthrus r3 w1_3 +genthrus r4 w2_1 +genthrus r5 w2_2 +genthrus r6 w3_1 + +checknbshapes r1 -face 1 +checkprops r1 -s 574.919 +checknbshapes r2 -face 2 +checkprops r2 -s 543.935 +checknbshapes r3 -face 1 +checkprops r3 -s 576.17 +checknbshapes r4 -face 2 +checkprops r4 -s 865.397 +checknbshapes r5 -face 2 +checkprops r5 -s 829.628 +checknbshapes r6 -face 4 +checkprops r6 -s 1695.02 + +explode w1 v +explode w2 v +explode w3 v + +genthrus r7 w1_1 +genthrus r8 w1_2 +genthrus r9 w1_3 +genthrus r10 w1_4 +genthrus r11 w2_1 +genthrus r12 w2_2 +genthrus r13 w2_3 +genthrus r14 w3_1 +genthrus r15 w3_2 + +checkprops r7 -l 41.4735 +checkprops r8 -l 42.8862 +checkprops r9 -l 43.2561 +checkprops r10 -l 41.7738 +checkprops r11 -l 41.7738 +checkprops r12 -l 40.0173 +checkprops r13 -l 41.4735 +checkprops r14 -l 41.4735 +checkprops r15 -l 41.7738 diff --git a/tests/bugs/modalg_6/bug26150_15 b/tests/bugs/modalg_6/bug26150_15 new file mode 100644 index 0000000000..977a25d0e4 --- /dev/null +++ b/tests/bugs/modalg_6/bug26150_15 @@ -0,0 +1,89 @@ +puts "============" +puts "OCC26150" +puts "============" +puts "" +######################################################################### +# BRepOffsetAPI_ThruSections doesn't implement history method Generated() +######################################################################### + +restore [locate_data_file bug27386_pr2.brep] pr2 +polyline pr1 5 0 0 5 -5 0 -5 -5 0 -5 0 0 +explode pr2 +wire pr2 pr2_1 pr2_2 +circle cc 0 100 0 5 +trim cc cc 0 pi +mkedge cc cc +wire pr3 cc +beziercurve c1 3 0 50 -45 5 50 -50 0 50 -55 +beziercurve c2 3 0 50 -45 -5 50 -50 0 50 -55 +trim c1 c1 0.5 1 +trim c2 c2 0.5 1 +mkedge e1 c1 +mkedge e2 c2 +orientation e2 R +wire pr4 e1 e2 +donly pr1 pr2 pr3 pr4 + +explode pr1 +explode pr2 +explode pr3 +explode pr4 + +thrusections r 1 1 pr1 pr2 pr3 pr4 pr1 + +genthrus r1 pr1_1 +genthrus r2 pr1_2 +genthrus r3 pr1_3 +genthrus r4 pr2_1 +genthrus r5 pr2_2 +genthrus r6 pr3_1 +genthrus r7 pr4_1 +genthrus r8 pr4_2 + +checknbshapes r1 -face 4 +checkprops r1 -s 902.335 +checknbshapes r2 -face 8 +checkprops r2 -s 2278.73 +checknbshapes r3 -face 4 +checkprops r3 -s 902.335 +checknbshapes r4 -face 8 +checkprops r4 -s 2041.7 +checknbshapes r5 -face 8 +checkprops r5 -s 2041.7 +checknbshapes r6 -face 16 +checkprops r6 -s 4083.4 +checknbshapes r7 -face 8 +checkprops r7 -s 2041.7 +checknbshapes r8 -face 8 +checkprops r8 -s 2041.7 + +explode pr1 v +explode pr2 v +explode pr3 v +explode pr4 v + +genthrus r9 pr1_1 +genthrus r10 pr1_2 +genthrus r11 pr1_3 +genthrus r12 pr1_4 +genthrus r13 pr2_1 +genthrus r14 pr2_2 +genthrus r15 pr2_3 +genthrus r16 pr3_1 +genthrus r17 pr3_2 +genthrus r18 pr4_1 +genthrus r19 pr4_2 +genthrus r20 pr4_3 + +checkprops r9 -l 276.046 +checkprops r10 -l 298.732 +checkprops r11 -l 298.732 +checkprops r12 -l 276.046 +checkprops r13 -l 276.046 +checkprops r14 -l 311.127 +checkprops r15 -l 276.046 +checkprops r16 -l 276.046 +checkprops r17 -l 276.046 +checkprops r18 -l 276.046 +checkprops r19 -l 311.127 +checkprops r20 -l 276.046 diff --git a/tests/bugs/modalg_6/bug26150_16 b/tests/bugs/modalg_6/bug26150_16 new file mode 100644 index 0000000000..53c8a66eb9 --- /dev/null +++ b/tests/bugs/modalg_6/bug26150_16 @@ -0,0 +1,89 @@ +puts "============" +puts "OCC26150" +puts "============" +puts "" +######################################################################### +# BRepOffsetAPI_ThruSections doesn't implement history method Generated() +######################################################################### + +restore [locate_data_file bug27386_pr2.brep] pr2 +polyline pr1 5 0 0 5 -5 0 -5 -5 0 -5 0 0 +explode pr2 +wire pr2 pr2_1 pr2_2 +circle cc 0 100 0 5 +trim cc cc 0 pi +mkedge cc cc +wire pr3 cc +beziercurve c1 3 0 50 -45 5 50 -50 0 50 -55 +beziercurve c2 3 0 50 -45 -5 50 -50 0 50 -55 +trim c1 c1 0.5 1 +trim c2 c2 0.5 1 +mkedge e1 c1 +mkedge e2 c2 +orientation e2 R +wire pr4 e1 e2 +donly pr1 pr2 pr3 pr4 + +explode pr1 +explode pr2 +explode pr3 +explode pr4 + +thrusections r 1 0 pr1 pr2 pr3 pr4 pr1 + +genthrus r1 pr1_1 +genthrus r2 pr1_2 +genthrus r3 pr1_3 +genthrus r4 pr2_1 +genthrus r5 pr2_2 +genthrus r6 pr3_1 +genthrus r7 pr4_1 +genthrus r8 pr4_2 + +checknbshapes r1 -face 1 +checkprops r1 -s 1427.73 +checknbshapes r2 -face 2 +checkprops r2 -s 2845.67 +checknbshapes r3 -face 1 +checkprops r3 -s 1427.73 +checknbshapes r4 -face 2 +checkprops r4 -s 2850.56 +checknbshapes r5 -face 2 +checkprops r5 -s 2850.56 +checknbshapes r6 -face 4 +checkprops r6 -s 5701.12 +checknbshapes r7 -face 2 +checkprops r7 -s 2850.56 +checknbshapes r8 -face 2 +checkprops r8 -s 2850.56 + +explode pr1 v +explode pr2 v +explode pr3 v +explode pr4 v + +genthrus r9 pr1_1 +genthrus r10 pr1_2 +genthrus r11 pr1_3 +genthrus r12 pr1_4 +genthrus r13 pr2_1 +genthrus r14 pr2_2 +genthrus r15 pr2_3 +genthrus r16 pr3_1 +genthrus r17 pr3_2 +genthrus r18 pr4_1 +genthrus r19 pr4_2 +genthrus r20 pr4_3 + +checkprops r9 -l 322.713 +checkprops r10 -l 347.889 +checkprops r11 -l 347.889 +checkprops r12 -l 322.713 +checkprops r13 -l 322.713 +checkprops r14 -l 363.603 +checkprops r15 -l 322.713 +checkprops r16 -l 322.713 +checkprops r17 -l 322.713 +checkprops r18 -l 322.713 +checkprops r19 -l 363.603 +checkprops r20 -l 322.713 diff --git a/tests/bugs/modalg_6/bug26150_17 b/tests/bugs/modalg_6/bug26150_17 new file mode 100644 index 0000000000..f027813dc7 --- /dev/null +++ b/tests/bugs/modalg_6/bug26150_17 @@ -0,0 +1,81 @@ +puts "============" +puts "OCC26150" +puts "============" +puts "" +######################################################################### +# BRepOffsetAPI_ThruSections doesn't implement history method Generated() +######################################################################### + +polyline w1 -10 10 0 -10 -10 0 10 -10 0 10 10 0 +polyline w2 10 8 20 0 -10 20 -10 7 20 +circle w3 0 0 40 10 +trim w3 w3 pi 2*pi +mkedge w3 w3 +wire w3 w3 +vertex v1 0 0 -30 +vertex v2 0 0 70 + +explode w1 +explode w2 +explode w3 + +thrusections r 0 1 v1 w1 w2 w3 v2 + +genthrus r1 w1_1 +genthrus r2 w1_2 +genthrus r3 w1_3 +genthrus r4 w2_1 +genthrus r5 w2_2 +genthrus r6 w3_1 + +checknbshapes r1 -face 4 +checkprops r1 -s 1058.95 +checknbshapes r2 -face 8 +checkprops r2 -s 1023.52 +checknbshapes r3 -face 4 +checkprops r3 -s 1060.27 +checknbshapes r4 -face 8 +checkprops r4 -s 1604.51 +checknbshapes r5 -face 8 +checkprops r5 -s 1538.22 +checknbshapes r6 -face 16 +checkprops r6 -s 3142.73 + +explode w1 v +explode w2 v +explode w3 v + +genthrus r7 w1_1 +genthrus r8 w1_2 +genthrus r9 w1_3 +genthrus r10 w1_4 +genthrus r11 w2_1 +genthrus r12 w2_2 +genthrus r13 w2_3 +genthrus r14 w3_1 +genthrus r15 w3_2 +genthrus r16 v1 +genthrus r17 v2 + +checknbshapes r7 -edge 4 +checkprops r7 -l 106.202 +checknbshapes r8 -edge 4 +checkprops r8 -l 107.093 +checknbshapes r9 -edge 4 +checkprops r9 -l 107.388 +checknbshapes r10 -edge 4 +checkprops r10 -l 106.429 +checknbshapes r11 -edge 4 +checkprops r11 -l 106.429 +checknbshapes r12 -edge 4 +checkprops r12 -l 103.265 +checknbshapes r13 -edge 4 +checkprops r13 -l 106.202 +checknbshapes r14 -edge 4 +checkprops r14 -l 106.202 +checknbshapes r15 -edge 4 +checkprops r15 -l 106.429 +checknbshapes r16 -edge 20 +checkprops r16 -l 530.378 +checknbshapes r17 -edge 20 +checkprops r17 -l 530.378 diff --git a/tests/bugs/modalg_6/bug26150_18 b/tests/bugs/modalg_6/bug26150_18 new file mode 100644 index 0000000000..82f361d5f2 --- /dev/null +++ b/tests/bugs/modalg_6/bug26150_18 @@ -0,0 +1,70 @@ +puts "============" +puts "OCC26150" +puts "============" +puts "" +######################################################################### +# BRepOffsetAPI_ThruSections doesn't implement history method Generated() +######################################################################### + +polyline w1 -10 10 0 -10 -10 0 10 -10 0 10 10 0 +polyline w2 10 8 20 0 -10 20 -10 7 20 +circle w3 0 0 40 10 +trim w3 w3 pi 2*pi +mkedge w3 w3 +wire w3 w3 +vertex v1 0 0 -30 +vertex v2 0 0 70 + +explode w1 +explode w2 +explode w3 + +thrusections r 0 0 v1 w1 w2 w3 v2 + +genthrus r1 w1_1 +genthrus r2 w1_2 +genthrus r3 w1_3 +genthrus r4 w2_1 +genthrus r5 w2_2 +genthrus r6 w3_1 + +checknbshapes r1 -face 1 +checkprops r1 -s 1409.51 +checknbshapes r2 -face 2 +checkprops r2 -s 1703.44 +checknbshapes r3 -face 1 +checkprops r3 -s 1401.17 +checknbshapes r4 -face 2 +checkprops r4 -s 2316.52 +checknbshapes r5 -face 2 +checkprops r5 -s 2197.61 +checknbshapes r6 -face 4 +checkprops r6 -s 4514.13 + +explode w1 v +explode w2 v +explode w3 v + +genthrus r7 w1_1 +genthrus r8 w1_2 +genthrus r9 w1_3 +genthrus r10 w1_4 +genthrus r11 w2_1 +genthrus r12 w2_2 +genthrus r13 w2_3 +genthrus r14 w3_1 +genthrus r15 w3_2 +genthrus r16 v1 +genthrus r17 v2 + +checkprops r7 -l 109.077 +checkprops r8 -l 122.394 +checkprops r9 -l 124.029 +checkprops r10 -l 109.865 +checkprops r11 -l 109.865 +checkprops r12 -l 104.896 +checkprops r13 -l 109.077 +checkprops r14 -l 109.077 +checkprops r15 -l 109.865 +checkprops r16 -l 570.261 +checkprops r17 -l 570.261 diff --git a/tests/bugs/modalg_6/bug26150_2 b/tests/bugs/modalg_6/bug26150_2 new file mode 100644 index 0000000000..c2ea2a35cf --- /dev/null +++ b/tests/bugs/modalg_6/bug26150_2 @@ -0,0 +1,50 @@ +puts "============" +puts "OCC26150" +puts "============" +puts "" +######################################################################### +# BRepOffsetAPI_ThruSections doesn't implement history method Generated() +######################################################################### + +polyline w1 -10 -10 0 10 -10 0 10 10 0 -10 10 0 -10 -10 0 +vertex v1 0 -10 20 +vertex v2 10 8 20 +vertex v3 -10 7 20 +edge e1 v1 v2 +orientation e1 R +edge e2 v2 v3 +orientation e2 R +edge e3 v3 v1 +orientation e3 R +wire w2 e1 e2 e3 +circle w3 0 0 40 10 +mkedge w3 w3 +wire w3 w3 + +explode w2 + +thrusections r 1 1 w1 w2 w3 + +genthrus r5 w2_1 +genthrus r6 w2_2 +genthrus r7 w2_3 + +checknbshapes r5 -face 6 +checkprops r5 -s 872.216 +checknbshapes r6 -face 6 +checkprops r6 -s 852.53 +checknbshapes r7 -face 4 +checkprops r7 -s 835.461 + +explode w2 v + +genthrus r13 w2_1 +genthrus r14 w2_2 +genthrus r15 w2_3 + +checknbshapes r13 -edge 2 +checkprops r13 -l 40.0002 +checknbshapes r14 -edge 2 +checkprops r14 -l 40.2965 +checknbshapes r15 -edge 2 +checkprops r15 -l 40.2389 diff --git a/tests/bugs/modalg_6/bug26150_3 b/tests/bugs/modalg_6/bug26150_3 new file mode 100644 index 0000000000..ad8182a62a --- /dev/null +++ b/tests/bugs/modalg_6/bug26150_3 @@ -0,0 +1,75 @@ +puts "============" +puts "OCC26150" +puts "============" +puts "" +######################################################################### +# BRepOffsetAPI_ThruSections doesn't implement history method Generated() +######################################################################### + +polyline w1 -10 -10 0 10 -10 0 10 10 0 -10 10 0 -10 -10 0 +polyline w2 0 -10 20 -10 7 20 10 8 20 0 -10 20 +circle w3 0 0 40 10 +mkedge w3 w3 +wire w3 w3 + +explode w1 +explode w2 +explode w3 + +thrusections r 1 0 w1 w2 w3 + +genthrus r1 w1_1 +genthrus r2 w1_2 +genthrus r3 w1_3 +genthrus r4 w1_4 +genthrus r5 w2_1 +genthrus r6 w2_2 +genthrus r7 w2_3 +genthrus r8 w3_1 + +checknbshapes r1 -face 2 +checkprops r1 -s 679.305 +checknbshapes r2 -face 3 +checkprops r2 -s 649.975 +checknbshapes r3 -face 1 +checkprops r3 -s 554.732 +checknbshapes r4 -face 2 +checkprops r4 -s 648.481 +checknbshapes r5 -face 2 +checkprops r5 -s 828.494 +checknbshapes r6 -face 3 +checkprops r6 -s 837.872 +checknbshapes r7 -face 3 +checkprops r7 -s 866.128 +checknbshapes r8 -face 8 +checkprops r8 -s 2532.49 + +explode w1 v +explode w2 v +explode w3 v + +genthrus r9 w1_1 +genthrus r10 w1_2 +genthrus r11 w1_3 +genthrus r12 w1_4 +genthrus r13 w2_1 +genthrus r14 w2_2 +genthrus r15 w2_3 +genthrus r16 w3_1 + +checknbshapes r9 -edge 1 +checkprops r9 -l 43.4094 +checknbshapes r10 -edge 1 +checkprops r10 -l 43.6285 +checknbshapes r11 -edge 1 +checkprops r11 -l 40.596 +checknbshapes r12 -edge 1 +checkprops r12 -l 40.9228 +checknbshapes r13 -edge 1 +checkprops r13 -l 40.0003 +checknbshapes r14 -edge 1 +checkprops r14 -l 40.3103 +checknbshapes r15 -edge 1 +checkprops r15 -l 40.3794 +checknbshapes r16 -edge 1 +checkprops r16 -l 40.9892 diff --git a/tests/bugs/modalg_6/bug26150_4 b/tests/bugs/modalg_6/bug26150_4 new file mode 100644 index 0000000000..a232eeb5a1 --- /dev/null +++ b/tests/bugs/modalg_6/bug26150_4 @@ -0,0 +1,50 @@ +puts "============" +puts "OCC26150" +puts "============" +puts "" +######################################################################### +# BRepOffsetAPI_ThruSections doesn't implement history method Generated() +######################################################################### + +polyline w1 -10 -10 0 10 -10 0 10 10 0 -10 10 0 -10 -10 0 +vertex v1 0 -10 20 +vertex v2 10 8 20 +vertex v3 -10 7 20 +edge e1 v1 v2 +orientation e1 R +edge e2 v2 v3 +orientation e2 R +edge e3 v3 v1 +orientation e3 R +wire w2 e1 e2 e3 +circle w3 0 0 40 10 +mkedge w3 w3 +wire w3 w3 + +explode w2 + +thrusections r 1 0 w1 w2 w3 + +genthrus r5 w2_1 +genthrus r6 w2_2 +genthrus r7 w2_3 + +checknbshapes r5 -face 3 +checkprops r5 -s 866.128 +checknbshapes r6 -face 3 +checkprops r6 -s 837.872 +checknbshapes r7 -face 2 +checkprops r7 -s 828.494 + +explode w2 v + +genthrus r13 w2_1 +genthrus r14 w2_2 +genthrus r15 w2_3 + +checknbshapes r13 -edge 1 +checkprops r13 -l 40.0003 +checknbshapes r14 -edge 1 +checkprops r14 -l 40.3794 +checknbshapes r15 -edge 1 +checkprops r15 -l 40.3103 diff --git a/tests/bugs/modalg_6/bug26150_5 b/tests/bugs/modalg_6/bug26150_5 new file mode 100644 index 0000000000..392d03cc72 --- /dev/null +++ b/tests/bugs/modalg_6/bug26150_5 @@ -0,0 +1,41 @@ +puts "============" +puts "OCC26150" +puts "============" +puts "" +######################################################################### +# BRepOffsetAPI_ThruSections doesn't implement history method Generated() +######################################################################### + +polyline w1 -10 -10 0 10 -10 0 10 10 0 -10 10 0 -10 -10 0 +polyline w2 0 -10 20 -10 7 20 10 8 20 0 -10 20 +circle w3 0 0 40 10 +mkedge w3 w3 +wire w3 w3 +vertex v1 0 0 -30 +vertex v2 0 0 70 + +explode w1 + +thrusections r 1 1 v1 w1 w2 w3 v2 + +genthrus r1 w1_1 +genthrus r2 w1_2 +genthrus r3 w1_3 +genthrus r4 w1_4 + +checknbshapes r1 -face 8 +checkprops r1 -s 1232.78 +checknbshapes r2 -face 12 +checkprops r2 -s 1215.55 +checknbshapes r3 -face 4 +checkprops r3 -s 1155.34 +checknbshapes r4 -face 8 +checkprops r4 -s 1214.91 + +genthrus r5 v1 +genthrus r6 v2 + +checknbshapes r5 -edge 32 +checkprops r5 -l 841.334 +checknbshapes r6 -edge 32 +checkprops r6 -l 841.334 diff --git a/tests/bugs/modalg_6/bug26150_6 b/tests/bugs/modalg_6/bug26150_6 new file mode 100644 index 0000000000..6316a449de --- /dev/null +++ b/tests/bugs/modalg_6/bug26150_6 @@ -0,0 +1,41 @@ +puts "============" +puts "OCC26150" +puts "============" +puts "" +######################################################################### +# BRepOffsetAPI_ThruSections doesn't implement history method Generated() +######################################################################### + +polyline w1 -10 -10 0 10 -10 0 10 10 0 -10 10 0 -10 -10 0 +polyline w2 0 -10 20 -10 7 20 10 8 20 0 -10 20 +circle w3 0 0 40 10 +mkedge w3 w3 +wire w3 w3 +vertex v1 0 0 -30 +vertex v2 0 0 70 + +explode w1 + +thrusections r 1 0 v1 w1 w2 w3 v2 + +genthrus r1 w1_1 +genthrus r2 w1_2 +genthrus r3 w1_3 +genthrus r4 w1_4 + +checknbshapes r1 -face 2 +checkprops r1 -s 1970.62 +checknbshapes r2 -face 3 +checkprops r2 -s 1933.42 +checknbshapes r3 -face 1 +checkprops r3 -s 1690.2 +checknbshapes r4 -face 2 +checkprops r4 -s 1859.72 + +genthrus r5 v1 +genthrus r6 v2 + +checknbshapes r5 -edge 8 +checkprops r5 -l 902.911 +checknbshapes r6 -edge 8 +checkprops r6 -l 902.911 diff --git a/tests/bugs/modalg_6/bug26150_7 b/tests/bugs/modalg_6/bug26150_7 new file mode 100644 index 0000000000..e6d9422722 --- /dev/null +++ b/tests/bugs/modalg_6/bug26150_7 @@ -0,0 +1,41 @@ +puts "============" +puts "OCC26150" +puts "============" +puts "" +######################################################################### +# BRepOffsetAPI_ThruSections doesn't implement history method Generated() +######################################################################### + +polyline w1 -10 -10 0 10 -10 0 10 10 0 -10 10 0 -10 -10 0 +polyline w2 -10 -10 20 10 -10 20 10 10 20 -10 10 20 -10 -10 20 +trotate w2 0 0 0 0 0 1 45 +polyline w3 -10 -10 40 10 -10 40 10 10 40 -10 10 40 -10 -10 40 +trotate w3 0 0 0 0 0 1 90 +vertex v1 0 0 -30 +vertex v2 0 0 70 + +explode w1 + +thrusections -N r 1 1 v1 w1 w2 w3 v2 + +genthrus r1 w1_1 +genthrus r2 w1_2 +genthrus r3 w1_3 +genthrus r4 w1_4 + +checknbshapes r1 -face 4 +checkprops r1 -s 1412.16 +checknbshapes r2 -face 4 +checkprops r2 -s 1412.16 +checknbshapes r3 -face 4 +checkprops r3 -s 1412.16 +checknbshapes r4 -face 4 +checkprops r4 -s 1412.16 + +genthrus r5 v1 +genthrus r6 v2 + +checknbshapes r5 -edge 16 +checkprops r5 -l 447.259 +checknbshapes r6 -edge 16 +checkprops r6 -l 447.259 diff --git a/tests/bugs/modalg_6/bug26150_8 b/tests/bugs/modalg_6/bug26150_8 new file mode 100644 index 0000000000..e8a87487cb --- /dev/null +++ b/tests/bugs/modalg_6/bug26150_8 @@ -0,0 +1,37 @@ +puts "============" +puts "OCC26150" +puts "============" +puts "" +######################################################################### +# BRepOffsetAPI_ThruSections doesn't implement history method Generated() +######################################################################### + +polyline w1 -10 -10 0 10 -10 0 10 10 0 -10 10 0 -10 -10 0 +polyline w2 -10 -10 20 10 -10 20 10 10 20 -10 10 20 -10 -10 20 +trotate w2 0 0 0 0 0 1 45 +polyline w3 -10 -10 40 10 -10 40 10 10 40 -10 10 40 -10 -10 40 +trotate w3 0 0 0 0 0 1 90 +vertex v1 0 0 -30 +vertex v2 0 0 70 + +explode w1 + +thrusections -N r 1 0 v1 w1 w2 w3 v2 + +genthrus r1 w1_1 +genthrus r2 w1_2 +genthrus r3 w1_3 +genthrus r4 w1_4 + +checkprops r1 -s 1694.42 +checkprops r2 -s 1694.42 +checkprops r3 -s 1694.42 +checkprops r4 -s 1694.42 + +genthrus r5 v1 +genthrus r6 v2 + +checknbshapes r5 -edge 4 +checkprops r5 -l 466.764 +checknbshapes r6 -edge 4 +checkprops r6 -l 466.764 diff --git a/tests/bugs/modalg_6/bug26150_9 b/tests/bugs/modalg_6/bug26150_9 new file mode 100644 index 0000000000..38fc6d4d7f --- /dev/null +++ b/tests/bugs/modalg_6/bug26150_9 @@ -0,0 +1,94 @@ +puts "============" +puts "OCC26150" +puts "============" +puts "" +######################################################################### +# BRepOffsetAPI_ThruSections doesn't implement history method Generated() +######################################################################### + +restore [locate_data_file bug27386_pr1.brep] pr1 +restore [locate_data_file bug27386_pr2.brep] pr2 +restore [locate_data_file bug27386_pr3.brep] pr3 +beziercurve c1 3 0 50 -45 5 50 -50 0 50 -55 +beziercurve c2 3 0 50 -45 -5 50 -50 0 50 -55 +mkedge e1 c1 +mkedge e2 c2 +orientation e2 R +wire pr4 e1 e2 +donly pr1 pr2 pr3 pr4 + +explode pr1 +explode pr2 +explode pr3 +explode pr4 + +thrusections r 1 1 pr1 pr2 pr3 pr4 pr1 + +genthrus r1 pr1_1 +genthrus r2 pr1_2 +genthrus r3 pr1_3 +genthrus r4 pr1_4 +genthrus r5 pr2_1 +genthrus r6 pr2_2 +genthrus r7 pr2_3 +genthrus r8 pr3_1 +genthrus r9 pr4_1 +genthrus r10 pr4_2 + +checknbshapes r1 -face 8 +checkprops r1 -s 1909.23 +checknbshapes r2 -face 8 +checkprops r2 -s 1520.59 +checknbshapes r3 -face 8 +checkprops r3 -s 2249.48 +checknbshapes r4 -face 12 +checkprops r4 -s 1518.88 +checknbshapes r5 -face 12 +checkprops r5 -s 2414.6 +checknbshapes r6 -face 8 +checkprops r6 -s 2416.3 +checknbshapes r7 -face 16 +checkprops r7 -s 2367.27 +checknbshapes r8 -face 36 +checkprops r8 -s 7198.18 +checknbshapes r9 -face 20 +checkprops r9 -s 3598.24 +checknbshapes r10 -face 16 +checkprops r10 -s 3599.94 + +explode pr1 v +explode pr2 v +explode pr3 v +explode pr4 v + +genthrus r11 pr1_1 +genthrus r12 pr1_2 +genthrus r13 pr1_3 +genthrus r14 pr1_4 +genthrus r15 pr2_1 +genthrus r16 pr2_2 +genthrus r17 pr2_3 +genthrus r18 pr3_1 +genthrus r19 pr4_1 +genthrus r20 pr4_2 + +checknbshapes r11 -edge 4 +checkprops r11 -l 260.921 +checknbshapes r12 -edge 4 +checkprops r12 -l 260.921 +checknbshapes r13 -edge 4 +checkprops r13 -l 299.007 +checknbshapes r14 -edge 4 +checkprops r14 -l 299.007 +checknbshapes r15 -edge 4 +checkprops r15 -l 264.795 +checknbshapes r16 -edge 4 +checkprops r16 -l 311.127 +checknbshapes r17 -edge 4 +checkprops r17 -l 264.795 +checknbshapes r18 -edge 4 +checkprops r18 -l 280.806 +checknbshapes r19 -edge 4 +checkprops r19 -l 254.558 +checknbshapes r20 -edge 4 +checkprops r20 -l 311.127