#include "MRMeshFwd.h"#include "MRAffineXf.h"#include "MRBox.h"#include "MRId.h"#include "MRMeshTopology.h"#include "MRMeshTriPoint.h"Go to the source code of this file.
Classes | |
| struct | MRMeshAddMeshPartParameters |
| optional parameters for mrMeshAddMeshPart More... | |
Typedefs | |
| typedef struct MRMeshAddMeshPartParameters | MRMeshAddMeshPartParameters |
| optional parameters for mrMeshAddMeshPart | |
Functions | |
| MR_EXTERN_C_BEGIN MRMESHC_API MRMesh * | mrMeshCopy (const MRMesh *mesh) |
| creates a copy of a Mesh object | |
| MRMESHC_API MRMesh * | mrMeshFromTriangles (const MRVector3f *vertexCoordinates, size_t vertexCoordinatesNum, const MRThreeVertIds *t, size_t tNum) |
| constructs a mesh from vertex coordinates and a set of triangles with given ids | |
| MRMESHC_API MRMesh * | mrMeshFromTrianglesDuplicatingNonManifoldVertices (const MRVector3f *vertexCoordinates, size_t vertexCoordinatesNum, const MRThreeVertIds *t, size_t tNum) |
| MRMESHC_API MRMesh * | mrMeshNewFromPointTriples (const MRTriangle3f *posTriangles, size_t posTrianglesNum, bool duplicateNonManifoldVertices) |
| MRMESHC_API const MRVector3f * | mrMeshPoints (const MRMesh *mesh) |
| gets read-only access to the mesh vertex coordinates | |
| MRMESHC_API MRVector3f * | mrMeshPointsRef (MRMesh *mesh) |
| gets read-write access to the mesh vertex coordinates | |
| MRMESHC_API size_t | mrMeshPointsNum (const MRMesh *mesh) |
| gets count of the mesh vertex coordinates | |
| MRMESHC_API const MRMeshTopology * | mrMeshTopology (const MRMesh *mesh) |
| gets read-only access to the mesh topology object | |
| MRMESHC_API MRMeshTopology * | mrMeshTopologyRef (MRMesh *mesh) |
| gets read-write access to the mesh topology object | |
| MRMESHC_API MRBox3f | mrMeshComputeBoundingBox (const MRMesh *mesh, const MRAffineXf3f *toWorld) |
| MRMESHC_API void | mrMeshTransform (MRMesh *mesh, const MRAffineXf3f *xf, const MRVertBitSet *region) |
| MRMESHC_API MRVector3f | mrMeshHoleDirArea (const MRMesh *mesh, MREdgeId e) |
| MRMESHC_API double | mrMeshArea (const MRMesh *mesh, const MRFaceBitSet *region) |
| computes the area of given face-region (or whole mesh if region is null) | |
| MRMESHC_API float | mrMeshEdgeLength (const MRMesh *mesh, MRUndirectedEdgeId e) |
| returns Euclidean length of the edge | |
| MRMESHC_API float | mrMeshEdgeLengthSq (const MRMesh *mesh, MRUndirectedEdgeId e) |
| returns squared Euclidean length of the edge (faster to compute than length) | |
| MRMESHC_API void | mrMeshDeleteFaces (MRMesh *mesh, const MRFaceBitSet *fs, const MRUndirectedEdgeBitSet *keepEdges) |
| deletes multiple given faces, also deletes adjacent edges and vertices if they were not shared by remaining faces and not in | |
| MRMESHC_API void | mrMeshAddMeshPart (MRMesh *mesh, const MRMeshPart *meshPart, const MRMeshAddMeshPartParameters *params) |
| appends mesh (from) in addition to this mesh: creates new edges, faces, verts and points | |
| MRMESHC_API void | mrMeshPack (MRMesh *mesh, bool rearrangeTriangles) |
| tightly packs all arrays eliminating lone edges and invalid face, verts and points | |
| MRMESHC_API void | mrMeshPackOptimally (MRMesh *mesh, bool preserveAABBTree) |
| MRMESHC_API double | mrMeshVolume (const MRMesh *mesh, const MRFaceBitSet *region) |
| MRMESHC_API void | mrMeshFree (MRMesh *mesh) |
| deallocates a Mesh object | |
| MRMESHC_API MRTriangulation * | mrMeshGetTriangulation (const MRMesh *mesh) |
| MRMESHC_API MREdgePath * | mrMeshFindHoleRepresentiveEdges (const MRMesh *mesh) |
| MRMESHC_API void | mrMeshInvalidateCaches (MRMesh *mesh, bool pointsChanged) |
| MRMESHC_API void | mrMeshAddMesh (MRMesh *mesh, const MRMesh *from) |
| appends another mesh as separate connected component(s) to this | |
| MRMESHC_API MRVector3f | mrMeshNormalFromVert (const MRMesh *mesh, MRVertId v) |
| computes normal in a vertex using sum of directed areas of neighboring triangles | |
| MRMESHC_API MRMeshTriPoint | mrToTriPoint (const MRMesh *mesh, MRFaceId f, MRVector3f point) |
| converts face id and 3d point into barycentric representation | |
| typedef struct MRMeshAddMeshPartParameters MRMeshAddMeshPartParameters |
optional parameters for mrMeshAddMeshPart
| MRMESHC_API void mrMeshAddMesh | ( | MRMesh * | mesh, |
| const MRMesh * | from ) |
appends another mesh as separate connected component(s) to this
| MRMESHC_API void mrMeshAddMeshPart | ( | MRMesh * | mesh, |
| const MRMeshPart * | meshPart, | ||
| const MRMeshAddMeshPartParameters * | params ) |
appends mesh (from) in addition to this mesh: creates new edges, faces, verts and points
| MRMESHC_API double mrMeshArea | ( | const MRMesh * | mesh, |
| const MRFaceBitSet * | region ) |
computes the area of given face-region (or whole mesh if region is null)
| MRMESHC_API MRBox3f mrMeshComputeBoundingBox | ( | const MRMesh * | mesh, |
| const MRAffineXf3f * | toWorld ) |
passes through all valid vertices and finds the minimal bounding box containing all of them; if toWorld transformation is given then returns minimal bounding box in world space
| MR_EXTERN_C_BEGIN MRMESHC_API MRMesh * mrMeshCopy | ( | const MRMesh * | mesh | ) |
creates a copy of a Mesh object
| MRMESHC_API void mrMeshDeleteFaces | ( | MRMesh * | mesh, |
| const MRFaceBitSet * | fs, | ||
| const MRUndirectedEdgeBitSet * | keepEdges ) |
deletes multiple given faces, also deletes adjacent edges and vertices if they were not shared by remaining faces and not in
| keepEdges |
| MRMESHC_API float mrMeshEdgeLength | ( | const MRMesh * | mesh, |
| MRUndirectedEdgeId | e ) |
returns Euclidean length of the edge
| MRMESHC_API float mrMeshEdgeLengthSq | ( | const MRMesh * | mesh, |
| MRUndirectedEdgeId | e ) |
returns squared Euclidean length of the edge (faster to compute than length)
| MRMESHC_API MREdgePath * mrMeshFindHoleRepresentiveEdges | ( | const MRMesh * | mesh | ) |
returns one edge with no valid left face for every boundary in the mesh NOTE: this is a shortcut for mrMeshTopologyFindHoleRepresentiveEdges( mrMeshTopology( mesh ) )
| MRMESHC_API void mrMeshFree | ( | MRMesh * | mesh | ) |
deallocates a Mesh object
| MRMESHC_API MRMesh * mrMeshFromTriangles | ( | const MRVector3f * | vertexCoordinates, |
| size_t | vertexCoordinatesNum, | ||
| const MRThreeVertIds * | t, | ||
| size_t | tNum ) |
constructs a mesh from vertex coordinates and a set of triangles with given ids
| MRMESHC_API MRMesh * mrMeshFromTrianglesDuplicatingNonManifoldVertices | ( | const MRVector3f * | vertexCoordinates, |
| size_t | vertexCoordinatesNum, | ||
| const MRThreeVertIds * | t, | ||
| size_t | tNum ) |
constructs a mesh from vertex coordinates and a set of triangles with given ids; unlike simple mrMeshFromTriangles it tries to resolve non-manifold vertices by creating duplicate vertices
| MRMESHC_API MRTriangulation * mrMeshGetTriangulation | ( | const MRMesh * | mesh | ) |
returns three vertex ids for valid triangles (which can be accessed by FaceId), vertex ids for invalid triangles are undefined, and shall not be read NOTE: this is a shortcut for mrMeshTopologyGetTriangulation( mrMeshTopology( mesh ) )
| MRMESHC_API MRVector3f mrMeshHoleDirArea | ( | const MRMesh * | mesh, |
| MREdgeId | e ) |
computes directed area of the hole specified by one of its edges with no valid left face (left is hole); if the hole is planar then returned vector is orthogonal to the plane pointing outside and its magnitude is equal to hole area
| MRMESHC_API void mrMeshInvalidateCaches | ( | MRMesh * | mesh, |
| bool | pointsChanged ) |
invalidates caches (aabb-trees) after any change in mesh geometry or topology
| pointsChanged | specifies whether points have changed (otherwise only topology has changed) |
| MRMESHC_API MRMesh * mrMeshNewFromPointTriples | ( | const MRTriangle3f * | posTriangles, |
| size_t | posTrianglesNum, | ||
| bool | duplicateNonManifoldVertices ) |
constructs a mesh from point triples;
| duplicateNonManifoldVertices | = false, all coinciding points are given the same VertId in the result; |
| duplicateNonManifoldVertices | = true, it tries to avoid non-manifold vertices by creating duplicate vertices with same coordinates |
| MRMESHC_API MRVector3f mrMeshNormalFromVert | ( | const MRMesh * | mesh, |
| MRVertId | v ) |
computes normal in a vertex using sum of directed areas of neighboring triangles
| MRMESHC_API void mrMeshPack | ( | MRMesh * | mesh, |
| bool | rearrangeTriangles ) |
tightly packs all arrays eliminating lone edges and invalid face, verts and points
| MRMESHC_API void mrMeshPackOptimally | ( | MRMesh * | mesh, |
| bool | preserveAABBTree ) |
packs tightly and rearranges vertices, triangles and edges to put close in space elements in close indices
| preserveAABBTree | whether to keep valid mesh's AABB tree after return (it will take longer to compute and it will occupy more memory) |
| MRMESHC_API const MRVector3f * mrMeshPoints | ( | const MRMesh * | mesh | ) |
gets read-only access to the mesh vertex coordinates
| MRMESHC_API size_t mrMeshPointsNum | ( | const MRMesh * | mesh | ) |
gets count of the mesh vertex coordinates
| MRMESHC_API MRVector3f * mrMeshPointsRef | ( | MRMesh * | mesh | ) |
gets read-write access to the mesh vertex coordinates
| MRMESHC_API const MRMeshTopology * mrMeshTopology | ( | const MRMesh * | mesh | ) |
gets read-only access to the mesh topology object
| MRMESHC_API MRMeshTopology * mrMeshTopologyRef | ( | MRMesh * | mesh | ) |
gets read-write access to the mesh topology object
| MRMESHC_API void mrMeshTransform | ( | MRMesh * | mesh, |
| const MRAffineXf3f * | xf, | ||
| const MRVertBitSet * | region ) |
applies given transformation to specified vertices if region is NULL, all valid mesh vertices are used
| MRMESHC_API double mrMeshVolume | ( | const MRMesh * | mesh, |
| const MRFaceBitSet * | region ) |
returns volume of closed mesh region, if region is not closed DBL_MAX is returned if region is NULL - whole mesh is region
| MRMESHC_API MRMeshTriPoint mrToTriPoint | ( | const MRMesh * | mesh, |
| MRFaceId | f, | ||
| MRVector3f | point ) |
converts face id and 3d point into barycentric representation