colorTrans: Transfers vertex colors between meshes.

View source: R/colorTrans.r

colorTransR Documentation

Transfers vertex colors between meshes.

Description

colorTrans transfers the vertex color of mesh2 onto mesh1 by interpolating vertex colors of closest face.

Usage

colorTrans(mesh1, mesh2, tol = 1)

Arguments

mesh1

triangular mesh of class "mesh3d".

mesh2

triangular mesh of class "mesh3d".

tol

maximal distance of closest point included in color transfer.

Value

returns the mesh1 with transfered vertex colors.

Author(s)

Stefan Schlager

Examples


require(Morpho)
data(nose)
redmesh <- shortnose.mesh
#color mesh red
redmesh$material$color <- matrix("#FF0000",dim(shortnose.mesh$it))
# mesh without colors
nocolmesh <- shortnose.mesh
mixmesh <- colorTrans(nocolmesh, redmesh)
## Not run: 
require(rgl)
shade3d(mixmesh)

## End(Not run)

zarquon42b/mesheR documentation built on July 1, 2024, 1:54 p.m.