From 2dd7091cc39f496c06f58672397111eb4975e261 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Thu, 22 Jul 2021 11:55:08 +0200 Subject: [PATCH] Tech ENABLE_MODIFIED_DOWNSCALE_ON_LOAD_OBJECTS_TOO_BIG set as default --- src/libslic3r/Technologies.hpp | 2 -- src/slic3r/GUI/Plater.cpp | 21 --------------------- 2 files changed, 23 deletions(-) diff --git a/src/libslic3r/Technologies.hpp b/src/libslic3r/Technologies.hpp index d55a67724..3668aa60e 100644 --- a/src/libslic3r/Technologies.hpp +++ b/src/libslic3r/Technologies.hpp @@ -41,8 +41,6 @@ //==================== #define ENABLE_2_4_0_ALPHA0 1 -// Enable a modified version of automatic downscale on load of objects too big -#define ENABLE_MODIFIED_DOWNSCALE_ON_LOAD_OBJECTS_TOO_BIG (1 && ENABLE_2_4_0_ALPHA0) // Enable scrollable legend in preview #define ENABLE_SCROLLABLE_LEGEND (1 && ENABLE_2_4_0_ALPHA0) // Enable visualization of start gcode as regular toolpaths diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 1998ef19b..73999e67c 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2520,7 +2520,6 @@ std::vector Plater::priv::load_model_objects(const ModelObjectPtrs& mode #endif /* AUTOPLACEMENT_ON_LOAD */ } -#if ENABLE_MODIFIED_DOWNSCALE_ON_LOAD_OBJECTS_TOO_BIG for (size_t i = 0; i < object->instances.size(); ++i) { ModelInstance* instance = object->instances[i]; const Vec3d size = object->instance_bounding_box(i).size(); @@ -2542,26 +2541,6 @@ std::vector Plater::priv::load_model_objects(const ModelObjectPtrs& mode scaled_down = true; } } -#else - const Vec3d size = object->bounding_box().size(); - const Vec3d ratio = size.cwiseQuotient(bed_size); - const double max_ratio = std::max(ratio(0), ratio(1)); - if (max_ratio > 10000) { - // the size of the object is too big -> this could lead to overflow when moving to clipper coordinates, - // so scale down the mesh - double inv = 1. / max_ratio; - object->scale_mesh_after_creation(Vec3d(inv, inv, inv)); - object->origin_translation = Vec3d::Zero(); - object->center_around_origin(); - scaled_down = true; - } else if (max_ratio > 5) { - const Vec3d inverse = 1.0 / max_ratio * Vec3d::Ones(); - for (ModelInstance *instance : object->instances) { - instance->set_scaling_factor(inverse); - } - scaled_down = true; - } -#endif // ENABLE_MODIFIED_DOWNSCALE_ON_LOAD_OBJECTS_TOO_BIG object->ensure_on_bed(allow_negative_z); }