mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-29 21:07:11 +00:00
Use PartPlate's m_height to allow CLI to perform proper BuildVolume check
This commit is contained in:
@@ -2770,19 +2770,16 @@ bool PartPlate::check_outside(int obj_id, int instance_id, BoundingBoxf3* boundi
|
||||
plate_box.min.z() += instance_box.min.z(); // not considering outsize if sinking
|
||||
|
||||
if (instance_box.min.z() < SINKING_Z_THRESHOLD) {
|
||||
// Orca: For sinking object, we use a more expensive algorithm so part below build plate won't be considered
|
||||
// m_plater is null in CLI mode.
|
||||
if (m_plater && 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(), m_extruder_areas, m_extruder_heights);
|
||||
const auto state = instance->calc_print_volume_state(build_volume);
|
||||
outside = state == ModelInstancePVS_Partly_Outside;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (plate_box.contains(instance_box))
|
||||
{
|
||||
if (m_exclude_bounding_box.size() > 0)
|
||||
// For sinking object, we use a more expensive algorithm so part below build plate won't be considered.
|
||||
// m_height mirrors the printer's printable height independent of m_plater, so this runs in CLI too.
|
||||
if (plate_box.intersects(instance_box)) {
|
||||
// TODO: FIXME: this does not take exclusion area into account
|
||||
const BuildVolume build_volume(get_shape(), m_height, m_extruder_areas, m_extruder_heights);
|
||||
const auto state = instance->calc_print_volume_state(build_volume);
|
||||
outside = state == ModelInstancePVS_Partly_Outside;
|
||||
}
|
||||
} else if (plate_box.contains(instance_box)) {
|
||||
if (m_exclude_bounding_box.size() > 0)
|
||||
{
|
||||
Polygon hull = instance->convex_hull_2d();
|
||||
int index;
|
||||
@@ -2800,9 +2797,9 @@ bool PartPlate::check_outside(int obj_id, int instance_id, BoundingBoxf3* boundi
|
||||
}
|
||||
else
|
||||
outside = false;
|
||||
}
|
||||
}
|
||||
|
||||
return outside;
|
||||
return outside;
|
||||
}
|
||||
|
||||
//judge whether instance is intesected with plate or not
|
||||
|
||||
Reference in New Issue
Block a user