Fix STL export. #1448
This commit is contained in:
parent
213f832e75
commit
afdb490cf1
@ -568,7 +568,8 @@ sub split_object {
|
|||||||
my $mesh = $model_object->mesh;
|
my $mesh = $model_object->mesh;
|
||||||
$mesh->align_to_origin;
|
$mesh->align_to_origin;
|
||||||
|
|
||||||
my @new_meshes = $mesh->split_mesh;
|
$mesh->repair;
|
||||||
|
my @new_meshes = @{$mesh->split};
|
||||||
if (@new_meshes == 1) {
|
if (@new_meshes == 1) {
|
||||||
Slic3r::GUI::warning_catcher($self)->("The selected object couldn't be split because it already contains a single part.");
|
Slic3r::GUI::warning_catcher($self)->("The selected object couldn't be split because it already contains a single part.");
|
||||||
return;
|
return;
|
||||||
@ -583,9 +584,10 @@ sub split_object {
|
|||||||
my $new_model = Slic3r::Model->new;
|
my $new_model = Slic3r::Model->new;
|
||||||
|
|
||||||
foreach my $mesh (@new_meshes) {
|
foreach my $mesh (@new_meshes) {
|
||||||
|
$mesh->repair;
|
||||||
my $bb = $mesh->bounding_box;
|
my $bb = $mesh->bounding_box;
|
||||||
my $model_object = $new_model->add_object(vertices => $mesh->vertices);
|
my $model_object = $new_model->add_object;
|
||||||
$model_object->add_volume(facets => $mesh->facets);
|
$model_object->add_volume(mesh => $mesh);
|
||||||
my $object = Slic3r::GUI::Plater::Object->new(
|
my $object = Slic3r::GUI::Plater::Object->new(
|
||||||
name => basename($current_object->input_file),
|
name => basename($current_object->input_file),
|
||||||
input_file => $current_object->input_file,
|
input_file => $current_object->input_file,
|
||||||
|
@ -216,10 +216,10 @@ sub mesh {
|
|||||||
foreach my $instance (@instances) {
|
foreach my $instance (@instances) {
|
||||||
my $mesh = $object->mesh->clone;
|
my $mesh = $object->mesh->clone;
|
||||||
if ($instance) {
|
if ($instance) {
|
||||||
$mesh->rotate($instance->rotation);
|
$mesh->rotate($instance->rotation, Slic3r::Point->new(0,0));
|
||||||
$mesh->scale($instance->scaling_factor);
|
$mesh->scale($instance->scaling_factor);
|
||||||
$mesh->align_to_origin;
|
$mesh->align_to_origin;
|
||||||
$mesh->move(@{$instance->offset});
|
$mesh->translate(@{$instance->offset}, 0);
|
||||||
}
|
}
|
||||||
push @meshes, $mesh;
|
push @meshes, $mesh;
|
||||||
}
|
}
|
||||||
@ -246,15 +246,14 @@ sub split_meshes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $volume = $object->volumes->[0];
|
my $volume = $object->volumes->[0];
|
||||||
foreach my $mesh ($volume->mesh->split_mesh) {
|
foreach my $mesh (@{$volume->mesh->split}) {
|
||||||
my $new_object = $self->add_object(
|
my $new_object = $self->add_object(
|
||||||
input_file => $object->input_file,
|
input_file => $object->input_file,
|
||||||
config => $object->config,
|
config => $object->config,
|
||||||
layer_height_ranges => $object->layer_height_ranges,
|
layer_height_ranges => $object->layer_height_ranges,
|
||||||
);
|
);
|
||||||
$new_object->add_volume(
|
$new_object->add_volume(
|
||||||
vertices => $mesh->vertices,
|
mesh => $mesh,
|
||||||
facets => $mesh->facets,
|
|
||||||
material_id => $volume->material_id,
|
material_id => $volume->material_id,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user