mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-04 22:31:02 +00:00
Belt: remove the tagged diagnostic logging
Drops the [BELT-DEBUG], [BELTRACE], [BELT-CALIB] and [BELT-PREVIEW] log lines, the SLIC3R_BELT_DIAGNOSTIC_LOG blocks, and the counters and temporaries that existed only to feed them. Six of the purge tower lines logged at warning level, which is Orca's default, on every plan. Raised in Hanif Koh's review of #14394.
This commit is contained in:
@@ -128,10 +128,6 @@ void Print::_align_belt_purge_layers()
|
||||
delta += h;
|
||||
po->belt_shift_layer_grid(delta); // no-op for the reference object (delta ~ 0)
|
||||
}
|
||||
|
||||
BOOST_LOG_TRIVIAL(debug) << "[BELT-DEBUG] purge grid align: snapped " << m_objects.size()
|
||||
<< " objects onto ref grid offset=" << ref_offset
|
||||
<< " (ref=" << ref->model_object()->name << ")";
|
||||
}
|
||||
|
||||
// Belt mode replacement for _make_wipe_tower(): plan filament-change purging
|
||||
@@ -246,21 +242,11 @@ void Print::_plan_belt_purge()
|
||||
}
|
||||
}
|
||||
|
||||
// Diagnostic: the prism only absorbs purge at toolchange layers whose
|
||||
// print_z coincides with one of its own layers. Compare the prism's layer
|
||||
// print_z range to the toolchange print_z range and count how many
|
||||
// toolchange layers actually land on a prism layer. This distinguishes a
|
||||
// range/grid-alignment failure (no coverage) from a capacity shortfall
|
||||
// (covered but not enough cross-section).
|
||||
// The prism only absorbs purge at toolchange layers whose print_z coincides
|
||||
// with one of its own layers.
|
||||
PrintObject *prism_po = nullptr;
|
||||
for (PrintObject *po : m_objects)
|
||||
if (po->config().belt_purge_tower_object.value && !po->layers().empty()) { prism_po = po; break; }
|
||||
const PrintObject *diag_prism = prism_po;
|
||||
if (diag_prism != nullptr)
|
||||
BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] purge prism layer range print_z=["
|
||||
<< diag_prism->layers().front()->print_z << ", " << diag_prism->layers().back()->print_z
|
||||
<< "] nlayers=" << diag_prism->layers().size();
|
||||
int tc_layers = 0, tc_layers_covered = 0;
|
||||
|
||||
float total_leftover = 0.f;
|
||||
float worst_layer_leftover = 0.f;
|
||||
@@ -269,26 +255,14 @@ void Print::_plan_belt_purge()
|
||||
unsigned int current_extruder_id = m_wipe_tower_data.tool_ordering.first_extruder();
|
||||
for (auto &layer_tools : m_wipe_tower_data.tool_ordering.layer_tools()) {
|
||||
float layer_leftover = 0.f;
|
||||
bool layer_has_tc = false;
|
||||
for (const unsigned int extruder_id : layer_tools.extruders) {
|
||||
if (extruder_id == current_extruder_id)
|
||||
continue;
|
||||
if (!layer_has_tc) {
|
||||
layer_has_tc = true;
|
||||
++tc_layers;
|
||||
if (diag_prism != nullptr && diag_prism->get_layer_at_printz(layer_tools.print_z, EPSILON) != nullptr)
|
||||
++tc_layers_covered;
|
||||
}
|
||||
float volume_to_wipe = use_flush_matrix ?
|
||||
wipe_volumes[current_extruder_id][extruder_id] * flush_multiplier :
|
||||
(float) m_config.prime_volume;
|
||||
float leftover = layer_tools.wiping_extrusions().mark_wiping_extrusions(*this, current_extruder_id, extruder_id,
|
||||
volume_to_wipe);
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] purge toolchange print_z=" << layer_tools.print_z
|
||||
<< " filament " << current_extruder_id << "->" << extruder_id
|
||||
<< " requested=" << volume_to_wipe
|
||||
<< " absorbed=" << volume_to_wipe - leftover
|
||||
<< " leftover=" << leftover;
|
||||
layer_leftover += leftover;
|
||||
current_extruder_id = extruder_id;
|
||||
}
|
||||
@@ -323,11 +297,6 @@ void Print::_plan_belt_purge()
|
||||
this->throw_if_canceled();
|
||||
}
|
||||
|
||||
BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] purge coverage: " << tc_layers_covered << "/" << tc_layers
|
||||
<< " toolchange layers land on a prism layer"
|
||||
<< (tc_layers > 0 && tc_layers_covered == 0 ? " (RANGE/GRID MISALIGNMENT — prism absorbs nothing)" :
|
||||
tc_layers_covered < tc_layers ? " (partial coverage)" : " (full coverage)");
|
||||
|
||||
if (total_leftover > 1.f) {
|
||||
this->active_step_add_warning(
|
||||
PrintStateBase::WarningLevel::CRITICAL,
|
||||
@@ -336,8 +305,6 @@ void Print::_plan_belt_purge()
|
||||
"Increase the belt purge tower width, or reduce flushing volumes."),
|
||||
int(std::ceil(total_leftover)), int(std::ceil(worst_layer_leftover)),
|
||||
Slic3r::float_to_string_decimal_point(worst_layer_z, 2)));
|
||||
BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] purge planning leftover total=" << total_leftover
|
||||
<< " worst_layer=" << worst_layer_leftover << " at print_z=" << worst_layer_z;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -356,10 +323,6 @@ void PrintObject::belt_shift_layer_grid(double delta)
|
||||
for (SupportLayer *layer : m_support_layers)
|
||||
layer->print_z += delta;
|
||||
m_slicing_params.belt_floor_z_shift += delta;
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] belt_shift_layer_grid"
|
||||
<< " obj=" << this->model_object()->name
|
||||
<< " delta=" << delta
|
||||
<< " first_layer.print_z=" << (m_layers.empty() ? 0. : m_layers.front()->print_z);
|
||||
}
|
||||
|
||||
// Belt mode: drop layers strictly above z (used to cancel the purge prism early
|
||||
@@ -382,9 +345,6 @@ size_t PrintObject::belt_truncate_layers_above(coordf_t z)
|
||||
m_layers.resize(keep);
|
||||
if (!m_layers.empty())
|
||||
m_layers.back()->upper_layer = nullptr;
|
||||
BOOST_LOG_TRIVIAL(debug) << "[BELT-DEBUG] truncate purge prism above print_z=" << z
|
||||
<< " kept=" << keep << " removed=" << removed
|
||||
<< " new_top=" << (m_layers.empty() ? 0. : m_layers.back()->print_z);
|
||||
return removed;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,13 +3,6 @@
|
||||
|
||||
#include <limits>
|
||||
|
||||
#include <boost/log/trivial.hpp>
|
||||
#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
#include <thread>
|
||||
#endif
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
void BeltSliceStrategy::apply_preslice_transforms(Transform3d &trafo,
|
||||
@@ -45,79 +38,18 @@ void BeltSliceStrategy::apply_preslice_transforms(Transform3d &trafo,
|
||||
// each volume within the object) would compute min_z against mesh-local vertex
|
||||
// coordinates rather than object-space coordinates, so volumes translated along
|
||||
// the slicer's Z axis would be silently excluded from the bound check.
|
||||
#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG
|
||||
// Capture the incoming trafo for diagnostic logging.
|
||||
// This is the slicer-frame transform AFTER remap + rotation but BEFORE z_shift.
|
||||
const Transform3d trafo_pre_shift = trafo;
|
||||
auto log_mat = [](const Matrix3d &m) {
|
||||
std::ostringstream ss;
|
||||
ss << std::fixed << std::setprecision(4);
|
||||
ss << "[[" << m(0,0) << "," << m(0,1) << "," << m(0,2) << "],"
|
||||
<< "[" << m(1,0) << "," << m(1,1) << "," << m(1,2) << "],"
|
||||
<< "[" << m(2,0) << "," << m(2,1) << "," << m(2,2) << "]]";
|
||||
return ss.str();
|
||||
};
|
||||
auto log_vec3 = [](const Vec3d &v) {
|
||||
std::ostringstream ss;
|
||||
ss << std::fixed << std::setprecision(4);
|
||||
ss << "(" << v.x() << "," << v.y() << "," << v.z() << ")";
|
||||
return ss.str();
|
||||
};
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] apply_preslice_transforms enter"
|
||||
<< " has_rotation=" << has_rotation
|
||||
<< " has_remap=" << has_remap
|
||||
<< " trafo.linear=" << log_mat(trafo_pre_shift.linear())
|
||||
<< " trafo.translation=" << log_vec3(trafo_pre_shift.translation())
|
||||
<< " volumes=" << model_volumes.size();
|
||||
#endif
|
||||
|
||||
double min_z = std::numeric_limits<double>::max();
|
||||
#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG
|
||||
int vol_idx = 0;
|
||||
#endif
|
||||
for (const ModelVolume *mv : model_volumes) {
|
||||
#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG
|
||||
if (!mv->is_model_part()) { ++vol_idx; continue; }
|
||||
#else
|
||||
if (!mv->is_model_part()) continue;
|
||||
#endif
|
||||
Transform3d vol_trafo = trafo * mv->get_matrix();
|
||||
const auto &its = mv->mesh().its;
|
||||
#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG
|
||||
// Per-volume bbox in mesh-frame and post-trafo slicer-frame.
|
||||
Vec3d mesh_min(std::numeric_limits<double>::max(), std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
|
||||
Vec3d mesh_max(std::numeric_limits<double>::lowest(), std::numeric_limits<double>::lowest(), std::numeric_limits<double>::lowest());
|
||||
Vec3d slicer_min(std::numeric_limits<double>::max(), std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
|
||||
Vec3d slicer_max(std::numeric_limits<double>::lowest(), std::numeric_limits<double>::lowest(), std::numeric_limits<double>::lowest());
|
||||
double vol_min_z = std::numeric_limits<double>::max();
|
||||
#endif
|
||||
for (const stl_vertex &v : its.vertices) {
|
||||
Vec3d vm = v.cast<double>();
|
||||
Vec3d pt = vol_trafo * vm;
|
||||
min_z = std::min(min_z, pt.z());
|
||||
#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG
|
||||
mesh_min = mesh_min.cwiseMin(vm);
|
||||
mesh_max = mesh_max.cwiseMax(vm);
|
||||
slicer_min = slicer_min.cwiseMin(pt);
|
||||
slicer_max = slicer_max.cwiseMax(pt);
|
||||
vol_min_z = std::min(vol_min_z, pt.z());
|
||||
#endif
|
||||
}
|
||||
#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] vol[" << vol_idx
|
||||
<< "] id=" << mv->id().id << " name='" << mv->name << "'"
|
||||
<< " mesh_bbox_min=" << log_vec3(mesh_min) << " mesh_bbox_max=" << log_vec3(mesh_max)
|
||||
<< " get_matrix.translation=" << log_vec3(mv->get_matrix().translation())
|
||||
<< " slicer_bbox_min=" << log_vec3(slicer_min) << " slicer_bbox_max=" << log_vec3(slicer_max)
|
||||
<< " vol_min_z=" << vol_min_z;
|
||||
++vol_idx;
|
||||
#endif
|
||||
}
|
||||
const double z_shift_val = (min_z < 0. && min_z != std::numeric_limits<double>::max()) ? -min_z : 0.;
|
||||
#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] combined min_z=" << min_z
|
||||
<< " z_shift_val=" << z_shift_val;
|
||||
#endif
|
||||
if (z_shift_val > 0.) {
|
||||
Transform3d z_shift = Transform3d::Identity();
|
||||
z_shift.matrix()(2, 3) = z_shift_val;
|
||||
@@ -126,18 +58,8 @@ void BeltSliceStrategy::apply_preslice_transforms(Transform3d &trafo,
|
||||
// out_belt_min_z is only meaningful in belt mode; the standalone-remap path
|
||||
// never reported it.
|
||||
if (out_belt_min_z && config.belt_printer.value) {
|
||||
const double new_val = (min_z != std::numeric_limits<double>::max()) ? min_z : 0.;
|
||||
#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] write m_belt_min_z tid=" << std::this_thread::get_id()
|
||||
<< " target=" << out_belt_min_z << " old=" << *out_belt_min_z << " new=" << new_val;
|
||||
#endif
|
||||
*out_belt_min_z = new_val;
|
||||
*out_belt_min_z = (min_z != std::numeric_limits<double>::max()) ? min_z : 0.;
|
||||
}
|
||||
#ifdef SLIC3R_BELT_DIAGNOSTIC_LOG
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] apply_preslice_transforms exit"
|
||||
<< " final_trafo.linear=" << log_mat(trafo.linear())
|
||||
<< " final_trafo.translation=" << log_vec3(trafo.translation());
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace Slic3r
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include "Print.hpp"
|
||||
#include "BeltTransform.hpp"
|
||||
|
||||
#include <thread>
|
||||
#include "BoundingBox.hpp"
|
||||
#include "ClipperUtils.hpp"
|
||||
#include "Clipper2Utils.hpp"
|
||||
@@ -460,15 +459,11 @@ std::vector<std::set<int>> PrintObject::detect_extruder_geometric_unprintables()
|
||||
// 3) Generates perimeters, gap fills and fill regions (fill regions of type stInternal).
|
||||
void PrintObject::make_perimeters()
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] make_perimeters request tid=" << std::this_thread::get_id() << " obj=" << this;
|
||||
// prerequisites
|
||||
this->slice();
|
||||
|
||||
if (! this->set_started(posPerimeters)) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] make_perimeters SKIP tid=" << std::this_thread::get_id() << " obj=" << this << " (already started/done)";
|
||||
if (! this->set_started(posPerimeters))
|
||||
return;
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] make_perimeters ENTER tid=" << std::this_thread::get_id() << " obj=" << this;
|
||||
|
||||
m_print->set_status(15, L("Generating walls"));
|
||||
BOOST_LOG_TRIVIAL(info) << "Generating walls..." << log_memory_info();
|
||||
@@ -566,7 +561,6 @@ void PrintObject::make_perimeters()
|
||||
m_print->throw_if_canceled();
|
||||
BOOST_LOG_TRIVIAL(debug) << "Generating perimeters in parallel - end";
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] make_perimeters EXIT tid=" << std::this_thread::get_id() << " obj=" << this;
|
||||
this->set_done(posPerimeters);
|
||||
}
|
||||
|
||||
@@ -955,9 +949,7 @@ void PrintObject::detect_overhangs_for_lift()
|
||||
|
||||
void PrintObject::generate_support_material()
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] generate_support_material request tid=" << std::this_thread::get_id() << " obj=" << this;
|
||||
if (this->set_started(posSupportMaterial)) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] generate_support_material ENTER tid=" << std::this_thread::get_id() << " obj=" << this;
|
||||
this->clear_support_layers();
|
||||
|
||||
if(!has_support() && !m_print->get_no_check_flag()) {
|
||||
@@ -1005,10 +997,7 @@ void PrintObject::generate_support_material()
|
||||
// posSupportMaterial, so this needs no extra invalidation edges.
|
||||
make_belt_brim(*this);
|
||||
m_print->throw_if_canceled();
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] generate_support_material EXIT tid=" << std::this_thread::get_id() << " obj=" << this;
|
||||
this->set_done(posSupportMaterial);
|
||||
} else {
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] generate_support_material SKIP tid=" << std::this_thread::get_id() << " obj=" << this << " (already started/done)";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <boost/log/trivial.hpp>
|
||||
#include <limits>
|
||||
#include <thread>
|
||||
|
||||
#include <tbb/parallel_for.h>
|
||||
|
||||
@@ -860,12 +859,8 @@ void groupingVolumesForBrim(PrintObject* object, LayerPtrs& layers, int firstLay
|
||||
// Resulting expolygons of layer regions are marked as Internal.
|
||||
void PrintObject::slice()
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] slice request tid=" << std::this_thread::get_id() << " obj=" << this;
|
||||
if (! this->set_started(posSlice)) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] slice SKIP tid=" << std::this_thread::get_id() << " obj=" << this << " (already started/done)";
|
||||
if (! this->set_started(posSlice))
|
||||
return;
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] slice ENTER tid=" << std::this_thread::get_id() << " obj=" << this;
|
||||
//BBS: add flag to reload scene for shell rendering
|
||||
m_print->set_status(5, L("Slicing mesh"), PrintBase::SlicingStatus::RELOAD_SCENE);
|
||||
std::vector<coordf_t> layer_height_profile;
|
||||
@@ -1000,41 +995,6 @@ void PrintObject::slice()
|
||||
0.);
|
||||
double centering_z_corr = (T_fwd.linear() * c_off).z();
|
||||
global_z_offset += centering_z_corr;
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] centering correction"
|
||||
<< " obj=" << this->model_object()->name
|
||||
<< " m_center_offset_mm=(" << c_off.x() << "," << c_off.y() << ")"
|
||||
<< " centering_z_corr=" << centering_z_corr
|
||||
<< " (added to global_z_offset)";
|
||||
}
|
||||
|
||||
// [BELT-DEBUG] Per-object summary so Case A vs Case B can be compared
|
||||
// side-by-side. Lays out every value that feeds into the final layer
|
||||
// print_z adjustment.
|
||||
{
|
||||
BoundingBoxf3 raw_bb = this->model_object()->raw_bounding_box();
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] slice() per-object summary"
|
||||
<< " obj=" << this->model_object()->name
|
||||
<< " n_volumes=" << this->model_object()->volumes.size()
|
||||
<< " raw_bbox.min=(" << raw_bb.min.x() << "," << raw_bb.min.y() << "," << raw_bb.min.z() << ")"
|
||||
<< " raw_bbox.max=(" << raw_bb.max.x() << "," << raw_bb.max.y() << "," << raw_bb.max.z() << ")"
|
||||
<< " raw_bbox.center=(" << raw_bb.center().x() << "," << raw_bb.center().y() << ")"
|
||||
<< " m_center_offset=(" << unscale<double>(m_center_offset.x()) << "," << unscale<double>(m_center_offset.y()) << ")"
|
||||
<< " inst_shift=(" << unscale<double>(inst_shift.x()) << "," << unscale<double>(inst_shift.y()) << ")"
|
||||
<< " m_belt_min_z=" << m_belt_min_z
|
||||
<< " belt_surface_z=" << belt_surface_z
|
||||
<< " belt_z_shift=" << belt_z_shift;
|
||||
// Per-volume bbox + get_matrix translation so order/composition is visible.
|
||||
int vi = 0;
|
||||
for (const ModelVolume *mv : this->model_object()->volumes) {
|
||||
if (!mv->is_model_part()) { ++vi; continue; }
|
||||
BoundingBoxf3 vol_bb = mv->mesh().transformed_bounding_box(mv->get_matrix());
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] vol[" << vi
|
||||
<< "] id=" << mv->id().id << " name='" << mv->name << "'"
|
||||
<< " get_matrix.translation=(" << mv->get_matrix().translation().x() << "," << mv->get_matrix().translation().y() << "," << mv->get_matrix().translation().z() << ")"
|
||||
<< " object_bbox.min=(" << vol_bb.min.x() << "," << vol_bb.min.y() << "," << vol_bb.min.z() << ")"
|
||||
<< " object_bbox.max=(" << vol_bb.max.x() << "," << vol_bb.max.y() << "," << vol_bb.max.z() << ")";
|
||||
++vi;
|
||||
}
|
||||
}
|
||||
|
||||
if (pcfg.belt_preslice_global.value) {
|
||||
@@ -1044,9 +1004,6 @@ void PrintObject::slice()
|
||||
Vec3d d(unscale<double>(inst_shift.x()), unscale<double>(inst_shift.y()), 0.);
|
||||
Vec3d c = T.linear() * d - d;
|
||||
global_z_offset += c.z();
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] write m_belt_global_xy_correction tid=" << std::this_thread::get_id()
|
||||
<< " obj=" << this << " old=(" << m_belt_global_xy_correction.x() << "," << m_belt_global_xy_correction.y()
|
||||
<< ") new=(" << c.x() << "," << c.y() << ")";
|
||||
m_belt_global_xy_correction = Vec2d(c.x(), c.y());
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "Belt preslice_global: correction=("
|
||||
@@ -1081,18 +1038,7 @@ void PrintObject::slice()
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "Belt global: z_offset=" << global_z_offset
|
||||
<< " (relative to min across " << this->print()->objects().size() << " objects)";
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] write m_belt_global_z_offset tid=" << std::this_thread::get_id()
|
||||
<< " obj=" << this << " old=" << m_belt_global_z_offset << " new=" << global_z_offset;
|
||||
m_belt_global_z_offset = global_z_offset;
|
||||
// [BELT-DEBUG] Final breakdown of all contributions to layer.print_z
|
||||
// and where the first / last layer end up post-adjustment.
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] global_z_offset breakdown"
|
||||
<< " obj=" << this->model_object()->name
|
||||
<< " belt_z_shift=" << belt_z_shift
|
||||
<< " total_global_z_offset=" << global_z_offset
|
||||
<< " xy_correction=(" << m_belt_global_xy_correction.x() << "," << m_belt_global_xy_correction.y() << ")"
|
||||
<< " belt_floor_z_shift_before=" << (m_slicing_params.belt_floor_z_shift)
|
||||
<< " n_layers=" << m_layers.size();
|
||||
if (std::abs(global_z_offset) > EPSILON) {
|
||||
for (Layer *layer : m_layers)
|
||||
layer->print_z += global_z_offset;
|
||||
@@ -1101,12 +1047,6 @@ void PrintObject::slice()
|
||||
// layer print_z, so belt_floor_z_shift must match.
|
||||
m_slicing_params.belt_floor_z_shift += global_z_offset;
|
||||
}
|
||||
if (!m_layers.empty()) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELT-DEBUG] post-adjustment"
|
||||
<< " first_layer.print_z=" << m_layers.front()->print_z
|
||||
<< " last_layer.print_z=" << m_layers.back()->print_z
|
||||
<< " belt_floor_z_shift_after=" << m_slicing_params.belt_floor_z_shift;
|
||||
}
|
||||
if (!m_layers.empty()) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "Belt global: first_layer_z=" << m_layers.front()->print_z
|
||||
<< " last_layer_z=" << m_layers.back()->print_z
|
||||
@@ -1125,10 +1065,6 @@ void PrintObject::slice()
|
||||
}
|
||||
|
||||
// BBS
|
||||
BOOST_LOG_TRIVIAL(trace) << "[BELTRACE] slice EXIT tid=" << std::this_thread::get_id() << " obj=" << this
|
||||
<< " layers=" << m_layers.size() << " belt_min_z=" << m_belt_min_z
|
||||
<< " belt_global_z_offset=" << m_belt_global_z_offset
|
||||
<< " belt_xy=(" << m_belt_global_xy_correction.x() << "," << m_belt_global_xy_correction.y() << ")";
|
||||
this->set_done(posSlice);
|
||||
}
|
||||
|
||||
|
||||
@@ -1913,8 +1913,6 @@ void TreeSupport::generate()
|
||||
if (first_layer != nullptr) {
|
||||
ExPolygons floating = diff_ex(first_layer->lslices_extrudable,
|
||||
ctx.surface_polygon(first_layer->bottom_z() - first_layer->height));
|
||||
BOOST_LOG_TRIVIAL(debug) << "[BELT-CALIB] wedge seed: obj=" << m_object->model_object()->name
|
||||
<< " bottom_z=" << first_layer->bottom_z() << " floating=" << floating.size();
|
||||
if (!floating.empty()) {
|
||||
source_areas = std::move(floating);
|
||||
first_z = first_layer->bottom_z();
|
||||
|
||||
@@ -171,7 +171,6 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object
|
||||
if (prism_idxs.empty())
|
||||
return false;
|
||||
remove_prisms(prism_idxs);
|
||||
BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] belt purge tower removed (conditions not met)";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -295,22 +294,13 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object
|
||||
const double lat_origin = plate_origin[belt_is_y ? 0 : 1];
|
||||
const double inset = 1.;
|
||||
double lat_center = lat_max + 5. + 0.5 * width; // fallback: just past the parts
|
||||
BoundingBoxf bed_ext_dbg;
|
||||
if (const auto *bed_opt = printer_config.option<ConfigOptionPoints>("printable_area");
|
||||
bed_opt != nullptr && !bed_opt->values.empty()) {
|
||||
const BoundingBoxf bed_ext = get_extents(bed_opt->values);
|
||||
bed_ext_dbg = bed_ext;
|
||||
const double bed_lat_max = belt_is_y ? bed_ext.max.x() : bed_ext.max.y();
|
||||
lat_center = lat_origin + bed_lat_max - inset - 0.5 * width;
|
||||
}
|
||||
|
||||
BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] purge place"
|
||||
<< " plate_origin=(" << plate_origin.x() << "," << plate_origin.y() << ")"
|
||||
<< " parts_x=[" << x_min << "," << x_max << "] parts_y=[" << y_min << "," << y_max << "] z_max=" << z_max
|
||||
<< " bed_ext=[" << bed_ext_dbg.min.x() << "," << bed_ext_dbg.min.y()
|
||||
<< " -> " << bed_ext_dbg.max.x() << "," << bed_ext_dbg.max.y() << "]"
|
||||
<< " lat_center=" << lat_center << " belt=[" << belt_start << "," << belt_end << "]";
|
||||
|
||||
const Vec3d desired_center(belt_is_y ? lat_center : belt_center,
|
||||
belt_is_y ? belt_center : lat_center,
|
||||
0.5 * height);
|
||||
@@ -395,15 +385,6 @@ bool ensure_belt_purge_tower(Model &model, PartPlateList &partplate_list, Object
|
||||
// until the parts/config actually change.
|
||||
sig = new_sig;
|
||||
|
||||
BOOST_LOG_TRIVIAL(warning) << "[BELT-DEBUG] belt purge tower generated"
|
||||
<< " belt_is_y=" << belt_is_y
|
||||
<< " W=" << width << " L=" << length << " H=" << height
|
||||
<< " v_layer=" << v_layer << " max_flush=" << max_flush
|
||||
<< " filaments=" << filaments.size()
|
||||
<< " theta_deg=" << Geometry::rad2deg(theta)
|
||||
<< " desired_center=(" << desired_center.x() << "," << desired_center.y() << "," << desired_center.z() << ")"
|
||||
<< " achieved_center=(" << new_object->bounding_box_exact().center().x() << ","
|
||||
<< new_object->bounding_box_exact().center().y() << ")";
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1387,8 +1387,6 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const
|
||||
// translation, which this min-corner step recovers.
|
||||
const Vec3d d = model_bb.min - tp_bb.min;
|
||||
belt_inv = Transform3d(Eigen::Translation3d(d)) * belt_inv;
|
||||
BOOST_LOG_TRIVIAL(debug) << "[BELT-PREVIEW] anchor d=[" << d.x() << "," << d.y() << "," << d.z()
|
||||
<< "] (clip kept " << n_clip << "/" << n_filtered << " moves)";
|
||||
}
|
||||
}
|
||||
libvgcode::GCodeInputData data = libvgcode::convert(gcode_result, str_tool_colors, str_color_print_colors, m_viewer,
|
||||
|
||||
@@ -15893,20 +15893,6 @@ void Plater::_calib_apply_belt_mode()
|
||||
inst->rotate(cancel_rotation);
|
||||
obj->invalidate_bounding_box();
|
||||
obj->ensure_on_bed();
|
||||
|
||||
{
|
||||
const BoundingBoxf3 rb = obj->raw_bounding_box();
|
||||
const Vec3d io = inst->get_offset();
|
||||
const Vec3d ir = inst->get_rotation();
|
||||
BOOST_LOG_TRIVIAL(debug) << "[BELT-CALIB] helper exit: obj=" << obj->name
|
||||
<< " inst_offset=(" << io.x() << "," << io.y() << "," << io.z() << ")"
|
||||
<< " inst_rot=(" << ir.x() << "," << ir.y() << "," << ir.z() << ")"
|
||||
<< " vol0_offset=(" << obj->volumes.front()->get_offset().x() << ","
|
||||
<< obj->volumes.front()->get_offset().y() << "," << obj->volumes.front()->get_offset().z() << ")"
|
||||
<< " raw_bbox=(" << rb.min.x() << "," << rb.min.y() << "," << rb.min.z()
|
||||
<< ")..(" << rb.max.x() << "," << rb.max.y() << "," << rb.max.z() << ")"
|
||||
<< " min_z=" << obj->min_z();
|
||||
}
|
||||
}
|
||||
|
||||
// Each object's support wedge extends upstream of it by roughly its own
|
||||
|
||||
Reference in New Issue
Block a user