mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +03:00
0023367: New functionality restoring the middle path of pipe-like shape
This commit is contained in:
parent
24def445c3
commit
7416e83cf6
@ -20,6 +20,7 @@
|
|||||||
#include <BRepLib_MakeWire.hxx>
|
#include <BRepLib_MakeWire.hxx>
|
||||||
|
|
||||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||||
|
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||||
#include <TopExp.hxx>
|
#include <TopExp.hxx>
|
||||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||||
#include <TopoDS.hxx>
|
#include <TopoDS.hxx>
|
||||||
@ -361,7 +362,7 @@ void BRepOffsetAPI_MiddlePath::Build()
|
|||||||
TopTools_MapOfShape CurVertices;
|
TopTools_MapOfShape CurVertices;
|
||||||
|
|
||||||
Standard_Integer i, j, k;
|
Standard_Integer i, j, k;
|
||||||
TopoDS_Edge anEdge, theEdge;
|
TopoDS_Edge anEdge;
|
||||||
TopoDS_Vertex V1, V2, NextVertex;
|
TopoDS_Vertex V1, V2, NextVertex;
|
||||||
//Initialization of <myPaths>
|
//Initialization of <myPaths>
|
||||||
for (i = 1; i <= StartVertices.Length(); i++)
|
for (i = 1; i <= StartVertices.Length(); i++)
|
||||||
@ -389,29 +390,29 @@ void BRepOffsetAPI_MiddlePath::Build()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Filling of "myPaths"
|
//Filling of "myPaths"
|
||||||
//TopTools_MapOfShape StartFacesMap;
|
|
||||||
TopTools_ListOfShape NextVertices;
|
TopTools_ListOfShape NextVertices;
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
StartFacesMap.Clear();
|
|
||||||
for (i = 1; i <= myPaths.Length(); i++)
|
for (i = 1; i <= myPaths.Length(); i++)
|
||||||
{
|
{
|
||||||
const TopoDS_Shape& LastEdge = myPaths(i).Last();
|
const TopoDS_Shape& theShape = myPaths(i).Last();
|
||||||
const TopTools_ListOfShape& LF = EFmap(LastEdge);
|
TopoDS_Edge theEdge;
|
||||||
for (itl.Initialize(LF); itl.More(); itl.Next())
|
TopoDS_Vertex theVertex;
|
||||||
StartFacesMap.Add(itl.Value();
|
if (theShape.ShapeType() == TopAbs_EDGE)
|
||||||
}
|
{
|
||||||
*/
|
theEdge = TopoDS::Edge(theShape);
|
||||||
//TopTools_SequenceOfShape NewEdges;
|
theVertex = TopExp::LastVertex(theEdge, Standard_True);
|
||||||
for (i = 1; i <= myPaths.Length(); i++)
|
}
|
||||||
{
|
else //last segment of path was punctual
|
||||||
theEdge = TopoDS::Edge(myPaths(i).Last());
|
{
|
||||||
TopoDS_Vertex theVertex = TopExp::LastVertex(theEdge, Standard_True);
|
theEdge = TopoDS::Edge(myPaths(i)(myPaths(i).Length()-1));
|
||||||
|
theVertex = TopoDS::Vertex(theShape);
|
||||||
|
}
|
||||||
|
|
||||||
if (EndVertices.Contains(theVertex))
|
if (EndVertices.Contains(theVertex))
|
||||||
continue;
|
continue;
|
||||||
const TopTools_ListOfShape& LE = VEmap.FindFromKey(theVertex);
|
const TopTools_ListOfShape& LE = VEmap.FindFromKey(theVertex);
|
||||||
Standard_Boolean NextEdgeFound = Standard_False;
|
TopTools_MapOfShape NextEdgeCandidates;
|
||||||
for (itl.Initialize(LE); itl.More(); itl.Next())
|
for (itl.Initialize(LE); itl.More(); itl.Next())
|
||||||
{
|
{
|
||||||
anEdge = TopoDS::Edge(itl.Value());
|
anEdge = TopoDS::Edge(itl.Value());
|
||||||
@ -426,15 +427,20 @@ void BRepOffsetAPI_MiddlePath::Build()
|
|||||||
NextVertex = V1;
|
NextVertex = V1;
|
||||||
}
|
}
|
||||||
if (!CurVertices.Contains(NextVertex))
|
if (!CurVertices.Contains(NextVertex))
|
||||||
{
|
NextEdgeCandidates.Add(anEdge);
|
||||||
NextEdgeFound = Standard_True;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (NextEdgeFound)
|
if (!NextEdgeCandidates.IsEmpty())
|
||||||
{
|
{
|
||||||
myPaths(i).Append(anEdge);
|
if (NextEdgeCandidates.Extent() > 1)
|
||||||
NextVertices.Append(NextVertex);
|
myPaths(i).Append(theVertex); //punctual segment of path
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TopTools_MapIteratorOfMapOfShape mapit(NextEdgeCandidates);
|
||||||
|
anEdge = TopoDS::Edge(mapit.Key());
|
||||||
|
myPaths(i).Append(anEdge);
|
||||||
|
NextVertex = TopExp::LastVertex(anEdge, Standard_True);
|
||||||
|
NextVertices.Append(NextVertex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (NextVertices.IsEmpty())
|
if (NextVertices.IsEmpty())
|
||||||
@ -444,8 +450,32 @@ void BRepOffsetAPI_MiddlePath::Build()
|
|||||||
NextVertices.Clear();
|
NextVertices.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Temporary
|
||||||
|
/*
|
||||||
|
TopoDS_Compound aCompound, aCmp1;
|
||||||
|
BRep_Builder BB;
|
||||||
|
BB.MakeCompound(aCompound);
|
||||||
|
BB.MakeCompound(aCmp1);
|
||||||
|
for (i = 1; i <= myPaths.Length(); i++)
|
||||||
|
{
|
||||||
|
TopoDS_Compound aCmp;
|
||||||
|
BB.MakeCompound(aCmp);
|
||||||
|
for (j = 1; j <= myPaths(i).Length(); j++)
|
||||||
|
BB.Add(aCmp, myPaths(i)(j));
|
||||||
|
BB.Add(aCmp1, aCmp);
|
||||||
|
}
|
||||||
|
BB.Add(aCompound, aCmp1);
|
||||||
|
|
||||||
|
myShape = aCompound;
|
||||||
|
|
||||||
|
Done();
|
||||||
|
return;
|
||||||
|
*/
|
||||||
|
////////////
|
||||||
|
|
||||||
//Building of set of sections
|
//Building of set of sections
|
||||||
Standard_Integer NbE = EdgeSeq.Length();
|
Standard_Integer NbE = EdgeSeq.Length();
|
||||||
|
Standard_Integer NbPaths = myPaths.Length();
|
||||||
Standard_Integer NbVer = myPaths.Length();
|
Standard_Integer NbVer = myPaths.Length();
|
||||||
if (myClosedSection)
|
if (myClosedSection)
|
||||||
NbVer++;
|
NbVer++;
|
||||||
@ -461,6 +491,21 @@ void BRepOffsetAPI_MiddlePath::Build()
|
|||||||
{
|
{
|
||||||
if (!EdgeSeq(j-1).IsNull())
|
if (!EdgeSeq(j-1).IsNull())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
//for the end of initial shape
|
||||||
|
if (myPaths(j-1).Length() < i)
|
||||||
|
{
|
||||||
|
TopoDS_Edge aE1 = TopoDS::Edge(myPaths(j-1)(i-1));
|
||||||
|
TopoDS_Shape LastVer = TopExp::LastVertex(aE1, Standard_True);
|
||||||
|
myPaths(j-1).Append(LastVer);
|
||||||
|
}
|
||||||
|
if (myPaths((j<=NbPaths)? j : 1).Length() < i)
|
||||||
|
{
|
||||||
|
TopoDS_Edge aE2 = TopoDS::Edge(myPaths((j<=NbPaths)? j : 1)(i-1));
|
||||||
|
TopoDS_Shape LastVer = TopExp::LastVertex(aE2, Standard_True);
|
||||||
|
myPaths((j<=NbPaths)? j : 1).Append(LastVer);
|
||||||
|
}
|
||||||
|
//////////////////////////////
|
||||||
|
|
||||||
if (ToInsertVertex)
|
if (ToInsertVertex)
|
||||||
{
|
{
|
||||||
@ -470,11 +515,11 @@ void BRepOffsetAPI_MiddlePath::Build()
|
|||||||
TopoDS_Shape fver = TopExp::FirstVertex(aE1, Standard_True);
|
TopoDS_Shape fver = TopExp::FirstVertex(aE1, Standard_True);
|
||||||
myPaths(j-1).InsertBefore(i, fver);
|
myPaths(j-1).InsertBefore(i, fver);
|
||||||
}
|
}
|
||||||
if (myPaths((j<=NbE)? j : 1)(i).ShapeType() == TopAbs_EDGE)
|
if (myPaths((j<=NbPaths)? j : 1)(i).ShapeType() == TopAbs_EDGE)
|
||||||
{
|
{
|
||||||
TopoDS_Edge aE2 = TopoDS::Edge(myPaths((j<=NbE)? j : 1)(i));
|
TopoDS_Edge aE2 = TopoDS::Edge(myPaths((j<=NbPaths)? j : 1)(i));
|
||||||
TopoDS_Shape fver = TopExp::FirstVertex(aE2, Standard_True);
|
TopoDS_Shape fver = TopExp::FirstVertex(aE2, Standard_True);
|
||||||
myPaths((j<=NbE)? j : 1).InsertBefore(i, fver);
|
myPaths((j<=NbPaths)? j : 1).InsertBefore(i, fver);
|
||||||
}
|
}
|
||||||
ToInsertVertex = Standard_False;
|
ToInsertVertex = Standard_False;
|
||||||
}
|
}
|
||||||
@ -482,15 +527,15 @@ void BRepOffsetAPI_MiddlePath::Build()
|
|||||||
TopoDS_Edge E1, E2;
|
TopoDS_Edge E1, E2;
|
||||||
if (myPaths(j-1)(i).ShapeType() == TopAbs_EDGE)
|
if (myPaths(j-1)(i).ShapeType() == TopAbs_EDGE)
|
||||||
E1 = TopoDS::Edge(myPaths(j-1)(i));
|
E1 = TopoDS::Edge(myPaths(j-1)(i));
|
||||||
if (myPaths((j<=NbE)? j : 1)(i).ShapeType() == TopAbs_EDGE)
|
if (myPaths((j<=NbPaths)? j : 1)(i).ShapeType() == TopAbs_EDGE)
|
||||||
E2 = TopoDS::Edge(myPaths((j<=NbE)? j : 1)(i));
|
E2 = TopoDS::Edge(myPaths((j<=NbPaths)? j : 1)(i));
|
||||||
TopoDS_Edge E12 = TopoDS::Edge(SectionsEdges(i)(j-1));
|
TopoDS_Edge E12 = TopoDS::Edge(SectionsEdges(i)(j-1));
|
||||||
|
|
||||||
//TopoDS_Vertex PrevVertex = TopoDS::Vertex(VerSeq(j-1));
|
//TopoDS_Vertex PrevVertex = TopoDS::Vertex(VerSeq(j-1));
|
||||||
//TopoDS_Vertex CurVertex = TopoDS::Vertex(VerSeq(j));
|
//TopoDS_Vertex CurVertex = TopoDS::Vertex(VerSeq(j));
|
||||||
TopoDS_Vertex PrevVertex = (E1.IsNull())? TopoDS::Vertex(myPaths(j-1)(i))
|
TopoDS_Vertex PrevVertex = (E1.IsNull())? TopoDS::Vertex(myPaths(j-1)(i))
|
||||||
: TopExp::LastVertex(E1, Standard_True);
|
: TopExp::LastVertex(E1, Standard_True);
|
||||||
TopoDS_Vertex CurVertex = (E2.IsNull())? TopoDS::Vertex(myPaths((j<=NbE)? j : 1)(i))
|
TopoDS_Vertex CurVertex = (E2.IsNull())? TopoDS::Vertex(myPaths((j<=NbPaths)? j : 1)(i))
|
||||||
: TopExp::LastVertex(E2, Standard_True);
|
: TopExp::LastVertex(E2, Standard_True);
|
||||||
|
|
||||||
TopoDS_Edge ProperEdge;
|
TopoDS_Edge ProperEdge;
|
||||||
@ -512,7 +557,7 @@ void BRepOffsetAPI_MiddlePath::Build()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((myPaths(j-1)(i)).ShapeType() == TopAbs_VERTEX &&
|
if ((myPaths(j-1)(i)).ShapeType() == TopAbs_VERTEX &&
|
||||||
(myPaths((j<=NbE)? j : 1)(i)).ShapeType() == TopAbs_VERTEX)
|
(myPaths((j<=NbPaths)? j : 1)(i)).ShapeType() == TopAbs_VERTEX)
|
||||||
{
|
{
|
||||||
EdgeSeq(j-1) = ProperEdge;
|
EdgeSeq(j-1) = ProperEdge;
|
||||||
continue;
|
continue;
|
||||||
@ -524,11 +569,12 @@ void BRepOffsetAPI_MiddlePath::Build()
|
|||||||
: TopExp::FirstVertex(E2, Standard_True);
|
: TopExp::FirstVertex(E2, Standard_True);
|
||||||
if (ProperEdge.IsNull()) //no connection between these two vertices
|
if (ProperEdge.IsNull()) //no connection between these two vertices
|
||||||
{
|
{
|
||||||
|
//Find the face on which E1, E2 and E12 lie
|
||||||
//ToInsertVertex = Standard_False;
|
//ToInsertVertex = Standard_False;
|
||||||
const TopoDS_Shape& EE1 = (E1.IsNull())?
|
const TopoDS_Shape& EE1 = (E1.IsNull())?
|
||||||
myPaths(j-1)(i-1) : E1;
|
myPaths(j-1)(i-1) : E1;
|
||||||
const TopoDS_Shape& EE2 = (E2.IsNull())?
|
const TopoDS_Shape& EE2 = (E2.IsNull())?
|
||||||
myPaths((j<=NbE)? j : 1)(i-1) : E2;
|
myPaths((j<=NbPaths)? j : 1)(i-1) : E2;
|
||||||
const TopTools_ListOfShape& LF = EFmap.FindFromKey(EE1);
|
const TopTools_ListOfShape& LF = EFmap.FindFromKey(EE1);
|
||||||
TopoDS_Face theFace;
|
TopoDS_Face theFace;
|
||||||
for (itl.Initialize(LF); itl.More(); itl.Next())
|
for (itl.Initialize(LF); itl.More(); itl.Next())
|
||||||
@ -562,7 +608,7 @@ void BRepOffsetAPI_MiddlePath::Build()
|
|||||||
if (E1.IsNull())
|
if (E1.IsNull())
|
||||||
E1 = TopoDS::Edge(myPaths(j-1)(i-1));
|
E1 = TopoDS::Edge(myPaths(j-1)(i-1));
|
||||||
if (E2.IsNull())
|
if (E2.IsNull())
|
||||||
E2 = TopoDS::Edge(myPaths((j<=NbE)? j : 1)(i-1));
|
E2 = TopoDS::Edge(myPaths((j<=NbPaths)? j : 1)(i-1));
|
||||||
Standard_Real fpar1, lpar1, fpar2, lpar2;
|
Standard_Real fpar1, lpar1, fpar2, lpar2;
|
||||||
Standard_Real FirstPar1, LastPar1, FirstPar2, LastPar2;
|
Standard_Real FirstPar1, LastPar1, FirstPar2, LastPar2;
|
||||||
Handle(Geom2d_Curve) PCurve1 = BRep_Tool::CurveOnSurface(E1, theFace, fpar1, lpar1);
|
Handle(Geom2d_Curve) PCurve1 = BRep_Tool::CurveOnSurface(E1, theFace, fpar1, lpar1);
|
||||||
@ -671,7 +717,7 @@ void BRepOffsetAPI_MiddlePath::Build()
|
|||||||
TopoDS_Shape VertexAsEdge = TopExp::FirstVertex(aLastEdge, Standard_True);
|
TopoDS_Shape VertexAsEdge = TopExp::FirstVertex(aLastEdge, Standard_True);
|
||||||
myPaths(k).InsertBefore(i, VertexAsEdge);
|
myPaths(k).InsertBefore(i, VertexAsEdge);
|
||||||
}
|
}
|
||||||
j = 1;
|
j = 1; //start from beginning
|
||||||
}
|
}
|
||||||
else if (ChooseEdge == 2)
|
else if (ChooseEdge == 2)
|
||||||
{
|
{
|
||||||
@ -687,7 +733,7 @@ void BRepOffsetAPI_MiddlePath::Build()
|
|||||||
if (ToInsertVertex)
|
if (ToInsertVertex)
|
||||||
{
|
{
|
||||||
myPaths(j-1).InsertBefore(i, PrevPrevVer);
|
myPaths(j-1).InsertBefore(i, PrevPrevVer);
|
||||||
myPaths((j<=NbE)? j : 1).InsertBefore(i, PrevCurVer);
|
myPaths((j<=NbPaths)? j : 1).InsertBefore(i, PrevCurVer);
|
||||||
EdgeSeq(j-1) = E12;
|
EdgeSeq(j-1) = E12;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -781,6 +827,7 @@ void BRepOffsetAPI_MiddlePath::Build()
|
|||||||
gp_Ax1 theAxis;
|
gp_Ax1 theAxis;
|
||||||
gp_Dir theDir1, theDir2;
|
gp_Dir theDir1, theDir2;
|
||||||
Standard_Real theAngle;
|
Standard_Real theAngle;
|
||||||
|
gp_Vec theTangent;
|
||||||
Standard_Boolean SimilarArcs = Standard_True;
|
Standard_Boolean SimilarArcs = Standard_True;
|
||||||
for (j = 1; j <= myPaths.Length(); j++)
|
for (j = 1; j <= myPaths.Length(); j++)
|
||||||
{
|
{
|
||||||
@ -799,6 +846,11 @@ void BRepOffsetAPI_MiddlePath::Build()
|
|||||||
theDir1 = gp_Vec(aCirc.Location(), Pnt1);
|
theDir1 = gp_Vec(aCirc.Location(), Pnt1);
|
||||||
theDir2 = gp_Vec(aCirc.Location(), Pnt2);
|
theDir2 = gp_Vec(aCirc.Location(), Pnt2);
|
||||||
theAngle = lpar - fpar;
|
theAngle = lpar - fpar;
|
||||||
|
Standard_Real theParam = (anEdge.Orientation() == TopAbs_FORWARD)?
|
||||||
|
fpar : lpar;
|
||||||
|
aCurve->D1(theParam, Pnt1, theTangent);
|
||||||
|
if (anEdge.Orientation() == TopAbs_REVERSED)
|
||||||
|
theTangent.Reverse();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -842,6 +894,14 @@ void BRepOffsetAPI_MiddlePath::Build()
|
|||||||
theAxis.Reverse();
|
theAxis.Reverse();
|
||||||
gp_Ax2 theAx2(theCenterOfCirc, theAxis.Direction(), Vec1);
|
gp_Ax2 theAx2(theCenterOfCirc, theAxis.Direction(), Vec1);
|
||||||
Handle(Geom_Circle) theCircle = GC_MakeCircle(theAx2, Vec1.Magnitude());
|
Handle(Geom_Circle) theCircle = GC_MakeCircle(theAx2, Vec1.Magnitude());
|
||||||
|
gp_Vec aTangent;
|
||||||
|
theCircle->D1( 0., Pnt1, aTangent );
|
||||||
|
if (aTangent * theTangent < 0.)
|
||||||
|
{
|
||||||
|
theAxis.Reverse();
|
||||||
|
theAx2 = gp_Ax2(theCenterOfCirc, theAxis.Direction(), Vec1);
|
||||||
|
theCircle = GC_MakeCircle(theAx2, Vec1.Magnitude());
|
||||||
|
}
|
||||||
MidEdges(i) = BRepLib_MakeEdge(theCircle, 0., theAngle);
|
MidEdges(i) = BRepLib_MakeEdge(theCircle, 0., theAngle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -240,6 +240,13 @@ GeomLib_IsPlanarSurface::GeomLib_IsPlanarSurface(const Handle(Geom_Surface)& S,
|
|||||||
Standard_Real Umin, Umax, Vmin, Vmax;
|
Standard_Real Umin, Umax, Vmin, Vmax;
|
||||||
S->Bounds(Umin, Umax, Vmin, Vmax);
|
S->Bounds(Umin, Umax, Vmin, Vmax);
|
||||||
S->D1((Umin+Umax)/2, (Vmin+Vmax)/2, P, DU, DV);
|
S->D1((Umin+Umax)/2, (Vmin+Vmax)/2, P, DU, DV);
|
||||||
|
if (DU.Magnitude() <= gp::Resolution() ||
|
||||||
|
DV.Magnitude() <= gp::Resolution())
|
||||||
|
{
|
||||||
|
Standard_Real NewU = (Umin+Umax)/2 + (Umax-Umin)*0.1;
|
||||||
|
Standard_Real NewV = (Vmin+Vmax)/2 + (Vmax-Vmin)*0.1;
|
||||||
|
S->D1( NewU, NewV, P, DU, DV );
|
||||||
|
}
|
||||||
Dn = DU^DV;
|
Dn = DU^DV;
|
||||||
if (Dn.Magnitude() > 1.e-7) {
|
if (Dn.Magnitude() > 1.e-7) {
|
||||||
Standard_Real angle = Dir.Angle(Dn);
|
Standard_Real angle = Dir.Angle(Dn);
|
||||||
@ -274,6 +281,13 @@ GeomLib_IsPlanarSurface::GeomLib_IsPlanarSurface(const Handle(Geom_Surface)& S,
|
|||||||
|
|
||||||
S->Bounds(Umin, Umax, Vmin, Vmax);
|
S->Bounds(Umin, Umax, Vmin, Vmax);
|
||||||
S->D1((Umin+Umax)/2, (Vmin+Vmax)/2, P, Du, Dv);
|
S->D1((Umin+Umax)/2, (Vmin+Vmax)/2, P, Du, Dv);
|
||||||
|
if (Du.Magnitude() <= gp::Resolution() ||
|
||||||
|
Dv.Magnitude() <= gp::Resolution())
|
||||||
|
{
|
||||||
|
Standard_Real NewU = (Umin+Umax)/2 + (Umax-Umin)*0.1;
|
||||||
|
Standard_Real NewV = (Vmin+Vmax)/2 + (Vmax-Vmin)*0.1;
|
||||||
|
S->D1( NewU, NewV, P, Du, Dv );
|
||||||
|
}
|
||||||
Dn = Du^Dv;
|
Dn = Du^Dv;
|
||||||
norm = Dn.Magnitude();
|
norm = Dn.Magnitude();
|
||||||
if (norm > 1.e-15) {
|
if (norm > 1.e-15) {
|
||||||
|
27
tests/bugs/modalg/bug23367_10
Executable file
27
tests/bugs/modalg/bug23367_10
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "CR23367"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
##########################################################################################################
|
||||||
|
# New functionality restoring the middle path of pipe-like shape
|
||||||
|
##########################################################################################################
|
||||||
|
|
||||||
|
polyline pp 0 0 0 10 0 0 20 10 0 20 20 0
|
||||||
|
polyline sp 0 0 0 0 0 100 0 50 200 0 100 100
|
||||||
|
mksweep sp
|
||||||
|
addsweep pp
|
||||||
|
buildsweep a -R
|
||||||
|
explode a e
|
||||||
|
wire w1 a_2 a_5 a_8
|
||||||
|
wire w2 a_24 a_22 a_20
|
||||||
|
donly a w1 w2
|
||||||
|
fit
|
||||||
|
middlepath result a w1 w2
|
||||||
|
|
||||||
|
set length 1.
|
||||||
|
|
||||||
|
set 2dviewer 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
23
tests/bugs/modalg/bug23367_11
Executable file
23
tests/bugs/modalg/bug23367_11
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "CR23367"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
##########################################################################################################
|
||||||
|
# New functionality restoring the middle path of pipe-like shape
|
||||||
|
##########################################################################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug23367_pipe1.brep] a
|
||||||
|
explode a e
|
||||||
|
wire w1 a_2
|
||||||
|
wire w2 a_6
|
||||||
|
donly a w1 w2
|
||||||
|
fit
|
||||||
|
middlepath result a w2 w1
|
||||||
|
|
||||||
|
set length 1386.13
|
||||||
|
|
||||||
|
set 2dviewer 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
23
tests/bugs/modalg/bug23367_12
Executable file
23
tests/bugs/modalg/bug23367_12
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "CR23367"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
##########################################################################################################
|
||||||
|
# New functionality restoring the middle path of pipe-like shape
|
||||||
|
##########################################################################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug23367_aa.brep] a
|
||||||
|
explode a e
|
||||||
|
wire w1 a_57 a_73 a_54 a_71
|
||||||
|
wire w2 a_133 a_148 a_130 a_146
|
||||||
|
donly a w1 w2
|
||||||
|
fit
|
||||||
|
middlepath result a w2 w1
|
||||||
|
|
||||||
|
set length 3.46311
|
||||||
|
|
||||||
|
set 2dviewer 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
27
tests/bugs/modalg/bug23367_13
Executable file
27
tests/bugs/modalg/bug23367_13
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "CR23367"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
##########################################################################################################
|
||||||
|
# New functionality restoring the middle path of pipe-like shape
|
||||||
|
##########################################################################################################
|
||||||
|
|
||||||
|
polyline pp 0 0 0 10 0 0 20 10 0 20 20 0
|
||||||
|
polyline sp 0 0 0 0 0 100 -50 50 200 -100 100 100
|
||||||
|
mksweep sp
|
||||||
|
addsweep pp
|
||||||
|
buildsweep a -R
|
||||||
|
explode a e
|
||||||
|
wire w1 a_2 a_5 a_8
|
||||||
|
wire w2 a_24 a_27 a_30
|
||||||
|
donly a w1 w2
|
||||||
|
fit
|
||||||
|
middlepath result a w1 w2
|
||||||
|
|
||||||
|
set length 1.
|
||||||
|
|
||||||
|
set 2dviewer 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
26
tests/bugs/modalg/bug23367_14
Executable file
26
tests/bugs/modalg/bug23367_14
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "CR23367"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
##########################################################################################################
|
||||||
|
# New functionality restoring the middle path of pipe-like shape
|
||||||
|
##########################################################################################################
|
||||||
|
|
||||||
|
polyline pp 0 0 0 10 -10 0 20 0 0 10 10 0 0 0 0
|
||||||
|
polyline sp 0 0 0 0 0 50 -100 0 0 -50 0 -50 0 0 0
|
||||||
|
mksweep sp
|
||||||
|
addsweep pp
|
||||||
|
buildsweep a -R
|
||||||
|
explode a e
|
||||||
|
wire ww a_11 a_8 a_5 a_2
|
||||||
|
donly a ww
|
||||||
|
fit
|
||||||
|
middlepath result a ww ww
|
||||||
|
|
||||||
|
set length 1.
|
||||||
|
|
||||||
|
set 2dviewer 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
27
tests/bugs/modalg/bug23367_15
Executable file
27
tests/bugs/modalg/bug23367_15
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "CR23367"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
##########################################################################################################
|
||||||
|
# New functionality restoring the middle path of pipe-like shape
|
||||||
|
##########################################################################################################
|
||||||
|
|
||||||
|
polyline pp 0 0 0 10 -10 0 20 0 0 10 10 0 0 0 0
|
||||||
|
polyline sp 0 0 0 0 0 50 -100 0 0 -50 0 -50
|
||||||
|
mksweep sp
|
||||||
|
addsweep pp
|
||||||
|
buildsweep a -R
|
||||||
|
explode a e
|
||||||
|
wire w1 a_11 a_8 a_5 a_2
|
||||||
|
wire w2 a_34 a_36 a_28 a_31
|
||||||
|
donly a w1 w2
|
||||||
|
fit
|
||||||
|
middlepath result a w1 w2
|
||||||
|
|
||||||
|
set length 1.
|
||||||
|
|
||||||
|
set 2dviewer 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
22
tests/bugs/modalg/bug23367_7
Executable file
22
tests/bugs/modalg/bug23367_7
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "CR23367"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
##########################################################################################################
|
||||||
|
# New functionality restoring the middle path of pipe-like shape
|
||||||
|
##########################################################################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug23367_aa.brep] a
|
||||||
|
explode a e
|
||||||
|
wire w1 a_57 a_73 a_54 a_71
|
||||||
|
wire w2 a_133 a_148 a_130 a_146
|
||||||
|
donly a w1 w2
|
||||||
|
fit
|
||||||
|
middlepath result a w1 w2
|
||||||
|
|
||||||
|
set length 3.46311
|
||||||
|
|
||||||
|
set 2dviewer 1
|
||||||
|
|
||||||
|
|
||||||
|
|
22
tests/bugs/modalg/bug23367_8
Executable file
22
tests/bugs/modalg/bug23367_8
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "CR23367"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
##########################################################################################################
|
||||||
|
# New functionality restoring the middle path of pipe-like shape
|
||||||
|
##########################################################################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug23367_bb.brep] b
|
||||||
|
explode b e
|
||||||
|
wire w1 b_1 b_29 b_60 b_27
|
||||||
|
wire w2 b_11 b_23 b_56 b_33
|
||||||
|
donly b w1 w2
|
||||||
|
fit
|
||||||
|
middlepath result b w1 w2
|
||||||
|
|
||||||
|
set length 1.94244
|
||||||
|
|
||||||
|
set 2dviewer 1
|
||||||
|
|
||||||
|
|
||||||
|
|
25
tests/bugs/modalg/bug23367_9
Executable file
25
tests/bugs/modalg/bug23367_9
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "CR23367"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
##########################################################################################################
|
||||||
|
# New functionality restoring the middle path of pipe-like shape
|
||||||
|
##########################################################################################################
|
||||||
|
|
||||||
|
ptorus a 50 10 0 180
|
||||||
|
explode a f
|
||||||
|
shape b Sh
|
||||||
|
add a_1 b
|
||||||
|
explode b e
|
||||||
|
wire ww b_2
|
||||||
|
donly b ww
|
||||||
|
fit
|
||||||
|
middlepath result b ww ww
|
||||||
|
|
||||||
|
set length 1.
|
||||||
|
|
||||||
|
set 2dviewer 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user