vcgMetro: evaluate the difference between two triangular meshes.

Description Usage Arguments Value Note References Examples

View source: R/vcgMetro.r

Description

Implementation of the command line tool "metro" to evaluate the difference between two triangular meshes.

Usage

1
2
3
4
5
vcgMetro(mesh1, mesh2, nSamples = 0, nSamplesArea = 0,
  vertSamp = TRUE, edgeSamp = TRUE, faceSamp = TRUE,
  unrefVert = FALSE, samplingType = c("SS", "MC", "SD"),
  searchStruct = c("SGRID", "AABB", "OCTREE", "HGRID"), from = 0,
  to = 0, colormeshes = FALSE, silent = FALSE)

Arguments

mesh1

triangular mesh (object of class 'mesh3d').

mesh2

triangular mesh (object of class 'mesh3d').

nSamples

set the required number of samples if 0, this will be set to approx. 10x the face number.

nSamplesArea

set the required number of samples per area unit, override nSamples.

vertSamp

logical: if FALSE, disable vertex sampling.

edgeSamp

logical: if FALSE, disable edge sampling.

faceSamp

logical: if FALSE, disable face sampling.

unrefVert

logical: if FALSE, ignore unreferred vertices.

samplingType

set the face sampling mode. options are: SS (similar triangles sampling), SD (subdivision sampling), MC (montecarlo sampling).

searchStruct

set search structures to use. options are: SGIRD (static Uniform Grid), OCTREE, AABB (AxisAligned Bounding Box Tree), HGRID (Hashed Uniform Grid).

from

numeric: minimum value for color mapping.

to

numeric: maximum value for color mapping.

colormeshes

if TRUE, meshes with vertices colored according to distance are returned

silent

logical: if TRUE, output to console is suppressed.

Value

ForwardSampling, BackwardSampling

lists containing information about forward (mesh1 to mesh2) and backward (mesh2 to mesh1) sampling with the following entries

distances1, distances2

vectors containing vertex distances from mesh1 to mesh2 and mesh2 to mesh1.

forward_hist, backward_hist

Matrices tracking the sampling results

if colormeshes == TRUE

mesh1, mesh2

meshes with color coded distances and an additional entry called quality containing the sampled per-vertex distances

Note

this is a straightforward implementation of the command line tool metro http://vcg.isti.cnr.it/vcglib/metro.html

References

P. Cignoni, C. Rocchini and R. Scopigno. Metro: measuring error on simplified surfaces. Computer Graphics Forum, Blackwell Publishers, vol. 17(2), June 1998, pp 167-174

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
require(Morpho)
data(humface)
data(dummyhead)
## align humface to dummyhead.mesh
humfalign <- rotmesh.onto(humface,humface.lm,dummyhead.lm)
samp <- vcgMetro(humfalign$mesh,dummyhead.mesh,faceSamp=FALSE,edgeSamp=FALSE)
## create heatmap using Morpho's meshDist function
## Not run: 
## create custom heatmaps based on distances
mD <- meshDist(humfalign$mesh,distvec=samp$distances1)

## End(Not run)

zarquon42b/Rvcg documentation built on Jan. 17, 2019, 9:10 a.m.