Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/libseqarrange/src/seq_sequential.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11679,11 +11679,11 @@ bool optimize_SubglobalConsequentialPolygonNonoverlappingBinaryCentered(const So
{
printf(" %d\n", undecided[j]);
}
printf("Missing\n");
for (unsigned int j = 0; j < missing.size(); ++j)
{
printf(" %d\n", missing[j]);
}
// printf("Missing\n");
// for (unsigned int j = 0; j < missing.size(); ++j)
// {
// printf(" %d\n", missing[j]);
// }
printf("Decided\n");
for (unsigned int j = 0; j < decided_polygons.size(); ++j)
{
Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/ArrangeHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ void SeqArrange::process_seq_arrange(std::function<void(int)> progress_fn)
});
assert(it != m_plates.end());
size_t plate_id = it - m_plates.begin();
if (expected_plate != -1 && expected_plate != plate_id)
if (expected_plate != -1 && static_cast<size_t>(expected_plate) != plate_id)
throw ExceptionCannotApplySeqArrange();
expected_plate = otp.glued_to_next ? plate_id : -1;
}
Expand Down
5 changes: 3 additions & 2 deletions src/libslic3r/Feature/Interlocking/InterlockingGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ void InterlockingGenerator::addBoundaryCells(const std::vector<ExPolygons>& lay
std::unordered_set<GridPoint3>& cells) const
{
auto voxel_emplacer = [&cells](GridPoint3 p) {
if (p.z() < 0) {
if (static_cast<coord_t>(p.z()) < 0) {
return true;
}
cells.emplace(p);
Expand Down Expand Up @@ -292,7 +292,8 @@ void InterlockingGenerator::applyMicrostructureToOutlines(const std::unordered_s
for (const GridPoint3& grid_loc : cells) {
Vec3crd bottom_corner = vu.toLowerCorner(grid_loc);
for (size_t mesh_idx = 0; mesh_idx < 2; mesh_idx++) {
for (size_t layer_nr = bottom_corner.z(); layer_nr < bottom_corner.z() + cell_size.z() && layer_nr < max_layer_count;
for (coord_t layer_nr = bottom_corner.z(); layer_nr < bottom_corner.z() + cell_size.z() &&
layer_nr < static_cast<coord_t>(max_layer_count);
layer_nr += beam_layer_count) {
ExPolygons areas_here = cell_area_per_mesh_per_layer[static_cast<size_t>(layer_nr / beam_layer_count) %
cell_area_per_mesh_per_layer.size()][mesh_idx];
Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/GCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2740,7 +2740,7 @@ LayerResult GCodeGenerator::process_layer(
m_last_processor_extrusion_role = GCodeExtrusionRole::WipeTower;

if (has_custom_gcode_to_emit && extruder_id_for_custom_gcode == int(extruder_extrusions.extruder_id)) {
assert(m_writer.extruder()->id() == extruder_id_for_custom_gcode);
assert(int(m_writer.extruder()->id()) == extruder_id_for_custom_gcode);
assert(m_pending_pre_extrusion_gcode.empty());
// Now we have picked the right extruder, so we can emit the custom g-code.
gcode += ProcessLayer::emit_custom_gcode_per_print_z(*this, *layer_tools.custom_gcode, m_writer.extruder()->id(), first_extruder_id, print.config());
Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/GCode/CoolingBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ std::vector<PerExtruderAdjustments> CoolingBuffer::parse_layer_gcode(const std::
}
if ((line.type & CoolingLine::TYPE_G92) == 0) {
// G0, G1, G2, G3. Calculate the duration.
assert((line.type & CoolingLine::TYPE_G0) != 0 + (line.type & CoolingLine::TYPE_G1) != 0 + (line.type & CoolingLine::TYPE_G2G3) != 0 == 1);
assert(((line.type & CoolingLine::TYPE_G0) != 0) + ((line.type & CoolingLine::TYPE_G1) != 0) + ((line.type & CoolingLine::TYPE_G2G3) != 0) == 1);
if (m_config.use_relative_e_distances.value)
// Reset extruder accumulator.
current_pos[AxisIdx::E] = 0.f;
Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/GCode/WipeTowerIntegration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class WipeTowerIntegration {
std::string finalize(GCodeGenerator &gcodegen);
std::vector<float> used_filament_length() const;
std::optional<WipeTower::ToolChangeResult> get_toolchange(std::size_t index, bool ignore_sparse) const {
if (m_layer_idx >= m_tool_changes.size()) {
if (static_cast<std::size_t>(m_layer_idx) >= m_tool_changes.size()) {
return std::nullopt;
}
if(
Expand Down
4 changes: 2 additions & 2 deletions src/libslic3r/MultipleBeds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ void MultipleBeds::set_instances_outside_outside_bed_unprintable(Model& model, c

void MultipleBeds::move_from_bed_to_first_bed(Model& model, const int bed_index) const
{
if (bed_index < 0 || bed_index >= MAX_NUMBER_OF_BEDS) {
if (bed_index < 0 || static_cast<size_t>(bed_index) >= MAX_NUMBER_OF_BEDS) {
assert(false);
return;
}
Expand Down Expand Up @@ -461,7 +461,7 @@ Vec2crd MultipleBeds::get_bed_gap() const {

void MultipleBeds::ensure_wipe_towers_on_beds(Model& model, const std::vector<std::unique_ptr<Print>>& prints)
{
for (size_t bed_idx = 0; bed_idx < get_number_of_beds(); ++bed_idx) {
for (size_t bed_idx = 0; bed_idx < static_cast<size_t>(get_number_of_beds()); ++bed_idx) {
ModelWipeTower& mwt = model.get_wipe_tower_vector()[bed_idx];
double depth = prints[bed_idx]->wipe_tower_data().depth;
double width = prints[bed_idx]->wipe_tower_data().width;
Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/SLAPrint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ std::string SLAPrint::validate(std::vector<std::string>*) const
if (iexpt_cur < iexpt_min || iexpt_cur > iexpt_max)
return _u8L("Initial exposition time is out of printer profile bounds.");

for (const std::string& prefix : { "", "branching" }) {
for (const std::string prefix : { "", "branching" }) {

double head_penetration = m_full_print_config.opt_float(prefix + "support_head_penetration");
double head_width = m_full_print_config.opt_float(prefix + "support_head_width");
Expand Down
6 changes: 4 additions & 2 deletions src/libslic3r/ShortestPath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -847,10 +847,12 @@ std::vector<std::pair<size_t, bool>> chain_segments_greedy_constrained_reversals
Chain *chain2 = (end_point2_chain_id == 0) ? nullptr : &chains.chain(end_point2_chain_id);
assert(chain1 == nullptr || (chain1_flip ? (chain1->begin == end_point1_other || chain1->end == end_point1_other) : (chain1->begin == end_point1 || chain1->end == end_point1)));
assert(chain2 == nullptr || (chain2_flip ? (chain2->begin == end_point2_other || chain2->end == end_point2_other) : (chain2->begin == end_point2 || chain2->end == end_point2)));
if (chain1_flip)
if (chain1_flip) {
chain1->flip(end_points);
if (chain2_flip)
}
if (chain2_flip) {
chain2->flip(end_points);
}
assert(chain1 == nullptr || chain1->begin == end_point1 || chain1->end == end_point1);
assert(chain2 == nullptr || chain2->begin == end_point2 || chain2->end == end_point2);
size_t chain_id = chains.merge(end_point1_chain_id, end_point2_chain_id);
Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/Support/TreeModelVolumes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ std::vector<std::pair<TreeModelVolumes::RadiusLayerPair, std::reference_wrapper<
for (auto &radius_polygons : layer)
out.emplace_back(std::make_pair(radius_polygons.first, layer_idx), radius_polygons.second);
}
assert(std::is_sorted(out.begin(), out.end(), [](auto &l, auto &r){ return l.first.second < r.first.second || (l.first.second == r.first.second) && l.first.first < r.first.first; }));
assert(std::is_sorted(out.begin(), out.end(), [](auto &l, auto &r){ return l.first.second < r.first.second || ((l.first.second == r.first.second) && (l.first.first < r.first.first)); }));
return out;
}

Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/Support/TreeSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2752,7 +2752,7 @@ static void create_nodes_from_area(
if (elem.state.result_on_layer_is_set()) {
double radius_increase = support_element_radius(config, elem) - support_element_radius(config, parent);
assert(radius_increase >= 0);
double shift = (elem.state.result_on_layer - parent.state.result_on_layer).cast<double>().norm();
// double shift = (elem.state.result_on_layer - parent.state.result_on_layer).cast<double>().norm();
//FIXME this assert fails a lot. Is it correct?
// assert(shift < radius_increase + 2. * config.maximum_move_distance_slow);
}
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/3DBed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ void Bed3D::render(GLCanvas3D& canvas, const Transform3d& view_matrix, const Tra
const BoundingBoxf bb = this->build_volume().bounding_volume2d();

for (int i : beds_to_render) {
if (i + 1 >= m_digits_models.size())
if (static_cast<size_t>(i) + 1 >= m_digits_models.size())
break;

double size_x = std::max(10., std::min(bb.size().x(), bb.size().y()) * 0.11);
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/GLCanvas3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2125,7 +2125,7 @@ void GLCanvas3D::render()
const int curr_active_bed_id = s_multiple_beds.get_active_bed();
if (m_last_active_bed_id != curr_active_bed_id) {
const Vec3d bed_offset = s_multiple_beds.get_bed_translation(s_multiple_beds.get_active_bed());
const Vec2d bed_center = m_bed.build_volume().bed_center() + Vec2d(bed_offset.x(), bed_offset.y());
//const Vec2d bed_center = m_bed.build_volume().bed_center() + Vec2d(bed_offset.x(), bed_offset.y());
m_last_active_bed_id = curr_active_bed_id;
}

Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/OptionsGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ void ConfigOptionsGroup::back_to_config_value(const DynamicPrintConfig& config,
{
boost::any value;
if (opt_key == "bed_shape") {
for (const std::string& key : {"bed_custom_texture", "bed_custom_model"}) {
for (const std::string key : {"bed_custom_texture", "bed_custom_model"}) {
value = config.opt_string(key);
this->change_opt_value(key, value);
}
Expand Down