mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 09:06:02 +08:00
Prepare arrange for variable bed distance
This commit is contained in:
parent
f025c9cd6f
commit
e58a15bdf8
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user