Manifold3d is a Python library providing bindings to the Manifold C++ geometry kernel (v3.4.1). It specializes in creating and operating on topologically robust, manifold triangle meshes, making it ideal for applications in CAD, 3D printing, and simulations. The library guarantees manifold output and leverages parallelization for performance. It has an active development cycle with regular releases.
pip install manifold3dVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates creating basic 3D primitives (sphere, box) and performing common boolean operations like union and difference. It showcases the core functionality of combining and modifying manifold meshes. For saving or loading complex 3D file formats, integrating with a dedicated mesh I/O library like `trimesh` is recommended.
Migrate 3D file I/O operations to `trimesh` or similar libraries. Example: `pip install trimesh` and use `trimesh.Trimesh` for imports/exports.
Upgrade to `manifold3d==3.4.1` or a newer version.
Always use integer or exact float degree values for rotations (e.g., `manifold.rotate([90, 0, 0])`) instead of converting from radians or using approximations.
Ensure input meshes are manifold. Consider using external mesh repair tools if starting with potentially non-manifold data.
For full-featured 3D file I/O, especially with vertex properties, use `trimesh` to handle mesh loading and saving.
Install the library using pip: `pip install manifold3d`
Ensure you have a C++ compiler installed (e.g., 'Desktop development with C++' workload in Visual Studio on Windows or `build-essential` on Linux). If building with parallelization enabled, ensure TBB (Intel Threading Building Blocks) development libraries are available (e.g., `libtbb-dev` on Linux). For Windows, consider building with `-DBUILD_SHARED_LIBS=OFF` if issues persist.
Pre-process your input mesh to ensure it is manifold using external mesh repair tools or libraries (e.g., `trimesh.repair.make_manifold`). For slightly non-manifold meshes, `manifold3d` offers a `merge()` function.
Check the return value of `manifold3d` operations for `None` or an error status before proceeding. Ensure input parameters are valid and that the geometric operations are topologically sound, as invalid operations can lead to `None` results.