Fix build error

This commit is contained in:
Noisyfox
2025-08-19 14:06:26 +08:00
parent 6e063bdc8d
commit 82497c18db
6 changed files with 18 additions and 16 deletions

View File

@@ -3089,7 +3089,7 @@ int CLI::run(int argc, char **argv)
else {
partplate_list.reset_size(old_printable_width, old_printable_depth, old_printable_height, false);
}
partplate_list.set_shapes(make_counter_clockwise(current_printable_area), current_exclude_areas, bed_texture, height_to_lid, height_to_rod);
partplate_list.set_shapes(make_counter_clockwise(current_printable_area), current_exclude_area, current_extruder_areas, bed_texture, height_to_lid, height_to_rod);
//plate_stride = partplate_list.plate_stride_x();
}

View File

@@ -114,7 +114,7 @@ BuildVolume::BuildVolume(const std::vector<Vec2d> &printable_area, const double
if (extruder_shape.size() >= 4 && std::abs((poly_area - double(extruder_volume.bbox.size().x()) * double(extruder_volume.bbox.size().y()))) < sqr(SCALED_EPSILON))
{
extruder_volume.type = Type::Rectangle;
extruder_volume.type = BuildVolume_Type::Rectangle;
extruder_volume.circle.center = 0.5 * (extruder_volume.bbox.min.cast<double>() + extruder_volume.bbox.max.cast<double>());
extruder_volume.circle.radius = 0.5 * extruder_volume.bbox.size().cast<double>().norm();
}
@@ -134,13 +134,13 @@ BuildVolume::BuildVolume(const std::vector<Vec2d> &printable_area, const double
prev = p;
}
if (is_circle) {
extruder_volume.type = Type::Circle;
extruder_volume.type = BuildVolume_Type::Circle;
extruder_volume.circle.center = scaled<double>(extruder_volume.circle.center);
extruder_volume.circle.radius = scaled<double>(extruder_volume.circle.radius);
}
}
if (m_type == Type::Invalid) {
if (m_type == BuildVolume_Type::Invalid) {
//not supported currently, use the same as bed
extruder_volume.same_with_bed = true;
extruder_volume.type = m_type;
@@ -428,25 +428,25 @@ BuildVolume::ObjectState BuildVolume::check_object_state_with_extruder_area(con
if (!extruder_volume.same_with_bed) {
switch (extruder_volume.type) {
case Type::Rectangle:
case BuildVolume_Type::Rectangle:
{
BoundingBox3Base<Vec3d> build_volume = extruder_volume.bboxf.inflated(SceneEpsilon);
if (m_max_print_height == 0.0)
build_volume.max.z() = std::numeric_limits<double>::max();
BoundingBox3Base<Vec3f> build_volumef(build_volume.min.cast<float>(), build_volume.max.cast<float>());
return_state = object_state_templ(its, trafo, false, [build_volumef](const Vec3f &pt) { return build_volumef.contains(pt); });
return_state = object_state_templ(its, trafo, false, true, [build_volumef](const Vec3f &pt) { return build_volumef.contains(pt); });
break;
}
case Type::Circle:
case BuildVolume_Type::Circle:
{
Geometry::Circlef circle { unscaled<float>(extruder_volume.circle.center), unscaled<float>(extruder_volume.circle.radius + SceneEpsilon) };
return_state = (m_max_print_height == 0.0) ?
object_state_templ(its, trafo, false, [circle](const Vec3f &pt) { return circle.contains(to_2d(pt)); }) :
object_state_templ(its, trafo, false, [circle, z = m_max_print_height + SceneEpsilon](const Vec3f &pt) { return pt.z() < z && circle.contains(to_2d(pt)); });
object_state_templ(its, trafo, false, true, [circle](const Vec3f &pt) { return circle.contains(to_2d(pt)); }) :
object_state_templ(its, trafo, false, true, [circle, z = m_max_print_height + SceneEpsilon](const Vec3f &pt) { return pt.z() < z && circle.contains(to_2d(pt)); });
break;
}
case Type::Invalid:
case BuildVolume_Type::Invalid:
default:
break;
}

View File

@@ -716,7 +716,7 @@ void GCodeProcessor::apply_config(const PrintConfig& config)
// sanity check
if(m_preheat_steps < 1)
m_preheat_steps = 1;
m_result.backtrace_enabled = m_preheat_time > 0 && (m_is_XL_printer || (!m_single_extruder_multi_material && extruders_count > 1));
m_result.backtrace_enabled = m_preheat_time > 0 && (m_is_XL_printer || (!m_single_extruder_multi_material && filament_count > 1));
assert(config.nozzle_volume.size() == config.nozzle_diameter.size());
m_nozzle_volume.resize(config.nozzle_volume.size());
@@ -5198,10 +5198,11 @@ void GCodeProcessor::update_slice_warnings()
std::vector<int>nozzle_hrc_lists(m_result.nozzle_type.size(), 0);
// store the nozzle hrc of each extruder
for (size_t idx = 0; idx < m_result.nozzle_type.size(); ++idx)
for (size_t idx = 0; idx < m_result.nozzle_type.size(); ++idx) {
nozzle_hrc_lists[idx] = m_result.nozzle_hrc;
if(nozzle_hrc_lists[idx] <= 0)
nozzle_hrc_lists[idx] = Print::get_hrc_by_nozzle_type(m_result.nozzle_type[idx]);
}
for (size_t idx = 0; idx < used_filaments.size(); ++idx) {
int filament_hrc = 0;

View File

@@ -689,7 +689,7 @@ class Print;
bool m_wiping;
bool m_flushing;
bool m_wipe_tower;
float m_remaining_volume;
std::vector<float> m_remaining_volume;
bool m_manual_filament_change;
//BBS: x, y offset for gcode generated

View File

@@ -1094,8 +1094,9 @@ bool GLVolumeCollection::check_outside_state(const BuildVolume &build_volume, Mo
{
std::vector<bool> inside_extruders;
state = plate_build_volume.check_volume_bbox_state_with_extruder_areas(bb, inside_extruders);
}
}
break;
}
case BuildVolume_Type::Circle:
case BuildVolume_Type::Convex:
//FIXME doing test on convex hull until we learn to do test on non-convex polygons efficiently.

View File

@@ -2098,7 +2098,7 @@ bool PartPlate::check_outside(int obj_id, int instance_id, BoundingBoxf3* boundi
// Orca: For sinking object, we use a more expensive algorithm so part below build plate won't be considered
if (plate_box.intersects(instance_box)) {
// TODO: FIXME: this does not take exclusion area into account
const BuildVolume build_volume(get_shape(), m_plater->build_volume().printable_height());
const BuildVolume build_volume(get_shape(), m_plater->build_volume().printable_height(), m_extruder_areas);
const auto state = instance->calc_print_volume_state(build_volume);
outside = state == ModelInstancePVS_Partly_Outside;
}
@@ -3743,7 +3743,7 @@ void PartPlateList::reinit()
void PartPlateList::update_plates()
{
update_all_plates_pos_and_size(true, false);
set_shapes(m_shape, m_exclude_areas, m_logo_texture_filename, m_height_to_lid, m_height_to_rod);
set_shapes(m_shape, m_exclude_areas, m_extruder_areas, m_logo_texture_filename, m_height_to_lid, m_height_to_rod);
}
int PartPlateList::create_plate(bool adjust_position)