mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0025656: Specification of semantic of Closed flag of an edge
1. Using of the "Closed" flag was unified: a) this flag is applicable for TopoDS_Wire and TopoDS_Shell only, because these entities may hedge an area in 2D space or a volume in 3D space correspondingly; b) other types of TopoDS shapes are passing over this flag; c) changing of this flag should be controlled by high-level algorithms (not BRep_Builder). 2. Implemented verification of the closedness of edges. An edge is closed if and only if its first and last vertices are the same. 3. Test cases were changed according to new behavior.
This commit is contained in:
@@ -1455,7 +1455,7 @@ gp_Pnt2d BRep_Tool::Parameters(const TopoDS_Vertex& V,
|
||||
//=======================================================================
|
||||
Standard_Boolean BRep_Tool::IsClosed (const TopoDS_Shape& theShape)
|
||||
{
|
||||
if (theShape.ShapeType() == TopAbs_SHELL || theShape.ShapeType() == TopAbs_SOLID)
|
||||
if (theShape.ShapeType() == TopAbs_SHELL)
|
||||
{
|
||||
NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher> aMap (101, new NCollection_IncAllocator);
|
||||
TopExp_Explorer exp (theShape.Oriented(TopAbs_FORWARD), TopAbs_EDGE);
|
||||
@@ -1487,6 +1487,12 @@ Standard_Boolean BRep_Tool::IsClosed (const TopoDS_Shape& theShape)
|
||||
}
|
||||
return hasBound && aMap.IsEmpty();
|
||||
}
|
||||
else if (theShape.ShapeType() == TopAbs_EDGE)
|
||||
{
|
||||
TopoDS_Vertex aVFirst, aVLast;
|
||||
TopExp::Vertices(TopoDS::Edge(theShape), aVFirst, aVLast);
|
||||
return !aVFirst.IsNull() && aVFirst.IsSame(aVLast);
|
||||
}
|
||||
return theShape.Closed();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user