Don't return empty halves after cutting

This commit is contained in:
Alessandro Ranellucci 2014-05-02 13:13:47 +02:00
parent fc3a73afe8
commit fce669dea0

View file

@ -609,11 +609,14 @@ sub cut {
$upper_mesh->reset_repair_stats;
$lower_mesh->reset_repair_stats;
if ($upper_mesh->facets_count > 0) {
$upper->add_volume(
material_id => $volume->material_id,
mesh => $upper_mesh,
modifier => $volume->modifier,
);
}
if ($lower_mesh->facets_count > 0) {
$lower->add_volume(
material_id => $volume->material_id,
mesh => $lower_mesh,
@ -621,7 +624,10 @@ sub cut {
);
}
}
}
$upper = undef if !@{$upper->volumes};
$lower = undef if !@{$lower->volumes};
return ($upper, $lower);
}