mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-28 19:31:22 +00:00
ENH: buildvolume: add logic to support extruder_printable_height
jira: no-jira Change-Id: I962c4aed8c536c0fd8b89ae090cd0463c5d645db (cherry picked from commit 43773d77010492453473797e77e83e9a4630c25f)
This commit is contained in:
+6
-2
@@ -3136,6 +3136,7 @@ int CLI::run(int argc, char **argv)
|
|||||||
std::vector<Pointfs> current_extruder_areas;
|
std::vector<Pointfs> current_extruder_areas;
|
||||||
//update part plate's size
|
//update part plate's size
|
||||||
double print_height = m_print_config.opt_float("printable_height");
|
double print_height = m_print_config.opt_float("printable_height");
|
||||||
|
std::vector<double> current_extruder_print_heights;
|
||||||
double height_to_lid = m_print_config.opt_float("extruder_clearance_height_to_lid");
|
double height_to_lid = m_print_config.opt_float("extruder_clearance_height_to_lid");
|
||||||
double height_to_rod = m_print_config.opt_float("extruder_clearance_height_to_rod");
|
double height_to_rod = m_print_config.opt_float("extruder_clearance_height_to_rod");
|
||||||
double clearance_radius = m_print_config.opt_float("extruder_clearance_radius");
|
double clearance_radius = m_print_config.opt_float("extruder_clearance_radius");
|
||||||
@@ -3145,6 +3146,9 @@ int CLI::run(int argc, char **argv)
|
|||||||
if (m_print_config.opt<ConfigOptionPointsGroups>("extruder_printable_area")) {
|
if (m_print_config.opt<ConfigOptionPointsGroups>("extruder_printable_area")) {
|
||||||
current_extruder_areas = m_print_config.opt<ConfigOptionPointsGroups>("extruder_printable_area")->values;
|
current_extruder_areas = m_print_config.opt<ConfigOptionPointsGroups>("extruder_printable_area")->values;
|
||||||
}
|
}
|
||||||
|
if (m_print_config.opt<ConfigOptionFloatsNullable>("extruder_printable_height")) {
|
||||||
|
current_extruder_print_heights = m_print_config.opt<ConfigOptionFloatsNullable>("extruder_printable_height")->values;
|
||||||
|
}
|
||||||
current_printable_width = current_printable_area[2].x() - current_printable_area[0].x();
|
current_printable_width = current_printable_area[2].x() - current_printable_area[0].x();
|
||||||
current_printable_depth = current_printable_area[2].y() - current_printable_area[0].y();
|
current_printable_depth = current_printable_area[2].y() - current_printable_area[0].y();
|
||||||
current_printable_height = print_height;
|
current_printable_height = print_height;
|
||||||
@@ -3195,7 +3199,7 @@ int CLI::run(int argc, char **argv)
|
|||||||
else {
|
else {
|
||||||
partplate_list.reset_size(old_printable_width, old_printable_depth, old_printable_height, false);
|
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_area, current_extruder_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, current_extruder_print_heights, bed_texture, height_to_lid, height_to_rod);
|
||||||
//plate_stride = partplate_list.plate_stride_x();
|
//plate_stride = partplate_list.plate_stride_x();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4915,7 +4919,7 @@ int CLI::run(int argc, char **argv)
|
|||||||
BOOST_LOG_TRIVIAL(info) << boost::format("print_volume {%1%,%2%,%3%}->{%4%, %5%, %6%}") % print_volume.min(0) % print_volume.min(1)
|
BOOST_LOG_TRIVIAL(info) << boost::format("print_volume {%1%,%2%,%3%}->{%4%, %5%, %6%}") % print_volume.min(0) % print_volume.min(1)
|
||||||
% print_volume.min(2) % print_volume.max(0) % print_volume.max(1) % print_volume.max(2) << std::endl;
|
% print_volume.min(2) % print_volume.max(0) % print_volume.max(1) % print_volume.max(2) << std::endl;
|
||||||
#else
|
#else
|
||||||
BuildVolume build_volume(part_plate->get_shape(), print_height, part_plate->get_extruder_areas());
|
BuildVolume build_volume(part_plate->get_shape(), print_height, part_plate->get_extruder_areas(), current_extruder_print_heights);
|
||||||
//model.update_print_volume_state(build_volume);
|
//model.update_print_volume_state(build_volume);
|
||||||
unsigned int count = model.update_print_volume_state(build_volume);
|
unsigned int count = model.update_print_volume_state(build_volume);
|
||||||
|
|
||||||
|
|||||||
@@ -9,9 +9,11 @@
|
|||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
|
||||||
BuildVolume::BuildVolume(const std::vector<Vec2d> &printable_area, const double printable_height, const std::vector<std::vector<Vec2d>> &extruder_areas) : m_bed_shape(printable_area), m_max_print_height(printable_height), m_extruder_shapes(extruder_areas)
|
BuildVolume::BuildVolume(const std::vector<Vec2d> &printable_area, const double printable_height, const std::vector<std::vector<Vec2d>> &extruder_areas, const std::vector<double>& extruder_printable_heights)
|
||||||
|
: m_bed_shape(printable_area), m_max_print_height(printable_height), m_extruder_shapes(extruder_areas), m_extruder_printable_height(extruder_printable_heights)
|
||||||
{
|
{
|
||||||
assert(printable_height >= 0);
|
assert(printable_height >= 0);
|
||||||
|
assert(extruder_printable_heights.size() == extruder_areas.size());
|
||||||
|
|
||||||
m_polygon = Polygon::new_scale(printable_area);
|
m_polygon = Polygon::new_scale(printable_area);
|
||||||
assert(m_polygon.is_counter_clockwise());
|
assert(m_polygon.is_counter_clockwise());
|
||||||
@@ -83,6 +85,7 @@ BuildVolume::BuildVolume(const std::vector<Vec2d> &printable_area, const double
|
|||||||
m_shared_volume.data[1] = m_bboxf.min.y();
|
m_shared_volume.data[1] = m_bboxf.min.y();
|
||||||
m_shared_volume.data[2] = m_bboxf.max.x();
|
m_shared_volume.data[2] = m_bboxf.max.x();
|
||||||
m_shared_volume.data[3] = m_bboxf.max.y();
|
m_shared_volume.data[3] = m_bboxf.max.y();
|
||||||
|
m_shared_volume.zs[1] = m_bboxf.max.z();
|
||||||
for (unsigned int index = 0; index < m_extruder_shapes.size(); index++)
|
for (unsigned int index = 0; index < m_extruder_shapes.size(); index++)
|
||||||
{
|
{
|
||||||
std::vector<Vec2d>& extruder_shape = m_extruder_shapes[index];
|
std::vector<Vec2d>& extruder_shape = m_extruder_shapes[index];
|
||||||
@@ -97,7 +100,7 @@ BuildVolume::BuildVolume(const std::vector<Vec2d> &printable_area, const double
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (extruder_shape == printable_area) {
|
if ((extruder_shape == printable_area)&&(extruder_printable_heights[index] == printable_height)) {
|
||||||
extruder_volume.same_with_bed = true;
|
extruder_volume.same_with_bed = true;
|
||||||
extruder_volume.type = m_type;
|
extruder_volume.type = m_type;
|
||||||
extruder_volume.bbox = m_bbox;
|
extruder_volume.bbox = m_bbox;
|
||||||
@@ -110,7 +113,7 @@ BuildVolume::BuildVolume(const std::vector<Vec2d> &printable_area, const double
|
|||||||
double poly_area = poly.area();
|
double poly_area = poly.area();
|
||||||
extruder_volume.bbox = get_extents(poly);
|
extruder_volume.bbox = get_extents(poly);
|
||||||
BoundingBoxf temp_bboxf = get_extents(extruder_shape);
|
BoundingBoxf temp_bboxf = get_extents(extruder_shape);
|
||||||
extruder_volume.bboxf = BoundingBoxf3{ to_3d(temp_bboxf.min, 0.), to_3d(temp_bboxf.max, printable_height) };
|
extruder_volume.bboxf = BoundingBoxf3{ to_3d(temp_bboxf.min, 0.), to_3d(temp_bboxf.max, extruder_printable_heights[index]) };
|
||||||
|
|
||||||
if (extruder_shape.size() >= 4 && std::abs((poly_area - double(extruder_volume.bbox.size().x()) * double(extruder_volume.bbox.size().y()))) < sqr(SCALED_EPSILON))
|
if (extruder_shape.size() >= 4 && std::abs((poly_area - double(extruder_volume.bbox.size().x()) * double(extruder_volume.bbox.size().y()))) < sqr(SCALED_EPSILON))
|
||||||
{
|
{
|
||||||
@@ -161,11 +164,13 @@ BuildVolume::BuildVolume(const std::vector<Vec2d> &printable_area, const double
|
|||||||
m_shared_volume.data[2] = extruder_volume.bboxf.max.x();
|
m_shared_volume.data[2] = extruder_volume.bboxf.max.x();
|
||||||
if (m_shared_volume.data[3] > extruder_volume.bboxf.max.y())
|
if (m_shared_volume.data[3] > extruder_volume.bboxf.max.y())
|
||||||
m_shared_volume.data[3] = extruder_volume.bboxf.max.y();
|
m_shared_volume.data[3] = extruder_volume.bboxf.max.y();
|
||||||
|
if (m_shared_volume.zs[1] > extruder_volume.bboxf.max.z())
|
||||||
|
m_shared_volume.zs[1] = extruder_volume.bboxf.max.z();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_shared_volume.type = static_cast<int>(m_type);
|
m_shared_volume.type = static_cast<int>(m_type);
|
||||||
m_shared_volume.zs[0] = 0.f;
|
m_shared_volume.zs[0] = 0.f;
|
||||||
m_shared_volume.zs[1] = printable_height;
|
//m_shared_volume.zs[1] = printable_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_LOG_TRIVIAL(debug) << "BuildVolume printable_area clasified as: " << this->type_name();
|
BOOST_LOG_TRIVIAL(debug) << "BuildVolume printable_area clasified as: " << this->type_name();
|
||||||
|
|||||||
@@ -55,12 +55,13 @@ public:
|
|||||||
// Initialized to empty, all zeros, Invalid.
|
// Initialized to empty, all zeros, Invalid.
|
||||||
BuildVolume() {}
|
BuildVolume() {}
|
||||||
// Initialize from PrintConfig::printable_area and PrintConfig::printable_height
|
// Initialize from PrintConfig::printable_area and PrintConfig::printable_height
|
||||||
BuildVolume(const std::vector<Vec2d> &printable_area, const double printable_height, const std::vector<std::vector<Vec2d>> &extruder_areas);
|
BuildVolume(const std::vector<Vec2d> &printable_area, const double printable_height, const std::vector<std::vector<Vec2d>> &extruder_areas, const std::vector<double>& extruder_printable_heights);
|
||||||
|
|
||||||
// Source data, unscaled coordinates.
|
// Source data, unscaled coordinates.
|
||||||
const std::vector<Vec2d>& printable_area() const { return m_bed_shape; }
|
const std::vector<Vec2d>& printable_area() const { return m_bed_shape; }
|
||||||
double printable_height() const { return m_max_print_height; }
|
double printable_height() const { return m_max_print_height; }
|
||||||
const std::vector<std::vector<Vec2d>>& extruder_areas() const { return m_extruder_shapes; }
|
const std::vector<std::vector<Vec2d>>& extruder_areas() const { return m_extruder_shapes; }
|
||||||
|
const std::vector<double>& extruder_heights() const { return m_extruder_printable_height; }
|
||||||
const BuildSharedVolume& get_shared_volume() const { return m_shared_volume; }
|
const BuildSharedVolume& get_shared_volume() const { return m_shared_volume; }
|
||||||
|
|
||||||
// Derived data
|
// Derived data
|
||||||
@@ -139,6 +140,7 @@ private:
|
|||||||
BuildSharedVolume m_shared_volume; //used for rendering
|
BuildSharedVolume m_shared_volume; //used for rendering
|
||||||
// Source definition of the print volume height (PrintConfig::printable_height)
|
// Source definition of the print volume height (PrintConfig::printable_height)
|
||||||
double m_max_print_height { 0.f };
|
double m_max_print_height { 0.f };
|
||||||
|
std::vector<double> m_extruder_printable_height;
|
||||||
|
|
||||||
// Derived values.
|
// Derived values.
|
||||||
BuildVolume_Type m_type { BuildVolume_Type::Invalid };
|
BuildVolume_Type m_type { BuildVolume_Type::Invalid };
|
||||||
|
|||||||
@@ -226,6 +226,7 @@ class Print;
|
|||||||
//BBS: add bed exclude area
|
//BBS: add bed exclude area
|
||||||
Pointfs bed_exclude_area;
|
Pointfs bed_exclude_area;
|
||||||
std::vector<Pointfs> extruder_areas;
|
std::vector<Pointfs> extruder_areas;
|
||||||
|
std::vector<double> extruder_heights;
|
||||||
//BBS: add toolpath_outside
|
//BBS: add toolpath_outside
|
||||||
bool toolpath_outside;
|
bool toolpath_outside;
|
||||||
//BBS: add object_label_enabled
|
//BBS: add object_label_enabled
|
||||||
|
|||||||
@@ -4020,7 +4020,7 @@ void generate_tree_support_3D(PrintObject &print_object, TreeSupport* tree_suppo
|
|||||||
Points bedpts = tree_support->m_machine_border.contour.points;
|
Points bedpts = tree_support->m_machine_border.contour.points;
|
||||||
Pointfs bedptsf;
|
Pointfs bedptsf;
|
||||||
std::transform(bedpts.begin(), bedpts.end(), std::back_inserter(bedptsf), [](const Point &p) { return unscale(p); });
|
std::transform(bedpts.begin(), bedpts.end(), std::back_inserter(bedptsf), [](const Point &p) { return unscale(p); });
|
||||||
BuildVolume build_volume{ bedptsf, tree_support->m_print_config->printable_height, {}};
|
BuildVolume build_volume{ bedptsf, tree_support->m_print_config->printable_height, {}, {} };
|
||||||
|
|
||||||
TreeSupport3D::generate_support_areas(*print_object.print(), tree_support, build_volume, { idx }, throw_on_cancel);
|
TreeSupport3D::generate_support_areas(*print_object.print(), tree_support, build_volume, { idx }, throw_on_cancel);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -251,8 +251,8 @@ void Bed3D::Axes::render()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//BBS: add part plate logic
|
//BBS: add part plate logic
|
||||||
bool Bed3D::set_shape(const Pointfs& printable_area, const double printable_height, std::vector<Pointfs> extruder_areas, const std::string& custom_model, bool force_as_custom,
|
bool Bed3D::set_shape(const Pointfs& printable_area, const double printable_height, std::vector<Pointfs> extruder_areas, std::vector<double> extruder_heights, const std::string& custom_model, bool force_as_custom,
|
||||||
const Vec2d& position, bool with_reset)
|
const Vec2d position, bool with_reset)
|
||||||
{
|
{
|
||||||
/*auto check_texture = [](const std::string& texture) {
|
/*auto check_texture = [](const std::string& texture) {
|
||||||
boost::system::error_code ec; // so the exists call does not throw (e.g. after a permission problem)
|
boost::system::error_code ec; // so the exists call does not throw (e.g. after a permission problem)
|
||||||
@@ -289,7 +289,7 @@ bool Bed3D::set_shape(const Pointfs& printable_area, const double printable_heig
|
|||||||
}
|
}
|
||||||
|
|
||||||
//BBS: add position related logic
|
//BBS: add position related logic
|
||||||
if (m_bed_shape == printable_area && m_build_volume.printable_height() == printable_height && m_type == type && m_model_filename == model_filename && position == m_position && m_extruder_shapes == extruder_areas)
|
if (m_bed_shape == printable_area && m_build_volume.printable_height() == printable_height && m_type == type && m_model_filename == model_filename && position == m_position && m_extruder_shapes == extruder_areas && m_extruder_heights == extruder_heights)
|
||||||
// No change, no need to update the UI.
|
// No change, no need to update the UI.
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -298,6 +298,7 @@ bool Bed3D::set_shape(const Pointfs& printable_area, const double printable_heig
|
|||||||
m_position = position;
|
m_position = position;
|
||||||
m_bed_shape = printable_area;
|
m_bed_shape = printable_area;
|
||||||
m_extruder_shapes = extruder_areas;
|
m_extruder_shapes = extruder_areas;
|
||||||
|
m_extruder_heights = extruder_heights;
|
||||||
if ((position(0) != 0) || (position(1) != 0)) {
|
if ((position(0) != 0) || (position(1) != 0)) {
|
||||||
Pointfs new_bed_shape;
|
Pointfs new_bed_shape;
|
||||||
for (const Vec2d& p : m_bed_shape) {
|
for (const Vec2d& p : m_bed_shape) {
|
||||||
@@ -313,10 +314,10 @@ bool Bed3D::set_shape(const Pointfs& printable_area, const double printable_heig
|
|||||||
}
|
}
|
||||||
new_extruder_shapes.push_back(new_extruder_shape);
|
new_extruder_shapes.push_back(new_extruder_shape);
|
||||||
}
|
}
|
||||||
m_build_volume = BuildVolume { new_bed_shape, printable_height, new_extruder_shapes };
|
m_build_volume = BuildVolume { new_bed_shape, printable_height, new_extruder_shapes, m_extruder_heights };
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_build_volume = BuildVolume { printable_area, printable_height, m_extruder_shapes };
|
m_build_volume = BuildVolume { printable_area, printable_height, m_extruder_shapes, m_extruder_heights };
|
||||||
m_type = type;
|
m_type = type;
|
||||||
//m_texture_filename = texture_filename;
|
//m_texture_filename = texture_filename;
|
||||||
m_model_filename = model_filename;
|
m_model_filename = model_filename;
|
||||||
@@ -352,7 +353,7 @@ bool Bed3D::set_shape(const Pointfs& printable_area, const double printable_heig
|
|||||||
//BBS: add api to set position for partplate related bed
|
//BBS: add api to set position for partplate related bed
|
||||||
void Bed3D::set_position(Vec2d& position)
|
void Bed3D::set_position(Vec2d& position)
|
||||||
{
|
{
|
||||||
set_shape(m_bed_shape, m_build_volume.printable_height(), m_extruder_shapes, m_model_filename, false, position, false);
|
set_shape(m_bed_shape, m_build_volume.printable_height(), m_extruder_shapes, m_extruder_heights, m_model_filename, false, position, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bed3D::set_axes_mode(bool origin)
|
void Bed3D::set_axes_mode(bool origin)
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ private:
|
|||||||
Vec2d m_position{ Vec2d::Zero() };
|
Vec2d m_position{ Vec2d::Zero() };
|
||||||
std::vector<Vec2d> m_bed_shape;
|
std::vector<Vec2d> m_bed_shape;
|
||||||
std::vector<std::vector<Vec2d>> m_extruder_shapes;
|
std::vector<std::vector<Vec2d>> m_extruder_shapes;
|
||||||
|
std::vector<double> m_extruder_heights;
|
||||||
bool m_is_dark = false;
|
bool m_is_dark = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -127,8 +128,8 @@ public:
|
|||||||
//FIXME if the build volume max print height is updated, this function still returns zero
|
//FIXME if the build volume max print height is updated, this function still returns zero
|
||||||
// as this class does not use it, thus there is no need to update the UI.
|
// as this class does not use it, thus there is no need to update the UI.
|
||||||
// BBS
|
// BBS
|
||||||
bool set_shape(const Pointfs& printable_area, const double printable_height, std::vector<Pointfs> extruder_areas, const std::string& custom_model, bool force_as_custom = false,
|
bool set_shape(const Pointfs& printable_area, const double printable_height, std::vector<Pointfs> extruder_areas, std::vector<double> extruder_heights, const std::string& custom_model, bool force_as_custom = false,
|
||||||
const Vec2d& position = Vec2d::Zero(), bool with_reset = true);
|
const Vec2d position = Vec2d::Zero(), bool with_reset = true);
|
||||||
|
|
||||||
void set_position(Vec2d& position);
|
void set_position(Vec2d& position);
|
||||||
void set_axes_mode(bool origin);
|
void set_axes_mode(bool origin);
|
||||||
|
|||||||
@@ -1077,7 +1077,7 @@ bool GLVolumeCollection::check_outside_state(const BuildVolume &build_volume, Mo
|
|||||||
|
|
||||||
GUI::PartPlate* curr_plate = GUI::wxGetApp().plater()->get_partplate_list().get_selected_plate();
|
GUI::PartPlate* curr_plate = GUI::wxGetApp().plater()->get_partplate_list().get_selected_plate();
|
||||||
const Pointfs& pp_bed_shape = curr_plate->get_shape();
|
const Pointfs& pp_bed_shape = curr_plate->get_shape();
|
||||||
BuildVolume plate_build_volume(pp_bed_shape, build_volume.printable_height(), build_volume.extruder_areas());
|
BuildVolume plate_build_volume(pp_bed_shape, build_volume.printable_height(), build_volume.extruder_areas(), build_volume.extruder_heights());
|
||||||
const std::vector<BoundingBoxf3>& exclude_areas = curr_plate->get_exclude_areas();
|
const std::vector<BoundingBoxf3>& exclude_areas = curr_plate->get_exclude_areas();
|
||||||
|
|
||||||
std::map<ModelObject*, std::map<int, std::set<int>>> objects_unprintable_filaments;
|
std::map<ModelObject*, std::map<int, std::set<int>>> objects_unprintable_filaments;
|
||||||
@@ -1287,6 +1287,7 @@ bool GLVolumeCollection::check_outside_state(const BuildVolume &build_volume, Mo
|
|||||||
if (filament_maps[filament - 1] == extruder_id)
|
if (filament_maps[filament - 1] == extruder_id)
|
||||||
{
|
{
|
||||||
object_filament_info.manual_filaments.emplace(filament, extruder_id);
|
object_filament_info.manual_filaments.emplace(filament, extruder_id);
|
||||||
|
object_results->filament_maps[filament] = extruder_id;
|
||||||
conflict_filaments_set.emplace(filament);
|
conflict_filaments_set.emplace(filament);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ struct ObjectFilamentInfo {
|
|||||||
struct ObjectFilamentResults {
|
struct ObjectFilamentResults {
|
||||||
FilamentMapMode mode;
|
FilamentMapMode mode;
|
||||||
std::vector<int> filaments; //filaments has conflicts
|
std::vector<int> filaments; //filaments has conflicts
|
||||||
|
std::map<int, int> filament_maps; //filament maps
|
||||||
std::vector<ModelObject*> partly_outside_objects; //partly outside objects
|
std::vector<ModelObject*> partly_outside_objects; //partly outside objects
|
||||||
|
|
||||||
std::vector<ObjectFilamentInfo> object_filaments;
|
std::vector<ObjectFilamentInfo> object_filaments;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace GUI {
|
|||||||
|
|
||||||
BedShape::BedShape(const Pointfs& points)
|
BedShape::BedShape(const Pointfs& points)
|
||||||
{
|
{
|
||||||
m_build_volume = { points, 0.f, {} };
|
m_build_volume = { points, 0.f, {}, {} };
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::string get_option_label(BedShape::Parameter param)
|
static std::string get_option_label(BedShape::Parameter param)
|
||||||
|
|||||||
@@ -1009,6 +1009,7 @@ void GCodeViewer::load(const GCodeProcessorResult& gcode_result, const Print& pr
|
|||||||
//BBS: add bed exclude area
|
//BBS: add bed exclude area
|
||||||
Pointfs bed_exclude_area = Pointfs();
|
Pointfs bed_exclude_area = Pointfs();
|
||||||
std::vector<Pointfs> extruder_areas;
|
std::vector<Pointfs> extruder_areas;
|
||||||
|
std::vector<double> extruder_heights;
|
||||||
std::string texture;
|
std::string texture;
|
||||||
std::string model;
|
std::string model;
|
||||||
|
|
||||||
@@ -1030,8 +1031,10 @@ void GCodeViewer::load(const GCodeProcessorResult& gcode_result, const Print& pr
|
|||||||
|
|
||||||
if (!gcode_result.extruder_areas.empty())
|
if (!gcode_result.extruder_areas.empty())
|
||||||
extruder_areas = gcode_result.extruder_areas;
|
extruder_areas = gcode_result.extruder_areas;
|
||||||
|
if (!gcode_result.extruder_heights.empty())
|
||||||
|
extruder_heights = gcode_result.extruder_heights;
|
||||||
|
|
||||||
wxGetApp().plater()->set_bed_shape(printable_area, bed_exclude_area, gcode_result.printable_height, extruder_areas, texture, model, gcode_result.printable_area.empty());
|
wxGetApp().plater()->set_bed_shape(printable_area, bed_exclude_area, gcode_result.printable_height, extruder_areas, extruder_heights, texture, model, gcode_result.printable_area.empty());
|
||||||
}
|
}
|
||||||
/*else {
|
/*else {
|
||||||
// adjust printbed size in dependence of toolpaths bbox
|
// adjust printbed size in dependence of toolpaths bbox
|
||||||
|
|||||||
@@ -1386,6 +1386,18 @@ void GLCanvas3D::construct_error_string(ObjectFilamentResults& object_result, st
|
|||||||
error_string += _u8L("Please solve the problem by moving them within the build volume.\n");
|
error_string += _u8L("Please solve the problem by moving them within the build volume.\n");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
error_string += _u8L("In the Filament manual-matching mode, Following filament->extruder maps: \n");
|
||||||
|
for (auto& filament: object_result.filaments)
|
||||||
|
{
|
||||||
|
error_string += std::to_string(filament) + "->" + std::to_string(object_result.filament_maps[filament]) + "\n";
|
||||||
|
}
|
||||||
|
error_string += "cannot be printed as they are placed in the unprintable area of the corresponding extruder. This may be caused by the following objects:\n";
|
||||||
|
for(ObjectFilamentInfo& object_filament: object_result.object_filaments)
|
||||||
|
{
|
||||||
|
error_string += object_filament.object->name;
|
||||||
|
error_string += "\n";
|
||||||
|
}
|
||||||
|
error_string += _u8L("Please solve the problem by moving them within the build volume.\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -846,7 +846,7 @@ void MainFrame::update_layout()
|
|||||||
{
|
{
|
||||||
m_main_sizer->Add(m_plater, 1, wxEXPAND);
|
m_main_sizer->Add(m_plater, 1, wxEXPAND);
|
||||||
//BBS: add bed exclude area
|
//BBS: add bed exclude area
|
||||||
m_plater->set_bed_shape({ { 0.0, 0.0 }, { 200.0, 0.0 }, { 200.0, 200.0 }, { 0.0, 200.0 } }, {}, 0.0, {}, {}, {}, true);
|
m_plater->set_bed_shape({ { 0.0, 0.0 }, { 200.0, 0.0 }, { 200.0, 200.0 }, { 0.0, 200.0 } }, {}, 0.0, {}, {}, {}, {}, true);
|
||||||
m_plater->get_collapse_toolbar().set_enabled(false);
|
m_plater->get_collapse_toolbar().set_enabled(false);
|
||||||
m_plater->enable_sidebar(false);
|
m_plater->enable_sidebar(false);
|
||||||
m_plater->Show();
|
m_plater->Show();
|
||||||
|
|||||||
@@ -2121,7 +2121,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
|
// 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)) {
|
if (plate_box.intersects(instance_box)) {
|
||||||
// TODO: FIXME: this does not take exclusion area into account
|
// 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);
|
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);
|
const auto state = instance->calc_print_volume_state(build_volume);
|
||||||
outside = state == ModelInstancePVS_Partly_Outside;
|
outside = state == ModelInstancePVS_Partly_Outside;
|
||||||
}
|
}
|
||||||
@@ -2668,9 +2668,10 @@ void PartPlate::generate_exclude_polygon(ExPolygon &exclude_polygon)
|
|||||||
exclude_polygon.contour.make_counter_clockwise();
|
exclude_polygon.contour.make_counter_clockwise();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PartPlate::set_shape(const Pointfs& shape, const Pointfs& exclude_areas, const std::vector<Pointfs>& extruder_areas, Vec2d position, float height_to_lid, float height_to_rod)
|
bool PartPlate::set_shape(const Pointfs& shape, const Pointfs& exclude_areas, const std::vector<Pointfs>& extruder_areas, const std::vector<double>& extruder_heights, Vec2d position, float height_to_lid, float height_to_rod)
|
||||||
{
|
{
|
||||||
Pointfs new_shape, new_exclude_areas;
|
Pointfs new_shape, new_exclude_areas;
|
||||||
|
m_extruder_heights = extruder_heights;
|
||||||
for (const Vec2d& p : shape) {
|
for (const Vec2d& p : shape) {
|
||||||
new_shape.push_back(Vec2d(p.x() + position.x(), p.y() + position.y()));
|
new_shape.push_back(Vec2d(p.x() + position.x(), p.y() + position.y()));
|
||||||
}
|
}
|
||||||
@@ -3675,7 +3676,7 @@ void PartPlateList::reset_size(int width, int depth, int height, bool reload_obj
|
|||||||
m_plate_height = height;
|
m_plate_height = height;
|
||||||
update_all_plates_pos_and_size(false, false, true);
|
update_all_plates_pos_and_size(false, false, true);
|
||||||
if (update_shapes) {
|
if (update_shapes) {
|
||||||
set_shapes(m_shape, m_exclude_areas, m_extruder_areas, m_logo_texture_filename, m_height_to_lid, m_height_to_rod);
|
set_shapes(m_shape, m_exclude_areas, m_extruder_areas, m_extruder_heights, m_logo_texture_filename, m_height_to_lid, m_height_to_rod);
|
||||||
}
|
}
|
||||||
if (reload_objects)
|
if (reload_objects)
|
||||||
reload_all_objects();
|
reload_all_objects();
|
||||||
@@ -3760,7 +3761,7 @@ void PartPlateList::reinit()
|
|||||||
|
|
||||||
//reset plate 0's position
|
//reset plate 0's position
|
||||||
Vec2d pos = compute_shape_position(0, m_plate_cols);
|
Vec2d pos = compute_shape_position(0, m_plate_cols);
|
||||||
m_plate_list[0]->set_shape(m_shape, m_exclude_areas, m_extruder_areas, pos, m_height_to_lid, m_height_to_rod);
|
m_plate_list[0]->set_shape(m_shape, m_exclude_areas, m_extruder_areas, m_extruder_heights, pos, m_height_to_lid, m_height_to_rod);
|
||||||
//reset unprintable plate's position
|
//reset unprintable plate's position
|
||||||
Vec3d origin2 = compute_origin_for_unprintable();
|
Vec3d origin2 = compute_origin_for_unprintable();
|
||||||
unprintable_plate.set_pos_and_size(origin2, m_plate_width, m_plate_depth, m_plate_height, false);
|
unprintable_plate.set_pos_and_size(origin2, m_plate_width, m_plate_depth, m_plate_height, false);
|
||||||
@@ -3777,7 +3778,7 @@ void PartPlateList::reinit()
|
|||||||
void PartPlateList::update_plates()
|
void PartPlateList::update_plates()
|
||||||
{
|
{
|
||||||
update_all_plates_pos_and_size(true, false);
|
update_all_plates_pos_and_size(true, false);
|
||||||
set_shapes(m_shape, m_exclude_areas, m_extruder_areas, m_logo_texture_filename, m_height_to_lid, m_height_to_rod);
|
set_shapes(m_shape, m_exclude_areas, m_extruder_areas, m_extruder_heights, m_logo_texture_filename, m_height_to_lid, m_height_to_rod);
|
||||||
}
|
}
|
||||||
|
|
||||||
int PartPlateList::create_plate(bool adjust_position)
|
int PartPlateList::create_plate(bool adjust_position)
|
||||||
@@ -3810,7 +3811,7 @@ int PartPlateList::create_plate(bool adjust_position)
|
|||||||
|
|
||||||
plate->set_index(new_index);
|
plate->set_index(new_index);
|
||||||
Vec2d pos = compute_shape_position(new_index, cols);
|
Vec2d pos = compute_shape_position(new_index, cols);
|
||||||
plate->set_shape(m_shape, m_exclude_areas, m_extruder_areas, pos, m_height_to_lid, m_height_to_rod);
|
plate->set_shape(m_shape, m_exclude_areas, m_extruder_areas, m_extruder_heights, pos, m_height_to_lid, m_height_to_rod);
|
||||||
m_plate_list.emplace_back(plate);
|
m_plate_list.emplace_back(plate);
|
||||||
update_plate_cols();
|
update_plate_cols();
|
||||||
if (old_cols != cols)
|
if (old_cols != cols)
|
||||||
@@ -3818,7 +3819,7 @@ int PartPlateList::create_plate(bool adjust_position)
|
|||||||
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(":old_cols %1% -> new_cols %2%") % old_cols % cols;
|
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(":old_cols %1% -> new_cols %2%") % old_cols % cols;
|
||||||
//update the origin of each plate
|
//update the origin of each plate
|
||||||
update_all_plates_pos_and_size(adjust_position, false);
|
update_all_plates_pos_and_size(adjust_position, false);
|
||||||
set_shapes(m_shape, m_exclude_areas, m_extruder_areas, m_logo_texture_filename, m_height_to_lid, m_height_to_rod);
|
set_shapes(m_shape, m_exclude_areas, m_extruder_areas, m_extruder_heights, m_logo_texture_filename, m_height_to_lid, m_height_to_rod);
|
||||||
|
|
||||||
if (m_plater) {
|
if (m_plater) {
|
||||||
Vec2d pos = compute_shape_position(m_current_plate, cols);
|
Vec2d pos = compute_shape_position(m_current_plate, cols);
|
||||||
@@ -3989,7 +3990,7 @@ int PartPlateList::delete_plate(int index)
|
|||||||
|
|
||||||
//update render shapes
|
//update render shapes
|
||||||
Vec2d pos = compute_shape_position(i, m_plate_cols);
|
Vec2d pos = compute_shape_position(i, m_plate_cols);
|
||||||
plate->set_shape(m_shape, m_exclude_areas, m_extruder_areas, pos, m_height_to_lid, m_height_to_rod);
|
plate->set_shape(m_shape, m_exclude_areas, m_extruder_areas, m_extruder_heights, pos, m_height_to_lid, m_height_to_rod);
|
||||||
}
|
}
|
||||||
|
|
||||||
//update current_plate if delete current
|
//update current_plate if delete current
|
||||||
@@ -4012,7 +4013,7 @@ int PartPlateList::delete_plate(int index)
|
|||||||
{
|
{
|
||||||
//update the origin of each plate
|
//update the origin of each plate
|
||||||
update_all_plates_pos_and_size();
|
update_all_plates_pos_and_size();
|
||||||
set_shapes(m_shape, m_exclude_areas, m_extruder_areas, m_logo_texture_filename, m_height_to_lid, m_height_to_rod);
|
set_shapes(m_shape, m_exclude_areas, m_extruder_areas, m_extruder_heights, m_logo_texture_filename, m_height_to_lid, m_height_to_rod);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -5109,12 +5110,13 @@ void PartPlateList::select_plate_view()
|
|||||||
m_plater->get_camera().select_view("topfront");
|
m_plater->get_camera().select_view("topfront");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PartPlateList::set_shapes(const Pointfs& shape, const Pointfs& exclude_areas, const std::vector<Pointfs>& extruder_areas, const std::string& texture_filename, float height_to_lid, float height_to_rod)
|
bool PartPlateList::set_shapes(const Pointfs& shape, const Pointfs& exclude_areas, const std::vector<Pointfs>& extruder_areas, const std::vector<double>& extruder_heights, const std::string& texture_filename, float height_to_lid, float height_to_rod)
|
||||||
{
|
{
|
||||||
const std::lock_guard<std::mutex> local_lock(m_plates_mutex);
|
const std::lock_guard<std::mutex> local_lock(m_plates_mutex);
|
||||||
m_shape = shape;
|
m_shape = shape;
|
||||||
m_exclude_areas = exclude_areas;
|
m_exclude_areas = exclude_areas;
|
||||||
m_extruder_areas = extruder_areas;
|
m_extruder_areas = extruder_areas;
|
||||||
|
m_extruder_heights = extruder_heights;
|
||||||
m_height_to_lid = height_to_lid;
|
m_height_to_lid = height_to_lid;
|
||||||
m_height_to_rod = height_to_rod;
|
m_height_to_rod = height_to_rod;
|
||||||
|
|
||||||
@@ -5128,7 +5130,7 @@ bool PartPlateList::set_shapes(const Pointfs& shape, const Pointfs& exclude_area
|
|||||||
Vec2d pos;
|
Vec2d pos;
|
||||||
|
|
||||||
pos = compute_shape_position(i, m_plate_cols);
|
pos = compute_shape_position(i, m_plate_cols);
|
||||||
plate->set_shape(shape, exclude_areas, extruder_areas, pos, height_to_lid, height_to_rod);
|
plate->set_shape(shape, exclude_areas, extruder_areas, extruder_heights, pos, height_to_lid, height_to_rod);
|
||||||
}
|
}
|
||||||
is_load_bedtype_textures = false; //reload textures
|
is_load_bedtype_textures = false; //reload textures
|
||||||
is_load_extruder_only_area_textures = false; // reload textures
|
is_load_extruder_only_area_textures = false; // reload textures
|
||||||
@@ -5308,7 +5310,7 @@ int PartPlateList::rebuild_plates_after_deserialize(std::vector<bool>& previous_
|
|||||||
}
|
}
|
||||||
update_plate_cols();
|
update_plate_cols();
|
||||||
update_all_plates_pos_and_size(false, false, false, false);
|
update_all_plates_pos_and_size(false, false, false, false);
|
||||||
set_shapes(m_shape, m_exclude_areas, m_extruder_areas, m_logo_texture_filename, m_height_to_lid, m_height_to_rod);
|
set_shapes(m_shape, m_exclude_areas, m_extruder_areas, m_extruder_heights, m_logo_texture_filename, m_height_to_lid, m_height_to_rod);
|
||||||
for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
|
for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
|
||||||
{
|
{
|
||||||
bool need_reset_print = false;
|
bool need_reset_print = false;
|
||||||
@@ -5643,7 +5645,7 @@ int PartPlateList::load_gcode_files()
|
|||||||
//BoundingBoxf3 print_volume = m_plate_list[i]->get_bounding_box(false);
|
//BoundingBoxf3 print_volume = m_plate_list[i]->get_bounding_box(false);
|
||||||
//print_volume.max(2) = this->m_plate_height;
|
//print_volume.max(2) = this->m_plate_height;
|
||||||
//print_volume.min(2) = -1e10;
|
//print_volume.min(2) = -1e10;
|
||||||
m_model->update_print_volume_state({m_plate_list[i]->get_shape(), (double)this->m_plate_height, m_plate_list[i]->get_extruder_areas() });
|
m_model->update_print_volume_state({m_plate_list[i]->get_shape(), (double)this->m_plate_height, m_plate_list[i]->get_extruder_areas(), m_plate_list[i]->get_extruder_heights() });
|
||||||
|
|
||||||
if (!m_plate_list[i]->load_gcode_from_file(m_plate_list[i]->m_gcode_path_from_3mf))
|
if (!m_plate_list[i]->load_gcode_from_file(m_plate_list[i]->m_gcode_path_from_3mf))
|
||||||
ret ++;
|
ret ++;
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ private:
|
|||||||
Pointfs m_shape;
|
Pointfs m_shape;
|
||||||
Pointfs m_exclude_area;
|
Pointfs m_exclude_area;
|
||||||
std::vector<Pointfs> m_extruder_areas;
|
std::vector<Pointfs> m_extruder_areas;
|
||||||
|
std::vector<double> m_extruder_heights;
|
||||||
BoundingBoxf3 m_bounding_box;
|
BoundingBoxf3 m_bounding_box;
|
||||||
BoundingBoxf3 m_extended_bounding_box;
|
BoundingBoxf3 m_extended_bounding_box;
|
||||||
mutable std::vector<BoundingBoxf3> m_exclude_bounding_box;
|
mutable std::vector<BoundingBoxf3> m_exclude_bounding_box;
|
||||||
@@ -365,8 +366,9 @@ public:
|
|||||||
|
|
||||||
/*rendering related functions*/
|
/*rendering related functions*/
|
||||||
const Pointfs& get_shape() const { return m_shape; }
|
const Pointfs& get_shape() const { return m_shape; }
|
||||||
bool set_shape(const Pointfs& shape, const Pointfs& exclude_areas, const std::vector<Pointfs>& extruder_areas, Vec2d position, float height_to_lid, float height_to_rod);
|
bool set_shape(const Pointfs& shape, const Pointfs& exclude_areas, const std::vector<Pointfs>& extruder_areas, const std::vector<double>& extruder_heights, Vec2d position, float height_to_lid, float height_to_rod);
|
||||||
const std::vector<Pointfs>& get_extruder_areas() const { return m_extruder_areas; }
|
const std::vector<Pointfs>& get_extruder_areas() const { return m_extruder_areas; }
|
||||||
|
const std::vector<double>& get_extruder_heights() const { return m_extruder_heights; }
|
||||||
bool contains(const Vec3d& point) const;
|
bool contains(const Vec3d& point) const;
|
||||||
bool contains(const GLVolume& v) const;
|
bool contains(const GLVolume& v) const;
|
||||||
bool contains(const BoundingBoxf3& bb) const;
|
bool contains(const BoundingBoxf3& bb) const;
|
||||||
@@ -571,6 +573,7 @@ class PartPlateList : public ObjectBase
|
|||||||
Pointfs m_shape;
|
Pointfs m_shape;
|
||||||
Pointfs m_exclude_areas;
|
Pointfs m_exclude_areas;
|
||||||
std::vector<Pointfs> m_extruder_areas;
|
std::vector<Pointfs> m_extruder_areas;
|
||||||
|
std::vector<double> m_extruder_heights;
|
||||||
BoundingBoxf3 m_bounding_box;
|
BoundingBoxf3 m_bounding_box;
|
||||||
bool m_intialized;
|
bool m_intialized;
|
||||||
std::string m_logo_texture_filename;
|
std::string m_logo_texture_filename;
|
||||||
@@ -830,7 +833,7 @@ public:
|
|||||||
int select_plate_by_obj(int obj_index, int instance_index);
|
int select_plate_by_obj(int obj_index, int instance_index);
|
||||||
void calc_bounding_boxes();
|
void calc_bounding_boxes();
|
||||||
void select_plate_view();
|
void select_plate_view();
|
||||||
bool set_shapes(const Pointfs& shape, const Pointfs& exclude_areas, const std::vector<Pointfs>& extruder_areas, const std::string& custom_texture, float height_to_lid, float height_to_rod);
|
bool set_shapes(const Pointfs& shape, const Pointfs& exclude_areas, const std::vector<Pointfs>& extruder_areas, const std::vector<double>& extruder_heights, const std::string& custom_texture, float height_to_lid, float height_to_rod);
|
||||||
void set_hover_id(int id);
|
void set_hover_id(int id);
|
||||||
void reset_hover_id();
|
void reset_hover_id();
|
||||||
bool intersects(const BoundingBoxf3 &bb);
|
bool intersects(const BoundingBoxf3 &bb);
|
||||||
|
|||||||
@@ -2953,7 +2953,7 @@ struct Plater::priv
|
|||||||
// fills the m_bed.m_grid_lines and sets m_bed.m_origin.
|
// fills the m_bed.m_grid_lines and sets m_bed.m_origin.
|
||||||
// Sets m_bed.m_polygon to limit the object placement.
|
// Sets m_bed.m_polygon to limit the object placement.
|
||||||
//BBS: add bed exclude area
|
//BBS: add bed exclude area
|
||||||
void set_bed_shape(const Pointfs& shape, const Pointfs& exclude_areas, const double printable_height, std::vector<Pointfs> extruder_areas, const std::string& custom_texture, const std::string& custom_model, bool force_as_custom = false);
|
void set_bed_shape(const Pointfs& shape, const Pointfs& exclude_areas, const double printable_height, std::vector<Pointfs> extruder_areas, std::vector<double> extruder_heights, const std::string& custom_texture, const std::string& custom_model, bool force_as_custom = false);
|
||||||
|
|
||||||
bool can_delete() const;
|
bool can_delete() const;
|
||||||
bool can_delete_all() const;
|
bool can_delete_all() const;
|
||||||
@@ -5622,7 +5622,7 @@ void Plater::priv::update_print_volume_state()
|
|||||||
{
|
{
|
||||||
//BBS: use the plate's bounding box instead of the bed's
|
//BBS: use the plate's bounding box instead of the bed's
|
||||||
PartPlate* pp = partplate_list.get_curr_plate();
|
PartPlate* pp = partplate_list.get_curr_plate();
|
||||||
BuildVolume build_volume(pp->get_shape(), this->bed.build_volume().printable_height(), this->bed.build_volume().extruder_areas());
|
BuildVolume build_volume(pp->get_shape(), this->bed.build_volume().printable_height(), this->bed.build_volume().extruder_areas(), this->bed.build_volume().extruder_heights());
|
||||||
this->model.update_print_volume_state(build_volume);
|
this->model.update_print_volume_state(build_volume);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8728,7 +8728,7 @@ bool Plater::priv::show_publish_dlg(bool show)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//BBS: add bed exclude area
|
//BBS: add bed exclude area
|
||||||
void Plater::priv::set_bed_shape(const Pointfs& shape, const Pointfs& exclude_areas, const double printable_height, std::vector<Pointfs> extruder_areas, const std::string& custom_texture, const std::string& custom_model, bool force_as_custom)
|
void Plater::priv::set_bed_shape(const Pointfs& shape, const Pointfs& exclude_areas, const double printable_height, std::vector<Pointfs> extruder_areas, std::vector<double> extruder_heights, const std::string& custom_texture, const std::string& custom_model, bool force_as_custom)
|
||||||
{
|
{
|
||||||
//Orca: reduce resolution for large bed printer
|
//Orca: reduce resolution for large bed printer
|
||||||
BoundingBoxf bed_size = get_extents(shape);
|
BoundingBoxf bed_size = get_extents(shape);
|
||||||
@@ -8739,7 +8739,7 @@ void Plater::priv::set_bed_shape(const Pointfs& shape, const Pointfs& exclude_ar
|
|||||||
|
|
||||||
//BBS: add shape position
|
//BBS: add shape position
|
||||||
Vec2d shape_position = partplate_list.get_current_shape_position();
|
Vec2d shape_position = partplate_list.get_current_shape_position();
|
||||||
bool new_shape = bed.set_shape(shape, printable_height, extruder_areas, custom_model, force_as_custom, shape_position);
|
bool new_shape = bed.set_shape(shape, printable_height, extruder_areas, extruder_heights, custom_model, force_as_custom, shape_position);
|
||||||
|
|
||||||
float prev_height_lid, prev_height_rod;
|
float prev_height_lid, prev_height_rod;
|
||||||
partplate_list.get_height_limits(prev_height_lid, prev_height_rod);
|
partplate_list.get_height_limits(prev_height_lid, prev_height_rod);
|
||||||
@@ -8763,11 +8763,11 @@ void Plater::priv::set_bed_shape(const Pointfs& shape, const Pointfs& exclude_ar
|
|||||||
|
|
||||||
//Pointfs& exclude_areas = config->option<ConfigOptionPoints>("bed_exclude_area")->values;
|
//Pointfs& exclude_areas = config->option<ConfigOptionPoints>("bed_exclude_area")->values;
|
||||||
partplate_list.reset_size(max.x() - min.x() - Bed3D::Axes::DefaultTipRadius, max.y() - min.y() - Bed3D::Axes::DefaultTipRadius, z);
|
partplate_list.reset_size(max.x() - min.x() - Bed3D::Axes::DefaultTipRadius, max.y() - min.y() - Bed3D::Axes::DefaultTipRadius, z);
|
||||||
partplate_list.set_shapes(shape, exclude_areas, extruder_areas, custom_texture, height_to_lid, height_to_rod);
|
partplate_list.set_shapes(shape, exclude_areas, extruder_areas, extruder_heights, custom_texture, height_to_lid, height_to_rod);
|
||||||
|
|
||||||
Vec2d new_shape_position = partplate_list.get_current_shape_position();
|
Vec2d new_shape_position = partplate_list.get_current_shape_position();
|
||||||
if (shape_position != new_shape_position)
|
if (shape_position != new_shape_position)
|
||||||
bed.set_shape(shape, printable_height, extruder_areas, custom_model, force_as_custom, new_shape_position);
|
bed.set_shape(shape, printable_height, extruder_areas, extruder_heights, custom_model, force_as_custom, new_shape_position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -13880,14 +13880,15 @@ void Plater::set_bed_shape() const
|
|||||||
p->config->option<ConfigOptionPoints>("bed_exclude_area")->values,
|
p->config->option<ConfigOptionPoints>("bed_exclude_area")->values,
|
||||||
p->config->option<ConfigOptionFloat>("printable_height")->value,
|
p->config->option<ConfigOptionFloat>("printable_height")->value,
|
||||||
p->config->option<ConfigOptionPointsGroups>("extruder_printable_area")->values,
|
p->config->option<ConfigOptionPointsGroups>("extruder_printable_area")->values,
|
||||||
|
p->config->option<ConfigOptionFloatsNullable>("extruder_printable_height")->values,
|
||||||
p->config->option<ConfigOptionString>("bed_custom_texture")->value.empty() ? texture_filename : p->config->option<ConfigOptionString>("bed_custom_texture")->value,
|
p->config->option<ConfigOptionString>("bed_custom_texture")->value.empty() ? texture_filename : p->config->option<ConfigOptionString>("bed_custom_texture")->value,
|
||||||
p->config->option<ConfigOptionString>("bed_custom_model")->value);
|
p->config->option<ConfigOptionString>("bed_custom_model")->value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//BBS: add bed exclude area
|
//BBS: add bed exclude area
|
||||||
void Plater::set_bed_shape(const Pointfs& shape, const Pointfs& exclude_area, const double printable_height, std::vector<Pointfs> extruder_areas, const std::string& custom_texture, const std::string& custom_model, bool force_as_custom) const
|
void Plater::set_bed_shape(const Pointfs& shape, const Pointfs& exclude_area, const double printable_height, std::vector<Pointfs> extruder_areas, std::vector<double> extruder_heights, const std::string& custom_texture, const std::string& custom_model, bool force_as_custom) const
|
||||||
{
|
{
|
||||||
p->set_bed_shape(make_counter_clockwise(shape), exclude_area, printable_height, extruder_areas, custom_texture, custom_model, force_as_custom);
|
p->set_bed_shape(make_counter_clockwise(shape), exclude_area, printable_height, extruder_areas, extruder_heights, custom_texture, custom_model, force_as_custom);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Plater::force_filament_colors_update()
|
void Plater::force_filament_colors_update()
|
||||||
|
|||||||
@@ -674,7 +674,7 @@ public:
|
|||||||
void update_flush_volume_matrix(size_t old_nozzle_size, size_t new_nozzle_size);
|
void update_flush_volume_matrix(size_t old_nozzle_size, size_t new_nozzle_size);
|
||||||
//BBS: add bed exclude area
|
//BBS: add bed exclude area
|
||||||
void set_bed_shape() const;
|
void set_bed_shape() const;
|
||||||
void set_bed_shape(const Pointfs& shape, const Pointfs& exclude_area, const double printable_height, std::vector<Pointfs> extruder_areas, const std::string& custom_texture, const std::string& custom_model, bool force_as_custom = false) const;
|
void set_bed_shape(const Pointfs& shape, const Pointfs& exclude_area, const double printable_height, std::vector<Pointfs> extruder_areas, std::vector<double> extruder_heights, const std::string& custom_texture, const std::string& custom_model, bool force_as_custom = false) const;
|
||||||
|
|
||||||
const NotificationManager* get_notification_manager() const;
|
const NotificationManager* get_notification_manager() const;
|
||||||
NotificationManager* get_notification_manager();
|
NotificationManager* get_notification_manager();
|
||||||
|
|||||||
@@ -1012,6 +1012,7 @@ bool CalibUtils::process_and_store_3mf(Model *model, const DynamicPrintConfig &f
|
|||||||
{
|
{
|
||||||
Pointfs bedfs = make_counter_clockwise(full_config.opt<ConfigOptionPoints>("printable_area")->values);
|
Pointfs bedfs = make_counter_clockwise(full_config.opt<ConfigOptionPoints>("printable_area")->values);
|
||||||
std::vector<Pointfs> extruder_areas = full_config.option<ConfigOptionPointsGroups>("extruder_printable_area")->values;
|
std::vector<Pointfs> extruder_areas = full_config.option<ConfigOptionPointsGroups>("extruder_printable_area")->values;
|
||||||
|
std::vector<double> extruder_heights = full_config.option<ConfigOptionFloatsNullable>("extruder_printable_height")->values;
|
||||||
double print_height = full_config.opt_float("printable_height");
|
double print_height = full_config.opt_float("printable_height");
|
||||||
double current_width = bedfs[2].x() - bedfs[0].x();
|
double current_width = bedfs[2].x() - bedfs[0].x();
|
||||||
double current_depth = bedfs[2].y() - bedfs[0].y();
|
double current_depth = bedfs[2].y() - bedfs[0].y();
|
||||||
@@ -1058,7 +1059,7 @@ bool CalibUtils::process_and_store_3mf(Model *model, const DynamicPrintConfig &f
|
|||||||
int print_index;
|
int print_index;
|
||||||
part_plate->get_print(&print, &gcode_result, &print_index);
|
part_plate->get_print(&print, &gcode_result, &print_index);
|
||||||
|
|
||||||
BuildVolume build_volume(bedfs, print_height, extruder_areas);
|
BuildVolume build_volume(bedfs, print_height, extruder_areas, extruder_heights);
|
||||||
unsigned int count = model->update_print_volume_state(build_volume);
|
unsigned int count = model->update_print_volume_state(build_volume);
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
error_message = _L("Unable to calibrate: maybe because the set calibration value range is too large, or the step is too small");
|
error_message = _L("Unable to calibrate: maybe because the set calibration value range is too large, or the step is too small");
|
||||||
|
|||||||
Reference in New Issue
Block a user