Generate 3D meshes from signed distance functions with a simple Python API.
Project description
texosdf
texosdf is a lightweight Python package for generating 3D meshes from signed
distance functions (SDFs).
It is a modernized fork of fogleman/sdf,
published as texosdf with proper packaging, curated exports, typed modules,
and clearer optional dependency handling.
Installation
Install the core package:
pip install texosdf
Optional extras:
pip install texosdf[plot]
pip install texosdf[mesh]
pip install texosdf[all]
Notes:
plotinstallsmatplotlibforshow_slice()meshinstallsmeshiofor mesh loading and non-STL exportMesh.sdf()also requires OpenVDB andpyopenvdbpyopenvdbis intentionally not included in package requirements because it is platform-specific and only needed for the advanced mesh-to-SDF workflow
Quickstart
from texosdf import *
shape = sphere(1) & box(1.5)
cutout = cylinder(0.5)
shape -= cutout.orient(X) | cutout.orient(Y) | cutout.orient(Z)
shape.save("out.stl")
Why import *?
While import * is usually not ideal in general Python code, CAD and geometry
scripting has broadly moved in that direction because it makes modeling scripts
shorter and easier to read. texosdf keeps that convenience on purpose.
If you use Ruff in scripts written that way, add:
# ruff: noqa: F403, F405
from texosdf import *
Features
- 2D and 3D analytic SDF primitives
- boolean operators such as union, difference, and intersection
- transforms and deformations such as translate, rotate, twist, bend, and shell
- 2D-to-3D operations such as extrude, revolve, and profile blending
- text and image-based masks
- optional plotting and mesh loading/export helpers
- custom SDF authoring with decorators such as
@sdf2,@sdf3,@op2, and@op3
Full Documentation
- GitHub repository: torayeff/texosdf
- Full documentation and examples: README on GitHub
- Example scripts: examples folder
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file texosdf-0.1.0.tar.gz.
File metadata
- Download URL: texosdf-0.1.0.tar.gz
- Upload date:
- Size: 28.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95b1bb1bb654695aa9b9e1ee04ad277dc1da5c81529c66c1e905bc1de3bb33c3
|
|
| MD5 |
229d5229edc33e29dd728d10e1769b4a
|
|
| BLAKE2b-256 |
7e64653409ec7c04da5d34d9cdb99b9e967c486b4fbdc5135b6f1af25b215fa1
|
Provenance
The following attestation bundles were made for texosdf-0.1.0.tar.gz:
Publisher:
publish.yml on torayeff/texosdf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
texosdf-0.1.0.tar.gz -
Subject digest:
95b1bb1bb654695aa9b9e1ee04ad277dc1da5c81529c66c1e905bc1de3bb33c3 - Sigstore transparency entry: 1139481240
- Sigstore integration time:
-
Permalink:
torayeff/texosdf@6ebbb3fcde54e95c80f622306fa5c38300808fee -
Branch / Tag:
refs/heads/main - Owner: https://github.com/torayeff
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6ebbb3fcde54e95c80f622306fa5c38300808fee -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file texosdf-0.1.0-py3-none-any.whl.
File metadata
- Download URL: texosdf-0.1.0-py3-none-any.whl
- Upload date:
- Size: 27.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e32b4712c646c7fa9af453f2b7d56102d3cfae249cc4321402b24f65e68adc9a
|
|
| MD5 |
4690302549ca7f74a877273c63944eb0
|
|
| BLAKE2b-256 |
7b238050ea6c6f9e9a7d9a82810a8cb6f10410b7f00b83cabee68cf2f29d7d12
|
Provenance
The following attestation bundles were made for texosdf-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on torayeff/texosdf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
texosdf-0.1.0-py3-none-any.whl -
Subject digest:
e32b4712c646c7fa9af453f2b7d56102d3cfae249cc4321402b24f65e68adc9a - Sigstore transparency entry: 1139481403
- Sigstore integration time:
-
Permalink:
torayeff/texosdf@6ebbb3fcde54e95c80f622306fa5c38300808fee -
Branch / Tag:
refs/heads/main - Owner: https://github.com/torayeff
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6ebbb3fcde54e95c80f622306fa5c38300808fee -
Trigger Event:
workflow_dispatch
-
Statement type: