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
Requires build123d >=0.13 (OCP 8). Developed and tested against both the latest
release and a pinned build123d dev revision (see [tool.uv.sources]). The 0.1.x
series supported build123d 0.11.
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 — design-for-printing helpers
Cutters for holes, fastener pockets and fits, with numbers chosen so FDM parts work without test prints (0.4 nozzle / 0.2 layer, +Z is the print direction).
from build123d_utils_jas import printing
part -= Pos(x, y, top) * printing.heatset_pocket("M3", screw_depth=4)
part -= Pos(x, y, top) * printing.nut_trap("M4", slot=12)
with BuildPart() as bp:
...
insert(Pos(x, y, top) * printing.hole_vertical(printing.bore_d(5), 10), mode=Mode.SUBTRACT)
Every helper returns a cutter to subtract, with its mouth at the origin cutting
toward −Z (or −X for horizontal=True, teardrop tip up). Exceptions: mouse_ear
is added, foot_chamfer and fix_horizontal_holes return the modified part, and
counterbore_up opens toward the bed and cuts +Z.
| Group | Helpers |
|---|---|
| numbers | bore_d, clearance_d, screw_into_plastic_d, thread_forming_d, snap_cantilever; tables NUT, CLEARANCE, TAP_DRILL, HEATSET, SNAP_STRAIN |
| holes | hole_vertical (seam tip), hole_horizontal (teardrop), clearance_hole |
| fasteners | heatset_pocket, nut_trap, counterbore_up (bridge trick, opens downward) |
| fits | crush_rib_bore, hex_press_hole |
| misc | zip_tie_channel, mouse_ear, foot_chamfer |
| finished geometry | fix_horizontal_holes(shape) turns existing horizontal-ish round bores into flat-roof teardrops |
| building blocks | teardrop_sketch, cut_into, teardrop_wire, bore_geometry |
All defaults live in printing.Params: printing.P is the default and
printing.ABS adds XY shrink compensation for bores that take bought parts
(bore_d(22, gap=0, p=printing.ABS)). Other processes get a preset via
dataclasses.replace(printing.P, ...). The module docstring lists which helpers
are FDM-only (teardrops, seam tips, the bridge trick, mouse ears, foot chamfer).
fasteners — FastHeatSetNut
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
Metadata
Release files for build123d-utils-jas 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| build123d_utils_jas-0.2.0.tar.gz | 20.5 kB | With provenance | Details for build123d_utils_jas-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| build123d_utils_jas-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for build123d_utils_jas-0.2.0-py3-none-any.whl |
Total release size: 44.4 kB
Release files / build123d_utils_jas-0.2.0.tar.gz
| Download URL | build123d_utils_jas-0.2.0.tar.gz |
|---|---|
| Size | 20.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6b651f46ad22fd19f30d5f30edba2c33c4f9c73aedec04bd4603dbf1b8e4fd91
|
|
BLAKE2b-256 checksum How to use checksums |
8db2235f33e9a2f6e746cb8b858c2b200027db499449a9d147b8ef7a6157ea74
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logRelease files / build123d_utils_jas-0.2.0-py3-none-any.whl
| Download URL | build123d_utils_jas-0.2.0-py3-none-any.whl |
|---|---|
| Size | 23.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
30a70f75d36d1201c268d966c14322e9f5d144d2e2301df7069e8a41c92833a2
|
|
BLAKE2b-256 checksum How to use checksums |
d1f4c6a34e9d6c329d47e4812c26952c1d6a1cb54ba0594ff0a7ffaa25ec38e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logSecurity for build123d-utils-jas 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for build123d_utils_jas-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.