CARPEYOYO'S GITHUB PROJECTS

PyRule

PyRule Icon

The Python Programmable CAD

The repository for this project can be found here and the wiki that contains information about installation can be found here.

This project is still in the development stage. Essentially it began as a desire to create a OpenSCAD like programmable CAD which used a common language such as Python that would at least run under Linux. Currently simple object constructed of triangles can be made. If fact, the icon for this program (included above) was created using a script included in the examples directory.

PyRule's GUI was written using GTK in C along with the embedded Python. C was choosen as the language for this project as the Python C API and GTK both were C libraries. The GUI consists of two parts, the draw area to the right where the Objects called to be shown in the Python script are displayed and the control menus to the left. The image below shows a screenshot the the main Program control menu. The script file, working directory, and a argument string can be specified here and the Execute and Interrupt buttons control a child process that runs the actual python code. Any standard or error output from the child process is also written to the "Program Output:" text view.

Program Control Menu Screenshot

The image below shows a screenshot of the Screen Control menu. The rotatation buttons allow a quick change of view from the specified axis. It is important to note that clicking on the draw area will allow you to rotate around the x axis using the Up and Down keys, the y axis using the Left and Right keys, and the z axis using the "," and "." ("<" and ">") keys. The scale of the Objects on the screen and whether the projection uses perspective or orthogonal view can also be specified here. The widget at the bottom of this menu shows the orientation of the axis.

Screen Control Menu Screenshot

The image below shows the Save Control menu. PyRule allows saving the current screen image as PNG or SVG formats. Also by default it can save the current Objects as a binary STL file. There is also a limited custom save script that can be used.

Save Control Menu Screenshot