Open CASCADE Technology 7.8.2.dev
|
Tool class for shape proximity detection. More...
#include <BRepExtrema_ShapeProximity.hxx>
Public Member Functions | |
BRepExtrema_ShapeProximity (const Standard_Real theTolerance=Precision::Infinite()) | |
Creates empty proximity tool. | |
BRepExtrema_ShapeProximity (const TopoDS_Shape &theShape1, const TopoDS_Shape &theShape2, const Standard_Real theTolerance=Precision::Infinite()) | |
Creates proximity tool for the given two shapes. | |
Standard_Real | Tolerance () const |
Returns tolerance value for overlap test (distance between shapes). | |
void | SetTolerance (const Standard_Real theTolerance) |
Sets tolerance value for overlap test (distance between shapes). | |
Standard_Real | Proximity () const |
Returns proximity value calculated for the whole input shapes. | |
Standard_Boolean | LoadShape1 (const TopoDS_Shape &theShape1) |
Loads 1st shape into proximity tool. | |
Standard_Boolean | LoadShape2 (const TopoDS_Shape &theShape2) |
Loads 2nd shape into proximity tool. | |
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. | |
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. | |
void | Perform () |
Performs search of overlapped faces. | |
Standard_Boolean | IsDone () const |
True if the search is completed. | |
const BRepExtrema_MapOfIntegerPackedMapOfInteger & | OverlapSubShapes1 () const |
Returns set of IDs of overlapped faces of 1st shape (started from 0). | |
const BRepExtrema_MapOfIntegerPackedMapOfInteger & | OverlapSubShapes2 () const |
Returns set of IDs of overlapped faces of 2nd shape (started from 0). | |
const TopoDS_Shape & | GetSubShape1 (const Standard_Integer theID) const |
Returns sub-shape from 1st shape with the given index (started from 0). | |
const TopoDS_Shape & | GetSubShape2 (const Standard_Integer theID) const |
Returns sub-shape from 1st shape with the given index (started from 0). | |
const Handle< BRepExtrema_TriangleSet > & | ElementSet1 () const |
Returns set of all the face triangles of the 1st shape. | |
const Handle< BRepExtrema_TriangleSet > & | ElementSet2 () const |
Returns set of all the face triangles of the 2nd shape. | |
const gp_Pnt & | ProximityPoint1 () const |
Returns the point on the 1st shape, which could be used as a reference point for the value of the proximity. | |
const gp_Pnt & | ProximityPoint2 () const |
Returns the point on the 2nd shape, which could be used as a reference point for the value of the proximity. | |
const ProxPnt_Status & | ProxPntStatus1 () const |
Returns the status of point on the 1st shape, which could be used as a reference point for the value of the proximity. | |
const ProxPnt_Status & | ProxPntStatus2 () const |
Returns the status of point on the 2nd shape, which could be used as a reference point for the value of the proximity. | |
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 (handles only edge/edge or face/face cases) 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).
BRepExtrema_ShapeProximity::BRepExtrema_ShapeProximity | ( | const Standard_Real | theTolerance = Precision::Infinite() | ) |
Creates empty proximity tool.
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.
|
inline |
Returns set of all the face triangles of the 1st shape.
|
inline |
Returns set of all the face triangles of the 2nd shape.
|
inline |
Returns sub-shape from 1st shape with the given index (started from 0).
|
inline |
Returns sub-shape from 1st shape with the given index (started from 0).
|
inline |
True if the search is completed.
Standard_Boolean BRepExtrema_ShapeProximity::LoadShape1 | ( | const TopoDS_Shape & | theShape1 | ) |
Loads 1st shape into proximity tool.
Standard_Boolean BRepExtrema_ShapeProximity::LoadShape2 | ( | const TopoDS_Shape & | theShape2 | ) |
Loads 2nd shape into proximity tool.
|
inline |
Returns set of IDs of overlapped faces of 1st shape (started from 0).
|
inline |
Returns set of IDs of overlapped faces of 2nd shape (started from 0).
void BRepExtrema_ShapeProximity::Perform | ( | ) |
Performs search of overlapped faces.
|
inline |
Returns proximity value calculated for the whole input shapes.
|
inline |
Returns the point on the 1st shape, which could be used as a reference point for the value of the proximity.
|
inline |
Returns the point on the 2nd shape, which could be used as a reference point for the value of the proximity.
|
inline |
Returns the status of point on the 1st shape, which could be used as a reference point for the value of the proximity.
|
inline |
Returns the status of point on the 2nd shape, which could be used as a reference point for the value of the proximity.
|
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.
|
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.
|
inline |
Sets tolerance value for overlap test (distance between shapes).
|
inline |
Returns tolerance value for overlap test (distance between shapes).