MeshLib Python Docs
Loading...
Searching...
No Matches
mrmeshpy.MeshBuilder Class Reference

Classes

class  BuildSettings
class  Const_equalVector3f
class  ConstBuildSettings
class  ConstMeshPiece
class  ConstTriangle
class  ConstUniteCloseParams
class  ConstVertDuplication
class  ConstVertexIdentifier
class  ConstVertInfo
class  ConstVertSpan
class  ConstVertTri
class  equalVector3f
class  MeshPiece
class  Triangle
class  UniteCloseParams
class  VertDuplication
class  VertexIdentifier
class  VertInfo
class  VertSpan
class  VertTri

Static Public Member Functions

int addTriangles (MeshTopology res, ConstTriangulation t, MeshBuilder.ConstBuildSettings settings=...)
None addTriangles (MeshTopology res, std_vector_Id_VertTag vertTriples, FaceBitSet createdFaces=None)
std_vector_int computeTrianglesRepetitions (ConstTriangulation t)
int duplicateNonManifoldVertices (Triangulation t, FaceBitSet region=None, std_vector_MeshBuilder_VertDuplication dups=None, ConstVertId lastValidVert=..., Const_func_bool_from_Id_VertTag_Id_VertTag_Id_VertTag_Id_VertTag_Id_VertTag betterCont='{}')
MeshTopology fromDisjointMeshPieces (ConstTriangulation t, ConstVertId maxVertId, Const_std_vector_MeshBuilder_MeshPiece pieces, MeshBuilder.ConstBuildSettings settings=...)
MeshTopology fromFaceSoup (ConstVector_VertId verts, ConstVector_MeshBuilder_VertSpan_FaceId faces, MeshBuilder.ConstBuildSettings settings=..., Const_func_bool_from_float progressCb='{}')
Mesh fromPointTriples (Const_std_vector_std_array_Vector3_float_3ul posTriples)
MeshTopology fromTriangles (ConstTriangulation t, MeshBuilder.ConstBuildSettings settings=..., Const_func_bool_from_float progressCb='{}')
MeshTopology fromTrianglesDuplicatingNonManifoldVertices (Triangulation t, std_vector_MeshBuilder_VertDuplication dups=None, MeshBuilder.ConstBuildSettings settings=..., Const_func_bool_from_Id_VertTag_Id_VertTag_Id_VertTag_Id_VertTag_Id_VertTag betterCont='{}')
int uniteCloseVertices (Mesh mesh, float closeDist, bool uniteOnlyBd=True, VertMap optionalVertOldToNew=None)
int uniteCloseVertices (Mesh mesh, MeshBuilder.ConstUniteCloseParams params=...)

Detailed Description

This is a namespace.

Member Function Documentation

◆ addTriangles() [1/2]

int mrmeshpy.MeshBuilder.addTriangles ( MeshTopology res,
ConstTriangulation t,
MeshBuilder.ConstBuildSettings settings = ... )
static
adds triangles in the existing topology, given face indecies must be free;
settings.region on output contain the remaining triangles that could not be added into the topology right now, but may be added later when other triangles appear in the mesh
\\return the total number of triangles added in the topology

◆ addTriangles() [2/2]

None mrmeshpy.MeshBuilder.addTriangles ( MeshTopology res,
std_vector_Id_VertTag vertTriples,
FaceBitSet createdFaces = None )
static
adds triangles in the existing topology, auto selecting face ids for them;
vertTriples on output contain the remaining triangles that could not be added into the topology right now, but may be added later when other triangles appear in the mesh

◆ computeTrianglesRepetitions()

std_vector_int mrmeshpy.MeshBuilder.computeTrianglesRepetitions ( ConstTriangulation t)
static
computes the histogram of triangle repetitions in given triangulation, ignoring vertex order in each triangle:
res[0] is the number of triangles without duplicates,
res[1] is the number of distinct triangles present in two copies,
res[2] is the number of distinct triangles present in three copies, etc.

◆ duplicateNonManifoldVertices()

int mrmeshpy.MeshBuilder.duplicateNonManifoldVertices ( Triangulation t,
FaceBitSet region = None,
std_vector_MeshBuilder_VertDuplication dups = None,
ConstVertId lastValidVert = ...,
Const_func_bool_from_Id_VertTag_Id_VertTag_Id_VertTag_Id_VertTag_Id_VertTag betterCont = '{}' )
static
resolve non-manifold vertices by creating duplicate vertices in the triangulation (which is modified)
`lastValidVert` is needed if `region` or `t` does not contain full mesh, then first duplicated vertex will have `lastValidVert+1` index
`dups` (if given) contents will be ignored and overridden; it receives the duplications in creation order with consecutive dupVert ids starting from `lastValidVert+1`
`betterCont` (if given) selects the best triangle among several possible path continuations
return number of duplicated vertices

◆ fromDisjointMeshPieces()

MeshTopology mrmeshpy.MeshBuilder.fromDisjointMeshPieces ( ConstTriangulation t,
ConstVertId maxVertId,
Const_std_vector_MeshBuilder_MeshPiece pieces,
MeshBuilder.ConstBuildSettings settings = ... )
static
construct mesh topology in parallel from given disjoint mesh pieces (which do not have any shared vertex)
and some additional triangles (in settings) that join the pieces

◆ fromFaceSoup()

MeshTopology mrmeshpy.MeshBuilder.fromFaceSoup ( ConstVector_VertId verts,
ConstVector_MeshBuilder_VertSpan_FaceId faces,
MeshBuilder.ConstBuildSettings settings = ...,
Const_func_bool_from_float progressCb = '{}' )
static
construct mesh topology from face soup, where each face can have arbitrary degree (not only triangles)

◆ fromPointTriples()

Mesh mrmeshpy.MeshBuilder.fromPointTriples ( Const_std_vector_std_array_Vector3_float_3ul posTriples)
static
construct mesh from point triples;
all coinciding points are given the same VertId in the result

◆ fromTriangles()

MeshTopology mrmeshpy.MeshBuilder.fromTriangles ( ConstTriangulation t,
MeshBuilder.ConstBuildSettings settings = ...,
Const_func_bool_from_float progressCb = '{}' )
static
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

◆ fromTrianglesDuplicatingNonManifoldVertices()

MeshTopology mrmeshpy.MeshBuilder.fromTrianglesDuplicatingNonManifoldVertices ( Triangulation t,
std_vector_MeshBuilder_VertDuplication dups = None,
MeshBuilder.ConstBuildSettings settings = ...,
Const_func_bool_from_Id_VertTag_Id_VertTag_Id_VertTag_Id_VertTag_Id_VertTag betterCont = '{}' )
static
construct mesh topology from a set of triangles with given ids;
unlike simple fromTriangles() it tries to resolve non-manifold vertices by creating duplicate vertices;
triangulation is modified to introduce duplicates;
`betterCont` (if given) selects the best triangle among several possible continuations during the duplication

◆ uniteCloseVertices() [1/2]

int mrmeshpy.MeshBuilder.uniteCloseVertices ( Mesh mesh,
float closeDist,
bool uniteOnlyBd = True,
VertMap optionalVertOldToNew = None )
static
the function finds groups of mesh vertices located closer to each other than \\p closeDist, and unites such vertices in one;
then the mesh is rebuilt from the remaining triangles
\\param optionalVertOldToNew is the mapping of vertices: before -> after
\\param uniteOnlyBd if true then only boundary vertices can be united, all internal vertices (even close ones) will remain
\\return the number of vertices united, 0 means no change in the mesh

◆ uniteCloseVertices() [2/2]

int mrmeshpy.MeshBuilder.uniteCloseVertices ( Mesh mesh,
MeshBuilder.ConstUniteCloseParams params = ... )
static
the function finds groups of mesh vertices located closer to each other than \\p params.closeDist, and unites such vertices in one;
then the mesh is rebuilt from the remaining triangles
\\return the number of vertices united, 0 means no change in the mesh

The documentation for this class was generated from the following file: