Not Logged In

solidpython 0.1.1

SolidPython is a generalization of Phillip Tiefenbacher's openscad module, found on [Thingiverse]http://www.thingiverse.com/thing:1481) It generates valid OpenSCAD code from Python code with minimal overhead. Here's a simple example:

Installing SolidPython----------------------* Download SolidPython ( Click [here]https://github.com/SolidCode/SolidPython/archive/master.zip to download directly, or use git to pull it all down ) ** TODO: Put SolidPyton on PyPI* Unzip the file, probably in ~/Downloads/SolidPython-master* In a terminal, cd to location of file:

cd ~/Downloads/SolidPython-master* Run the install script:

sudo python setup.py --install

Using SolidPython-------------------------* Include SolidPython at the top of your Python file:

from solid import * from solid.utils import * # Not required, but the utils file is useful* To include other scad code, call ```use("/path/to/scadfile.scad")``` or ```include("/path/to/scadfile.scad")```* OpenSCAD uses curly-brace blocks ({}) to create its tree. SolidPython uses parentheses with comma-delimited lists. __OpenSCAD:__

* Call ```scad_render( py_scad_obj)``` to generate SCAD code. This returns a string of valid OpenSCAD code.* *or*: call ```scad_render_to_file( py_scad_obj, filepath)``` to store that code in a file. * If 'filepath' is open in the OpenSCAD IDE and Design => 'Automatic Reload and Compile' is checked (in the OpenSCAD IDE), calling ```scad_render_to_file()``` from Python will load the object in the IDE.* Alternately, you could call OpenSCAD's command line and render straight to STL.

Example Code------------The best way to learn how SolidPython works is to look at the included example code. If you've installed SolidPython, the following line will print the location of the examples directory: