Building topologies by triangles. More...
Classes | |
struct | BuildSettings |
struct | equalVector3f |
this makes bit-wise comparison of two Vector3f's thus making two NaNs equal More... | |
struct | MeshPiece |
struct | Triangle |
mesh triangle represented by its three vertices and by its face ID More... | |
struct | VertDuplication |
class | VertexIdentifier |
struct | VertSpan |
Functions | |
MRMESH_API MeshTopology | fromTriangles (const Triangulation &t, const BuildSettings &settings={}, ProgressCallback progressCb={}) |
MRMESH_API size_t | duplicateNonManifoldVertices (Triangulation &t, FaceBitSet *region=nullptr, std::vector< VertDuplication > *dups=nullptr) |
MRMESH_API MeshTopology | fromTrianglesDuplicatingNonManifoldVertices (Triangulation &t, std::vector< VertDuplication > *dups=nullptr, const BuildSettings &settings={}) |
MRMESH_API Mesh | fromPointTriples (const std::vector< Triangle3f > &posTriples) |
MRMESH_API MeshTopology | fromDisjointMeshPieces (const Triangulation &t, VertId maxVertId, const std::vector< MeshPiece > &pieces, const BuildSettings &settings={}) |
MRMESH_API void | addTriangles (MeshTopology &res, const Triangulation &t, const BuildSettings &settings={}) |
MRMESH_API void | addTriangles (MeshTopology &res, std::vector< VertId > &vertTriples, FaceBitSet *createdFaces=nullptr) |
MRMESH_API MeshTopology | fromFaceSoup (const std::vector< VertId > &verts, const Vector< VertSpan, FaceId > &faces, const BuildSettings &settings={}, ProgressCallback progressCb={}) |
construct mesh topology from face soup, where each face can have arbitrary degree (not only triangles) | |
MRMESH_API int | uniteCloseVertices (Mesh &mesh, float closeDist, bool uniteOnlyBd=true, VertMap *optionalVertOldToNew=nullptr) |
Building topologies by triangles.
This namespace provides API for building meshes.
Simple example with key steps
MRMESH_API void MR::MeshBuilder::addTriangles | ( | MeshTopology & | res, |
const Triangulation & | t, | ||
const BuildSettings & | settings = {} ) |
MRMESH_API void MR::MeshBuilder::addTriangles | ( | MeshTopology & | res, |
std::vector< VertId > & | vertTriples, | ||
FaceBitSet * | createdFaces = nullptr ) |
MRMESH_API size_t MR::MeshBuilder::duplicateNonManifoldVertices | ( | Triangulation & | t, |
FaceBitSet * | region = nullptr, | ||
std::vector< VertDuplication > * | dups = nullptr ) |
MRMESH_API MeshTopology MR::MeshBuilder::fromDisjointMeshPieces | ( | const Triangulation & | t, |
VertId | maxVertId, | ||
const std::vector< MeshPiece > & | pieces, | ||
const BuildSettings & | settings = {} ) |
MRMESH_API MeshTopology MR::MeshBuilder::fromFaceSoup | ( | const std::vector< VertId > & | verts, |
const Vector< VertSpan, FaceId > & | faces, | ||
const BuildSettings & | settings = {}, | ||
ProgressCallback | progressCb = {} ) |
construct mesh topology from face soup, where each face can have arbitrary degree (not only triangles)
MRMESH_API Mesh MR::MeshBuilder::fromPointTriples | ( | const std::vector< Triangle3f > & | posTriples | ) |
MRMESH_API MeshTopology MR::MeshBuilder::fromTriangles | ( | const Triangulation & | t, |
const BuildSettings & | settings = {}, | ||
ProgressCallback | progressCb = {} ) |
construct mesh topology from a set of triangles with given ids; if skippedTris is given then it receives all input triangles not added in the resulting topology
MRMESH_API MeshTopology MR::MeshBuilder::fromTrianglesDuplicatingNonManifoldVertices | ( | Triangulation & | t, |
std::vector< VertDuplication > * | dups = nullptr, | ||
const BuildSettings & | settings = {} ) |
MRMESH_API int MR::MeshBuilder::uniteCloseVertices | ( | Mesh & | mesh, |
float | closeDist, | ||
bool | uniteOnlyBd = true, | ||
VertMap * | optionalVertOldToNew = nullptr ) |
the function finds groups of mesh vertices located closer to each other than
closeDist,and | unites such vertices in one; then the mesh is rebuilt from the remaining triangles |
optionalVertOldToNew | is the mapping of vertices: before -> after |
uniteOnlyBd | if true then only boundary vertices can be united, all internal vertices (even close ones) will remain |