2011-11-27 10:40:03 +00:00
|
|
|
package Slic3r::TriangleMesh;
|
2013-09-09 22:40:46 +00:00
|
|
|
use strict;
|
|
|
|
use warnings;
|
2011-11-27 10:40:03 +00:00
|
|
|
|
2013-09-09 22:40:46 +00:00
|
|
|
use List::Util qw(first);
|
|
|
|
use Slic3r::Geometry qw(X Y);
|
2013-08-05 18:21:08 +00:00
|
|
|
use Slic3r::Geometry::Clipper qw(union_ex offset);
|
2011-11-27 10:40:03 +00:00
|
|
|
|
2013-09-09 22:40:46 +00:00
|
|
|
sub needed_repair {
|
2012-02-18 19:36:14 +00:00
|
|
|
my $self = shift;
|
|
|
|
|
2013-09-09 22:40:46 +00:00
|
|
|
my $stats = $self->stats;
|
|
|
|
return (first { $stats->{$_} > 0 }
|
|
|
|
qw(degenerate_facets edges_fixed facets_removed facets_added facets_reversed backwards_edges)) ? 1 : 0;
|
2013-05-17 12:14:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sub center {
|
|
|
|
my $self = shift;
|
2013-06-16 10:21:25 +00:00
|
|
|
return $self->bounding_box->center;
|
2013-05-17 12:14:33 +00:00
|
|
|
}
|
|
|
|
|
2011-11-27 10:40:03 +00:00
|
|
|
1;
|