Do not remove custom supports/seams when converting units to imperial

This commit is contained in:
Lukas Matena 2020-12-14 14:22:43 +01:00
parent a5d363a9f4
commit 5553762d9c

View File

@ -1042,8 +1042,6 @@ void ModelObject::convert_units(ModelObjectPtrs& new_objects, bool from_imperial
int vol_idx = 0; int vol_idx = 0;
for (ModelVolume* volume : volumes) for (ModelVolume* volume : volumes)
{ {
volume->supported_facets.clear();
volume->seam_facets.clear();
if (!volume->mesh().empty()) { if (!volume->mesh().empty()) {
TriangleMesh mesh(volume->mesh()); TriangleMesh mesh(volume->mesh());
mesh.require_shared_vertices(); mesh.require_shared_vertices();
@ -1060,6 +1058,9 @@ void ModelObject::convert_units(ModelObjectPtrs& new_objects, bool from_imperial
vol->source.object_idx = (int)new_objects.size(); vol->source.object_idx = (int)new_objects.size();
vol->source.volume_idx = vol_idx; vol->source.volume_idx = vol_idx;
vol->supported_facets.assign(volume->supported_facets);
vol->seam_facets.assign(volume->seam_facets);
// Perform conversion only if the target "imperial" state is different from the current one. // Perform conversion only if the target "imperial" state is different from the current one.
// This check supports conversion of "mixed" set of volumes, each with different "imperial" state. // This check supports conversion of "mixed" set of volumes, each with different "imperial" state.
if (//vol->source.is_converted_from_inches != from_imperial && if (//vol->source.is_converted_from_inches != from_imperial &&