C3D Toolkit  Kernel - 105435, Vision - 121811.105435
+ Collaboration diagram for Polygonal Objects:

Classes

class  MbMeshProcessorValues
 Parameters of BRep shell construction from polygonal mesh. More...
 
class  MbMeshProcessor
 Class for creating a BRep solid by polygonal mesh. More...
 
struct  MbCurvature
 Curvature and principal curvature direction data. More...
 
class  MbFloatPoint
 A two-dimensional point. More...
 
class  MbFloatPoint3D
 Three-dimensional point. More...
 
class  MbFloatVector3D
 Three-dimensional vector. More...
 
class  MbFloatAxis3D
 Axis. More...
 
class  MbExactGrid
 Triangulation on double data. More...
 
class  MbFloatGrid
 Triangulation on float data. More...
 
class  MbExactPolygon3D
 Polygon on double data. More...
 
class  MbFloatPolygon3D
 Polygon on float data. More...
 
class  MbPolygon
 Two-dimensional polygon. More...
 
class  MbPrimitive
 Primitive. More...
 
class  MbApex3D
 Apex (point). More...
 
class  MbExactApex3D
 Apex on double data. More...
 
class  MbFloatApex3D
 Apex on float data. More...
 
class  MbPolygon3D
 Polygon. More...
 
class  MbGrid
 Triangulation. More...
 
class  MbTriangle
 Triangle. More...
 
class  MbQuadrangle
 Quadrangle. More...
 
class  MbElement
 Element of tesselation of solid volume. More...
 
class  MbGridLoop
 Border of triangulation. More...
 
class  MbGridSegment
 A polygonal mesh segment (segmentation result). More...
 
class  MbFaceAndGrid
 Mathematical face and its calculated grid. More...
 
struct  MbLumpAndFaces
 A solid with an array of faces and triangulation grids. More...
 

Enumerations

enum  BrepMode { bm_Default = 0, bm_NoGrids = 1, bm_CanonicOnly = 2 }
 BRep construction mode. More...
 
enum  MbePrimitiveType {
  pt_Apex3D, pt_ExactApex3D, pt_FloatApex3D, pt_Polygon3D,
  pt_ExactPolygon3D, pt_FloatPolygon3D, pt_Grid, pt_ExactGrid,
  pt_FloatGrid
}
 Types of primitives. More...
 
enum  MbeMoveType { mt_Forward = 0, mt_Backward = 1 }
 Motion direction. More...
 

Functions

void CalculateWire (const MbPlaneItem &obj, const MbPlacement3D &plane, double sag, MbMesh &mesh)
 Create a polygonal two-dimensional object. More...
 
MbResultType CreateIcosahedron (const MbPlacement3D &place, double radius, const MbFormNote &fn, MbMesh *&result)
 Construct an icosahedron mesh. More...
 
MbResultType CreateSpherePolyhedron (const MbPlacement3D &place, double radius, double &epsilon, MbMesh *&result)
 Construct an spherical mesh. More...
 
MbResultType CreateConvexPolyhedron (const SArray< MbFloatPoint3D > &points, MbMesh *&result)
 Calculate a convex hull of a point set. More...
 
MbResultType CreateConvexPolyhedron (const MbMesh &mesh, double offset, MbMesh *&result)
 Construct the convex hull of triangulation grid. More...
 
bool AreIntersectConvexPolyhedrons (const MbMesh &mesh1, const MbMesh &mesh2)
 Whether there is intersection of convex grids. More...
 
MbResultType MeshCutting (MbMesh &mesh, MbeCopyMode sameShell, const MbPlacement3D &place, int part, const MbSNameMaker &names, bool closed, MbMesh *&result)
 Cut a part of a polygonal object by a plane. More...
 
MbResultType CalculateBallPivotingGrid (const MbCollection &collection, double radius, double radiusMin, double angle, MbMesh *&result)
 Build a triangulation by point cloud with Ball Pivoting algorithm. More...
 
static MbMeshProcessorMbMeshProcessor::Create (const MbCollection &collection)
 Create mesh processor by collection. More...
 
virtual void MbMeshProcessor::SetRelativeTolerance (double tolerance)=0
 Set relative tolerance. More...
 
virtual void MbMeshProcessor::SetTolerance (double tolerance)=0
 Set tolerance. More...
 
virtual double MbMeshProcessor::GetTolerance () const =0
 Get tolerance. More...
 
virtual void MbMeshProcessor::SetBrepMode (BrepMode brepMode)=0
 Choose types of surfaces to generate. More...
 
virtual const MbCollectionMbMeshProcessor::GetSimplifiedMesh ()=0
 Get fixed (simplified) copy of the input mesh. More...
 
virtual const MbCollectionMbMeshProcessor::GetSegmentedMesh ()=0
 Get segmented copy of the input mesh. More...
 
