Solidpython - fast and furious extension
Project description
solidpython_ff
Fast and Furious solidpython, more pythonic!
Solidpythonsticks to Openscad's operation(arguments) (objects,...) API.
This is a slim wrapper (and some tiny utility functions) that turn this into a python object.operation(arguments) API.
For example:
translate([0,0,10]) (
cylinder(r=3,h=10) +
rotate([0,90,0]) (
cylinder(r=3, h=10 )
)
)
becomes
(cylinder(r=3, h=10) + cylinder(r=3, h=10).rotate([0,90,0])).translate([0,0,10])
There's also abbreviations, so you can go
cy(r=3, h=10) + cy(r=3, h=10).r([0,90,0])).t([0,0,10])
The functions have been tuned to understand to understand the openscady 'list-triplets' as well as regular old parameters, and the utils convenience functions are also available.
cy(r=3, h=10) + cy(r=3, h=10).r(0,90,0)).t(0,0,10)
Or even
(cy(r=3, h=10) + cy(r=3, h=10)).rzx().up(10) # rotate z to x
More convenience:
cy(r=3, h=10, segments = 64).scale(x=10, y=5) # z = 1 is implied, 64 segments is the default
cy(r=3, h=10).s(x=10, y=5) # z = 1 is implied
square(3,5).e(10, axis='x', center=True) # a rectangle 3*5, extruded by 10mm, down 5mm, rotated so that extrusion direction is in the x axis.
cy(3,0).debug() # translates to # in openscad
cy(3,0).d()
cy(3,0).background() # translates to % in openscad
cy(3,0).b()
q(10,20,30) + cy(1.5,31).hole() # or .h() for 'first class negative space, and quick cubes
rq(10, r=2, axis='x', edges=(0,1)) # a 10x10x10 cube that has the top edges, parallel to the x axis rounded (so the 'straight' face is facing x)
q(10).x(5) # alias for forward.
q(10).y(5) # alias for right.
q(10).z(5) # alias for up.
q(10).dump("example.scad") # write the object to a .scad file (calls scad_render_to_file)
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
solidpython_ff-0.1.1.tar.gz
(16.5 kB
view details)
File details
Details for the file solidpython_ff-0.1.1.tar.gz
.
File metadata
- Download URL: solidpython_ff-0.1.1.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.50.1 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58f6aa8f7fbbb0c83777ad3833e1df98eb1f069b62305c5c44f68cd074c78b07 |
|
MD5 | 030b43d0c6bdfd306f78bc601aceeece |
|
BLAKE2b-256 | 014222fc91c5e9c9f8b878fd0dbd731718d077d85ba6aeb2ab6a1d34d6d7ec5d |