mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 14:44:19 -06:00
Tech ENABLE_ALLOW_NEGATIVE_Z -> Added threshold to detect if an object is sinking
This commit is contained in:
parent
1f29a2593b
commit
1c35dfe591
6 changed files with 19 additions and 11 deletions
|
@ -963,7 +963,7 @@ void ModelObject::center_around_origin(bool include_modifiers)
|
|||
void ModelObject::ensure_on_bed(bool allow_negative_z)
|
||||
{
|
||||
const double min_z = get_min_z();
|
||||
if (!allow_negative_z || min_z > 0.0)
|
||||
if (!allow_negative_z || min_z > SINKING_Z_THRESHOLD)
|
||||
translate_instances({ 0.0, 0.0, -min_z });
|
||||
}
|
||||
#else
|
||||
|
|
|
@ -1129,6 +1129,10 @@ void check_model_ids_validity(const Model &model);
|
|||
void check_model_ids_equal(const Model &model1, const Model &model2);
|
||||
#endif /* NDEBUG */
|
||||
|
||||
#if ENABLE_ALLOW_NEGATIVE_Z
|
||||
static const float SINKING_Z_THRESHOLD = -0.001f;
|
||||
#endif // ENABLE_ALLOW_NEGATIVE_Z
|
||||
|
||||
} // namespace Slic3r
|
||||
|
||||
namespace cereal
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue