mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
Fixed retrieving of the "saved in inches" flag from 3MF.
Fixed "import STL from Inches" - it should always scale up even if the object is bigger than 3x3x3mm.
This commit is contained in:
parent
3795f6b779
commit
9fdf8c8b8d
4 changed files with 11 additions and 9 deletions
|
@ -461,11 +461,11 @@ bool Model::looks_like_imperial_units() const
|
|||
return false;
|
||||
}
|
||||
|
||||
void Model::convert_from_imperial_units()
|
||||
void Model::convert_from_imperial_units(bool only_small_volumes)
|
||||
{
|
||||
double in_to_mm = 25.4;
|
||||
for (ModelObject* obj : this->objects)
|
||||
if (obj->get_object_stl_stats().volume < 9.0) { // 9 = 3*3*3;
|
||||
if (! only_small_volumes || obj->get_object_stl_stats().volume < 9.0) { // 9 = 3*3*3;
|
||||
obj->scale_mesh_after_creation(Vec3d(in_to_mm, in_to_mm, in_to_mm));
|
||||
for (ModelVolume* v : obj->volumes)
|
||||
v->source.is_converted_from_inches = true;
|
||||
|
@ -1062,7 +1062,7 @@ void ModelObject::convert_units(ModelObjectPtrs& new_objects, bool from_imperial
|
|||
|
||||
// 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.
|
||||
if (vol->source.is_converted_from_inches != from_imperial &&
|
||||
if (//vol->source.is_converted_from_inches != from_imperial &&
|
||||
(volume_idxs.empty() ||
|
||||
std::find(volume_idxs.begin(), volume_idxs.end(), vol_idx) != volume_idxs.end())) {
|
||||
vol->scale_geometry_after_creation(versor);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue