support Klipper Exclude objects natively.

Also remove fake slicer info
This commit is contained in:
SoftFever 2023-04-01 13:25:55 +08:00
parent 32d952587d
commit 22a24168e6
11 changed files with 141 additions and 34 deletions

View file

@ -159,7 +159,8 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
"accel_to_decel_factor",
"wipe_on_loops",
"gcode_comments",
"gcode_label_objects"
"gcode_label_objects",
"exclude_object"
};
static std::unordered_set<std::string> steps_ignore;
@ -3329,4 +3330,14 @@ int Print::load_cached_data(const std::string& directory)
return ret;
}
BoundingBoxf3 PrintInstance::get_bounding_box() {
return print_object->model_object()->instance_bounding_box(*model_instance, false);
}
Polygon PrintInstance::get_convex_hull_2d() {
Polygon poly = print_object->model_object()->convex_hull_2d(model_instance->get_matrix());
poly.douglas_peucker(0.1);
return poly;
}
} // namespace Slic3r