Static Public Member Functions | |
Mesh | fromFaceSoup (VertCoords vertexCoordinates, std_vector_Id_VertTag verts, Vector_MeshBuilder_VertSpan_FaceId faces, MeshBuilder.BuildSettings settings='MR::MeshBuilder::BuildSettings{}', func_bool_from_float cb='MR::ProgressCallback{}') |
Mesh | fromPointTriples (std_vector_std_array_Vector3_float_3ul posTriples, bool duplicateNonManifoldVertices) |
Mesh | fromTriMesh (TriMesh triMesh, MeshBuilder.BuildSettings settings='MR::MeshBuilder::BuildSettings{}', func_bool_from_float cb='MR::ProgressCallback{}') |
Mesh | fromTriangles (VertCoords vertexCoordinates, Triangulation t, MeshBuilder.BuildSettings settings='MR::MeshBuilder::BuildSettings{}', func_bool_from_float cb='MR::ProgressCallback{}') |
Mesh | fromTrianglesDuplicatingNonManifoldVertices (VertCoords vertexCoordinates, Triangulation t, std_vector_MeshBuilder_VertDuplication dups=None, MeshBuilder.BuildSettings settings='MR::MeshBuilder::BuildSettings{}') |
Generated from: MR::Mesh This class represents a mesh, including topology (connectivity) information and point coordinates, as well as some caches to accelerate search algorithms \\ingroup MeshGroup
None meshlib.mrmeshpy.Mesh.__init__ | ( | self | ) |
Implicit default constructor.
None meshlib.mrmeshpy.Mesh.__init__ | ( | self, | |
Mesh | arg0 ) |
Implicit copy constructor.
bool meshlib.mrmeshpy.Mesh.__eq__ | ( | self, | |
Mesh | b ) |
compare that two meshes are exactly the same
None meshlib.mrmeshpy.Mesh.addPart | ( | self, | |
Mesh | from_, | ||
FaceMap | outFmap = None, | ||
VertMap | outVmap = None, | ||
WholeEdgeMap | outEmap = None, | ||
bool | rearrangeTriangles = False ) |
appends mesh (from) in addition to this mesh: creates new edges, faces, verts and points
None meshlib.mrmeshpy.Mesh.addPartByFaceMap | ( | self, | |
Mesh | from_, | ||
FaceMap | fromFaces, | ||
bool | flipOrientation = False, | ||
std_vector_std_vector_Id_EdgeTag | thisContours = 'std::vector<MR::EdgePath>{}', | ||
std_vector_std_vector_Id_EdgeTag | fromContours = 'std::vector<MR::EdgePath>{}', | ||
PartMapping | map = 'MR::PartMapping{}' ) |
fromFaces contains mapping from this-mesh (considering it is empty) to from-mesh
None meshlib.mrmeshpy.Mesh.addPartByMask | ( | self, | |
Mesh | from_, | ||
FaceBitSet | fromFaces, | ||
bool | flipOrientation = False, | ||
std_vector_std_vector_Id_EdgeTag | thisContours = 'std::vector<MR::EdgePath>{}', | ||
std_vector_std_vector_Id_EdgeTag | fromContours = 'std::vector<MR::EdgePath>{}', | ||
PartMapping | map = 'MR::PartMapping{}' ) |
this version has more parameters: if flipOrientation then every from triangle is inverted before adding
None meshlib.mrmeshpy.Mesh.addPartByMask | ( | self, | |
Mesh | from_, | ||
FaceBitSet | fromFaces, | ||
PartMapping | map ) |
the same but copies only portion of (from) specified by fromFaces
creates new point and assigns given position to it
Id_EdgeTag meshlib.mrmeshpy.Mesh.addSeparateContours | ( | self, | |
std_vector_std_vector_Vector3_float | contours, | ||
AffineXf3f | xf = None ) |
append points to mesh and connect them returns first EdgeId of new edges
Id_EdgeTag meshlib.mrmeshpy.Mesh.addSeparateEdgeLoop | ( | self, | |
std_vector_Vector3_float | contourPoints ) |
append points to mesh and connect them as closed edge loop returns first EdgeId of new edges
float meshlib.mrmeshpy.Mesh.area | ( | self, | |
FaceBitSet | fs ) |
computes the area of given face-region
float meshlib.mrmeshpy.Mesh.area | ( | self, | |
FaceBitSet | fs = None ) |
computes the area of given face-region (or whole mesh)
float meshlib.mrmeshpy.Mesh.area | ( | self, | |
FaceId | f ) |
returns the area of given face
None meshlib.mrmeshpy.Mesh.attachEdgeLoopPart | ( | self, | |
Id_EdgeTag | first, | ||
Id_EdgeTag | last, | ||
std_vector_Vector3_float | contourPoints ) |
append points to mesh and connect them to given edges making edge loop first point connects with first edge dest last point connects with last edge org note that first and last edge should have no left face
float meshlib.mrmeshpy.Mesh.averageEdgeLength | ( | self | ) |
computes average length of an edge in this mesh
float meshlib.mrmeshpy.Mesh.calcFastWindingNumber | ( | self, | |
Vector3f | pt, | ||
float | beta = 2 ) |
computes generalized winding number in a point (pt), which is * for closed mesh with normals outside: 1 inside, 0 outside; * for planar mesh: 0.5 inside, -0.5 outside; and in general is equal to (portion of solid angle where inside part of mesh is observable) minus (portion of solid angle where outside part of mesh is observable) \\param beta determines the precision of fast approximation: the more the better, recommended value 2 or more
float meshlib.mrmeshpy.Mesh.circumcircleDiameter | ( | self, | |
FaceId | f ) |
returns circumcircle diameter of given mesh triangle
float meshlib.mrmeshpy.Mesh.circumcircleDiameterSq | ( | self, | |
FaceId | f ) |
returns squared circumcircle diameter of given mesh triangle
Mesh meshlib.mrmeshpy.Mesh.cloneRegion | ( | self, | |
FaceBitSet | region, | ||
bool | flipOrientation = False, | ||
PartMapping | map = 'MR::PartMapping{}' ) |
creates new mesh from given triangles of this mesh
Box3f meshlib.mrmeshpy.Mesh.computeBoundingBox | ( | self, | |
AffineXf3f | toWorld = None ) |
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
Box3f meshlib.mrmeshpy.Mesh.computeBoundingBox | ( | self, | |
FaceBitSet | region, | ||
AffineXf3f | toWorld = None ) |
passes through all given faces (or whole mesh if region == null) and finds the minimal bounding box containing all of them if toWorld transformation is given then returns minimal bounding box in world space
float meshlib.mrmeshpy.Mesh.cotan | ( | self, | |
UndirectedEdgeId | ue ) |
computes sum of cotangents of the angle in the left and right triangles opposite to given edge, and returns 0 if left face does not exist
float meshlib.mrmeshpy.Mesh.dblArea | ( | self, | |
FaceId | f ) |
returns twice the area of given face
float meshlib.mrmeshpy.Mesh.dblArea | ( | self, | |
VertId | v ) |
computes the length of summed directed double areas of all triangles around given vertex
None meshlib.mrmeshpy.Mesh.deleteFaces | ( | self, | |
FaceBitSet | fs, | ||
UndirectedEdgeBitSet | keepEdges = None ) |
deletes multiple given faces, also deletes adjacent edges and vertices if they were not shared by remaining faces ant not in \\param keepFaces
Vector3f meshlib.mrmeshpy.Mesh.destPnt | ( | self, | |
Id_EdgeTag | e ) |
returns coordinates of the edge destination
float meshlib.mrmeshpy.Mesh.dihedralAngle | ( | self, | |
UndirectedEdgeId | e ) |
given an edge between two triangular faces, computes the dihedral angle between them: 0 if both faces are in the same plane, positive if the faces form convex surface, negative if the faces form concave surface; please consider the usage of faster dihedralAngleSin(e) and dihedralAngleCos(e)
float meshlib.mrmeshpy.Mesh.dihedralAngleCos | ( | self, | |
UndirectedEdgeId | e ) |
given an edge between two triangular faces, computes cosine of dihedral angle between them: 1 if both faces are in the same plane, 0 if the surface makes right angle turn at the edge, -1 if the faces overlap one another
float meshlib.mrmeshpy.Mesh.dihedralAngleSin | ( | self, | |
UndirectedEdgeId | e ) |
given an edge between two triangular faces, computes sine of dihedral angle between them: 0 if both faces are in the same plane, positive if the faces form convex surface, negative if the faces form concave surface
Vector3d meshlib.mrmeshpy.Mesh.dirArea | ( | self, | |
FaceBitSet | fs ) |
computes the sum of directed areas for faces from given region
Vector3d meshlib.mrmeshpy.Mesh.dirArea | ( | self, | |
FaceBitSet | fs = None ) |
computes the sum of directed areas for faces from given region (or whole mesh)
computes directed double area for a triangular face from its vertices
computes sum of directed double areas of all triangles around given vertex
float meshlib.mrmeshpy.Mesh.discreteGaussianCurvature | ( | self, | |
VertId | v, | ||
bool_output | outBoundaryVert = None ) |
computes discrete Gaussian curvature (or angle defect) at given vertex, which 0 in inner vertices on planar mesh parts and reaches 2*pi on needle's tip, see http://math.uchicago.edu/~may/REU2015/REUPapers/Upadhyay.pdf optionally returns whether the vertex is on boundary
float meshlib.mrmeshpy.Mesh.discreteMeanCurvature | ( | self, | |
UndirectedEdgeId | e ) |
computes discrete mean curvature in given edge, measures in length^-1; 0 for planar regions, positive for convex surface, negative for concave surface
float meshlib.mrmeshpy.Mesh.discreteMeanCurvature | ( | self, | |
VertId | v ) |
computes discrete mean curvature in given vertex, measures in length^-1; 0 for planar regions, positive for convex surface, negative for concave surface
Vector3f meshlib.mrmeshpy.Mesh.edgeCenter | ( | self, | |
UndirectedEdgeId | e ) |
computes the center of given edge
float meshlib.mrmeshpy.Mesh.edgeLength | ( | self, | |
UndirectedEdgeId | e ) |
returns Euclidean length of the edge
float meshlib.mrmeshpy.Mesh.edgeLengthSq | ( | self, | |
UndirectedEdgeId | e ) |
returns squared Euclidean length of the edge (faster to compute than length)
computes coordinates of point given as edge and relative position on it
Vector3f meshlib.mrmeshpy.Mesh.edgePoint | ( | self, | |
Id_EdgeTag | e, | ||
float | f ) |
returns a point on the edge: origin point for f=0 and destination point for f=1
LineSegm3f meshlib.mrmeshpy.Mesh.edgeSegment | ( | self, | |
Id_EdgeTag | e ) |
returns line segment of given edge
Vector3f meshlib.mrmeshpy.Mesh.edgeVector | ( | self, | |
Id_EdgeTag | e ) |
returns vector equal to edge destination point minus edge origin point
Vector3f meshlib.mrmeshpy.Mesh.findCenterFromBBox | ( | self | ) |
computes bounding box and returns its center
Vector3f meshlib.mrmeshpy.Mesh.findCenterFromFaces | ( | self | ) |
computes center of mass considering that density of all triangles is the same
Vector3f meshlib.mrmeshpy.Mesh.findCenterFromPoints | ( | self | ) |
computes average position of all valid mesh vertices
MeshProjectionResult meshlib.mrmeshpy.Mesh.findClosestPoint | ( | self, | |
Vector3f | point, | ||
float | maxDistSq = 3.4028234663852886e+38, | ||
FaceBitSet | region = None, | ||
AffineXf3f | xf = None ) |
bool meshlib.mrmeshpy.Mesh.findClosestPoint | ( | self, | |
Vector3f | point, | ||
MeshProjectionResult | res, | ||
float | maxDistSq = 3.4028234663852886e+38, | ||
FaceBitSet | region = None, | ||
AffineXf3f | xf = None ) |
UndirectedEdgeBitSet meshlib.mrmeshpy.Mesh.findCreaseEdges | ( | self, | |
float | angleFromPlanar ) |
finds all mesh edges where dihedral angle is distinct from planar PI angle on at least given value
VertBitSet meshlib.mrmeshpy.Mesh.findSpikeVertices | ( | self, | |
float | minSumAngle, | ||
VertBitSet | region = None, | ||
func_bool_from_float | cb = 'MR::ProgressCallback{}' ) |
returns vertices where the sum of triangle angles is below given threshold
|
static |
construct mesh from vertex coordinates and construct mesh topology from face soup, where each face can have arbitrary degree (not only triangles); all non-triangular faces will be automatically subdivided on triangles
|
static |
construct mesh from point triples; \\param duplicateNonManifoldVertices = false, all coinciding points are given the same VertId in the result; \\param duplicateNonManifoldVertices = true, it tries to avoid non-manifold vertices by creating duplicate vertices with same coordinates
|
static |
construct mesh from vertex coordinates and a set of triangles with given ids
|
static |
construct mesh from vertex coordinates and a set of triangles with given ids; unlike simple fromTriangles() it tries to resolve non-manifold vertices by creating duplicate vertices
|
static |
construct mesh from TriMesh representation
AABBTree meshlib.mrmeshpy.Mesh.getAABBTree | ( | self | ) |
returns cached aabb-tree for this mesh, creating it if it did not exist in a thread-safe manner
AABBTree meshlib.mrmeshpy.Mesh.getAABBTreeNotCreate | ( | self | ) |
returns cached aabb-tree for this mesh, but does not create it if it did not exist
AABBTreePoints meshlib.mrmeshpy.Mesh.getAABBTreePoints | ( | self | ) |
returns cached aabb-tree for points of this mesh, creating it if it did not exist in a thread-safe manner
AABBTreePoints meshlib.mrmeshpy.Mesh.getAABBTreePointsNotCreate | ( | self | ) |
returns cached aabb-tree for points of this mesh, but does not create it if it did not exist
Box3f meshlib.mrmeshpy.Mesh.getBoundingBox | ( | self | ) |
returns the bounding box containing all valid vertices (implemented via getAABBTree()) this bounding box is insignificantly bigger that minimal box due to AABB algorithms precision
UndirectedEdgeId meshlib.mrmeshpy.Mesh.getClosestEdge | ( | self, | |
MeshTriPoint | p ) |
returns one of three face edges, closest to given point
UndirectedEdgeId meshlib.mrmeshpy.Mesh.getClosestEdge | ( | self, | |
PointOnFace | p ) |
returns one of three face edges, closest to given point
VertId meshlib.mrmeshpy.Mesh.getClosestVertex | ( | self, | |
MeshTriPoint | p ) |
returns one of three face vertices, closest to given point
VertId meshlib.mrmeshpy.Mesh.getClosestVertex | ( | self, | |
PointOnFace | p ) |
returns one of three face vertices, closest to given point
Dipoles meshlib.mrmeshpy.Mesh.getDipoles | ( | self | ) |
returns cached dipoles of aabb-tree nodes for this mesh, creating it if it did not exist in a thread-safe manner
Dipoles meshlib.mrmeshpy.Mesh.getDipolesNotCreate | ( | self | ) |
returns cached dipoles of aabb-tree nodes for this mesh, but does not create it if it did not exist
std_array_Vector3_float_3 meshlib.mrmeshpy.Mesh.getLeftTriPoints | ( | self, | |
Id_EdgeTag | e ) |
returns three points of left face of e
None meshlib.mrmeshpy.Mesh.getLeftTriPoints | ( | self, | |
Id_EdgeTag | e, | ||
Vector3f | v0, | ||
Vector3f | v1, | ||
Vector3f | v2 ) |
returns three points of left face of e
std_array_Vector3_float_3 meshlib.mrmeshpy.Mesh.getTriPoints | ( | self, | |
FaceId | f ) |
returns three points of given face
returns three points of given face
int meshlib.mrmeshpy.Mesh.heapBytes | ( | self | ) |
returns the amount of memory this object occupies on heap
Vector3d meshlib.mrmeshpy.Mesh.holeDirArea | ( | self, | |
Id_EdgeTag | 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
float meshlib.mrmeshpy.Mesh.holePerimiter | ( | self, | |
Id_EdgeTag | e ) |
computes the perimeter of the hole specified by one of its edges with no valid left face (left is hole)
None meshlib.mrmeshpy.Mesh.invalidateCaches | ( | self, | |
bool | pointsChanged = True ) |
invalidates caches (aabb-trees) after any change in mesh geometry or topology \\param pointsChanged specifies whether points have changed (otherwise only topology has changed)
bool meshlib.mrmeshpy.Mesh.isOutside | ( | self, | |
Vector3f | pt, | ||
float | windingNumberThreshold = 0.5, | ||
float | beta = 2 ) |
computes whether a point (pt) is located outside the object surrounded by this mesh using generalized winding number \\param beta determines the precision of winding number computation: the more the better, recommended value 2 or more
bool meshlib.mrmeshpy.Mesh.isOutsideByProjNorm | ( | self, | |
Vector3f | pt, | ||
MeshProjectionResult | proj, | ||
FaceBitSet | region = None ) |
computes whether a point (pt) is located outside the object surrounded by this mesh using pseudonormal at the closest point to in on mesh (proj); this method works much faster than \\ref isOutside but can return wrong sign if the closest point is located on self-intersecting part of the mesh
float meshlib.mrmeshpy.Mesh.leftCotan | ( | self, | |
Id_EdgeTag | e ) |
computes cotangent of the angle in the left( e ) triangle opposite to e, and returns 0 if left face does not exist
Vector3f meshlib.mrmeshpy.Mesh.leftDirDblArea | ( | self, | |
Id_EdgeTag | e ) |
computes directed double area of left triangular face of given edge
Vector3f meshlib.mrmeshpy.Mesh.leftNormal | ( | self, | |
Id_EdgeTag | e ) |
computes triangular face normal from its vertices
None meshlib.mrmeshpy.Mesh.mirror | ( | self, | |
Plane3f | plane ) |
reflects the mesh from a given plane
computes triangular face normal from its vertices
Vector3f meshlib.mrmeshpy.Mesh.normal | ( | self, | |
MeshTriPoint | p ) |
computes normal in three vertices of p's triangle, then interpolates them using barycentric coordinates and normalizes again; this is the same normal as in rendering with smooth shading
computes normal in a vertex using sum of directed areas of neighboring triangles
Vector3f meshlib.mrmeshpy.Mesh.orgPnt | ( | self, | |
Id_EdgeTag | e ) |
returns coordinates of the edge origin
None meshlib.mrmeshpy.Mesh.pack | ( | self, | |
FaceMap | outFmap = None, | ||
VertMap | outVmap = None, | ||
WholeEdgeMap | outEmap = None, | ||
bool | rearrangeTriangles = False ) |
tightly packs all arrays eliminating lone edges and invalid face, verts and points, optionally returns mappings: old.id -> new.id
PackMapping meshlib.mrmeshpy.Mesh.packOptimally | ( | self, | |
bool | preserveAABBTree, | ||
func_bool_from_float | cb ) |
PackMapping meshlib.mrmeshpy.Mesh.packOptimally | ( | self, | |
bool | preserveAABBTree = True ) |
packs tightly and rearranges vertices, triangles and edges to put close in space elements in close indices \\param preserveAABBTree whether to keep valid mesh's AABB tree after return (it will take longer to compute and it will occupy more memory)
float meshlib.mrmeshpy.Mesh.projArea | ( | self, | |
Vector3f | dir, | ||
FaceBitSet | fs ) |
computes the sum of absolute projected area of faces from given region as visible if look from given direction
float meshlib.mrmeshpy.Mesh.projArea | ( | self, | |
Vector3f | dir, | ||
FaceBitSet | fs = None ) |
computes the sum of absolute projected area of faces from given region (or whole mesh) as visible if look from given direction
MeshProjectionResult meshlib.mrmeshpy.Mesh.projectPoint | ( | self, | |
Vector3f | point, | ||
float | maxDistSq = 3.4028234663852886e+38, | ||
FaceBitSet | region = None, | ||
AffineXf3f | xf = None ) |
finds the closest mesh point on this mesh (or its region) to given point; \\param point source location to look the closest to \\param maxDistSq search only in the ball with sqrt(maxDistSq) radius around given point, smaller value here increases performance \\param xf is mesh-to-point transformation, if not specified then identity transformation is assumed and works much faster; \\return found closest point including Euclidean coordinates, barycentric coordinates, FaceId and squared distance to point or std::nullopt if no mesh point is found in the ball with sqrt(maxDistSq) radius around given point
bool meshlib.mrmeshpy.Mesh.projectPoint | ( | self, | |
Vector3f | point, | ||
MeshProjectionResult | res, | ||
float | maxDistSq = 3.4028234663852886e+38, | ||
FaceBitSet | region = None, | ||
AffineXf3f | xf = None ) |
finds the closest mesh point on this mesh (or its region) to given point; \\param point source location to look the closest to \\param res found closest point including Euclidean coordinates, barycentric coordinates, FaceId and squared distance to point \\param maxDistSq search only in the ball with sqrt(maxDistSq) radius around given point, smaller value here increases performance \\param xf is mesh-to-point transformation, if not specified then identity transformation is assumed and works much faster; \\return false if no mesh point is found in the ball with sqrt(maxDistSq) radius around given point
bool meshlib.mrmeshpy.Mesh.projectPoint | ( | self, | |
Vector3f | point, | ||
PointOnFace | res, | ||
float | maxDistSq = 3.4028234663852886e+38, | ||
FaceBitSet | region = None, | ||
AffineXf3f | xf = None ) |
finds the closest mesh point on this mesh (or its region) to given point; \\param point source location to look the closest to \\param res found closest point including Euclidean coordinates and FaceId \\param maxDistSq search only in the ball with sqrt(maxDistSq) radius around given point, smaller value here increases performance \\param xf is mesh-to-point transformation, if not specified then identity transformation is assumed and works much faster; \\return false if no mesh point is found in the ball with sqrt(maxDistSq) radius around given point
Vector3f meshlib.mrmeshpy.Mesh.pseudonormal | ( | self, | |
MeshTriPoint | p, | ||
FaceBitSet | region = None ) |
returns pseudonormal in corresponding face/edge/vertex for signed distance calculation; http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.107.9173&rep=rep1&type=pdf unlike normal( const MeshTriPoint & p ), this is not a smooth function
Vector3f meshlib.mrmeshpy.Mesh.pseudonormal | ( | self, | |
UndirectedEdgeId | e, | ||
FaceBitSet | region = None ) |
computes normalized half sum of face normals sharing given edge (only (region) faces will be considered);
Vector3f meshlib.mrmeshpy.Mesh.pseudonormal | ( | self, | |
VertId | v, | ||
FaceBitSet | region = None ) |
computes angle-weighted sum of normals of incident faces of given vertex (only (region) faces will be considered); the sum is normalized before returning
QuadraticForm3f meshlib.mrmeshpy.Mesh.quadraticForm | ( | self, | |
VertId | v, | ||
FaceBitSet | region = None, | ||
UndirectedEdgeBitSet | creases = None ) |
computes quadratic form in the vertex as the sum of squared distances from 1) planes of adjacent triangles 2) lines of adjacent boundary and crease edges
None meshlib.mrmeshpy.Mesh.shrinkToFit | ( | self | ) |
requests the removal of unused capacity
float meshlib.mrmeshpy.Mesh.signedDistance | ( | self, | |
Vector3f | pt ) |
given a point (pt) in 3D, computes the closest point on mesh, and \\return signed distance from pt to mesh: positive value - outside mesh, negative - inside mesh; this method can return wrong sign if the closest point is located on self-intersecting part of the mesh
float meshlib.mrmeshpy.Mesh.signedDistance | ( | self, | |
Vector3f | pt, | ||
float | maxDistSq, | ||
FaceBitSet | region = None ) |
given a point (pt) in 3D, computes the closest point on mesh, and \\return signed distance from pt to mesh: positive value - outside mesh, negative - inside mesh; or std::nullopt if the projection point is not within maxDist; this method can return wrong sign if the closest point is located on self-intersecting part of the mesh
float meshlib.mrmeshpy.Mesh.signedDistance | ( | self, | |
Vector3f | pt, | ||
MeshProjectionResult | proj, | ||
FaceBitSet | region = None ) |
given a point (pt) in 3D and the closest point to in on mesh (proj), \\return signed distance from pt to mesh: positive value - outside mesh, negative - inside mesh; this method can return wrong sign if the closest point is located on self-intersecting part of the mesh
float meshlib.mrmeshpy.Mesh.signedDistance | ( | self, | |
Vector3f | pt, | ||
MeshTriPoint | proj, | ||
FaceBitSet | region = None ) |
Id_EdgeTag meshlib.mrmeshpy.Mesh.splitEdge | ( | self, | |
Id_EdgeTag | e, | ||
FaceBitSet | region = None, | ||
phmap_flat_hash_map_Id_FaceTag_Id_FaceTag | new2Old = None ) |
same, but split given edge on two equal parts
Id_EdgeTag meshlib.mrmeshpy.Mesh.splitEdge | ( | self, | |
Id_EdgeTag | e, | ||
Vector3f | newVertPos, | ||
FaceBitSet | region = None, | ||
phmap_flat_hash_map_Id_FaceTag_Id_FaceTag | new2Old = None ) |
split given edge on two parts: dest(returned-edge) = org(e) - newly created vertex, org(returned-edge) = org(e-before-split), dest(e) = dest(e-before-split) \\details left and right faces of given edge if valid are also subdivided on two parts each; if left or right faces of the original edge were in the region, then include new parts of these faces in the region \\param new2Old receive mapping from newly appeared triangle to its original triangle (part to full)
VertId meshlib.mrmeshpy.Mesh.splitFace | ( | self, | |
FaceId | f, | ||
FaceBitSet | region = None, | ||
phmap_flat_hash_map_Id_FaceTag_Id_FaceTag | new2Old = None ) |
same, putting new vertex in the centroid of original triangle
VertId meshlib.mrmeshpy.Mesh.splitFace | ( | self, | |
FaceId | f, | ||
Vector3f | newVertPos, | ||
FaceBitSet | region = None, | ||
phmap_flat_hash_map_Id_FaceTag_Id_FaceTag | new2Old = None ) |
split given triangle on three triangles, introducing new vertex with given coordinates and connecting it to original triangle vertices; if region is given, then it must include (f) and new faces will be added there as well \\param new2Old receive mapping from newly appeared triangle to its original triangle (part to full)
float meshlib.mrmeshpy.Mesh.sumAngles | ( | self, | |
VertId | v, | ||
bool_output | outBoundaryVert = None ) |
computes the sum of triangle angles at given vertex; optionally returns whether the vertex is on boundary
EdgePoint meshlib.mrmeshpy.Mesh.toEdgePoint | ( | self, | |
Id_EdgeTag | e, | ||
Vector3f | p ) |
converts edge and 3d point into edge-point representation
converts vertex into edge-point representation
MeshTriPoint meshlib.mrmeshpy.Mesh.toTriPoint | ( | self, | |
FaceId | f, | ||
Vector3f | p ) |
converts face id and 3d point into barycentric representation
MeshTriPoint meshlib.mrmeshpy.Mesh.toTriPoint | ( | self, | |
PointOnFace | p ) |
converts face id and 3d point into barycentric representation
MeshTriPoint meshlib.mrmeshpy.Mesh.toTriPoint | ( | self, | |
VertId | v ) |
converts vertex into barycentric representation
None meshlib.mrmeshpy.Mesh.transform | ( | self, | |
AffineXf3f | xf, | ||
VertBitSet | region = None ) |
applies given transformation to specified vertices if region is nullptr, all valid mesh vertices are used
float meshlib.mrmeshpy.Mesh.triangleAspectRatio | ( | self, | |
FaceId | f ) |
returns aspect ratio of given mesh triangle equal to the ratio of the circum-radius to twice its in-radius
Vector3f meshlib.mrmeshpy.Mesh.triPoint | ( | self, | |
MeshTriPoint | p ) |
computes coordinates of point given as face and barycentric representation
None meshlib.mrmeshpy.Mesh.updateCaches | ( | self, | |
VertBitSet | changedVerts ) |
updates existing caches in case of few vertices were changed insignificantly, and topology remained unchanged; it shall be considered as a faster alternative to invalidateCaches() and following rebuild of trees
float meshlib.mrmeshpy.Mesh.volume | ( | self, | |
FaceBitSet | region = None ) |
returns volume of closed mesh region, if region is not closed DBL_MAX is returned if region is nullptr - whole mesh is region
None meshlib.mrmeshpy.Mesh.zeroUnusedPoints | ( | self | ) |
for all points not in topology.getValidVerts() sets coordinates to (0,0,0)