mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-05 19:46:29 +08:00
Fix regression in volume not being displayed in the GUI. #3431
This commit is contained in:
parent
848374602d
commit
f3259bb899
@ -1640,8 +1640,10 @@ sub selection_changed {
|
||||
$self->{object_info_size}->SetLabel(sprintf("%.2f x %.2f x %.2f", @{$model_object->instance_bounding_box(0)->size}));
|
||||
$self->{object_info_materials}->SetLabel($model_object->materials_count);
|
||||
|
||||
if (my $stats = $model_object->raw_mesh->stats) {
|
||||
$self->{object_info_volume}->SetLabel(sprintf('%.2f', $stats->{volume} * ($model_instance->scaling_factor**3)));
|
||||
my $raw_mesh = $model_object->raw_mesh;
|
||||
$raw_mesh->repair; # this calculates number_of_parts
|
||||
if (my $stats = $raw_mesh->stats) {
|
||||
$self->{object_info_volume}->SetLabel(sprintf('%.2f', $raw_mesh->volume * ($model_instance->scaling_factor**3)));
|
||||
$self->{object_info_facets}->SetLabel(sprintf('%d (%d shells)', $model_object->facets_count, $stats->{number_of_parts}));
|
||||
if (my $errors = sum(@$stats{qw(degenerate_facets edges_fixed facets_removed facets_added facets_reversed backwards_edges)})) {
|
||||
$self->{object_info_manifold}->SetLabel(sprintf("Auto-repaired (%d errors)", $errors));
|
||||
|
@ -13,7 +13,9 @@
|
||||
void ReadSTLFile(std::string input_file);
|
||||
void write_ascii(std::string output_file);
|
||||
void write_binary(std::string output_file);
|
||||
void check_topology();
|
||||
void repair();
|
||||
float volume();
|
||||
void WriteOBJFile(std::string output_file);
|
||||
void scale(float factor);
|
||||
void scale_xyz(Pointf3* versor)
|
||||
|
Loading…
x
Reference in New Issue
Block a user