mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0025021: New option of BRepOffsetAPI_MakeOffset algorithm: open result for open wire
Test cases for issue CR25021
This commit is contained in:
@@ -40,13 +40,15 @@ is
|
||||
Create returns MakeOffset from BRepOffsetAPI;
|
||||
---Purpose: Constructs an algorithm for creating an empty offset
|
||||
Create( Spine : Face from TopoDS;
|
||||
Join : JoinType from GeomAbs = GeomAbs_Arc)
|
||||
Join : JoinType from GeomAbs = GeomAbs_Arc;
|
||||
IsOpenResult : Boolean from Standard = Standard_False)
|
||||
returns MakeOffset from BRepOffsetAPI;
|
||||
---Purpose: Constructs an algorithm for creating an algorithm
|
||||
-- to build parallels to the spine Spine
|
||||
Init( me : in out;
|
||||
Spine : Face from TopoDS;
|
||||
Join : JoinType from GeomAbs = GeomAbs_Arc)
|
||||
Join : JoinType from GeomAbs = GeomAbs_Arc;
|
||||
IsOpenResult : Boolean from Standard = Standard_False)
|
||||
---Purpose: Initializes the algorithm to construct parallels to the spine Spine.
|
||||
-- Join defines the type of parallel generated by the
|
||||
-- salient vertices of the spine. The default type is
|
||||
@@ -55,11 +57,13 @@ is
|
||||
is static;
|
||||
|
||||
Create( Spine : Wire from TopoDS;
|
||||
Join : JoinType from GeomAbs = GeomAbs_Arc)
|
||||
Join : JoinType from GeomAbs = GeomAbs_Arc;
|
||||
IsOpenResult : Boolean from Standard = Standard_False)
|
||||
returns MakeOffset from BRepOffsetAPI;
|
||||
|
||||
Init( me : in out;
|
||||
Join : JoinType from GeomAbs = GeomAbs_Arc)
|
||||
Join : JoinType from GeomAbs = GeomAbs_Arc;
|
||||
IsOpenResult : Boolean from Standard = Standard_False)
|
||||
---Purpose: Initialize the evaluation of Offseting.
|
||||
is static;
|
||||
|
||||
@@ -99,6 +103,7 @@ fields
|
||||
myIsInitialized : Boolean from Standard;
|
||||
myLastIsLeft : Boolean from Standard;
|
||||
myJoin : JoinType from GeomAbs;
|
||||
myIsOpenResult : Boolean from Standard;
|
||||
myFace : Face from TopoDS;
|
||||
myWires : ListOfShape from TopTools;
|
||||
myLeft : ListOfOffsetWire from BRepFill;
|
||||
|
@@ -54,9 +54,10 @@ BRepOffsetAPI_MakeOffset::BRepOffsetAPI_MakeOffset()
|
||||
//=======================================================================
|
||||
|
||||
BRepOffsetAPI_MakeOffset::BRepOffsetAPI_MakeOffset(const TopoDS_Face& Spine,
|
||||
const GeomAbs_JoinType Join)
|
||||
const GeomAbs_JoinType Join,
|
||||
const Standard_Boolean IsOpenResult)
|
||||
{
|
||||
Init(Spine, Join);
|
||||
Init(Spine, Join, IsOpenResult);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,11 +67,13 @@ BRepOffsetAPI_MakeOffset::BRepOffsetAPI_MakeOffset(const TopoDS_Face& Spine,
|
||||
//=======================================================================
|
||||
|
||||
void BRepOffsetAPI_MakeOffset::Init(const TopoDS_Face& Spine,
|
||||
const GeomAbs_JoinType Join)
|
||||
const GeomAbs_JoinType Join,
|
||||
const Standard_Boolean IsOpenResult)
|
||||
{
|
||||
myFace = Spine;
|
||||
myIsInitialized = Standard_True;
|
||||
myJoin = Join;
|
||||
myIsOpenResult = IsOpenResult;
|
||||
TopExp_Explorer exp;
|
||||
for (exp.Init(myFace,TopAbs_WIRE); exp.More();exp.Next()) {
|
||||
myWires.Append(exp.Current());
|
||||
@@ -83,11 +86,13 @@ void BRepOffsetAPI_MakeOffset::Init(const TopoDS_Face& Spine,
|
||||
//=======================================================================
|
||||
|
||||
BRepOffsetAPI_MakeOffset::BRepOffsetAPI_MakeOffset(const TopoDS_Wire& Spine,
|
||||
const GeomAbs_JoinType Join)
|
||||
const GeomAbs_JoinType Join,
|
||||
const Standard_Boolean IsOpenResult)
|
||||
{
|
||||
myWires.Append(Spine);
|
||||
myIsInitialized = Standard_True;
|
||||
myJoin = Join;
|
||||
myIsOpenResult = IsOpenResult;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -95,9 +100,11 @@ BRepOffsetAPI_MakeOffset::BRepOffsetAPI_MakeOffset(const TopoDS_Wire& Spine,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BRepOffsetAPI_MakeOffset::Init(const GeomAbs_JoinType Join)
|
||||
void BRepOffsetAPI_MakeOffset::Init(const GeomAbs_JoinType Join,
|
||||
const Standard_Boolean IsOpenResult)
|
||||
{
|
||||
myJoin = Join;
|
||||
myIsOpenResult = IsOpenResult;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -118,10 +125,11 @@ void BRepOffsetAPI_MakeOffset::AddWire(const TopoDS_Wire& Spine)
|
||||
//=======================================================================
|
||||
|
||||
static void BuildDomains(TopoDS_Face& myFace,
|
||||
TopTools_ListOfShape& WorkWires,
|
||||
BRepFill_ListOfOffsetWire& myAlgos,
|
||||
GeomAbs_JoinType myJoin,
|
||||
Standard_Boolean isPositive)
|
||||
TopTools_ListOfShape& WorkWires,
|
||||
BRepFill_ListOfOffsetWire& myAlgos,
|
||||
GeomAbs_JoinType myJoin,
|
||||
Standard_Boolean myIsOpenResult,
|
||||
Standard_Boolean isPositive)
|
||||
{
|
||||
BRepAlgo_FaceRestrictor FR;
|
||||
TopoDS_Vertex VF,VL;
|
||||
@@ -190,7 +198,7 @@ static void BuildDomains(TopoDS_Face& myFace,
|
||||
for ( ; itW.More(); itW.Next()) {
|
||||
B.Add(F,itW.Value());
|
||||
}
|
||||
BRepFill_OffsetWire Algo(F, myJoin);
|
||||
BRepFill_OffsetWire Algo(F, myJoin, myIsOpenResult);
|
||||
myAlgos.Append(Algo);
|
||||
return;
|
||||
}
|
||||
@@ -243,7 +251,7 @@ static void BuildDomains(TopoDS_Face& myFace,
|
||||
// Creation of algorithms on each domain.
|
||||
//========================================
|
||||
for (itF.Initialize(Faces); itF.More(); itF.Next()) {
|
||||
BRepFill_OffsetWire Algo(TopoDS::Face(itF.Value()), myJoin);
|
||||
BRepFill_OffsetWire Algo(TopoDS::Face(itF.Value()), myJoin, myIsOpenResult);
|
||||
myAlgos.Append(Algo);
|
||||
}
|
||||
}
|
||||
@@ -253,8 +261,8 @@ static void BuildDomains(TopoDS_Face& myFace,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BRepOffsetAPI_MakeOffset::Perform( const Standard_Real Offset,
|
||||
const Standard_Real Alt)
|
||||
void BRepOffsetAPI_MakeOffset::Perform(const Standard_Real Offset,
|
||||
const Standard_Real Alt)
|
||||
{
|
||||
StdFail_NotDone_Raise_if ( !myIsInitialized,
|
||||
"BRepOffsetAPI_MakeOffset : Perform without Init");
|
||||
@@ -273,7 +281,7 @@ void BRepOffsetAPI_MakeOffset::Perform( const Standard_Real Offset,
|
||||
if( myLeft.IsEmpty() )
|
||||
{
|
||||
// Modified by Sergey KHROMOV - Fri Apr 27 14:35:26 2001 Begin
|
||||
BuildDomains(myFace,myWires,myLeft,myJoin, Standard_False);
|
||||
BuildDomains(myFace,myWires,myLeft,myJoin,myIsOpenResult, Standard_False);
|
||||
// Modified by Sergey KHROMOV - Fri Apr 27 14:35:26 2001 End
|
||||
}
|
||||
|
||||
@@ -296,7 +304,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, Standard_True);
|
||||
BuildDomains(myFace,myWires,myRight,myJoin,myIsOpenResult, Standard_True);
|
||||
// Modified by Sergey KHROMOV - Fri Apr 27 14:35:35 2001 End
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user