0028684: BRepOffsetAPI_MakeOffset produces wire with another orientation in compare with source wire

Added flag to reverse resulting shape, if it was reverse in BuildDomains() to bringing to the same direction as the original shape
This commit is contained in:
akaftasev
2021-08-24 22:47:18 +03:00
committed by smoskvin
parent 8f70959571
commit 55b5d19bd8
24 changed files with 136 additions and 8 deletions

View File

@@ -138,7 +138,8 @@ static void BuildDomains(TopoDS_Face& myFace,
BRepFill_ListOfOffsetWire& myAlgos,
GeomAbs_JoinType myJoin,
Standard_Boolean myIsOpenResult,
Standard_Boolean isPositive)
Standard_Boolean isPositive,
Standard_Boolean& isWasReversed)
{
BRepAlgo_FaceRestrictor FR;
TopoDS_Vertex VF,VL;
@@ -164,6 +165,7 @@ static void BuildDomains(TopoDS_Face& myFace,
const TopoDS_Shape& W = itl.Value();
LWires.Append(W.Reversed());
}
isWasReversed = Standard_True;
WorkWires = LWires;
}
}
@@ -296,13 +298,13 @@ void BRepOffsetAPI_MakeOffset::Perform(const Standard_Real Offset,
BRep_Builder B;
B.MakeCompound (Res);
myLastIsLeft = (Offset <= 0);
Standard_Boolean isWasReversed = Standard_False;
if( Offset <= 0. )
{
if( myLeft.IsEmpty() )
{
// Modified by Sergey KHROMOV - Fri Apr 27 14:35:26 2001 Begin
BuildDomains(myFace,myWires,myLeft,myJoin,myIsOpenResult, Standard_False);
BuildDomains(myFace,myWires,myLeft,myJoin,myIsOpenResult, Standard_False, isWasReversed);
// Modified by Sergey KHROMOV - Fri Apr 27 14:35:26 2001 End
}
@@ -312,9 +314,9 @@ void BRepOffsetAPI_MakeOffset::Perform(const Standard_Real Offset,
Algo.Perform(Abs(Offset),Alt);
if (Algo.IsDone() && !Algo.Shape().IsNull())
{
B.Add(Res,Algo.Shape());
B.Add(Res,isWasReversed ? Algo.Shape().Reversed() : Algo.Shape());
if (i == 1)
myShape = Algo.Shape();
myShape = isWasReversed ? Algo.Shape().Reversed() : Algo.Shape();
i++;
}
@@ -325,7 +327,7 @@ void BRepOffsetAPI_MakeOffset::Perform(const Standard_Real Offset,
if (myRight.IsEmpty())
{
// Modified by Sergey KHROMOV - Fri Apr 27 14:35:28 2001 Begin
BuildDomains(myFace,myWires,myRight,myJoin,myIsOpenResult, Standard_True);
BuildDomains(myFace,myWires,myRight,myJoin,myIsOpenResult, Standard_True, isWasReversed);
// Modified by Sergey KHROMOV - Fri Apr 27 14:35:35 2001 End
}
@@ -336,10 +338,10 @@ void BRepOffsetAPI_MakeOffset::Perform(const Standard_Real Offset,
if (Algo.IsDone() && !Algo.Shape().IsNull())
{
B.Add(Res,Algo.Shape());
B.Add(Res, isWasReversed ? Algo.Shape().Reversed() : Algo.Shape());
if (i == 1)
myShape = Algo.Shape();
myShape = isWasReversed ? Algo.Shape().Reversed() : Algo.Shape();
i++;
}