PolygonMesh.compareWith Method

Parent Object: PolygonMesh

PreviewThis functionality is provided as a preview of intended future API capabilities. You are encouraged to use it and report any problems or suggestions using the Fusion API and Scripts forum.

Because this is a preview of future functionality, there is the possibility that it will change, which will possibly break any existing programs that use this functionality. Because of that, you should never deliver any programs that use any preview capabilities. For a distributed program, you should wait until it has moved from preview to released state.


Defined in namespace "adsk::fusion" and the header file is <Fusion/MeshData/PolygonMesh.h>

Description

Compares this polygon mesh with another polygon mesh by computing, for every node in this mesh, the signed distance to the closest point on the other mesh (in cm). A positive value means the node lies on the side of the other mesh's surface normal; a negative value means it lies on the opposite side.

Syntax

"polygonMesh_var" is a variable referencing a PolygonMesh object.

# Uses no optional arguments.
returnValue = polygonMesh_var.compareWith(otherMesh)

# Uses optional arguments.
returnValue = polygonMesh_var.compareWith(otherMesh, transform, transformOther)
"polygonMesh_var" is a variable referencing a PolygonMesh object.

#include <Fusion/MeshData/PolygonMesh.h>

// Uses no optional arguments.
returnValue = polygonMesh_var->compareWith(otherMesh);

// Uses optional arguments.
returnValue = polygonMesh_var->compareWith(otherMesh, transform, transformOther);
"polygonMesh_var" is a variable referencing a PolygonMesh object.

// Uses no optional arguments.
returnValue = polygonMesh_var.compareWith(otherMesh);

// Uses Optional arguments.
returnValue = polygonMesh_var.compareWith(otherMesh, transform, transformOther);

Return Value

Type Description
float[] An array of floats with one signed distance per node, in the same order and with the same indexing as nodeCoordinates. The array length equals nodeCount. Returns null if the comparison could not be performed.

Parameters

Name Type Description
otherMesh PolygonMesh The other polygon mesh to compare against.
transform Matrix3D An optional transformation matrix applied to this polygon mesh before comparison. If omitted, the identity matrix is used.

This is an optional argument whose default value is null.
transformOther Matrix3D An optional transformation matrix applied to the other polygon mesh before comparison. If omitted, the identity matrix is used.

This is an optional argument whose default value is null.

Version

Introduced in version July 2026