Simple G-Code Generator

More
06 May 2017 10:15 #92737 by Erik
Erik created the topic: Simple G-Code Generator
Hello everybody,

based on the python scripts in the wiki ( wiki.linuxcnc.org/cgi-bin/wiki.pl?Simple...NC_G-Code_Generators ) I wrote a framework for small python g-code generators (for milling):
Download and screen-shots here

Currently (v3.3.0) it supports the following generators for milling:
  • Outlining: Rectangle, Circle, Arc, Ellipse, Polygon
  • Pocketing: Rectangle, Circle, Arc, Slot
  • Drill: Matrix, Grill
  • Engraving: Bezel, Text (all qcad fonts are now usable)
Other features:
  • Save, load and insert projects.
  • Edit values and order of generated objects (see above).
  • Remote control of AXIS to load the generated g-code.
  • Easy to add other generators or modify existing ones (at least this was the goal).

It is meant for hobbyist use only, so please do not expect the perfect path generation.
So this is my small contribution.....if anyone is interested to optimise, debug, add generator features, please let me know and I will write a short how-to. Any feedback is very appreciated!

Best regards
Erik
The following user(s) said Thank You: TurBoss
More
08 May 2017 12:11 #92812 by BigJohnT
BigJohnT replied the topic: Simple G-Code Generator
When I try and run it on LinuxMint 17.3 I get this error (I think it is an error)
: No such file or directory
JT
The following user(s) said Thank You: Erik
More
08 May 2017 14:06 - 08 May 2017 15:00 #92817 by Erik
Erik replied the topic: Simple G-Code Generator
Thanks for your feedback!
I was able to reproduce it: It is an issue with the encoding (end of line). Running dos2unix solved it. Still do not know how this happened. The configuration of the editor that I use seems fine.
Update on the way...
Erik
Last Edit: 08 May 2017 15:00 by Erik.
More
08 May 2017 14:25 #92819 by BigJohnT
BigJohnT replied the topic: Simple G-Code Generator
In windoze I use NotePad++, in Linux almost any text editor is fine.

JT
More
08 May 2017 14:59 #92823 by Erik
Erik replied the topic: Simple G-Code Generator
Updated version 3.3.1 is available.
The following user(s) said Thank You: tommylight
More
08 May 2017 23:35 #92885 by tommylight
tommylight replied the topic: Simple G-Code Generator
Works as it should. Thank you.
The following user(s) said Thank You: Erik
More
09 May 2017 10:24 #92903 by BigJohnT
BigJohnT replied the topic: Simple G-Code Generator
I saved the file with linux line endings and it ran but I got a segmentation fault when editing a rectangle pocket. Same thing with 3.3.1.

You might add the option to set the default units and plane.

JT
The following user(s) said Thank You: Erik
More
09 May 2017 13:55 #92926 by Erik
Erik replied the topic: Simple G-Code Generator
I think I fixed the segmentation fault issue. There were mandatory parameter checks (avoid endless loops) missing in three classes.

Version 3.3.2. is now available.

I am not sure if I understood your suggestion. Default units and plane for each object, or overall? For overall I got the preamble (custom code). I guess the metric default values are an issue, right? They can be edited in the code in the file <nclasses> class <Basedata>.

Found another issue on my LinuxCNC controller. I do not get axis-remote working from within the script when started stand-alone (the button <Save & LCNC Load> should be activated if LCNC is running.

Erik
More
10 May 2017 23:29 #92999 by BigJohnT
BigJohnT replied the topic: Simple G-Code Generator
Aye a check box for units and plane would be nice. So you don't have to edit it each time.

JT
More
11 May 2017 17:31 #93036 by Erik
Erik replied the topic: Simple G-Code Generator
I assume setting the units is only needed once. At the moment there are two ways possible:
1. edit the default preamble in the code <sgg.py> or...
2. put a g-code file named <preamble.ngc> into the directory of the script. This will be loaded as the default. Same works for the postamble.

Setting the plane makes sense for each object. Unfortunately the object classes are not written with this in mind. I will have a look on that...

Erik
Moderators: Skullworks
Time to create page: 0.103 seconds
Powered by Kunena Forum