mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-03-01 07:44:41 -07:00
Fix tree support bed exclusion area calculation (#9633)
Fix tree support bed exclusion area calculation (SoftFever/OrcaSlicer#9624)
This commit is contained in:
parent
c93e321ef0
commit
4ae4634976
4 changed files with 26 additions and 46 deletions
|
|
@ -548,19 +548,11 @@ std::vector<size_t> Print::layers_sorted_for_object(float start, float end, std:
|
|||
StringObjectException Print::sequential_print_clearance_valid(const Print &print, Polygons *polygons, std::vector<std::pair<Polygon, float>>* height_polygons)
|
||||
{
|
||||
StringObjectException single_object_exception;
|
||||
auto print_config = print.config();
|
||||
Pointfs excluse_area_points = print_config.bed_exclude_area.values;
|
||||
Polygons exclude_polys;
|
||||
Polygon exclude_poly;
|
||||
const auto& print_config = print.config();
|
||||
Polygons exclude_polys = get_bed_excluded_area(print_config);
|
||||
const Vec3d print_origin = print.get_plate_origin();
|
||||
for (int i = 0; i < excluse_area_points.size(); i++) {
|
||||
auto pt = excluse_area_points[i];
|
||||
exclude_poly.points.emplace_back(scale_(pt.x() + print_origin.x()), scale_(pt.y() + print_origin.y()));
|
||||
if (i % 4 == 3) { // exclude areas are always rectangle
|
||||
exclude_polys.push_back(exclude_poly);
|
||||
exclude_poly.points.clear();
|
||||
}
|
||||
}
|
||||
std::for_each(exclude_polys.begin(), exclude_polys.end(),
|
||||
[&print_origin](Polygon& p) { p.translate(scale_(print_origin.x()), scale_(print_origin.y())); });
|
||||
|
||||
std::map<ObjectID, Polygon> map_model_object_to_convex_hull;
|
||||
struct print_instance_info
|
||||
|
|
@ -887,19 +879,11 @@ static StringObjectException layered_print_cleareance_valid(const Print &print,
|
|||
if (print_instances_ordered.size() < 1)
|
||||
return {};
|
||||
|
||||
auto print_config = print.config();
|
||||
Pointfs excluse_area_points = print_config.bed_exclude_area.values;
|
||||
Polygons exclude_polys;
|
||||
Polygon exclude_poly;
|
||||
const auto& print_config = print.config();
|
||||
Polygons exclude_polys = get_bed_excluded_area(print_config);
|
||||
const Vec3d print_origin = print.get_plate_origin();
|
||||
for (int i = 0; i < excluse_area_points.size(); i++) {
|
||||
auto pt = excluse_area_points[i];
|
||||
exclude_poly.points.emplace_back(scale_(pt.x() + print_origin.x()), scale_(pt.y() + print_origin.y()));
|
||||
if (i % 4 == 3) { // exclude areas are always rectangle
|
||||
exclude_polys.push_back(exclude_poly);
|
||||
exclude_poly.points.clear();
|
||||
}
|
||||
}
|
||||
std::for_each(exclude_polys.begin(), exclude_polys.end(),
|
||||
[&print_origin](Polygon& p) { p.translate(scale_(print_origin.x()), scale_(print_origin.y())); });
|
||||
|
||||
std::map<const PrintInstance*, Polygon> map_model_object_to_convex_hull;
|
||||
// sequential_print_horizontal_clearance_valid
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue