diff options
Diffstat (limited to 'utils/view-toolpaths.pl')
-rwxr-xr-x | utils/view-toolpaths.pl | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/utils/view-toolpaths.pl b/utils/view-toolpaths.pl index 0e05a15a7..66ee226db 100755 --- a/utils/view-toolpaths.pl +++ b/utils/view-toolpaths.pl @@ -20,6 +20,7 @@ my %opt = (); my %options = ( 'help' => sub { usage() }, 'load=s' => \$opt{load}, + '3D' => \$opt{d3}, 'duplicate=i' => \$opt{duplicate}, ); GetOptions(%options) or usage(1); @@ -46,6 +47,7 @@ my %opt = (); # visualize toolpaths $Slic3r::ViewToolpaths::print = $sprint->_print; + $Slic3r::ViewToolpaths::d3 = $opt{d3}; my $app = Slic3r::ViewToolpaths->new; $app->MainLoop; } @@ -67,9 +69,10 @@ EOF package Slic3r::ViewToolpaths; use Wx qw(:sizer); -use base qw(Wx::App); +use base qw(Wx::App Class::Accessor); our $print; +our $d3; sub OnInit { my $self = shift; @@ -77,8 +80,24 @@ sub OnInit { my $frame = Wx::Frame->new(undef, -1, 'Toolpaths', [-1, -1], [500, 500]); my $panel = Wx::Panel->new($frame, -1); + my $canvas; + if ($d3) { + $canvas = Slic3r::GUI::PreviewCanvas->new($panel); + $canvas->print($print); + + #$canvas->set_bounding_box($print->bounding_box); + $canvas->set_bed_shape($print->config->bed_shape); + $canvas->set_bounding_box($print->objects->[0]->model_object->bounding_box); + + foreach my $object (@{$print->objects}) { + $canvas->load_object($object->model_object); + } + } else { + $canvas = Slic3r::GUI::Plater::2DToolpaths->new($panel, $print); + } + my $sizer = Wx::BoxSizer->new(wxVERTICAL); - $sizer->Add(Slic3r::GUI::Plater::2DToolpaths->new($panel, $print), 1, wxEXPAND, 0); + $sizer->Add($canvas, 1, wxEXPAND, 0); $panel->SetSizer($sizer); $frame->Show(1); |