From fdbe35b6199ec3c43ae096ae3f5e965a72144d83 Mon Sep 17 00:00:00 2001 From: Arthur Date: Wed, 5 Jul 2023 20:29:51 +0800 Subject: [PATCH] ENH: add placeholder first_layer_center_no_wipe_tower This placeholder can be used for smooth timelapse of i3 type printers. Change-Id: I953a437a7733835d850812565ff5f31b83292912 --- src/libslic3r/GCode.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index a05fa2344..e7238a58d 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -1790,6 +1790,14 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_placeholder_parser.set("first_layer_print_min", new ConfigOptionFloats({bbox.min.x() - plate_offset.x(), bbox.min.y() - plate_offset.y()})); m_placeholder_parser.set("first_layer_print_max", new ConfigOptionFloats({bbox.max.x() - plate_offset.x(), bbox.max.y() - plate_offset.y()})); m_placeholder_parser.set("first_layer_print_size", new ConfigOptionFloats({ bbox.size().x(), bbox.size().y() })); + // get center without wipe tower + BoundingBoxf bbox_wo_wt;// bounding box without wipe tower + for (auto& objPtr : print.objects()) { + BBoxData data; + bbox_wo_wt.merge(unscaled(objPtr->get_first_layer_bbox(data.area, data.layer_height, data.name))); + } + auto center = bbox_wo_wt.center(); + m_placeholder_parser.set("first_layer_center_no_wipe_tower", new ConfigOptionFloats(center.x(),center.y())); } {