virtual const std::vector< MbCurvature > & MbMeshProcessor::CalculateCurvatures ()=0
 Calculate the principal curvatures and principal curvature directions at mesh points. More...
 
virtual MbResultType MbMeshProcessor::SegmentMesh (bool createSurfaces=true)=0
 Segment a polygonal mesh. More...
 
virtual MbResultType MbMeshProcessor::CreateBRepShell (MbFaceShell *&pShell)=0
 Create shell. More...
 
virtual void MbMeshProcessor::FitSurfaceToSegment (size_t idxSegment)=0
 Fit surface to segment . More...
 
virtual void MbMeshProcessor::FitSurfaceToSegment (size_t idxSegment, MbeSpaceType surfaceType)=0
 Fit surface of a given type to a segment. More...
 
virtual const MbSurfaceMbMeshProcessor::GetSegmentSurface (size_t idxSegment) const =0
 Get surface of segment. More...
 
virtual void MbMeshProcessor::ResetSegmentation ()=0
 Reset segmentation of the polygonal mesh. More...
 
virtual bool MbMeshProcessor::FindShortestVertexPath (uint v1, uint v2, std::vector< uint > &path)=0
 Find shortest path between two vertices. More...
 
MbResultType ConvertMeshToShell (MbMesh &mesh, MbFaceShell *&shell, const MbMeshProcessorValues &params=MbMeshProcessorValues())
 Create shell from mesh with automatic surface reconstruction. More...
 
MbResultType ConvertCollectionToShell (MbCollection &collection, MbFaceShell *&shell, const MbMeshProcessorValues &params=MbMeshProcessorValues())
 Create shell from collection with automatic surface reconstruction. More...
 
void CalculateHideMesh (const MbSurface &surf, const MbVector3D &eyeDir, double sag, MbMesh *&mesh)
 Calculate mesh. More...
 
void TriangulateRegion (const MbRegion &region, double sag, MbPlanarGrid &grid)
 Triangulation of a two-dimensional region. More...
 

Detailed Description

Enumeration Type Documentation

◆ BrepMode

enum BrepMode

BRep construction mode.

BRep construction mode.

Enumerator
bm_Default 

Build all surfaces.

bm_NoGrids 

Don't build surfaces based on triangulation (MbGridSurface).

bm_CanonicOnly 

Build only elementary surfaces.

◆ MbePrimitiveType

Types of primitives.

Get type of primitive of polygonal object.

Enumerator
pt_Apex3D 

Apex.

pt_ExactApex3D 

Apex on double data.

pt_FloatApex3D 

Apex on float data.

pt_Polygon3D 

Polygon.

pt_ExactPolygon3D 

Polygon on double data.

pt_FloatPolygon3D 

Polygon on float data.

pt_Grid 

Triangulation.

pt_ExactGrid 

Triangulation on double data.

pt_FloatGrid 

Triangulation on float data.

◆ MbeMoveType

Motion direction.

Enumerator
mt_Forward 

Forward.

mt_Backward 

Backward.

Function Documentation

◆ CalculateWire()

void CalculateWire ( const MbPlaneItem obj,
const MbPlacement3D plane,
double  sag,
MbMesh mesh 
)

Create a polygonal two-dimensional object.

Create a polygonal object for two-dimensional object in the XOY-plane of the local coordinate system.

