mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-05 04:54:08 -06:00
Refactoring. Use Model class for representing the plate in GUI
This commit is contained in:
parent
f55e057504
commit
0e8a0ef1ca
19 changed files with 610 additions and 620 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue