Install & Compatibility
Where this runs
tested against v0.0.10 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 93.7MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.7s · import 0.002s · 86MB
92MB installed
● package 92MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
compute_vhacd
✓ from vhacdx import compute_vhacd
✗ from vhacdx import vhacd
This example demonstrates how to perform convex decomposition on a simple `trimesh` box. It highlights the expected NumPy array types for vertices (float64) and faces (int32) and how to access the individual convex hulls from the output list.
import numpy as np
import vhacdx
import trimesh # Used to generate example mesh
# 1. Create a sample mesh (e.g., a simple box)
# For a more complex shape, you might load from a file: mesh = trimesh.load('your_mesh.obj')
mesh = trimesh.creation.box()
vertices = mesh.vertices.astype(np.float64) # VHACD expects float64
faces = mesh.faces.astype(np.int32) # VHACD expects int32
print(f"Original mesh has {len(vertices)} vertices and {len(faces)} faces.")
# 2. Perform convex decomposition
# Parameters like 'resolution' and 'depth' significantly impact quality and performance.
# Consult the underlying VHACD C++ library documentation for detailed parameter explanations.
decomposed_hulls = vhacdx.vhacd(
vertices=vertices,
faces=faces,
resolution=100000, # Max voxels generated during voxelization (default 100,000)
depth=8 # Max recursion depth for the V-HACD algorithm (default 8)
)
# 3. Process the output
print(f"Decomposed into {len(decomposed_hulls)} convex hulls.")
# Each hull is a dictionary containing its own 'vertices' and 'faces'
for i, hull in enumerate(decomposed_hulls):
hull_vertices = hull['vertices']
hull_faces = hull['faces']
print(f" Hull {i}: {len(hull_vertices)} vertices, {len(hull_faces)} faces")
# You could then, for example, create trimesh objects for each hull:
# hull_mesh = trimesh.Trimesh(vertices=hull_vertices, faces=hull_faces)
# hull_mesh.show() # To visualize each hull separately
Upgrade
Version history
0.0.10latest on PyPI · released Dec 2, 2025
Audit
Dependencies
numpyrequiredRequired for handling mesh vertices and faces as numerical arrays.
trimeshoptionalCommonly used for generating, loading, and visualizing 3D mesh data, often used as input for vhacdx.vhacd.