Skip to main content

build123d-utils-jas

Personal build123d utilities, extracted from a pile of CAD projects that each carried their own diverging copy.

uv add build123d-utils-jas            # core
uv add 'build123d-utils-jas[fasteners,preview]'  # + FastHeatSetNut, + ocp_vscode viewer

Supports build123d >=0.11. Developed and tested against both the latest release and a pinned build123d dev revision (see [tool.uv.sources]).

Modules

fast_patch — faster Shape operations

Monkey-patches Shape.__copy__/moved/located/_apply_transform/fix/ bounding_box to skip revalidation and share the underlying TopoDS_Shape. bounding_box also defaults to the fast non-optimal OCC box with a coarse tolerance. Nothing happens at import time — opt in explicitly:

from build123d_utils_jas import apply_fast_patch, no_fast_patch

if __name__ == "__main__":
  apply_fast_patch()

with no_fast_patch():
  ...  # stock build123d behavior restored for this block

helpers — geometry helpers

from build123d_utils_jas import align, lift, raise_to, offset_to, extrude_to, CENTER, MIN, MAX

part = align(part, (CENTER, CENTER, MIN))       # bounding-box alignment to origin
plane = offset_to(Plane.XY.offset(3), bb.max.Z)  # offset a plane to an absolute coordinate
extrude_to(heatsink_bb.min.X)                    # extrude pending sketches to an absolute coordinate

Also flip, shell_loft, make_solid (solid from shells, holes supported), and convex_face_from_points (planar face from a point cloud's hull).

assembly — labeled compounds

from build123d_utils_jas import make_compound, find_part

a = make_compound(label="lamp", base=base, wago=[w1, w2])
find_part(a, "wago")      # -> [wago_0, wago_1]
find_part(a, "cap.can")   # dotted paths descend into nested compounds

vendor — cached STEP imports

from build123d_utils_jas import import_vendor, set_vendor_dir

set_vendor_dir("vendor")  # the default; resolved against the cwd
cob = import_vendor("XLamp CMA1303.STEP", rot=(90, 0, 0))

STEP files are cached on disk as BREP keyed by content hash (vendor/cache/<file>/<sha256>.brep) and memoized in-memory per process, so re-running a script re-imports nothing that didn't change.

viewer — ocp_vscode wrappers (opt-in)

show_object, push_object, show_objects, reset_show are no-ops until init_viewer() is called, so batch runs and imports never need a viewer. Requires the preview extra when actually used.

printing — FDM printability

fix_horizontal_holes(shape) finds horizontal-ish cylindrical/conical bores and cuts their tops into self-supporting flat-roof teardrops, leaving the load-bearing part of the bore round.

fastenersFastHeatSetNut

A bd_warehouse Nut for heat-set inserts with knurling removed for fast generation, plus a fill_factor property (insert volume vs. hole volume). Requires the fasteners extra.

AI use

AI (Claude) was used to manage the extraction of these utilities from their original per-project copies, and assisted in writing parts of the code. Design decisions and the original implementations are my own.

License

MIT

Download files

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

Source Distribution

build123d_utils_jas-0.1.0.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

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

build123d_utils_jas-0.1.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file build123d_utils_jas-0.1.0.tar.gz.

File metadata

  • Download URL: build123d_utils_jas-0.1.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for build123d_utils_jas-0.1.0.tar.gz
Algorithm Hash digest
SHA256 548c387af4bd58836883b61bd05913f0ee78650496bacc928e575b37318d1a0a
MD5 7da5d96d6a737cc86480fd39b81ef6b4
BLAKE2b-256 8e7e77e93dbe00f6dc76a4a12de5cb814f33df5eff2dedd13d44ddd7d784c100

See more details on using hashes here.

Provenance

The following attestation bundles were made for build123d_utils_jas-0.1.0.tar.gz:

Publisher: publish.yml on jsmnbom/build123d-utils-jas

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

File details

Details for the file build123d_utils_jas-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for build123d_utils_jas-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7690b0d9c535849568897159c676cc4bd1326804e18dc376ae8803a22728788
MD5 03c08bdcadde02c18fa18bf586e426d5
BLAKE2b-256 1b7c5f79c38cceda70bbb3e0db102639c23a9ea1993615a539bb685a43efebce

See more details on using hashes here.

Provenance

The following attestation bundles were made for build123d_utils_jas-0.1.0-py3-none-any.whl:

Publisher: publish.yml on jsmnbom/build123d-utils-jas

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

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page