13 comments

[ 3.1 ms ] story [ 53.1 ms ] thread
Rob Miles posted announcement[0,1] of rolling out sources of "FreeCAD Simulator":

> I’ve made this horrible hack to make it easier to debug my Python macros that run inside FreeCAD and design little boxes. It means that I can use all the lovely debugging features of Visual Studio Code to find out why my code don’t work. The hack takes the form of a few simple Python objects that fake part of the FreeCAD ones and allows your macros to run in any Python environment you fancy.

> If you like the idea of writing Python code that produces physical artefacts you might want to take a look at it.

FTR, There are amany interesting articles covering FreeCAD use for 3D Printing on Rob Miles' blog.[2,3]

[0] https://twitter.com/robmiles/status/1327700851499147265

[1] https://www.robmiles.com/journal/2020/11/5/freecad-simulator...

[2] https://www.robmiles.com/journal/category/FreeCAD

[3] https://www.robmiles.com/journal/category/3D+printing

In my naive opinion it would have been much easier to integrate the python debugger into FreeCAD proper. No need for mocking everything, you get the real values not fake ones. And this also does not scale. FreeCAD is constantly expanded.
I'm curious, why would you want to do this instead of using OpenSCAD?
Nobody wants to learn yet another language.
No need, as there is solidpython [1] which lets you use OpenSCAD from Python. The notation is brief, Pythons expressiveness makes everything easier and the learning curve is extremely low.

[1] https://github.com/SolidCode/SolidPython

Especially OpenSCAD's language: paying the price to learn a new DSL is only a reasonable investment when said DSL brings in a ton of added value as compared to a generic programming language.

OpenSCAD's DSL is a rather feeble attempt at a functional programming language, brings in almost no added value compared to - say - python and worst of all is very limited and has no library ecosystem.

Do yourself a favor and learn one of the python-based solutions that end up calling the same computational geometry engine (namely CGAL).

SolidPython is recommended in a sibling. Are there any others you can suggest?
SolidPython is the most mature and the one I'm using. There were others I tried before settling on solid, but TBH I forgot their name.

SolidPython has downsides though:

    - it is a giant PITA to install: you have to deploy that monstrous wart called "conda" which will gobble up 6G of your drive and fricking patch you .bashrc, all of this just so you can install solid

    - it lacks the following feature that native openscad has: "edit model source code with <insert fave editor here> and openscad will recompute the model automatically every time you save.
There's a way to implement that feature with an additional package (solidpython-reloader), but at that point, you've lost 80% of your target audience.
Big companies such as MusicTribe (Behringer) use FreeCAD. I hope they are contributing to it financially...
OpenSCAD can only produce triangulations (STL), not CAD geometries (STEP/IGES).

If you want an OpenSCAD-like workflow, but in Python and producing CAD (Brep) files, then cadquery 2 is progressing very quickly. They now have assembly support, so constructing a multi-solid part (as a STEP file) that can be dragged and dropped into FreeCAD is quite easy.

https://cadquery.readthedocs.io/en/latest/

Filleting with OpenSCAD is a nightmare.
This is really useful. I'm finally getting around to looking at beginning to think about writing a FreeCAD macro to create 3D celtic knotwork panels for 3D printing, and this will help :)