mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-05-17 23:53:20 +08:00
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:
@@ -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++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user