Nodes/RDAWG 3D Pack (CUDA 12.8 + PyTorch 2.9.0)/๐Ÿ”ท Compute Distance (RDAWG)
ComfyUI Node

๐Ÿ”ท Compute Distance (RDAWG)

How far apart are these meshes, actually? Numbers, not eyeballing

By rdawgemflยทCreated 11 months agoยทUpdated 11 months agoยท 0
๐Ÿ”ท Compute Distance (RDAWG)
  • mesh_a
  • mesh_b
  • distance_info
  • distance_values
โ—„distance_typeself_hausdorffโ–บ

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_distance to 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, or closest_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_mesh or closest_points and left mesh_b unwired. Connect it, or switch to self_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.
CategoryRDAWG 3D/Analysis

Inputs (3)

NameTypeDefaultDescription
mesh_aMESHโ€”
distance_typeCOMBOself_hausdorff3 options: self_hausdorff, mesh_to_mesh, closest_points
mesh_bMESHโ€”

Outputs (2)

NameTypeDescription
distance_infoSTRINGโ€”
distance_valuesTENSORโ€”