50% off: Unlimited data and AI learning.
State of Data and AI Literacy Report 2025

Morpho (version 1.0-1)

mesh2mesh: projects the vertices of a mesh onto the surface of another one.

Description

projects the vertices of a mesh onto the surface of another one by searching for the closest point (Euclidean distance or along vertex normals) on the target by for each vertex.

Usage

mesh2mesh(mesh1, tarmesh, clean = TRUE, cloud = FALSE, sign = FALSE)
ray2mesh(mesh1, tarmesh, tol = 1, angmax = NULL, clean = TRUE, 
    outname = NULL, readback = TRUE, inbound = FALSE, strict = FALSE, 
    ignore.stdout = FALSE, mindist = FALSE)

Arguments

mesh1
mesh to project. Can be an object of class "mesh3d" or path to an external mesh file (ply, obj, stl).
tarmesh
mesh to project onto. Can be an object of class "mesh3d" or path to an external mesh file (ply, obj, stl).
clean
logical: request removing of dumpfiles.
cloud
logical: if TRUE and mesh1 is an external mesh file, face information will not be read from this file (saves time), as there is none present.
sign
logical: if TRUE, signed distances are returned.
tol
numeric: maximum distance to search along ray, closest Euclidean distance will be used, if tol is exceeded.
angmax
numeric: maximum angle (in radians) of normals of original and hit point are allowed to differ.
outname
character: set name of dumpfile used in the process.
readback
logical: whether the data is to be read into workspace.
inbound
inverse search direction along rays.
strict
logical: writes the value 1e12 into vertex quality if no face is hit by the ray.
ignore.stdout
suppress command line output.
mindist
search in both directions of the ray and use closest points.

Value

  • returns projected mesh

Details

needs trimesh_project and rayproject from trimesh-tools to be installed ( http://sourceforge.net/projects/morpho-rpackage/files/Auxiliaries/)

References

Baerentzen, Jakob Andreas. & Aanaes, H., 2002. Generating Signed Distance Fields From Triangle Meshes. Informatics and Mathematical Modelling.

See Also

ply2mesh, closemeshKD