ENH: add new arrangement features for wrapping detection area

Jira: STUDIO-13735

Change-Id: I198d19f5e6ef70f0adfa6370269290c81d21a557
(cherry picked from commit dc83637652526111611d0833d5f5798aaa3e7be7)
This commit is contained in:
shan.chang
2025-08-04 21:44:39 +08:00
committed by Noisyfox
parent 942d023a1e
commit bd066e7f96
11 changed files with 127 additions and 31 deletions

View File

@@ -579,6 +579,7 @@ class PartPlateList : public ObjectBase
PartPlate unprintable_plate;
Pointfs m_shape;
Pointfs m_exclude_areas;
Pointfs m_wrapping_exclude_areas;
std::vector<Pointfs> m_extruder_areas;
std::vector<double> m_extruder_heights;
BoundingBoxf3 m_bounding_box;
@@ -755,6 +756,7 @@ public:
Vec3d get_current_plate_origin() { return compute_origin(m_current_plate, m_plate_cols); }
Vec2d get_current_shape_position() { return compute_shape_position(m_current_plate, m_plate_cols); }
Pointfs get_exclude_area() { return m_exclude_areas; }
Pointfs get_wrapping_exclude_area() const { return m_wrapping_exclude_areas; }
std::set<int> get_extruders(bool conside_custom_gcode = false) const;
@@ -816,7 +818,7 @@ public:
//preprocess an arrangement::ArrangePolygon, return true if it is in a locked plate
bool preprocess_arrange_polygon(int obj_index, int instance_index, arrangement::ArrangePolygon& arrange_polygon, bool selected);
bool preprocess_arrange_polygon_other_locked(int obj_index, int instance_index, arrangement::ArrangePolygon& arrange_polygon, bool selected);
bool preprocess_exclude_areas(arrangement::ArrangePolygons& unselected, int num_plates = 16, float inflation = 0);
bool preprocess_exclude_areas(arrangement::ArrangePolygons& unselected, bool enable_wrapping_detect, int num_plates = 16, float inflation = 0);
bool preprocess_nonprefered_areas(arrangement::ArrangePolygons& regions, int num_plates = 1, float inflation=0);
void postprocess_bed_index_for_selected(arrangement::ArrangePolygon& arrange_polygon);
@@ -841,7 +843,14 @@ public:
int select_plate_by_obj(int obj_index, int instance_index);
void calc_bounding_boxes();
void select_plate_view();
bool set_shapes(const Pointfs& shape, const Pointfs& exclude_areas, const std::vector<Pointfs>& extruder_areas, const std::vector<double>& extruder_heights, const std::string& custom_texture, float height_to_lid, float height_to_rod);
bool set_shapes(const Pointfs &shape,
const Pointfs &exclude_areas,
const Pointfs &wrapping_exclude_areas,
const std::vector<Pointfs> &extruder_areas,
const std::vector<double> &extruder_heights,
const std::string &custom_texture,
float height_to_lid,
float height_to_rod);
void set_hover_id(int id);
void reset_hover_id();
bool intersects(const BoundingBoxf3 &bb);