Skip to main content

Parametric configuration and tooling for build123d models.

Project description

bdbox

A live development environment for build123d models.

License PyPI Python CI Coverage Renovate GitHub stars

See the documentation site for full project details!

Installation

pip install bdbox

Works with any build123d model

Use bdbox with build123d models:

# mybox.py
from build123d import Box

result = Box(10, 10, 10)

Export to STEP or STL with bdbox:

bdbox mybox.py export out.step  # Export to STEP
bdbox mybox.py export out.stl   # Export to STL

View your model in your browser with OCP CAD Viewer, started automatically. bdbox automatically re-renders your model on save:

bdbox mybox.py view

See more about actions in the documentation!

Add parameters for interactive customization

Opt in to parametric customization by importing from 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 MyBox(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 mybox.py                 # Run with default values
python mybox.py view            # View with live reload
python mybox.py --width 50      # Override a field value
python mybox.py --preset large  # Apply a named preset
python mybox.py --help          # Usage info with all parameters

Export geometry to STEP or STL files using the built-in export action:

python mybox.py export output.step  # Export to STEP
python mybox.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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bdbox-0.5.1.tar.gz (46.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bdbox-0.5.1-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

Details for the file bdbox-0.5.1.tar.gz.

File metadata

  • Download URL: bdbox-0.5.1.tar.gz
  • Upload date:
  • Size: 46.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bdbox-0.5.1.tar.gz
Algorithm Hash digest
SHA256 000fb17c2f5fe4fae56c0a1f85b63c57c9edcc32442e254de5093aa58c2627b9
MD5 98aaef9379835e94ab1f5f40e36db380
BLAKE2b-256 a454ad83e71ff36e9e8aaf7258f83933d89af35801a81a851a69ccc3fb3d0a3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for bdbox-0.5.1.tar.gz:

Publisher: release.yaml on smkent/bdbox

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bdbox-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: bdbox-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 30.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bdbox-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5688c3b37732b737f4f2461181964a685c8b296a25d011a248756742d68d90a1
MD5 76408faaac93abfe5f1138a2a194d7a0
BLAKE2b-256 06400e6b1f399c9b570cb9cedc7c8e84b1cde5bc7b113268d7caea0cc3928312

See more details on using hashes here.

Provenance

The following attestation bundles were made for bdbox-0.5.1-py3-none-any.whl:

Publisher: release.yaml on smkent/bdbox

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page