mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-05 18:16:23 +03:00
0023162: BRepOffsetAPI_MakePipeShell works wrong
In ComputeOrigin(), superpose wire origins before checking distance between vertices Fix for wires of one edge
This commit is contained in:
parent
1bd657ae3c
commit
92075a6533
@ -1492,6 +1492,11 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean polar )
|
|||||||
else
|
else
|
||||||
for (j = 1; j <= theLength; j++)
|
for (j = 1; j <= theLength; j++)
|
||||||
{
|
{
|
||||||
|
// get a vector to superpose SeqVertices(j) on PrevSeq(1)
|
||||||
|
const TopoDS_Vertex& Vprev = TopoDS::Vertex( PrevSeq(1) );
|
||||||
|
const TopoDS_Vertex& V = TopoDS::Vertex( SeqVertices(j) );
|
||||||
|
gp_Vec curToPrevVec( BRep_Tool::Pnt(V), BRep_Tool::Pnt(Vprev) );
|
||||||
|
|
||||||
//Forward
|
//Forward
|
||||||
Standard_Real SumDist = 0.;
|
Standard_Real SumDist = 0.;
|
||||||
for (k = j, n = 1; k <= theLength; k++, n++)
|
for (k = j, n = 1; k <= theLength; k++, n++)
|
||||||
@ -1499,7 +1504,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean polar )
|
|||||||
const TopoDS_Vertex& Vprev = TopoDS::Vertex( PrevSeq(n) );
|
const TopoDS_Vertex& Vprev = TopoDS::Vertex( PrevSeq(n) );
|
||||||
gp_Pnt Pprev = BRep_Tool::Pnt(Vprev);
|
gp_Pnt Pprev = BRep_Tool::Pnt(Vprev);
|
||||||
const TopoDS_Vertex& V = TopoDS::Vertex( SeqVertices(k) );
|
const TopoDS_Vertex& V = TopoDS::Vertex( SeqVertices(k) );
|
||||||
gp_Pnt P = BRep_Tool::Pnt(V);
|
gp_Pnt P = BRep_Tool::Pnt(V).XYZ() + curToPrevVec.XYZ();
|
||||||
SumDist += Pprev.Distance(P);
|
SumDist += Pprev.Distance(P);
|
||||||
if (NbSamples > 0)
|
if (NbSamples > 0)
|
||||||
{
|
{
|
||||||
@ -1518,7 +1523,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean polar )
|
|||||||
(Ecurve.FirstParameter() + nbs*SampleOnCur) :
|
(Ecurve.FirstParameter() + nbs*SampleOnCur) :
|
||||||
(Ecurve.FirstParameter() + (NbSamples-nbs)*SampleOnCur);
|
(Ecurve.FirstParameter() + (NbSamples-nbs)*SampleOnCur);
|
||||||
gp_Pnt PonPrev = PrevEcurve.Value(ParOnPrev);
|
gp_Pnt PonPrev = PrevEcurve.Value(ParOnPrev);
|
||||||
gp_Pnt PonCur = Ecurve.Value(ParOnCur);
|
gp_Pnt PonCur = Ecurve.Value(ParOnCur).XYZ() + curToPrevVec.XYZ();
|
||||||
SumDist += PonPrev.Distance(PonCur);
|
SumDist += PonPrev.Distance(PonCur);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1528,7 +1533,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean polar )
|
|||||||
const TopoDS_Vertex& Vprev = TopoDS::Vertex( PrevSeq(n) );
|
const TopoDS_Vertex& Vprev = TopoDS::Vertex( PrevSeq(n) );
|
||||||
gp_Pnt Pprev = BRep_Tool::Pnt(Vprev);
|
gp_Pnt Pprev = BRep_Tool::Pnt(Vprev);
|
||||||
const TopoDS_Vertex& V = TopoDS::Vertex( SeqVertices(k) );
|
const TopoDS_Vertex& V = TopoDS::Vertex( SeqVertices(k) );
|
||||||
gp_Pnt P = BRep_Tool::Pnt(V);
|
gp_Pnt P = BRep_Tool::Pnt(V).XYZ() + curToPrevVec.XYZ();
|
||||||
SumDist += Pprev.Distance(P);
|
SumDist += Pprev.Distance(P);
|
||||||
if (NbSamples > 0)
|
if (NbSamples > 0)
|
||||||
{
|
{
|
||||||
@ -1547,7 +1552,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean polar )
|
|||||||
(Ecurve.FirstParameter() + nbs*SampleOnCur) :
|
(Ecurve.FirstParameter() + nbs*SampleOnCur) :
|
||||||
(Ecurve.FirstParameter() + (NbSamples-nbs)*SampleOnCur);
|
(Ecurve.FirstParameter() + (NbSamples-nbs)*SampleOnCur);
|
||||||
gp_Pnt PonPrev = PrevEcurve.Value(ParOnPrev);
|
gp_Pnt PonPrev = PrevEcurve.Value(ParOnPrev);
|
||||||
gp_Pnt PonCur = Ecurve.Value(ParOnCur);
|
gp_Pnt PonCur = Ecurve.Value(ParOnCur).XYZ() + curToPrevVec.XYZ();
|
||||||
SumDist += PonPrev.Distance(PonCur);
|
SumDist += PonPrev.Distance(PonCur);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1566,7 +1571,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean polar )
|
|||||||
const TopoDS_Vertex& Vprev = TopoDS::Vertex( PrevSeq(n) );
|
const TopoDS_Vertex& Vprev = TopoDS::Vertex( PrevSeq(n) );
|
||||||
gp_Pnt Pprev = BRep_Tool::Pnt(Vprev);
|
gp_Pnt Pprev = BRep_Tool::Pnt(Vprev);
|
||||||
const TopoDS_Vertex& V = TopoDS::Vertex( SeqVertices(k) );
|
const TopoDS_Vertex& V = TopoDS::Vertex( SeqVertices(k) );
|
||||||
gp_Pnt P = BRep_Tool::Pnt(V);
|
gp_Pnt P = BRep_Tool::Pnt(V).XYZ() + curToPrevVec.XYZ();
|
||||||
SumDist += Pprev.Distance(P);
|
SumDist += Pprev.Distance(P);
|
||||||
if (NbSamples > 0)
|
if (NbSamples > 0)
|
||||||
{
|
{
|
||||||
@ -1588,7 +1593,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean polar )
|
|||||||
(Ecurve.FirstParameter() + (NbSamples-nbs)*SampleOnCur) :
|
(Ecurve.FirstParameter() + (NbSamples-nbs)*SampleOnCur) :
|
||||||
(Ecurve.FirstParameter() + nbs*SampleOnCur);
|
(Ecurve.FirstParameter() + nbs*SampleOnCur);
|
||||||
gp_Pnt PonPrev = PrevEcurve.Value(ParOnPrev);
|
gp_Pnt PonPrev = PrevEcurve.Value(ParOnPrev);
|
||||||
gp_Pnt PonCur = Ecurve.Value(ParOnCur);
|
gp_Pnt PonCur = Ecurve.Value(ParOnCur).XYZ() + curToPrevVec.XYZ();
|
||||||
SumDist += PonPrev.Distance(PonCur);
|
SumDist += PonPrev.Distance(PonCur);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1598,7 +1603,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean polar )
|
|||||||
const TopoDS_Vertex& Vprev = TopoDS::Vertex( PrevSeq(n) );
|
const TopoDS_Vertex& Vprev = TopoDS::Vertex( PrevSeq(n) );
|
||||||
gp_Pnt Pprev = BRep_Tool::Pnt(Vprev);
|
gp_Pnt Pprev = BRep_Tool::Pnt(Vprev);
|
||||||
const TopoDS_Vertex& V = TopoDS::Vertex( SeqVertices(k) );
|
const TopoDS_Vertex& V = TopoDS::Vertex( SeqVertices(k) );
|
||||||
gp_Pnt P = BRep_Tool::Pnt(V);
|
gp_Pnt P = BRep_Tool::Pnt(V).XYZ() + curToPrevVec.XYZ();
|
||||||
SumDist += Pprev.Distance(P);
|
SumDist += Pprev.Distance(P);
|
||||||
if (NbSamples > 0)
|
if (NbSamples > 0)
|
||||||
{
|
{
|
||||||
@ -1617,7 +1622,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean polar )
|
|||||||
(Ecurve.FirstParameter() + (NbSamples-nbs)*SampleOnCur) :
|
(Ecurve.FirstParameter() + (NbSamples-nbs)*SampleOnCur) :
|
||||||
(Ecurve.FirstParameter() + nbs*SampleOnCur);
|
(Ecurve.FirstParameter() + nbs*SampleOnCur);
|
||||||
gp_Pnt PonPrev = PrevEcurve.Value(ParOnPrev);
|
gp_Pnt PonPrev = PrevEcurve.Value(ParOnPrev);
|
||||||
gp_Pnt PonCur = Ecurve.Value(ParOnCur);
|
gp_Pnt PonCur = Ecurve.Value(ParOnCur).XYZ() + curToPrevVec.XYZ();
|
||||||
SumDist += PonPrev.Distance(PonCur);
|
SumDist += PonPrev.Distance(PonCur);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user