transferPoints: transfer points between two registered meshes

View source: R/bary2point.r

transferPointsR Documentation

transfer points between two registered meshes

Description

transfer points between two registered meshes

Usage

transferPoints(x, mesh1, mesh2, tolwarn = 0.01)

Arguments

x

a matrix with 3D-coordinates (or a mesh), positioned on mesh1

mesh1

a mesh on which x is placed

mesh2

a mesh with vertices and faces corresponding to mesh1 (e.g. registered using gaussMatch).

tolwarn

numeric: if at least one coordinate of x is further away from mesh1 than tolwarn, a warning will be issued.

Details

the function gets the barycentric coordinates of x on mesh1 and uses them to find the corresponding positions on mesh2

Value

returns a matrix containing x tranfered to mesh2.

Examples


require(Rvcg)
data(humface)
#extract 300 random points from humface 
coords <- vcgSample(humface,200,"pd")

#move original mesh
transface <- rgl::translate3d(humface, 10, 10 ,10)
##extract coordinates
newcoord <- transferPoints(coords, humface, transface)
## Not run: 
require(rgl)
wire3d(transface, col=3)
spheres3d(newcoord)

## End(Not run)

zarquon42b/mesheR documentation built on Jan. 28, 2024, 2:17 p.m.