Refactoring. Use Model class for representing the plate in GUI

This commit is contained in:
Alessandro Ranellucci 2013-12-12 20:19:33 +01:00
parent f55e057504
commit 0e8a0ef1ca
19 changed files with 610 additions and 620 deletions

View file

@ -28,16 +28,15 @@ sub new {
$self->sphi(45);
$self->stheta(-45);
$object->align_to_origin;
$self->object_center($object->center);
$self->object_size($object->size);
my $bounding_box = $object->raw_mesh->bounding_box;
$self->object_center($bounding_box->center);
$self->object_size($bounding_box->size);
# group mesh(es) by material
my @materials = ();
$self->volumes([]);
foreach my $volume (@{$object->volumes}) {
my $mesh = $volume->mesh;
$mesh->repair;
my $material_id = $volume->material_id // '_';
my $color_idx = first { $materials[$_] eq $material_id } 0..$#materials;