lasersharkdesign
Posts: 8
Joined: Sat Apr 30, 2016 9:54 am

[ALREADY ADDED] Scripts/pre-processing of GCode

I bought Simplify3D after using Cura that came with my TAZ5 for a long while. I much prefer the control I have with Simplify3D over Cura, but one feature that I miss like crazy was the ability to write custom Python plugins, so I could do custom processing on my Gcode before it gets sent to the printer.

I've been dealing with the issue of inner holes being too small when printed, due to more filament being deposited on the inside of an arc than on the outside, causing issues. I've recently written a php script that performs arc compensation on all inner holes, and it's basically completely cured my issue.

The problem is that to print anything with accurate inner holes now, I need to prepare the file in Simplify3D, save the gcode file to disk, run the gcode through my script, then print the gcode.

If there were a way, like Cura has, to run gcode through a script before sending it to the printer, either via python, or even better, be able to send the file to a URL and take the output as the gcode to send to the printer.

It would open up a ton of options for customization. Is there any way this could be done, or a way someone has figured out to automate it a bit more than how manual it is at the moment?
lasersharkdesign
Posts: 8
Joined: Sat Apr 30, 2016 9:54 am

Re: Request: Scripts/pre-processing of GCode

Doing some desperate googling, it seems I may have found a solution. Was not aware this sort of thing was possible with Simplify3D:

http://community.robo3d.com/index.php?t ... etup.8217/

By installing and using curl, I'm able to send the file to a php script on a webserver, and save the output back over the file, and have the results be what is sent to the printer.

curl command I am using:
curl -F "postfieldname=value" -F "fileul=@[output_filepath]" http://server.url/path.php -s -o "[output_filepath]"

By putting post fields after a -F, sending the file (this works both saving the gcode, as well as printing via USB) to the server url, and saving it back over the original file, the modified result is what is sent to the printer.
dorsai3d
Posts: 237
Joined: Mon Jan 11, 2016 9:01 am

Re: Request: Scripts/pre-processing of GCode

You got it. I've done some of this with python scripts, which you can also call from the postprocessing scripts line, e.g.: ./Users/dorsai3d/bin/s3d2cube.py "[output_filepath]" where that python script would read, modify, and overwrite the incoming file.

Return to “Feature Requests”