mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-06-10 16:16:54 +08:00
0031148: Modeling Algorithms - Offset adjacent co-planar faces with different offset values
Extend the Offset operation (Join Type "Intersection", mode "Complete") to allow different offset values on adjacent co-planar faces. The gap between adjacent faces is closed by creating artificial face perpendicular to the face. Adding test cases.
This commit is contained in:
@@ -118,24 +118,14 @@ void BRepOffsetAPI_MakeOffsetShape::Build()
|
||||
const TopTools_ListOfShape& BRepOffsetAPI_MakeOffsetShape::Generated (const TopoDS_Shape& S)
|
||||
{
|
||||
myGenerated.Clear();
|
||||
|
||||
if (myLastUsedAlgo == OffsetAlgo_JOIN && !myOffsetShape.ClosingFaces().Contains(S))
|
||||
if (myLastUsedAlgo == OffsetAlgo_JOIN)
|
||||
{
|
||||
myOffsetShape.OffsetFacesFromShapes ().LastImage (S, myGenerated);
|
||||
|
||||
if (!myOffsetShape.ClosingFaces().IsEmpty())
|
||||
{
|
||||
// Reverse generated shapes in case of small solids.
|
||||
// Useful only for faces without influence on others.
|
||||
TopTools_ListIteratorOfListOfShape it(myGenerated);
|
||||
for (; it.More(); it.Next())
|
||||
it.Value().Reverse();
|
||||
}
|
||||
myGenerated = myOffsetShape.Generated (S);
|
||||
}
|
||||
else if (myLastUsedAlgo == OffsetAlgo_SIMPLE)
|
||||
{
|
||||
TopoDS_Shape aGenShape = mySimpleOffsetShape.Generated(S);
|
||||
if (!aGenShape.IsNull())
|
||||
if (!aGenShape.IsNull() && !aGenShape.IsSame (S))
|
||||
myGenerated.Append(aGenShape);
|
||||
}
|
||||
|
||||
@@ -143,33 +133,39 @@ const TopTools_ListOfShape& BRepOffsetAPI_MakeOffsetShape::Generated (const Topo
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GeneratedEdge
|
||||
//function : Modified
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const TopTools_ListOfShape& BRepOffsetAPI_MakeOffsetShape::GeneratedEdge (const TopoDS_Shape& S)
|
||||
const TopTools_ListOfShape& BRepOffsetAPI_MakeOffsetShape::Modified (const TopoDS_Shape& S)
|
||||
{
|
||||
myGenerated.Clear();
|
||||
|
||||
if (myLastUsedAlgo == OffsetAlgo_JOIN)
|
||||
{
|
||||
myOffsetShape.OffsetEdgesFromShapes().LastImage (S, myGenerated);
|
||||
|
||||
if (!myGenerated.IsEmpty())
|
||||
{
|
||||
if (S.IsSame(myGenerated.First()))
|
||||
myGenerated.RemoveFirst();
|
||||
}
|
||||
myGenerated = myOffsetShape.Modified (S);
|
||||
}
|
||||
else if (myLastUsedAlgo == OffsetAlgo_SIMPLE)
|
||||
{
|
||||
TopoDS_Shape aGenShape = mySimpleOffsetShape.Generated(S);
|
||||
if (!aGenShape.IsNull())
|
||||
TopoDS_Shape aGenShape = mySimpleOffsetShape.Modified(S);
|
||||
if (!aGenShape.IsNull() && !aGenShape.IsSame (S))
|
||||
myGenerated.Append(aGenShape);
|
||||
}
|
||||
|
||||
return myGenerated;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsDeleted
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BRepOffsetAPI_MakeOffsetShape::IsDeleted (const TopoDS_Shape& S)
|
||||
{
|
||||
if (myLastUsedAlgo == OffsetAlgo_JOIN)
|
||||
{
|
||||
return myOffsetShape.IsDeleted(S);
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetJoinType
|
||||
//purpose : Query offset join type.
|
||||
|
||||
Reference in New Issue
Block a user