Version: 8.3.0
SMESH_MAT2d::MedialAxis Class Reference

Medial axis (MA) is defined as the loci of centres of locally maximal balls inside 2D representation of a face. More...

#include <SMESH_MAT2d.hxx>

Public Member Functions

 MedialAxis (const TopoDS_Face &face, const std::vector< TopoDS_Edge > &edges, const double minSegLen, const bool ignoreCorners=false)
 MedialAxis constructor. More...
 
std::size_t nbBranches () const
 
const BranchgetBranch (size_t i) const
 Returns the i-th branch. More...
 
const std::vector< const
BranchEnd * > & 
getBranchPoints () const
 
const BoundarygetBoundary () const
 
void getPoints (const Branch *branch, std::vector< gp_XY > &points) const
 Return UVs of ends of MA edges of a branch. More...
 
Adaptor3d_Curvemake3DCurve (const Branch &branch) const
 Creates a 3d curve corresponding to a Branch. More...
 

Private Attributes

TopoDS_Face _face
 
TVD _vd
 
std::vector< Branch_branch
 
std::size_t _nbBranches
 
std::vector< const BranchEnd * > _branchPnt
 
Boundary _boundary
 
double _scale [2]
 

Detailed Description

Medial axis (MA) is defined as the loci of centres of locally maximal balls inside 2D representation of a face.

This class implements a piecewise approximation of MA.

Constructor & Destructor Documentation

SMESH_MAT2d::MedialAxis::MedialAxis ( const TopoDS_Face &  face,
const std::vector< TopoDS_Edge > &  edges,
const double  minSegLen,
const bool  ignoreCorners = false 
)

MedialAxis constructor.

Parameters
[in]face- a face to create MA for
[in]edges- edges of the face (possibly not all) on the order they encounter in the face boundary.
[in]minSegLen- minimal length of a mesh segment used to discretize the edges. It is used to define precision of MA approximation

References _boundary, _branch, _branchPnt, _nbBranches, _scale, _vd, and inSegmentsToFile.

Member Function Documentation

const Boundary& SMESH_MAT2d::MedialAxis::getBoundary ( ) const
const SMESH_MAT2d::Branch * SMESH_MAT2d::MedialAxis::getBranch ( size_t  i) const

Returns the i-th branch.

const std::vector< const BranchEnd* >& SMESH_MAT2d::MedialAxis::getBranchPoints ( ) const
void SMESH_MAT2d::MedialAxis::getPoints ( const Branch branch,
std::vector< gp_XY > &  points 
) const

Return UVs of ends of MA edges of a branch.

References SMESH_MAT2d::Branch::getPoints().

Adaptor3d_Curve * SMESH_MAT2d::MedialAxis::make3DCurve ( const Branch branch) const

Creates a 3d curve corresponding to a Branch.

Parameters
[in]branch- the Branch
Returns
Adaptor3d_Curve* - the new curve the caller is to delete

References SMESH_MAT2d::Branch::getPoints(), and Handle().

std::size_t SMESH_MAT2d::MedialAxis::nbBranches ( ) const

Field Documentation

Boundary SMESH_MAT2d::MedialAxis::_boundary
private

Referenced by MedialAxis().

std::vector< Branch > SMESH_MAT2d::MedialAxis::_branch
private

Referenced by MedialAxis().

std::vector< const BranchEnd* > SMESH_MAT2d::MedialAxis::_branchPnt
private

Referenced by MedialAxis().

TopoDS_Face SMESH_MAT2d::MedialAxis::_face
private
std::size_t SMESH_MAT2d::MedialAxis::_nbBranches
private

Referenced by MedialAxis().

double SMESH_MAT2d::MedialAxis::_scale[2]
private

Referenced by MedialAxis().

TVD SMESH_MAT2d::MedialAxis::_vd
private

Referenced by MedialAxis().