Open CASCADE Technology  7.4.0
Public Member Functions

BRepExtrema_ShapeProximity Class Reference

Tool class for shape proximity detection. For two given shapes and given tolerance (offset from the mesh) the algorithm allows to determine whether or not they are overlapped. The algorithm input consists of any shapes which can be decomposed into individual faces (used as basic shape elements). High performance is achieved through the use of existing triangulation of faces. So poly triangulation (with the desired deflection) should already be built. Note that solution is approximate (and corresponds to the deflection used for triangulation). More...

#include <BRepExtrema_ShapeProximity.hxx>

Public Member Functions

 BRepExtrema_ShapeProximity (const Standard_Real theTolerance=0.0)
 Creates empty proximity tool. More...
 
 BRepExtrema_ShapeProximity (const TopoDS_Shape &theShape1, const TopoDS_Shape &theShape2, const Standard_Real theTolerance=0.0)
 Creates proximity tool for the given two shapes. More...
 
Standard_Real Tolerance () const
 Returns tolerance value for overlap test (distance between shapes). More...
 
void SetTolerance (const Standard_Real theTolerance)
 Sets tolerance value for overlap test (distance between shapes). More...
 
Standard_Boolean LoadShape1 (const TopoDS_Shape &theShape1)
 Loads 1st shape into proximity tool. More...
 
Standard_Boolean LoadShape2 (const TopoDS_Shape &theShape2)
 Loads 2nd shape into proximity tool. More...
 
void Perform ()
 Performs search of overlapped faces. More...
 
Standard_Boolean IsDone () const
 True if the search is completed. More...
 
const BRepExtrema_MapOfIntegerPackedMapOfIntegerOverlapSubShapes1 () const
 Returns set of IDs of overlapped faces of 1st shape (started from 0). More...
 
const BRepExtrema_MapOfIntegerPackedMapOfIntegerOverlapSubShapes2 () const
 Returns set of IDs of overlapped faces of 2nd shape (started from 0). More...
 
const TopoDS_FaceGetSubShape1 (const Standard_Integer theID) const
 Returns sub-shape from 1st shape with the given index (started from 0). More...
 
const TopoDS_FaceGetSubShape2 (const Standard_Integer theID) const
 Returns sub-shape from 1st shape with the given index (started from 0). More...
 
const Handle< BRepExtrema_TriangleSet > & ElementSet1 () const
 Returns set of all the face triangles of the 1st shape. More...
 
const Handle< BRepExtrema_TriangleSet > & ElementSet2 () const
 Returns set of all the face triangles of the 2nd shape. More...
 

Detailed Description

Tool class for shape proximity detection. For two given shapes and given tolerance (offset from the mesh) the algorithm allows to determine whether or not they are overlapped. The algorithm input consists of any shapes which can be decomposed into individual faces (used as basic shape elements). High performance is achieved through the use of existing triangulation of faces. So poly triangulation (with the desired deflection) should already be built. Note that solution is approximate (and corresponds to the deflection used for triangulation).

The algorithm can be run in two modes. If tolerance is set to zero, the algorithm will detect only intersecting faces (containing triangles with common points). If tolerance is set to positive value, the algorithm will also detect faces located on distance less than the given tolerance from each other.

Constructor & Destructor Documentation

◆ BRepExtrema_ShapeProximity() [1/2]

BRepExtrema_ShapeProximity::BRepExtrema_ShapeProximity ( const Standard_Real  theTolerance = 0.0)

Creates empty proximity tool.

◆ BRepExtrema_ShapeProximity() [2/2]

BRepExtrema_ShapeProximity::BRepExtrema_ShapeProximity ( const TopoDS_Shape theShape1,
const TopoDS_Shape theShape2,
const Standard_Real  theTolerance = 0.0 
)

Creates proximity tool for the given two shapes.

Member Function Documentation

◆ ElementSet1()

const Handle< BRepExtrema_TriangleSet >& BRepExtrema_ShapeProximity::ElementSet1 ( ) const
inline

Returns set of all the face triangles of the 1st shape.

◆ ElementSet2()

const Handle< BRepExtrema_TriangleSet >& BRepExtrema_ShapeProximity::ElementSet2 ( ) const
inline

Returns set of all the face triangles of the 2nd shape.

◆ GetSubShape1()

const TopoDS_Face& BRepExtrema_ShapeProximity::GetSubShape1 ( const Standard_Integer  theID) const
inline

Returns sub-shape from 1st shape with the given index (started from 0).

◆ GetSubShape2()

const TopoDS_Face& BRepExtrema_ShapeProximity::GetSubShape2 ( const Standard_Integer  theID) const
inline

Returns sub-shape from 1st shape with the given index (started from 0).

◆ IsDone()

Standard_Boolean BRepExtrema_ShapeProximity::IsDone ( ) const
inline

True if the search is completed.

◆ LoadShape1()

Standard_Boolean BRepExtrema_ShapeProximity::LoadShape1 ( const TopoDS_Shape theShape1)

Loads 1st shape into proximity tool.

◆ LoadShape2()

Standard_Boolean BRepExtrema_ShapeProximity::LoadShape2 ( const TopoDS_Shape theShape2)

Loads 2nd shape into proximity tool.

◆ OverlapSubShapes1()

const BRepExtrema_MapOfIntegerPackedMapOfInteger& BRepExtrema_ShapeProximity::OverlapSubShapes1 ( ) const
inline

Returns set of IDs of overlapped faces of 1st shape (started from 0).

◆ OverlapSubShapes2()

const BRepExtrema_MapOfIntegerPackedMapOfInteger& BRepExtrema_ShapeProximity::OverlapSubShapes2 ( ) const
inline

Returns set of IDs of overlapped faces of 2nd shape (started from 0).

◆ Perform()

void BRepExtrema_ShapeProximity::Perform ( )

Performs search of overlapped faces.

◆ SetTolerance()

void BRepExtrema_ShapeProximity::SetTolerance ( const Standard_Real  theTolerance)
inline

Sets tolerance value for overlap test (distance between shapes).

◆ Tolerance()

Standard_Real BRepExtrema_ShapeProximity::Tolerance ( ) const
inline

Returns tolerance value for overlap test (distance between shapes).


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