PolygonMesh.convexHull 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

Generates a convex hull from this polygon mesh. The convex hull is returned as an array of node positions and triangle indices, which can be used by MeshBodies.addByTriangleMeshData to create a new mesh.

Syntax

"polygonMesh_var" is a variable referencing a PolygonMesh object.
# Uses no optional arguments.
(returnValue, nodeCoordinates, triangleNodeIndices) = polygonMesh_var.convexHull()

# Uses optional arguments.
returnValue = polygonMesh_var.convexHull(nodeCoordinates, triangleNodeIndices, transform)
"polygonMesh_var" is a variable referencing a PolygonMesh object.

#include <Fusion/MeshData/PolygonMesh.h

// Uses no optional arguments.

// Declare the output arguments.
double[] nodeCoordinates;
integer[] triangleNodeIndices;
boolean returnValue = polygonMesh_var->convexHull(nodeCoordinates, triangleNodeIndices);

// Uses optional arguments.

// Declare the output arguments.
Matrix3D transform;

// Call the function.
Ptr<PolygonMesh> returnValue = polygonMesh_var->convexHull(nodeCoordinates, triangleNodeIndices, transform);
"polygonMesh_var" is a variable referencing a PolygonMesh object.
// Uses no optional arguments.
[returnValue, nodeCoordinates, triangleNodeIndices] = polygonMesh_var.convexHull();

// Uses optional arguments.
returnValue = polygonMesh_var.convexHull(nodeCoordinates, triangleNodeIndices, transform);

Return Value

Type Description
boolean Returns true if the calculation was successful; false if an error occurred.

Parameters

Name Type Description
nodeCoordinates double[] On success, the array contains the x, y, z components of each hull vertex, as doubles.
triangleNodeIndices integer[] On success, the array contains index values that index into the nodeCoordinates array to define the three coordinates of each triangle.
transform Matrix3D An optional transformation matrix applied to this polygon mesh before generating convex hull. If omitted, the identity matrix is used.

This is an optional argument whose default value is null.

Version

Introduced in version October 2026