macpy3d 0.0.1
3D Models as Code
Requires Python: >=3.8

# MacPy3d

Create 3d Models as Code in Python.

## Why
Python is an amazing language with a huge userbase.
There are many ways to make 3d models ([Blender][1], [Fusion360][2], etc).
Most of these depend on making changes in a UI.
While this is probably a great way to design things for most people, some people prefer to use code directly.

Model as Code (MaC) has several advantages:

 * All design actions are written down, can be commented and can be checked into source control (e.g. git)
 * With multiple people working on the same project, merging the work is as simple as merging code, and all code-merging tools can be used
 * It's easy to create parametric designs, and using these parameters to create animations is also easy

[OpenScad][3] did a great job starting the Code as a Model movement.
Personally, I made many great designs on OpenScad.
However OpenScad uses its own language, meaning another learning curve.
It uses its own editor (although you may use your own).
Debugging is hard; I often ended up with nothing showing and no error messages;
or sometimes something would show just fine, only to refuse to rending with some obsucre errormessage.

[SolidPython][4] is a great project, allowing one to program in python, and doing all the hard work in OpenScad.
I (re)discovered SolidPython several times over the past years.
Every time I started enthusiastically with it, only to find out 1 big problem: since all the heavy lifting was done in OpenScad, the python code actually doesn't have access to the result of this heavy lifting.
This means that one cannot draw a cube, rotate it, and then inquire what the coordinates are of the corners.
A solution for this would be to always do all the work in Python, and only send polyhedrons to OpenScad, but then what is OpenScad good for?
In addition I ran into some troubles (mostly with the `extrude_along_line` in SolidPython and then intersecting that in OpenScad), resulting in errors.
And obviously, the problems with debugging remain the same.

## Goals
* Create models from python code
* Clear, consise, stable, documented API
* Allow full interaction with the models from python
* Modular setup: Bring your own editor
* Modular setup: Default viewer will be provided, but Bring Your Own Viewer is certainly supported
* Modular setup: API for creating your own functions
* Performance: Since every change will mean a full model rebuild, it's essential that this happens fast
* Easy debugging
* Export to STL (or something else that can be imported into [Cura][5])

## Non-goals (for now)
* Colour / Materials: For now, we don't support colour in our models
* Older python versions: Initially only python 3.8 (or maybe even 3.9 once that is released) will be supported. I don't expect that at any time in the future, things will work at python <3.6 (including python 2.x).
* Full portability: If installing on anything but mac, you may need to do some extra work (I will document any insights; this is obvioulsly exactly *because* we want everything to be so fast.

## Status
WIP -- pre-alpha -- nothing works


[1]: https://www.blender.org/
[2]: https://www.autodesk.com/products/fusion-360/overview
[3]: https://www.openscad.org/
[4]: https://github.com/SolidCode/SolidPython
[5]: https://ultimaker.com/software/ultimaker-cura