mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-02-15 17:09:43 -07:00
ENH: Improved safe position calculation for delayed photography
In the safe position calculation for time-lapse photography in traditional mode of piece-by-piece printing, for parts not currently being printed, the maximum expansion radius is used for parts higher than the current layer, and half of the expansion radius is used for parts lower than the current layer height; half of the expansion radius is used for the parts themselves. This reduces unnecessary avoidance. jira: STUDIO-13194 Change-Id: Id6ce03af29c9ebba974ea57ec41cca757067027a (cherry picked from commit 68c7f41900049e64d37d792503653ce5302759d8)
This commit is contained in:
parent
db05e4ac64
commit
1a34765856
4 changed files with 14 additions and 8 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -139,6 +139,7 @@ namespace Slic3r {
|
|||
for (auto& obj : object_list) {
|
||||
for (auto& instance : obj->instances()) {
|
||||
auto instance_bbox = get_real_instance_bbox(instance);
|
||||
bool higher_than_curr_layer = (layer->object() == obj) ? false : instance_bbox.max.z() > z_target;
|
||||
if(range_intersect(instance_bbox.min.z(), instance_bbox.max.z(), z_low, z_high)){
|
||||
ExPolygon expoly;
|
||||
expoly.contour = {
|
||||
|
|
@ -147,7 +148,7 @@ namespace Slic3r {
|
|||
{scale_(instance_bbox.max.x()), scale_(instance_bbox.max.y())},
|
||||
{scale_(instance_bbox.min.x()), scale_(instance_bbox.max.y())}
|
||||
};
|
||||
expoly.contour = expand_object_projection(expoly.contour, by_object);
|
||||
expoly.contour = expand_object_projection(expoly.contour, by_object, higher_than_curr_layer);
|
||||
ret.emplace_back(std::move(expoly));
|
||||
}
|
||||
}
|
||||
|
|
@ -249,11 +250,16 @@ namespace Slic3r {
|
|||
|
||||
|
||||
// expand the object expolygon by safe distance, scaled data
|
||||
Polygon TimelapsePosPicker::expand_object_projection(const Polygon& poly, bool by_object)
|
||||
Polygon TimelapsePosPicker::expand_object_projection(const Polygon &poly, bool by_object, bool higher_than_curr)
|
||||
{
|
||||
float radius = 0;
|
||||
if (by_object)
|
||||
radius = scale_(print->config().extruder_clearance_radius.value);
|
||||
if (by_object) {
|
||||
if (higher_than_curr) {
|
||||
radius = scale_(print->config().extruder_clearance_radius.value);
|
||||
}else{
|
||||
radius = scale_(print->config().extruder_clearance_radius.value / 2);
|
||||
}
|
||||
}
|
||||
else
|
||||
radius = scale_(print->config().extruder_clearance_radius.value / 2);
|
||||
|
||||
|
|
@ -557,7 +563,7 @@ namespace Slic3r {
|
|||
{ max_p.x(),max_p.y() },
|
||||
{ min_p.x(),max_p.y() }
|
||||
};
|
||||
object_projections.emplace_back(expand_object_projection(obj_proj,by_object));
|
||||
object_projections.emplace_back(expand_object_projection(obj_proj, by_object));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ namespace Slic3r {
|
|||
|
||||
Polygons collect_limit_areas_for_rod(const std::vector<const PrintObject*>& object_list, const PosPickCtx& ctx);
|
||||
|
||||
Polygon expand_object_projection(const Polygon& poly, bool by_object);
|
||||
Polygon expand_object_projection(const Polygon &poly, bool by_object, bool higher_than_curr = true);
|
||||
BoundingBoxf3 expand_object_bbox(const BoundingBoxf3& bbox, bool by_object);
|
||||
|
||||
Point pick_nearest_object_center(const Point& curr_pos, const std::vector<const PrintObject*>& object_list);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue