Parametric configuration and tooling for build123d models.
Project description
bdbox
A live development environment for build123d models.
See the documentation site for full project details!
Installation
pip install bdbox
Works with any build123d model
Use bdbox with build123d models:
# mymodel.py
from build123d import Box
result = Box(10, 10, 10)
Export to STEP or STL with bdbox:
bdbox mymodel.py export out.step # Export to STEP
bdbox mymodel.py export out.stl # Export to STL
Python module paths work too:
bdbox mypackage.mymodule.mymodel export out.step
python -m mypackage.mymodule.mymodel export out.step
A specific model class can be chosen from a module using bdbox:
bdbox mypackage.mymodule.mymodel:MyModel export out.step
View your model in your browser with OCP CAD Viewer, started
automatically. bdbox automatically re-renders your model on save:
bdbox mymodel.py view
bdbox mypackage.mymodule.mymodel view
See more about actions in the documentation!
Add parameters for interactive customization
Easily create parametric models using bdbox! Declare typed parameters with
defaults, then override them individually or with named presets:
from bdbox import Float, Int, Params, Preset, show
from build123d import Box
class P(Params):
width = Float(10.0, min=5, max=100)
length = Float(20.0, min=5, max=100)
thickness = Int(2, min=1, max=10)
presets = (
Preset("small", width=5.0, length=8.0),
Preset("large", width=80.0, length=40.0, thickness=5),
)
result = Box(P.width, P.length, P.thickness)
show(result)
Or inherit from the provided base class for reusable, importable models:
from bdbox import Float, Int, Model, Preset
from build123d import Box
class MyModel(Model):
width = Float(10.0, min=5, max=100)
length = Float(20.0, min=5, max=100)
thickness = Int(2, min=1, max=10)
presets = (
Preset("small", width=5.0, length=8.0),
Preset("large", width=80.0, length=40.0, thickness=5),
)
def build(self):
return Box(self.width, self.length, self.thickness)
Parameters become CLI flags automatically:
python mymodel.py # Run with default values
python mymodel.py view # View with live reload
python mymodel.py --width 50 # Override a field value
python mymodel.py --preset large # Apply a named preset
python mymodel.py --help # Usage info with all parameters
Export geometry to STEP or STL files using the built-in export action:
python mymodel.py export output.step # Export to STEP
python mymodel.py export output.stl # Export to STL
See more about parameters in the documentation!
Project template
This project is generated and maintained with copier-python.
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 bdbox-0.7.0.tar.gz.
File metadata
- Download URL: bdbox-0.7.0.tar.gz
- Upload date:
- Size: 55.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d6e833e083ee27d100ef0c65d3945fc0a3051e008aa22bff3cdc50ba51c5ceb
|
|
| MD5 |
682dac0c810a2877cdbc3b4b75c762ec
|
|
| BLAKE2b-256 |
9a8e59143b2bcd25d767294eeb646181f1c32a1fcef53262ec4936f8f550df45
|
Provenance
The following attestation bundles were made for bdbox-0.7.0.tar.gz:
Publisher:
release.yaml on smkent/bdbox
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bdbox-0.7.0.tar.gz -
Subject digest:
4d6e833e083ee27d100ef0c65d3945fc0a3051e008aa22bff3cdc50ba51c5ceb - Sigstore transparency entry: 1439249977
- Sigstore integration time:
-
Permalink:
smkent/bdbox@2a99c321dd5ada1fe5dda77e13a4ed0224278b43 -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/smkent
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@2a99c321dd5ada1fe5dda77e13a4ed0224278b43 -
Trigger Event:
push
-
Statement type:
File details
Details for the file bdbox-0.7.0-py3-none-any.whl.
File metadata
- Download URL: bdbox-0.7.0-py3-none-any.whl
- Upload date:
- Size: 33.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbcba0b9db9ac501b92089e8460a5c4b82ec363084921316939673a341d5cde1
|
|
| MD5 |
cb49a98a48ac543c4ddae4a286b30f1f
|
|
| BLAKE2b-256 |
c694a9563671b13b2421bcdcc51e783fd9321c0414c8e292fab66344281bc791
|
Provenance
The following attestation bundles were made for bdbox-0.7.0-py3-none-any.whl:
Publisher:
release.yaml on smkent/bdbox
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bdbox-0.7.0-py3-none-any.whl -
Subject digest:
fbcba0b9db9ac501b92089e8460a5c4b82ec363084921316939673a341d5cde1 - Sigstore transparency entry: 1439249983
- Sigstore integration time:
-
Permalink:
smkent/bdbox@2a99c321dd5ada1fe5dda77e13a4ed0224278b43 -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/smkent
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@2a99c321dd5ada1fe5dda77e13a4ed0224278b43 -
Trigger Event:
push
-
Statement type: