Open CASCADE Technology  7.3.0
Public Member Functions | Protected Member Functions
BRepExtrema_SelfIntersection Class Reference

Tool class for detection of self-sections in the given shape. This class is based on BRepExtrema_OverlapTool and thus uses shape tessellation to detect incorrect mesh fragments (pairs of overlapped triangles belonging to different faces). Thus, a result depends critically on the quality of mesh generator (e.g., BREP mesh is not always a good choice, because it can contain gaps between adjacent face triangulations, which may not share vertices on common edge; thus false overlap can be detected). As a result, this tool can be used for relatively fast approximated test which provides sub-set of potentially overlapped faces. More...

#include <BRepExtrema_SelfIntersection.hxx>

Inheritance diagram for BRepExtrema_SelfIntersection:
Inheritance graph
[legend]

Public Member Functions

 BRepExtrema_SelfIntersection (const Standard_Real theTolerance=0.0)
 Creates unitialized self-intersection tool. More...
 
 BRepExtrema_SelfIntersection (const TopoDS_Shape &theShape, const Standard_Real theTolerance=0.0)
 Creates self-intersection tool for the given shape. More...
 
Standard_Real Tolerance () const
 Returns tolerance value used for self-intersection test. More...
 
void SetTolerance (const Standard_Real theTolerance)
 Sets tolerance value used for self-intersection test. More...
 
Standard_Boolean LoadShape (const TopoDS_Shape &theShape)
 Loads shape for detection of self-intersections. More...
 
void Perform ()
 Performs detection of self-intersections. More...
 
Standard_Boolean IsDone () const
 True if the detection is completed. More...
 
const BRepExtrema_MapOfIntegerPackedMapOfIntegerOverlapElements () const
 Returns set of IDs of overlapped sub-shapes (started from 0). More...
 
const TopoDS_FaceGetSubShape (const Standard_Integer theID) const
 Returns sub-shape from the shape for the given index (started from 0). More...
 
const Handle< BRepExtrema_TriangleSet > & ElementSet () const
 Returns set of all the face triangles of the shape. More...
 
- Public Member Functions inherited from BRepExtrema_ElementFilter
virtual ~BRepExtrema_ElementFilter ()
 Releases resources of element filter. More...
 

Protected Member Functions

virtual BRepExtrema_ElementFilter::FilterResult PreCheckElements (const Standard_Integer theIndex1, const Standard_Integer theIndex2)
 Filter out correct adjacent mesh elements. More...
 
BRepExtrema_ElementFilter::FilterResult isRegularSharedVertex (const BVH_Vec3d &theSharedVert, const BVH_Vec3d &theTrng1Vtxs1, const BVH_Vec3d &theTrng1Vtxs2, const BVH_Vec3d &theTrng2Vtxs1, const BVH_Vec3d &theTrng2Vtxs2)
 Checks if the given triangles have only single common vertex. More...
 
BRepExtrema_ElementFilter::FilterResult isRegularSharedEdge (const BVH_Vec3d &theTrng1Vtxs0, const BVH_Vec3d &theTrng1Vtxs1, const BVH_Vec3d &theTrng1Vtxs2, const BVH_Vec3d &theTrng2Vtxs2)
 Checks if the given triangles have only single common edge. More...
 

Additional Inherited Members

- Public Types inherited from BRepExtrema_ElementFilter
enum  FilterResult { NoCheck, Overlap, DoCheck }
 Result of filtering function. More...
 

Detailed Description

Tool class for detection of self-sections in the given shape. This class is based on BRepExtrema_OverlapTool and thus uses shape tessellation to detect incorrect mesh fragments (pairs of overlapped triangles belonging to different faces). Thus, a result depends critically on the quality of mesh generator (e.g., BREP mesh is not always a good choice, because it can contain gaps between adjacent face triangulations, which may not share vertices on common edge; thus false overlap can be detected). As a result, this tool can be used for relatively fast approximated test which provides sub-set of potentially overlapped faces.

Constructor & Destructor Documentation

◆ BRepExtrema_SelfIntersection() [1/2]

BRepExtrema_SelfIntersection::BRepExtrema_SelfIntersection ( const Standard_Real  theTolerance = 0.0)

Creates unitialized self-intersection tool.

◆ BRepExtrema_SelfIntersection() [2/2]

BRepExtrema_SelfIntersection::BRepExtrema_SelfIntersection ( const TopoDS_Shape theShape,
const Standard_Real  theTolerance = 0.0 
)

Creates self-intersection tool for the given shape.

Member Function Documentation

◆ ElementSet()

const Handle< BRepExtrema_TriangleSet >& BRepExtrema_SelfIntersection::ElementSet ( ) const
inline

Returns set of all the face triangles of the shape.

◆ GetSubShape()

const TopoDS_Face& BRepExtrema_SelfIntersection::GetSubShape ( const Standard_Integer  theID) const
inline

Returns sub-shape from the shape for the given index (started from 0).

◆ IsDone()

Standard_Boolean BRepExtrema_SelfIntersection::IsDone ( ) const
inline

True if the detection is completed.

◆ isRegularSharedEdge()

BRepExtrema_ElementFilter::FilterResult BRepExtrema_SelfIntersection::isRegularSharedEdge ( const BVH_Vec3d theTrng1Vtxs0,
const BVH_Vec3d theTrng1Vtxs1,
const BVH_Vec3d theTrng1Vtxs2,
const BVH_Vec3d theTrng2Vtxs2 
)
protected

Checks if the given triangles have only single common edge.

◆ isRegularSharedVertex()

BRepExtrema_ElementFilter::FilterResult BRepExtrema_SelfIntersection::isRegularSharedVertex ( const BVH_Vec3d theSharedVert,
const BVH_Vec3d theTrng1Vtxs1,
const BVH_Vec3d theTrng1Vtxs2,
const BVH_Vec3d theTrng2Vtxs1,
const BVH_Vec3d theTrng2Vtxs2 
)
protected

Checks if the given triangles have only single common vertex.

◆ LoadShape()

Standard_Boolean BRepExtrema_SelfIntersection::LoadShape ( const TopoDS_Shape theShape)

Loads shape for detection of self-intersections.

◆ OverlapElements()

const BRepExtrema_MapOfIntegerPackedMapOfInteger& BRepExtrema_SelfIntersection::OverlapElements ( ) const
inline

Returns set of IDs of overlapped sub-shapes (started from 0).

◆ Perform()

void BRepExtrema_SelfIntersection::Perform ( )

Performs detection of self-intersections.

◆ PreCheckElements()

virtual BRepExtrema_ElementFilter::FilterResult BRepExtrema_SelfIntersection::PreCheckElements ( const Standard_Integer  theIndex1,
const Standard_Integer  theIndex2 
)
protectedvirtual

Filter out correct adjacent mesh elements.

Reimplemented from BRepExtrema_ElementFilter.

◆ SetTolerance()

void BRepExtrema_SelfIntersection::SetTolerance ( const Standard_Real  theTolerance)
inline

Sets tolerance value used for self-intersection test.

◆ Tolerance()

Standard_Real BRepExtrema_SelfIntersection::Tolerance ( ) const
inline

Returns tolerance value used for self-intersection test.


The documentation for this class was generated from the following file: