Open CASCADE Technology  7.7.0
Public Types | Public Member Functions
BRepExtrema_ShapeProximity Class Reference

Tool class for shape proximity detection. More...

#include <BRepExtrema_ShapeProximity.hxx>

Public Types

typedef BRepExtrema_ProximityValueTool::ProxPnt_Status ProxPnt_Status
 

Public Member Functions

 BRepExtrema_ShapeProximity (const Standard_Real theTolerance=Precision::Infinite())
 Creates empty proximity tool. More...
 
 BRepExtrema_ShapeProximity (const TopoDS_Shape &theShape1, const TopoDS_Shape &theShape2, const Standard_Real theTolerance=Precision::Infinite())
 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_Real Proximity () const
 Returns proximity value calculated for the whole input 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 SetNbSamples1 (const Standard_Integer theNbSamples)
 Set number of sample points on the 1st shape used to compute the proximity value. In case of 0, all triangulation nodes will be used. More...
 
void SetNbSamples2 (const Standard_Integer theNbSamples)
 Set number of sample points on the 2nd shape used to compute the proximity value. In case of 0, all triangulation nodes will be used. 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_ShapeGetSubShape1 (const Standard_Integer theID) const
 Returns sub-shape from 1st shape with the given index (started from 0). More...
 
const TopoDS_ShapeGetSubShape2 (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...
 
const gp_PntProximityPoint1 () const
 Returns the point on the 1st shape, which could be used as a reference point for the value of the proximity. More...
 
const gp_PntProximityPoint2 () const
 Returns the point on the 2nd shape, which could be used as a reference point for the value of the proximity. More...
 
const ProxPnt_StatusProxPntStatus1 () const
 Returns the status of point on the 1st shape, which could be used as a reference point for the value of the proximity. More...
 
const ProxPnt_StatusProxPntStatus2 () const
 Returns the status of point on the 2nd shape, which could be used as a reference point for the value of the proximity. More...
 

Detailed Description

Tool class for shape proximity detection.

First approach: 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).

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.

Second approach: Compute the proximity value between two shapes if the tolerance is not defined (Precision::Infinite()). In this case the proximity value is a minimal thickness of a layer containing both shapes.

For the both approaches the 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).

Member Typedef Documentation

◆ ProxPnt_Status

Constructor & Destructor Documentation

◆ BRepExtrema_ShapeProximity() [1/2]

BRepExtrema_ShapeProximity::BRepExtrema_ShapeProximity ( const Standard_Real  theTolerance = Precision::Infinite())

Creates empty proximity tool.

◆ BRepExtrema_ShapeProximity() [2/2]

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

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_Shape& 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_Shape& 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.

◆ Proximity()

Standard_Real BRepExtrema_ShapeProximity::Proximity ( ) const
inline

Returns proximity value calculated for the whole input shapes.

◆ ProximityPoint1()

const gp_Pnt& BRepExtrema_ShapeProximity::ProximityPoint1 ( ) const
inline

Returns the point on the 1st shape, which could be used as a reference point for the value of the proximity.

◆ ProximityPoint2()

const gp_Pnt& BRepExtrema_ShapeProximity::ProximityPoint2 ( ) const
inline

Returns the point on the 2nd shape, which could be used as a reference point for the value of the proximity.

◆ ProxPntStatus1()

const ProxPnt_Status& BRepExtrema_ShapeProximity::ProxPntStatus1 ( ) const
inline

Returns the status of point on the 1st shape, which could be used as a reference point for the value of the proximity.

◆ ProxPntStatus2()

const ProxPnt_Status& BRepExtrema_ShapeProximity::ProxPntStatus2 ( ) const
inline

Returns the status of point on the 2nd shape, which could be used as a reference point for the value of the proximity.

◆ SetNbSamples1()

void BRepExtrema_ShapeProximity::SetNbSamples1 ( const Standard_Integer  theNbSamples)
inline

Set number of sample points on the 1st shape used to compute the proximity value. In case of 0, all triangulation nodes will be used.

◆ SetNbSamples2()

void BRepExtrema_ShapeProximity::SetNbSamples2 ( const Standard_Integer  theNbSamples)
inline

Set number of sample points on the 2nd shape used to compute the proximity value. In case of 0, all triangulation nodes will be used.

◆ 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: