From f79ba8cec0022530ac09c86824fe0344d5ff33f0 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Tue, 17 Sep 2013 19:25:10 +0200 Subject: [PATCH] Update dump-stl.pl --- lib/Slic3r/Model.pm | 4 +++- utils/dump-stl.pl | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Slic3r/Model.pm b/lib/Slic3r/Model.pm index d7c8f235e..b017d21a0 100644 --- a/lib/Slic3r/Model.pm +++ b/lib/Slic3r/Model.pm @@ -225,7 +225,9 @@ sub mesh { } } - return Slic3r::TriangleMesh->merge(@meshes); + my $mesh = Slic3r::TriangleMesh->new; + $mesh->merge($_) for @meshes; + return $mesh; } # this method splits objects into multiple distinct objects by walking their meshes diff --git a/utils/dump-stl.pl b/utils/dump-stl.pl index 86543832b..1810d9a3f 100644 --- a/utils/dump-stl.pl +++ b/utils/dump-stl.pl @@ -19,6 +19,7 @@ $ARGV[0] or usage(1); if (-e $ARGV[0]) { my $model = Slic3r::Format::STL->read_file($ARGV[0]); my $mesh = $model->mesh; + $mesh->repair; printf "VERTICES = %s\n", join ',', map "[$_->[0],$_->[1],$_->[2]]", @{$mesh->vertices}; printf "FACETS = %s\n", join ',', map "[$_->[0],$_->[1],$_->[2]]", @{$mesh->facets}; exit 0;