Description
sdf is a Python library for generating 3D meshes from signed distance functions, or SDFs. You describe a shape with a small Python API, and the library samples the function and produces a mesh you can 3D print or use in a 3D application. The README's example builds a complete model with a few lines of code and uses the operators for union, intersection and difference, which is the canonical constructive solid geometry approach. The bounding box and the resolution of the mesh are estimated automatically, though you can set the bounds yourself or set the step size or the approximate number of sample points. The library writes binary STL natively, and it uses meshio for more than twenty other 3D formats such as OBJ, PLY and VTK. The README suggests viewing the output in a viewer such as MeshLab, and the author's meshview tool, or Quick Look on macOS. Requirements include Python 3, matplotlib, meshio, numpy, Pillow, scikit-image and scipy, installed by the setup script. Using meshes as SDF inputs needs OpenVDB, which the README says is harder to install through pip. The README credits Inigo Quilez for his documentation on signed distance functions.…
Highlights
- Build 3D meshes from Python code
- Union, intersection and difference operators
- Binary STL and over 20 formats via meshio
- Automatic bounds and resolution
Ratings & Reviews
No ratings yet
Be the first to rate SDF.
People also visit
Grid Apps
Browser-based Slicer for 3D Printing, CAM, Laser (Kiri:Moto) and mesh editor
SDF FAQ
What is sdf?
A Python library that generates 3D meshes from signed distance functions, using a small, simple API.
Can I 3D print the models?
Yes. The README says the example model can be 3D printed or used in a 3D application.
Which file formats does it write?
Binary STL natively, and other formats such as OBJ, PLY and VTK through meshio.
How do I install it?
Clone the repository and install the library in a Python virtualenv, as the README describes. The setup script installs the dependencies.
Do I need OpenVDB?
Only if you want to use meshes as SDFs. The README says OpenVDB and its Python module are needed for that and are not easy to install with pip.
How do I view the meshes?
The README suggests MeshLab or the author's meshview tool, and Quick Look on macOS for a quick check.
What are the best SDF alternatives?
Popular alternatives to SDF include Grid Apps, Viser and Pythonocc Demos. See all SDF alternatives








