๐ท Compute Distance (RDAWG)
How far apart are these meshes, actually? Numbers, not eyeballing
- mesh_a
- mesh_b
- distance_info
- distance_values
Whenever you're comparing two 3D objects - a reconstruction against the original, a scan against a mesh, two versions of a model - "does it look close?" isn't an answer you can automate. RDAWG3DComputeDistance turns that into numbers: it measures distances between mesh surfaces and hands you both a summary string and a per-point distance tensor. It's the closest thing this pack has to a diff tool for meshes.
The obvious use: after reconstructing a surface from a point cloud, compare the result to the ground-truth mesh and see quantitatively how far off you are. That's the kind of feedback loop that tells you whether your Poisson depth was right or your smoothing ate the detail.
How it works
Three distance modes:
- self_hausdorff - despite the name, this runs Open3D's self-intersection analysis: it detects places where the mesh intersects itself and reports how many and how far apart. If it finds none, you've got a clean, intersection-free surface - which matters for 3D printing and for any downstream operation that assumes sane topology.
- mesh_to_mesh - computes the one-way Hausdorff-style distance from every vertex of mesh A to the surface of mesh B (technically via
compute_point_cloud_distanceto B's vertices). Gives you max/mean/min distances. - closest_points - the same underlying distance computation, reported as a per-point breakdown with point counts on both meshes.
The distance_values tensor holds the per-point distances - wire it anywhere a tensor is useful, or just read the summary. Note that mesh_b is listed as required in the schema even though it's only actually consulted in the two mesh-comparison modes; the self-intersection mode is happy with just mesh_a.
The inputs that matter
- mesh_a - the primary mesh.
- distance_type -
self_hausdorff,mesh_to_mesh, orclosest_points. - mesh_b - the comparison mesh for the two-way modes.
Outputs: distance_info (STRING summary) and distance_values (TENSOR, per-point distances).
Install
Part of the RDAWG 3D Pack. ComfyUI Manager (search "RDAWG 3D Pack (CUDA 12.8 + PyTorch 2.9.0)") or:
cd ComfyUI/custom_nodes
git clone https://github.com/rdawgemfl/rdawg_3D_pack
cd rdawg_3D_pack
python install.py
Open3D 0.19.0+ is a hard import-time requirement - no Open3D, no pack (pip install open3d>=0.19.0). Python 3.11 recommended. Mind the installer's torch 2.9.0+cu128 pin if you already have a working PyTorch.
Where people get burned
- "Mesh B required" errors - you picked
mesh_to_meshorclosest_pointsand leftmesh_bunwired. Connect it, or switch toself_hausdorff. - Misreading the direction - the mesh-to-mesh distance is one-way (A's vertices to B). AโB and BโA can legitimately differ if one mesh is much denser. Compute both if it matters.
- Units, again - distances are in your model's units. If the meshes weren't loaded with
normalize, a "distance of 3" might mean meters or millimeters, and you'll misjudge how good the match is.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| mesh_a | MESH | โ | |
| distance_type | COMBO | self_hausdorff | 3 options: self_hausdorff, mesh_to_mesh, closest_points |
| mesh_b | MESH | โ |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| distance_info | STRING | โ |
| distance_values | TENSOR | โ |