Prepare arrange for variable bed distance

This commit is contained in:
tamasmeszaros 2022-07-07 15:51:41 +02:00
parent f025c9cd6f
commit e58a15bdf8
4 changed files with 15 additions and 10 deletions

View File

@ -489,7 +489,7 @@ void _arrange(
{
// Integer ceiling the min distance from the bed perimeters
coord_t md = params.min_obj_distance;
md = md / 2;
md = md / 2 - params.min_bed_distance;
auto corrected_bin = bin;
sl::offset(corrected_bin, md);

View File

@ -81,6 +81,9 @@ struct ArrangeParams {
/// pair of items on the print bed in any direction.
coord_t min_obj_distance = 0;
/// The minimum distance of any object from bed edges
coord_t min_bed_distance = 0;
/// The accuracy of optimization.
/// Goes from 0.0 to 1.0 and scales performance as well
float accuracy = 1.f;

View File

@ -476,7 +476,8 @@ public:
struct ArrangeSettings
{
float distance = 6.;
float distance = 6.f;
float distance_from_bed = 0.f;
// float distance_seq_print = 6.; // Used when sequential print is ON
// float distance_sla = 6.;
float accuracy = 0.65f; // Unused currently

View File

@ -286,6 +286,7 @@ arrangement::ArrangeParams get_arrange_params(Plater *p)
arrangement::ArrangeParams params;
params.allow_rotations = settings.enable_rotation;
params.min_obj_distance = scaled(settings.distance);
params.min_bed_distance = scaled(settings.distance_from_bed);
return params;
}