mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-24 07:03:59 -06:00
Ported the G-code generator from Perl to C++.
Removed GCode.pm Removed the Perl bindigns for AvoidCrossingPerimeters, OozePrevention, SpiralVase, Wipe Changed the std::set of extruder IDs to vector of IDs. Removed some MSVC compiler warnings, removed obnoxious compiler warnings when compiling the Perl bindings.
This commit is contained in:
parent
72ae3585e4
commit
e90279c513
52 changed files with 1362 additions and 1632 deletions
|
@ -1,6 +1,7 @@
|
|||
package Slic3r::Test;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Cwd 'abs_path';
|
||||
|
||||
require Exporter;
|
||||
our @ISA = qw(Exporter);
|
||||
|
@ -202,10 +203,19 @@ sub gcode {
|
|||
|
||||
$print = $print->print if $print->isa('Slic3r::Test::Print');
|
||||
|
||||
my $fh = IO::Scalar->new(\my $gcode);
|
||||
# Write the resulting G-code into a temporary file.
|
||||
my $gcode_temp_path = abs_path($0) . '.gcode.temp';
|
||||
$print->process;
|
||||
$print->export_gcode(output_fh => $fh, quiet => 1);
|
||||
$fh->close;
|
||||
$print->export_gcode(output_file => $gcode_temp_path, quiet => 1);
|
||||
# Read the temoprary G-code file.
|
||||
my $gcode;
|
||||
{
|
||||
local $/;
|
||||
open my $fh, '<', $gcode_temp_path or die "Test.pm: can't open $gcode_temp_path: $!";
|
||||
$gcode = <$fh>;
|
||||
}
|
||||
# Remove the temp file.
|
||||
unlink $gcode_temp_path;
|
||||
|
||||
return $gcode;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue