1 rri_metrics.surface_reference

rri_metrics.surface_reference

Versioned area-sampled surface reference for measurement diagnostics.

This module leaves the historical face-weighted point–mesh evaluator intact. Version two uses fixed area-distributed samples for completeness and an explicit metric-area degeneracy floor for point-to-triangle accuracy. Historical version one results used PyTorch3D’s larger training-loss default and require no rewrite; new results carry SURFACE_REFERENCE_EVALUATOR_VERSION.

1.1 Attributes

Name Description
SURFACE_REFERENCE_EVALUATOR_VERSION Version for the corrected area-sampled surface-reference evaluator.
SURFACE_REFERENCE_MIN_TRIANGLE_AREA_M2 Metric-area floor below which the surface evaluator treats a face as degenerate.

1.2 Functions

Name Description
chamfer_prepared_surface_point_mesh_batched Score point-to-triangle accuracy and sampled surface completeness.
sample_mesh_surface_nested Sample a reproducible area-distributed surface reference in metres.

1.2.1 chamfer_prepared_surface_point_mesh_batched

rri_metrics.surface_reference.chamfer_prepared_surface_point_mesh_batched(
    points,
    lengths,
    mesh,
    surface_points,
    *,
    candidate_chunk_size=None,
)

Score point-to-triangle accuracy and sampled surface completeness.

surface_points is one fixed area-distributed reference shared by root, current and successor clouds. The caller owns its count, seed and mesh identity. Empty reconstruction rows retain infinite completeness. Accuracy treats only faces below SURFACE_REFERENCE_MIN_TRIANGLE_AREA_M2 as degenerate, preserving valid small metric-scale triangle interiors.

1.2.2 sample_mesh_surface_nested

rri_metrics.surface_reference.sample_mesh_surface_nested(
    verts,
    faces,
    count,
    *,
    seed,
)

Sample a reproducible area-distributed surface reference in metres.

A larger count with the same seed retains the smaller sample as its prefix. Sampling uses CPU random draws so the reference identity is independent of the scorer device. Degenerate triangles receive zero probability.

Back to top