solid123d
A bridge that runs SolidPython (OpenSCAD-style) code on the build123d BRep kernel. Change one import and existing code produces native build123d shapes instead of OpenSCAD source.
# before
from solid import translate, cube, scad_render_to_file
# after
from solid123d import translate, cube, scad_render_to_file
c = translate([10, 0, 0])(cube(10, center=True))
scad_render_to_file(c, filename="c.scad") # writes c.step (real BRep geometry)
Every object returned is a plain build123d Shape, so bridged code mixes
freely with native build123d — the intended migration path:
from build123d import fillet
from solid123d import cube
part = cube(20, center=True)
part = fillet(part.edges(), radius=2) # native build123d from here on
Supported
- Primitives:
cube,sphere,cylinder(incl.r1/r2cones,d/d1/d2),square,circle,polygon(incl.pathsholes),text - Font resolution:
text(font=...)matches fonts by family name the way fontconfig/OpenSCAD does (incl."Family:style=Style"syntax), by scanning system font directories with fontTools and handing build123d the resolved file path. This fixes fonts with nonstandard subfamilies (e.g."Academy Engraved LET", whose subfamily "Plain" makes OCCT's own lookup fall back to Arial). - Transforms (callable style,
translate(v)(obj, ...)):translate,rotate(vector, scalar, and axis-angle forms with OpenSCAD ordering),scale,mirror,resize,color,offset - Booleans:
union(),difference(),intersection()— plus native operatorsa + b,a - b,a & b - 2D → 3D:
linear_extrude(incl.center,scale; notwist),rotate_extrude(incl. partialangle) - Export:
scad_render_to_filewrites.step/.stl; a.scadfilename is rewritten to.stepwith a warning solid123d.utils:up,down,left,right,forward,back- Typing aliases:
OpenSCADObjectandOpenSCADObjectPlusare aliases ofbuild123d.Shape, so existing annotations likedef some_obj() -> OpenSCADObject:remain correct
Known differences
a * bintersection is not overloaded; usea & borintersection()(a, b).hull()andminkowski()raiseNotImplementedError(no BRep equivalent); in build123d these are usually aloft,sweep,offset, or fillet.linear_extrude(twist=...)raisesNotImplementedError.$fn/segmentsarguments are accepted and ignored — BRep curves are exact.scad_render()(source string) raisesNotImplementedError.- OpenSCAD modifiers (
#,%,!) andimport()/surface()/projection()are not implemented.
Development
just test # or: uv run pytest
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
solid123d-0.1.0.tar.gz
(101.4 kB
view details)
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
solid123d-0.1.0-py3-none-any.whl
(12.1 kB
view details)
File details
Details for the file solid123d-0.1.0.tar.gz.
File metadata
- Download URL: solid123d-0.1.0.tar.gz
- Upload date:
- Size: 101.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a262e470e645d4b48236f40f9bc3d79740ba1995b59eb5c8d0b64bd61469b8b
|
|
| MD5 |
35b5e27471ceec1f509f8095a5f2f6d5
|
|
| BLAKE2b-256 |
359f4dfa16edcda0e5b76745e3e763c9a1d6fe82e50e89a3eb63d70ecea4acd9
|
File details
Details for the file solid123d-0.1.0-py3-none-any.whl.
File metadata
- Download URL: solid123d-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fafa381165115e631d3cef4c32d0d1fa6fcdcf1e51a6e7a65bb76c59dc3be09
|
|
| MD5 |
ff6e69f820cfc55e14ccce5c8a93b3b8
|
|
| BLAKE2b-256 |
09ce57a81abebb10c02ae88fbb7d25e09aa78ef6fff656cfdad2ba249f50b0e8
|