Don't return empty halves after cutting
This commit is contained in:
parent
fc3a73afe8
commit
fce669dea0
1 changed files with 15 additions and 9 deletions
|
@ -609,19 +609,25 @@ sub cut {
|
||||||
$upper_mesh->reset_repair_stats;
|
$upper_mesh->reset_repair_stats;
|
||||||
$lower_mesh->reset_repair_stats;
|
$lower_mesh->reset_repair_stats;
|
||||||
|
|
||||||
$upper->add_volume(
|
if ($upper_mesh->facets_count > 0) {
|
||||||
material_id => $volume->material_id,
|
$upper->add_volume(
|
||||||
mesh => $upper_mesh,
|
material_id => $volume->material_id,
|
||||||
modifier => $volume->modifier,
|
mesh => $upper_mesh,
|
||||||
);
|
modifier => $volume->modifier,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if ($lower_mesh->facets_count > 0) {
|
||||||
$lower->add_volume(
|
$lower->add_volume(
|
||||||
material_id => $volume->material_id,
|
material_id => $volume->material_id,
|
||||||
mesh => $lower_mesh,
|
mesh => $lower_mesh,
|
||||||
modifier => $volume->modifier,
|
modifier => $volume->modifier,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$upper = undef if !@{$upper->volumes};
|
||||||
|
$lower = undef if !@{$lower->volumes};
|
||||||
return ($upper, $lower);
|
return ($upper, $lower);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue