Added method for returning bed printable volume and general rectangular bed when building PrinterGeometry.

This commit is contained in:
surynek 2025-02-03 23:31:54 +01:00 committed by Lukas Matena
parent ac659a3c9b
commit 7ae5f05af2
2 changed files with 18 additions and 2 deletions

View File

@ -92,7 +92,21 @@ static Sequential::PrinterGeometry get_printer_geometry(const ConfigBase& config
// Convert the read data so libseqarrange understands them.
Sequential::PrinterGeometry out;
out.plate = { { 0, 0 }, { scaled(bed_x), 0}, {scaled(bed_x), scaled(bed_y)}, {0, scaled(bed_y)}};
//out.plate = { { 0, 0 }, { scaled(bed_x), 0}, {scaled(bed_x), scaled(bed_y)}, {0, scaled(bed_y)}};
BoundingBox bed_bounding_box = s_multiple_beds.get_bed_box();
double min_x = bed_bounding_box.min.x();
double min_y = bed_bounding_box.min.y();
double max_x = bed_bounding_box.max.x();
double max_y = bed_bounding_box.max.y();
out.plate = { { scaled(min_x), scaled(min_y)},
{ scaled(max_x), scaled(min_y)},
{ scaled(max_x), scaled(max_y)},
{ scaled(min_x), scaled(max_y)}};
for (const ExtruderSlice& slice : slices) {
(slice.shape_type == CONVEX ? out.convex_heights : out.box_heights).emplace(slice.height);
out.extruder_slices.insert(std::make_pair(slice.height, slice.polygons));

View File

@ -87,6 +87,8 @@ public:
m_build_volume_bb = build_volume_bb;
}
Vec2d get_bed_size() const { return m_build_volume_bb.size(); }
BoundingBox get_bed_box() const { return BoundingBox({m_build_volume_bb.min.x(), m_build_volume_bb.min.y()},
{m_build_volume_bb.max.x(), m_build_volume_bb.max.y()}); }
Vec2d bed_gap() const;
Vec2crd get_bed_gap() const;
void ensure_wipe_towers_on_beds(Model& model, const std::vector<std::unique_ptr<Print>>& prints);