Topics | |
| Mesh Delete | |
| Mesh Delone | |
| Mesh Eigen | |
| Fill/Stitch Holes overview | |
| This chapter represents documentation about hole triangulations or stitching two holes. | |
| Mesh Fixer | |
| Mesh Normals | |
| Mesh Relax | |
| Mesh Subdivide | |
Classes | |
| class | MR::MeshDiff |
| struct | MR::MeshRegion< RegionTag > |
| class | MR::MeshTopologyDiff |
| struct | MR::ShrinkwrapParameters |
| class | MR::VertCoordsDiff |
Functions | |
| void | MR::straightenBoundary (Mesh &mesh, EdgeId bd, float minNeiNormalsDot, float maxTriAspectRatio, FaceBitSet *newFaces=nullptr) |
| PointCloud | MR::meshToPointCloud (const Mesh &mesh, bool saveNormals=true, const VertBitSet *verts=nullptr) |
| Expected< PointCloud > | MR::meshToDensePointCloud (const MeshPart &mp, float radius, bool saveNormals=true, const ProgressCallback &cb={}) |
| bool | MR::shrinkwrap (Mesh &mesh, const Mesh &refMesh, const ShrinkwrapParameters ¶ms={}, const ProgressCallback &cb={}) |
| std::optional< VertCoords > | MR::findShrinkwrapPositions (const Mesh &mesh, const Mesh &refMesh, const ShrinkwrapParameters ¶ms={}, const ProgressCallback &cb={}) |
|
nodiscard |
#include <MRMesh/MRShrinkwrap.h>
computes for every vertex of the mesh its closest point on the reference mesh, leaving the vertices having no projection within MeshProjectionParameters::upDistLimitSq in place; the result is expressed in the coordinates of the mesh being projected
|
nodiscard |
#include <MRMesh/MRMeshToPointCloud.h>
Converts the mesh or its part in a point cloud dense enough to stop any ball of given radius: no ball of the radius can pass through the sampled surface without touching at least one point of the cloud, because every point of that surface is within the radius from some point of the cloud. The cloud consists of 1) all vertices of the sampled faces, having the same ids as in the mesh; 2) samples inside every triangle that its own vertices cannot cover, and on the edges of it. A triangle needs no samples at all, however long its edges are, if every point of it is within the radius from one of its vertices, as in a sliver with the third vertex near the longest edge. Please note that the number of samples grows as 1/radius^2.
| mp | the mesh or the part of it to be covered; nothing outside the part is sampled |
| saveNormals | if true then the normals of the cloud are set as well: the normals of the mesh vertices, and their interpolation in the samples on the edges and inside the triangles |
| PointCloud MR::meshToPointCloud | ( | const Mesh & | mesh, |
| bool | saveNormals = true, | ||
| const VertBitSet * | verts = nullptr ) |
#include <MRMesh/MRMeshToPointCloud.h>
Mesh to PointCloud
| bool MR::shrinkwrap | ( | Mesh & | mesh, |
| const Mesh & | refMesh, | ||
| const ShrinkwrapParameters & | params = {}, | ||
| const ProgressCallback & | cb = {} ) |
#include <MRMesh/MRShrinkwrap.h>
moves every vertex of the mesh in the closest point on the reference mesh; the vertices having no projection within MeshProjectionParameters::upDistLimitSq remain in place; this function changes vertex coordinates only, keeping mesh topology intact, so the result can self-intersect where refMesh is concave, and a non-zero offset makes it much more likely; consider offsetMesh(...) if a self-intersection free result is required
| void MR::straightenBoundary | ( | Mesh & | mesh, |
| EdgeId | bd, | ||
| float | minNeiNormalsDot, | ||
| float | maxTriAspectRatio, | ||
| FaceBitSet * | newFaces = nullptr ) |
#include <MRMesh/MRMeshBoundary.h>
adds triangles along the boundary to straighten it;
new triangle is added only if 1) aspect ratio of the new triangle is at most maxTriAspectRatio, 2) dot product of its normal with neighbor triangles is at least minNeiNormalsDot.