ComfyUI > Nodes > ComfyUI libigl > Mesh to Mesh Distance

ComfyUI Node: Mesh to Mesh Distance

Class Name

GeomPackMeshToMeshDistance

Category
geompack/distance
Author
PozzettiAndrea (Account age: 2240days)
Extension
ComfyUI libigl
Latest Updated
2025-12-22
Github Stars
0.06K

How to Install ComfyUI libigl

Install this extension via the ComfyUI Manager by searching for ComfyUI libigl
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI libigl in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Mesh to Mesh Distance Description

Compares 3D meshes using Hausdorff and Chamfer distances for precision and accuracy analysis.

Mesh to Mesh Distance:

The GeomPackMeshToMeshDistance node is designed to compare two 3D meshes by calculating the distance between them using various metrics. This node is particularly useful for tasks that require assessing the similarity or deviation between two mesh surfaces, such as quality control, error measurement, or shape analysis. By employing metrics like the Hausdorff and Chamfer distances, it provides a comprehensive analysis of the spatial relationship between the meshes. The Hausdorff distance measures the maximum deviation, highlighting the worst-case scenario, while the Chamfer distance offers an average squared distance, indicating overall similarity. This node is essential for artists and designers who need to ensure precision and accuracy in their 3D models, as it helps identify discrepancies and optimize mesh alignment.

Mesh to Mesh Distance Input Parameters:

mesh_a

This parameter represents the first mesh to be compared. It is a required input and should be provided in the TRIMESH format. The choice of mesh_a impacts the node's execution as it serves as one of the two primary subjects for distance calculation.

mesh_b

Similar to mesh_a, this parameter is the second mesh involved in the comparison. It is also required and must be in the TRIMESH format. The mesh_b parameter, along with mesh_a, forms the basis for the distance computation, influencing the final results.

metric

The metric parameter determines the method used to calculate the distance between the two meshes. It offers two options: "hausdorff" and "chamfer," with "hausdorff" being the default. The Hausdorff metric focuses on the maximum distance, while the Chamfer metric calculates the average squared distance. The choice of metric affects the type of analysis and insights gained from the node.

sample_count

This optional parameter specifies the number of points to sample from the mesh surfaces for distance calculation. It accepts integer values ranging from 1000 to 1000000, with a default of 10000. A higher sample count can lead to more accurate results but may increase computation time.

symmetric

The symmetric parameter is optional and determines whether the distance calculation should be symmetric. It offers "true" or "false" as options, with "true" as the default. When set to true, the node considers the distance from mesh_a to mesh_b and vice versa, providing a more balanced analysis.

Mesh to Mesh Distance Output Parameters:

distance

This output parameter provides the calculated distance between the two meshes as a floating-point number. The value represents either the maximum deviation or the average squared distance, depending on the chosen metric. It is crucial for understanding the degree of similarity or difference between the meshes.

info

The info parameter offers additional information about the distance calculation process. It may include details about the metric used, sample count, and any other relevant data. This output is useful for gaining insights into the computation and verifying the results.

Mesh to Mesh Distance Usage Tips:

  • To achieve more accurate results, consider increasing the sample_count parameter, especially for complex meshes with intricate details.
  • Use the symmetric parameter set to "true" for a comprehensive analysis that accounts for both directions of distance measurement between the meshes.
  • Choose the metric parameter based on your specific needs: use "hausdorff" for identifying maximum deviations and "chamfer" for assessing overall similarity.

Mesh to Mesh Distance Common Errors and Solutions:

Invalid TRIMESH format

  • Explanation: This error occurs when the input meshes are not provided in the correct TRIMESH format.
  • Solution: Ensure that both mesh_a and mesh_b are correctly formatted as TRIMESH before inputting them into the node.

Sample count out of range

  • Explanation: The sample_count parameter is set to a value outside the allowed range of 1000 to 1000000.
  • Solution: Adjust the sample_count to fall within the specified range to avoid this error.

Unsupported metric type

  • Explanation: An invalid value is provided for the metric parameter.
  • Solution: Verify that the metric is set to either "hausdorff" or "chamfer" to ensure compatibility with the node's functionality.

Mesh to Mesh Distance Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI libigl
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.