vcgMetro: evaluate the difference between two triangular meshes.

View source: R/vcgMetro.r

vcgMetroR Documentation

evaluate the difference between two triangular meshes.

Description

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

Usage

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

  • maxdist maximal Hausdorff distance

  • meandist mean Hausdorff distance

  • RMSdist RMS of the Hausdorff distances

  • area mesh area (of mesh1 in ForwardSampling and mesh2 in BackwardSampling)

  • RMSdist RMS of the Hausdorff distances

  • nvbsamples number of vertices sampled

  • nsamples number of samples

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://vcglib.net/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


if (requireNamespace("Morpho", quietly = TRUE)) {
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)

Rvcg documentation built on Sept. 30, 2024, 9:39 a.m.