Parameters
[in]obj- Two-dimensional object (if NULL, object isn't created).
[in]plane- A local coordinate system.
[in]sag- The maximum deviation of polygonal object from the original object by sag.
[out]mesh- Polygonal object.

◆ CreateIcosahedron()

MbResultType CreateIcosahedron ( const MbPlacement3D place,
double  radius,
const MbFormNote fn,
MbMesh *&  result 
)

Construct an icosahedron mesh.

Construct an icosahedron mesh.

Parameters
[in]place- Local placement.
[in]radius- The radius of the sphere.
[in]fn- Way for polygonal object constructing.
[out]result- The resulting mesh.
Returns
Returns operation result code.

◆ CreateSpherePolyhedron()

MbResultType CreateSpherePolyhedron ( const MbPlacement3D place,
double  radius,
double &  epsilon,
MbMesh *&  result 
)

Construct an spherical mesh.

Construct an approximation of the sphere by a convex polyhedron.

Parameters
[in]place- Local placement.
[in]radius- The radius of the sphere.
[in]epsilon- The approximation parameter.
[out]result- The resulting mesh.
Returns
Returns operation result code.

◆ CreateConvexPolyhedron() [1/2]

MbResultType CreateConvexPolyhedron ( const SArray< MbFloatPoint3D > &  points,
MbMesh *&  result 
)

Calculate a convex hull of a point set.

Calculate mesh being a convex hull of a point set.

Returns
Returns operation result code.

◆ CreateConvexPolyhedron() [2/2]

MbResultType CreateConvexPolyhedron ( const MbMesh mesh,
double  offset,
MbMesh *&  result 
)

Construct the convex hull of triangulation grid.

Construct the convex hull of triangulation grid.

Parameters
[in]mesh- Initial triangulated mesh.
[in]offset- The offset along a normal for the resulting grid.
[out]resMesh- The resulting triangulation convex grid.
Returns
Returns operation result code.

◆ AreIntersectConvexPolyhedrons()

bool AreIntersectConvexPolyhedrons ( const MbMesh mesh1,
const MbMesh mesh2 
)

Whether there is intersection of convex grids.

Whether there is intersection of convex grids.

Parameters
[in]mesh1- The first convex grid.
[in]mesh2- The second convex grid.
Returns
true - true - there is an intersection, false - there are no intersections.

◆ MeshCutting()

MbResultType MeshCutting ( MbMesh mesh,
MbeCopyMode  sameShell,
const MbPlacement3D place,
int  part,
const MbSNameMaker names,
bool  closed,
MbMesh *&  result 
)

Cut a part of a polygonal object by a plane.

Cut a part of a polygonal object off by a plane XY of local coordinate system.
part = 1 - a part of polygonal object above the XY plane is to be retained.
part = -1 - a part of polygonal object below the XY plane is to be retained.

Parameters
[in]solid- The source polygonal object.
[in]sameShell- The mode of copying of the source polygonal object.
[in]surface- A cutting plane.
[in]part- The direction of cutting off.
[in]names- An object for naming the new objects.
[in]closed- The flag of the cutting off mode: true - cut as a solid, false - cut as a shell.
[out]result- The resultant polygonal object.
Returns
Returns operation result code.

◆ CalculateBallPivotingGrid()

MbResultType CalculateBallPivotingGrid ( const MbCollection collection,
double  radius,
double  radiusMin,
double  angle,
MbMesh *&  result 
)

Build a triangulation by point cloud with Ball Pivoting algorithm.

Parameters
[in]collection- Collection of 3d elements.
[in]radius- Radius of the pivoting ball, if radius==0 an autoguess for the ball pivoting radius is attempted
[in]radiusMin- Clusterization radius ( % from radius value).
[in]angle- Max angle between two mesh faces
[out]result- The resultant polygonal object.
Returns
Returns operation result code.

◆ Create()

static MbMeshProcessor* MbMeshProcessor::Create ( const MbCollection collection)
static

Create mesh processor by collection.

Create mesh processor by collection. User must delete created object.

Parameters
[in]collection- Input collection containing triangle mesh.
Returns
Returns pointer to created object.

◆ SetRelativeTolerance()

virtual void MbMeshProcessor::SetRelativeTolerance ( double  tolerance)
pure virtual

Set relative tolerance.

Set relative tolerance by current mesh box.

Parameters
[in]tolerance- Relative tolerance to set.

◆ SetTolerance()

virtual void MbMeshProcessor::SetTolerance ( double  tolerance)
pure virtual

Set tolerance.

Set tolerance of surface reconstruction and segments extension. Method should be called before call to SegmentMesh. Default tolerance is 0.1.

Parameters
[in]tolerance- Tolerance to set.

◆ GetTolerance()

virtual double MbMeshProcessor::GetTolerance ( ) const
pure virtual

Get tolerance.

Get current tolerance used in surface reconstruction and segments extension.

Returns
Returns absolute tolerance.

◆ SetBrepMode()

virtual void MbMeshProcessor::SetBrepMode ( BrepMode  brepMode)
pure virtual

Choose types of surfaces to generate.

Set types of surfaces which will be generated on segments. The surfaces of unsupoprted type will not be built.

Parameters
[in]brepMode- Description of types of surfaces to generate.

◆ GetSimplifiedMesh()

virtual const MbCollection& MbMeshProcessor::GetSimplifiedMesh ( )
pure virtual

Get fixed (simplified) copy of the input mesh.

Get fixed copy of the input mesh. All further operations of MbMehsProcessor are performed for simplified mesh: curvature calculation, segmentation, shell creation. All indices in the output of these operations corresponds to indices of vertices and triangles of the simplified mesh returned from this function.

Returns
Returns a fixed version of the input mesh.

◆ GetSegmentedMesh()

virtual const MbCollection& MbMeshProcessor::GetSegmentedMesh ( )
pure virtual

Get segmented copy of the input mesh.

Get segmented copy of the input mesh. All further operations of MbMehsProcessor are performed for simplified mesh: curvature calculation, segmentation, shell creation. Segmentation is stored inside collection.

Returns
Returns a segmented version of the input mesh.

◆ CalculateCurvatures()

virtual const std::vector<MbCurvature>& MbMeshProcessor::CalculateCurvatures ( )
pure virtual

Calculate the principal curvatures and principal curvature directions at mesh points.

Calculate the principal curvatures and principal curvature directions at mesh points.

Returns
Returns principal curvatures and principal curvature directions at mesh points.

◆ SegmentMesh()

virtual MbResultType MbMeshProcessor::SegmentMesh ( bool  createSurfaces = true)
pure virtual

Segment a polygonal mesh.

Perform segmentation of a polygonal mesh.

Returns
Returns operation result code.
Parameters
[in]createSurfaces- Create surfaces on segments or not.

◆ CreateBRepShell()

virtual MbResultType MbMeshProcessor::CreateBRepShell ( MbFaceShell *&  pShell)
pure virtual

Create shell.

Create BRep shell that represents input mesh model. Current segmentation is used. If segmentation is not computed yet, then automatic segmentation is performed (with default paramters).

Parameters
[out]pShell- The pointer to created shell.
Returns
Returns operation result code.

◆ FitSurfaceToSegment() [1/2]

virtual void MbMeshProcessor::FitSurfaceToSegment ( size_t  idxSegment)
pure virtual

Fit surface to segment .

Recognize surface for mesh segment with a given index. Recognized surface is available through GetSegmentSurface method.

Parameters
[in]idxSegment- Index of a mesh segment.

◆ FitSurfaceToSegment() [2/2]

virtual void MbMeshProcessor::FitSurfaceToSegment ( size_t  idxSegment,
MbeSpaceType  surfaceType 
)
pure virtual

Fit surface of a given type to a segment.

Find surface of a given type approximating mesh segment with a given index. Recognized surface is available through GetSegmentSurface method.

Parameters
[in]idxSegment- Index of a mesh segment.
[in]surfaceType- Type of fitted surface.

◆ GetSegmentSurface()

virtual const MbSurface* MbMeshProcessor::GetSegmentSurface ( size_t  idxSegment) const
pure virtual

Get surface of segment.

Get surface that approximates segment. To fit surface use corresponding methods SegmentMesh or FitSurfaceToSegment.

Parameters
[in]idxSegment- Index of a mesh segment.
Returns
Returns pointer to segment surface if it exists, else - NULL.

◆ ResetSegmentation()

virtual void MbMeshProcessor::ResetSegmentation ( )
pure virtual

Reset segmentation of the polygonal mesh.

Reset segmentation of the polygonal mesh stored inside MbMeshProcessor.

◆ FindShortestVertexPath()

virtual bool MbMeshProcessor::FindShortestVertexPath ( uint  v1,
uint  v2,
std::vector< uint > &  path 
)
pure virtual

Find shortest path between two vertices.

Find shortest path between two vertices. The path should pass through collection vertices and edges.

Parameters
[in]v1- The index of first vertex.
[in]v2- The index of second vertex.
[out]path- The path from the first vertex to the second one. The array contains successive indices of path vertices.
Returns
Returns operation result code.

◆ ConvertMeshToShell()

MbResultType ConvertMeshToShell ( MbMesh mesh,
MbFaceShell *&  shell,
const MbMeshProcessorValues params = MbMeshProcessorValues() 
)

Create shell from mesh with automatic surface reconstruction.

Create BRep shell that represents input mesh model. Algorithm automatically detect and reconstruct faces based on elementary surfaces (plane, cylinder, sphere, cone, torus).

Parameters
[in]mesh- The input mesh.
[out]shell- The pointer to created shell.
[in]params- Parameters of BRep shell construction.
Returns
Returns operation result code.

◆ ConvertCollectionToShell()

MbResultType ConvertCollectionToShell ( MbCollection collection,
MbFaceShell *&  shell,
const MbMeshProcessorValues params = MbMeshProcessorValues() 
)

Create shell from collection with automatic surface reconstruction.

Create BRep shell that represents input mesh model from collection. Algorithm automatically detect and reconstruct faces based on elementary surfaces (plane, cylinder, sphere, cone, torus).

Parameters
[in]collection- The input collection.
[out]shell- The pointer to created shell.
[in]params- Parameters of BRep shell construction.
Returns
Returns operation result code.

◆ CalculateHideMesh()

void CalculateHideMesh ( const MbSurface surf,
const MbVector3D eyeDir,
double  sag,
MbMesh *&  mesh 
)

Calculate mesh.

Calculate mesh of array of surface silhouette curves.

◆ TriangulateRegion()

void TriangulateRegion ( const MbRegion region,
double  sag,
MbPlanarGrid grid 
)

Triangulation of a two-dimensional region.

Triangulation of a two-dimensional region. 'region' region has to be correct (improper handling of incorrect ones)