Learn R Programming

grip (version 0.3.0)

score.surface: Estimate symmetric area-weighted distance between triangular surfaces

Description

Compares already aligned surfaces using closest points on triangles, not nearest vertices. No registration, rescaling, or triangulation is performed.

Usage

score.surface(
  coords,
  triangles,
  reference.coords,
  reference.triangles,
  sample.size = 5000L,
  seed = 1L
)

Value

A list with rms, forward_rms, reverse_rms, forward_mean, reverse_mean, rms_mc_se, surface areas, zero-area face counts, sample_size, and seed. Forward means coords to reference.

Arguments

coords, reference.coords

Numeric three-column vertex matrices.

triangles, reference.triangles

Three-column matrices of one-based triangle indices into the corresponding vertex matrix. Open surfaces and different triangulations are supported. Duplicate faces are rejected.

sample.size

Number of independent area-uniform samples per surface, at least two. Increase this to assess Monte Carlo convergence.

seed

Nonnegative integer seed, at most 2147483646. Separate fixed streams are used for the two directions; the caller's RNG state is restored.

Details

For surfaces A and B, squared symmetric RMS is one half of the sum of the area-normalized integrals of squared closest-point distance in the two directions. Each direction has equal weight regardless of total area. The returned score has coordinate-distance units. The Monte Carlo standard error uses a delta-method approximation; it does not quantify mesh discretization error, alignment uncertainty, or between-cloud variability. Zero observed error gives a standard error of zero, not a proof of identity. Samples are uniform over triangle area, so overlapping faces count with multiplicity. Self-intersections are not repaired or detected. Zero-area faces have no sampling mass but remain distance targets. A surface with no positive-area faces is rejected. No Hausdorff maximum is estimated.

Examples

Run this code
x <- rbind(c(0, 0, 0), c(1, 0, 0), c(0, 1, 0))
f <- matrix(1:3, nrow = 1)
score.surface(x, f, x, f, sample.size = 100)$rms

Run the code above in your browser using DataLab