Post-processing script April 09, 2014 03:26PM |
Registered: 10 years ago Posts: 26 |
Re: Post-processing script April 09, 2014 05:21PM |
Registered: 11 years ago Posts: 198 |
Re: Post-processing script April 09, 2014 07:31PM |
Registered: 10 years ago Posts: 26 |
Re: Post-processing script April 10, 2014 01:34AM |
Registered: 11 years ago Posts: 198 |
open(GCODE, $ARGV[0]) or die("Could not open file."); foreach $line (< GCODE > ) { chomp($line); $line =~ s/^G1.*E-.*$/M42 P4 S0/; $line =~ s/^(G1 E0.01000.*)$/\1\nM42 P4 S255/; print "$line\n"; } close(GCODE);
Re: Post-processing script April 10, 2014 08:09AM |
Registered: 10 years ago Posts: 26 |
Re: Post-processing script April 15, 2014 12:56PM |
Registered: 10 years ago Posts: 26 |
Re: Post-processing script April 24, 2014 09:22AM |
Registered: 10 years ago Posts: 26 |
#!/usr/bin/perl -i.before_postproc # # Author : Guy Poizat # Version : 1.2 # Copyright : none. # # Change from previous version : added handling of slic3r's retraction speed setting, # so that this script is not disrupted by a setting change. use strict; use warnings; # what will replace a retraction line with : gcode to cut the laser power off. my $powerOffLine = "M42 P4 S0\n"; # what will replace an "unretraction" line with : gcode to switch the laser power on. my $powerOnLine = "M42 P4 S255\n"; # Extract the speed setting from slic3r's environment variables (or use the default 30mm/s). # Unit is millimeters per minute in gcode, millimeters per second in slic3r configuration. my $defaultRetractSpeed = 1800; my $envRetractSpeed = $ENV{"SLIC3R_RETRACT_SPEED"}; my $retractSpeed = defined( $envRetractSpeed ) ? $envRetractSpeed * 60 : $defaultRetractSpeed; # pattern of a retraction line - would make the filament back-off before a non printing move # on a FDM 3d printer, to avoid ooze. my $retractLine = "G1 F$retractSpeed.* E"; # pattern of an unretraction line - would make the filament forward back to its position before starting extruding again. my $unretractLine = "G1 E.* F$retractSpeed"; # read stdin and any/all files passed as parameters one line at a time while (< > ) { if (/$retractLine/) { # if we found a retraction line, replace it with laser power off print "$powerOffLine"; } else { # nothing to change, print line as-is print or die $!; } if (/$unretractLine/) { # if we have an un-retraction line, append laser power on right after it print "$powerOnLine"; } }
Re: Post-processing script April 24, 2014 12:54PM |
Registered: 13 years ago Posts: 2,947 |
FFF Settings Calculator | Gcode post processors | Geometric Object Deposition Tool Blog |
Tantillus.org | Mini Printable Lathe | How NOT to install a Pololu driver |
Re: Post-processing script April 24, 2014 02:53PM |
Registered: 10 years ago Posts: 26 |
Re: Post-processing script April 24, 2014 03:06PM |
Registered: 13 years ago Posts: 2,947 |
Quote
PierreYves.Pepin
Where should I add this? The person who wrote the script (DeuxVis on the forum), has no problem executing automatically it with his Repetier/Slic3r.
FFF Settings Calculator | Gcode post processors | Geometric Object Deposition Tool Blog |
Tantillus.org | Mini Printable Lathe | How NOT to install a Pololu driver |
Re: Post-processing script April 24, 2014 03:08PM |
Registered: 10 years ago Posts: 26 |
Re: Post-processing script April 24, 2014 03:09PM |
Registered: 13 years ago Posts: 2,947 |
#!/usr/bin/perl -i.before_postprocWhich is a path to perl on Linux so maybe the fact he is a linux user could be affecting this.
FFF Settings Calculator | Gcode post processors | Geometric Object Deposition Tool Blog |
Tantillus.org | Mini Printable Lathe | How NOT to install a Pololu driver |
Re: Post-processing script April 24, 2014 03:26PM |
Registered: 10 years ago Posts: 11 |
Re: Post-processing script January 15, 2015 08:07PM |
Admin Registered: 11 years ago Posts: 3,096 |
Re: Post-processing script January 18, 2015 10:24AM |
Admin Registered: 11 years ago Posts: 3,096 |