Macro 3D Printer Workflow

Description
Macro that creates an "stl" file with perfect rounding = without visible facets. It also allows to launch programs of your choice For example to automate the FreeCAD -> Slicer -> printing line

Principle of smoothing :
Iit modifies the deviation property of the solids before generation of the stl and then replace the old values.

At the end, it proposes to launch the stl file which will open for example under cura if the stl extension has been associated with cura in your operating system.

Launching other programs or commands :
You can ask it to chain any program or command that you might type in a terminal. To do this, you must change what is in the "parameters that can be changed" section.

Examples of applications:
- Turn on the printer and the light (requires for example a controlled socket)

- Connect octoprint to the printer

- Start the tray preheating

- Save your FreeCAD and stl file

Setup
Check that in your operating system, the stl extension is associated with your slicer. In other words, when you click on an stl file, it is your slicer that should open.

If you run the macro as it is, this will be ok for the generation of the stl without facet, but the others programs launches will not be ok. To be able to launch other programs (launch octoprint...), you have to adapt the lines of code that are after commands=[ have a lokk at the comments in the code.

Instructions for use
When you run the macro : Accuracy (param deviation) : 0.5 is the default value in FreeCad, 0.05 allows a stronger smoothing. 0.01 is perfect from a smoothing point of view. The lower the value, the better the quality, but the larger the size of the stl file

The value must be between 0 and 1