Add --marlin-config argument
Marlin requires certain configuration settings in order to work well
with FreeCAD. Those configuration settings will be added to the
end of the gcode file as comments, when --marlin-config is entered
as a post processor argument.
For PEP8 conformity:
Change some double-quotes to single-quotes.
Change sequence of import statements.
Modify code format to PEP8
Indentation and line length meet PEP8 requirements.
Other aspects of PEP8 are partially implemented.
Add code to remove embedded comments
Also, minor tweaks throughout
Change outstring to outList for clarity
Change format_outstring to format_outList
Change: if PathUtil.opProperty(obj, 'Active') is False:
To: if PathUtil.opProperty(obj, 'Active') == False:
Format file to PEP8 standard
Format first pass using:
autopep8 --in-place --aggressive --aggressive
Manually adjust format for better appearance
Recheck format using http://pep8online.com/
Change code related to pythonopen into with open() code
Minor refactoring
Change G4 P to G4 S for Marlin
Marlin uses P for milliseconds, S for seconds.
FreeCAD uses P for seconds, so change P to S.
Remove code for G20 inch mode and G91 relative mode
Due to the fundamentals of the FreeCAD pre-processor,
this post processor can only operate in the following modes:
G90 Absolute positions
G21 Metric units (mm)
G17 XY plane (3 axis vertical milling only)
Expand RETURN_TO option to float values for XYZ
The RETURN_TO option previously only accepted integer values, and
only for X and Y.
This change allows float values for XY and optionally Z.
Add class: "Drill" within drill_translate()
The nested functions within drill_translate() need to modify the
variable that was named trBuff. To allow this, trBuff was changed
to class: "Drill" with property "gcode".
Within drill_translate(), including within the nested functions,
modifying "trBuff" is now replaced with modifying "Drill.gcode".
Merge in updated portions of grbl_post.py
Prior verson was derived from an older grbl_post.py.
Merge in the portions of the newer grbl that seem improved.
Refactor overall after the merge.
Add options for partial comments
Add option: --no-finish-comments
Add option: --no-path-comments
‣ Make countersink and counterbore on metric holes freely definable by user.
‣ Fixed the Naming of M1.6, M2, M2.5 and M3.5
‣ Added constructor for custom enums from Enums to PropertyEnumeration
‣ Put definitions of cut-types (counterbore/countersink) for
screwtypes into json-files for easy modification.
‣ Allow users to put its own definitions in json-files in
[UserDir]/Mod/PartDesign/Resources/Hole
‣ Contains several examples of cut-type definition json-files that are
propably not production-ready.
This uses a local copy of nlohmann::json¹ to read json-files.
__________
¹ This is a very nice,header-only C++ library under the MIT License
(https://github.com/nlohmann/json). I copied the single-file-version
and the forward-declaration-header into …/PartDesign/App/ so no new
dependencies arise.
fix a problem with counterbore and countersink in PartDesign Hole feature.
It was not possible to custom define counterbores or countersinks if a
metric thread hole was selected.
Handle the cut-types None, Counterbore and Countersink euqal
regardless of type of thread and let the user customize:
None: none
Counterbore: diameter and depth
Countersink: diameter and angle