ComfyUI > Nodes > ComfyUI libigl > Point to Mesh Distance

ComfyUI Node: Point to Mesh Distance

Class Name

GeomPackPointToMeshDistance

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

Point to Mesh Distance Description

Computes point-to-mesh distances for proximity analysis, error measurement, and SDF creation.

Point to Mesh Distance:

The GeomPackPointToMeshDistance node is designed to compute the distance from a set of points, which can be part of a point cloud or a mesh, to the surface of a target mesh. This node is particularly useful for tasks such as proximity analysis, error measurement, and creating distance-based visualizations. It supports both unsigned and signed distance calculations. Unsigned distances are always positive and measure the proximity of points to the mesh surface, while signed distances can be positive or negative, indicating whether points are outside or inside the mesh, respectively. This functionality is crucial for generating implicit surface representations, such as signed distance fields (SDF), which are widely used in computer graphics and computational geometry.

Point to Mesh Distance Input Parameters:

target_mesh

The target_mesh parameter represents the mesh surface to which the distances from the input points will be calculated. It is essential for defining the reference geometry against which proximity is measured. This parameter does not have specific minimum or maximum values but must be a valid mesh object.

pointcloud

The pointcloud parameter consists of the set of points or vertices from which the distances to the target mesh will be computed. This input can be a point cloud or a mesh, and it serves as the source geometry for the distance calculation. Like the target_mesh, it must be a valid mesh object.

distance_type

The distance_type parameter determines the type of distance calculation to be performed. It can be either "unsigned" or "signed". The "unsigned" option calculates only positive distances, indicating how close points are to the mesh surface. The "signed" option provides distances that can be positive or negative, indicating whether points are outside or inside the mesh. The default value is "unsigned".

sign_method

The sign_method parameter is used when the distance_type is set to "signed". It specifies the method for determining the sign of the distance. Options include "default", "winding_number", "fast_winding_number", "pseudonormal", and "unsigned". Each method offers a different approach to calculating the sign, affecting the accuracy and performance of the signed distance computation. The default value is "default".

Point to Mesh Distance Output Parameters:

pointcloud

The pointcloud output is the modified input point cloud or mesh, now containing a distance field within its vertex attributes. This field holds the computed distances from each point to the target mesh surface, allowing for further analysis or visualization.

info

The info output provides a summary of the distance computation, including statistics such as minimum, maximum, mean, median, and standard deviation of the distances. It also includes metadata about the distance type, sign method, and the number of points inside, outside, or on the surface of the mesh, offering valuable insights into the results of the distance calculation.

Point to Mesh Distance Usage Tips:

  • To achieve accurate signed distance calculations, choose the appropriate sign_method based on your specific requirements. For example, use "winding_number" for more accurate results in complex geometries.
  • When working with large point clouds or meshes, consider using the "fast_winding_number" method for faster performance, albeit with a potential trade-off in accuracy.

Point to Mesh Distance Common Errors and Solutions:

Invalid mesh object

  • Explanation: This error occurs when the target_mesh or pointcloud is not a valid mesh object.
  • Solution: Ensure that both the target_mesh and pointcloud inputs are correctly formatted and valid mesh objects before running the node.

Unsupported distance type

  • Explanation: This error arises when an invalid value is provided for the distance_type parameter.
  • Solution: Verify that the distance_type is set to either "unsigned" or "signed" to ensure compatibility with the node's functionality.

Invalid sign method

  • Explanation: This error occurs when an unsupported value is used for the sign_method parameter.
  • Solution: Check that the sign_method is one of the supported options: "default", "winding_number", "fast_winding_number", "pseudonormal", or "unsigned".

Point 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.