Merge branch 'main' into dev/p2s-pr
This commit is contained in:
@@ -214,6 +214,9 @@ void AppConfig::set_defaults()
|
||||
|
||||
if (get("show_outline").empty())
|
||||
set_bool("show_outline", false);
|
||||
|
||||
if (get("show_axes").empty())
|
||||
set_bool("show_axes", true);
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
|
||||
@@ -227,8 +227,8 @@ struct SurfaceFillParams
|
||||
coordf_t overlap = 0.;
|
||||
// Angle as provided by the region config, in radians.
|
||||
float angle = 0.f;
|
||||
// Orca: is_using_template_angle
|
||||
bool is_using_template_angle = false;
|
||||
// Orca: fixed_angle
|
||||
bool fixed_angle = false;
|
||||
// Is bridging used for this fill? Bridging parameters may be used even if this->flow.bridge() is not set.
|
||||
bool bridge;
|
||||
// Non-negative for a bridge.
|
||||
@@ -284,7 +284,7 @@ struct SurfaceFillParams
|
||||
RETURN_COMPARE_NON_EQUAL(spacing);
|
||||
RETURN_COMPARE_NON_EQUAL(overlap);
|
||||
RETURN_COMPARE_NON_EQUAL(angle);
|
||||
RETURN_COMPARE_NON_EQUAL(is_using_template_angle);
|
||||
RETURN_COMPARE_NON_EQUAL(fixed_angle);
|
||||
RETURN_COMPARE_NON_EQUAL(density);
|
||||
RETURN_COMPARE_NON_EQUAL(multiline);
|
||||
// RETURN_COMPARE_NON_EQUAL_TYPED(unsigned, dont_adjust);
|
||||
@@ -313,7 +313,7 @@ struct SurfaceFillParams
|
||||
this->spacing == rhs.spacing &&
|
||||
this->overlap == rhs.overlap &&
|
||||
this->angle == rhs.angle &&
|
||||
this->is_using_template_angle == rhs.is_using_template_angle &&
|
||||
this->fixed_angle == rhs.fixed_angle &&
|
||||
this->bridge == rhs.bridge &&
|
||||
this->bridge_angle == rhs.bridge_angle &&
|
||||
this->density == rhs.density &&
|
||||
@@ -902,11 +902,11 @@ std::vector<SurfaceFill> group_fills(const Layer &layer, LockRegionParam &lock_p
|
||||
if (params.extrusion_role == erInternalInfill) {
|
||||
params.angle = calculate_infill_rotation_angle(layer.object(), layer.id(), region_config.infill_direction.value,
|
||||
region_config.sparse_infill_rotate_template.value);
|
||||
params.is_using_template_angle = !region_config.sparse_infill_rotate_template.value.empty();
|
||||
params.fixed_angle = !region_config.sparse_infill_rotate_template.value.empty();
|
||||
} else {
|
||||
params.angle = calculate_infill_rotation_angle(layer.object(), layer.id(), region_config.solid_infill_direction.value,
|
||||
region_config.solid_infill_rotate_template.value);
|
||||
params.is_using_template_angle = !region_config.solid_infill_rotate_template.value.empty();
|
||||
params.fixed_angle = !region_config.solid_infill_rotate_template.value.empty();
|
||||
}
|
||||
params.bridge_angle = float(surface.bridge_angle);
|
||||
|
||||
@@ -1094,7 +1094,7 @@ std::vector<SurfaceFill> group_fills(const Layer &layer, LockRegionParam &lock_p
|
||||
const PrintRegionConfig ®ion_config = layerm.region().config();
|
||||
params.angle = calculate_infill_rotation_angle(layer.object(), layer.id(), region_config.solid_infill_direction.value,
|
||||
region_config.solid_infill_rotate_template.value);
|
||||
params.is_using_template_angle = !region_config.solid_infill_rotate_template.value.empty();
|
||||
params.fixed_angle = !region_config.solid_infill_rotate_template.value.empty();
|
||||
|
||||
// calculate the actual flow we'll be using for this infill
|
||||
params.flow = layerm.flow(frSolidInfill);
|
||||
@@ -1199,7 +1199,7 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive:
|
||||
f->layer_id = this->id();
|
||||
f->z = this->print_z;
|
||||
f->angle = surface_fill.params.angle;
|
||||
f->is_using_template_angle = surface_fill.params.is_using_template_angle;
|
||||
f->fixed_angle = surface_fill.params.fixed_angle;
|
||||
f->adapt_fill_octree = (surface_fill.params.pattern == ipSupportCubic) ? support_fill_octree : adaptive_fill_octree;
|
||||
f->print_config = &this->object()->print()->config();
|
||||
f->print_object_config = &this->object()->config();
|
||||
@@ -1389,7 +1389,7 @@ Polylines Layer::generate_sparse_infill_polylines_for_anchoring(FillAdaptive::Oc
|
||||
f->layer_id = this->id() - this->object()->get_layer(0)->id(); // We need to subtract raft layers.
|
||||
f->z = this->print_z;
|
||||
f->angle = surface_fill.params.angle;
|
||||
f->is_using_template_angle = surface_fill.params.is_using_template_angle;
|
||||
f->fixed_angle = surface_fill.params.fixed_angle;
|
||||
f->adapt_fill_octree = (surface_fill.params.pattern == ipSupportCubic) ? support_fill_octree : adaptive_fill_octree;
|
||||
f->print_config = &this->object()->print()->config();
|
||||
f->print_object_config = &this->object()->config();
|
||||
@@ -1462,7 +1462,7 @@ void Layer::make_ironing()
|
||||
double height;
|
||||
double speed;
|
||||
double angle;
|
||||
bool is_using_template_angle;
|
||||
bool fixed_angle;
|
||||
double inset;
|
||||
|
||||
bool operator<(const IroningParams &rhs) const {
|
||||
@@ -1472,7 +1472,7 @@ void Layer::make_ironing()
|
||||
RETURN_COMPARE_NON_EQUAL(height);
|
||||
RETURN_COMPARE_NON_EQUAL(speed);
|
||||
RETURN_COMPARE_NON_EQUAL(angle);
|
||||
RETURN_COMPARE_NON_EQUAL(is_using_template_angle);
|
||||
RETURN_COMPARE_NON_EQUAL(fixed_angle);
|
||||
RETURN_COMPARE_NON_EQUAL(inset);
|
||||
return false;
|
||||
}
|
||||
@@ -1484,7 +1484,7 @@ void Layer::make_ironing()
|
||||
this->height == rhs.height &&
|
||||
this->speed == rhs.speed &&
|
||||
this->angle == rhs.angle &&
|
||||
this->is_using_template_angle == rhs.is_using_template_angle &&
|
||||
this->fixed_angle == rhs.fixed_angle &&
|
||||
this->pattern == rhs.pattern &&
|
||||
this->inset == rhs.inset;
|
||||
}
|
||||
@@ -1533,8 +1533,8 @@ void Layer::make_ironing()
|
||||
ironing_params.inset = config.ironing_inset;
|
||||
ironing_params.height = default_layer_height * 0.01 * config.ironing_flow;
|
||||
ironing_params.speed = config.ironing_speed;
|
||||
ironing_params.angle = calculate_infill_rotation_angle(this->object(), this->id(), config.solid_infill_direction.value, config.solid_infill_rotate_template.value) + config.ironing_angle * M_PI / 180.;
|
||||
ironing_params.is_using_template_angle = !config.solid_infill_rotate_template.value.empty();
|
||||
ironing_params.angle = (config.ironing_angle_fixed ? 0 : calculate_infill_rotation_angle(this->object(), this->id(), config.solid_infill_direction.value, config.solid_infill_rotate_template.value)) + config.ironing_angle * M_PI / 180.;
|
||||
ironing_params.fixed_angle = config.ironing_angle_fixed || !config.solid_infill_rotate_template.value.empty();
|
||||
ironing_params.pattern = config.ironing_pattern;
|
||||
ironing_params.layerm = layerm;
|
||||
by_extruder.emplace_back(ironing_params);
|
||||
@@ -1630,7 +1630,7 @@ void Layer::make_ironing()
|
||||
// Create the filler object.
|
||||
f->spacing = ironing_params.line_spacing;
|
||||
f->angle = float(ironing_params.angle);
|
||||
f->is_using_template_angle = ironing_params.is_using_template_angle;
|
||||
f->fixed_angle = ironing_params.fixed_angle;
|
||||
f->link_max_length = (coord_t) scale_(3. * f->spacing);
|
||||
double extrusion_height = ironing_params.height * f->spacing / nozzle_dmr;
|
||||
float extrusion_width = Flow::rounded_rectangle_extrusion_width_from_spacing(float(nozzle_dmr), float(extrusion_height));
|
||||
|
||||
@@ -304,11 +304,10 @@ std::pair<float, Point> Fill::_infill_direction(const Surface *surface) const
|
||||
printf("Filling bridge with angle %f\n", surface->bridge_angle);
|
||||
#endif /* SLIC3R_DEBUG */
|
||||
out_angle = float(surface->bridge_angle);
|
||||
} else if (this->layer_id != size_t(-1)) {
|
||||
} else if (this->layer_id != size_t(-1) && !fixed_angle) {
|
||||
// alternate fill direction
|
||||
//Orca: if template angle is not empty, don't apply layer angle
|
||||
if(!is_using_template_angle)
|
||||
out_angle += this->_layer_angle(this->layer_id / surface->thickness_layers);
|
||||
//Orca: Do not alternate direction if Fill.fixed_angle is true
|
||||
out_angle += this->_layer_angle(this->layer_id / surface->thickness_layers);
|
||||
} else {
|
||||
// printf("Layer_ID undefined!\n");
|
||||
}
|
||||
|
||||
@@ -119,8 +119,9 @@ public:
|
||||
coordf_t overlap;
|
||||
// in radians, ccw, 0 = East
|
||||
float angle;
|
||||
// Orca: is_using_template_angle
|
||||
bool is_using_template_angle{false};
|
||||
|
||||
// Orca: Fill direction is fixed absolute angle if SurfaceFillParams.fixed_angle or config.ironing_angle_fixed
|
||||
bool fixed_angle{false};
|
||||
// In scaled coordinates. Maximum lenght of a perimeter segment connecting two infill lines.
|
||||
// Used by the FillRectilinear2, FillGrid2, FillTriangles, FillStars and FillCubic.
|
||||
// If left to zero, the links will not be limited.
|
||||
@@ -203,7 +204,7 @@ protected:
|
||||
ExPolygon expolygon,
|
||||
ThickPolylines& thick_polylines_out) {}
|
||||
|
||||
virtual float _layer_angle(size_t idx) const { return is_using_template_angle ? 0.f : (idx & 1) ? float(M_PI/2.) : 0.f; }
|
||||
virtual float _layer_angle(size_t idx) const { return fixed_angle ? 0.f : (idx & 1) ? float(M_PI/2.) : 0.f; }
|
||||
|
||||
virtual std::pair<float, Point> _infill_direction(const Surface *surface) const;
|
||||
|
||||
|
||||
@@ -1290,7 +1290,7 @@ static std::vector<Vec2d> get_path_of_change_filament(const Print& print)
|
||||
std::string WipeTowerIntegration::prime(GCode &gcodegen)
|
||||
{
|
||||
std::string gcode;
|
||||
if (!gcodegen.is_BBL_Printer()) {
|
||||
if (!gcodegen.is_BBL_Printer() && !gcodegen.is_QIDI_Printer()) {
|
||||
for (const WipeTower::ToolChangeResult &tcr : m_priming) {
|
||||
if (!tcr.extrusions.empty())
|
||||
gcode += append_tcr2(gcodegen, tcr, tcr.new_tool);
|
||||
@@ -1306,7 +1306,7 @@ static std::vector<Vec2d> get_path_of_change_filament(const Print& print)
|
||||
assert(m_layer_idx >= 0);
|
||||
if (m_layer_idx >= (int) m_tool_changes.size())
|
||||
return gcode;
|
||||
if (!gcodegen.is_BBL_Printer()) {
|
||||
if (!gcodegen.is_BBL_Printer() && !gcodegen.is_QIDI_Printer()) {
|
||||
if (gcodegen.writer().need_toolchange(extruder_id) || finish_layer) {
|
||||
if (m_layer_idx < (int) m_tool_changes.size()) {
|
||||
if (!(size_t(m_tool_change_idx) < m_tool_changes[m_layer_idx].size()))
|
||||
@@ -1395,7 +1395,7 @@ static std::vector<Vec2d> get_path_of_change_filament(const Print& print)
|
||||
std::string WipeTowerIntegration::finalize(GCode &gcodegen)
|
||||
{
|
||||
std::string gcode;
|
||||
if (!gcodegen.is_BBL_Printer()) {
|
||||
if (!gcodegen.is_BBL_Printer() && !gcodegen.is_QIDI_Printer()) {
|
||||
if (std::abs(gcodegen.writer().get_position().z() - m_final_purge.print_z) > EPSILON)
|
||||
gcode += gcodegen.change_layer(m_final_purge.print_z);
|
||||
gcode += append_tcr2(gcodegen, m_final_purge, -1);
|
||||
@@ -1817,6 +1817,13 @@ bool GCode::is_BBL_Printer()
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GCode::is_QIDI_Printer()
|
||||
{
|
||||
if (m_curr_print)
|
||||
return m_curr_print->is_QIDI_printer();
|
||||
return false;
|
||||
}
|
||||
|
||||
void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* result, ThumbnailsGeneratorCallback thumbnail_cb)
|
||||
{
|
||||
PROFILE_CLEAR();
|
||||
@@ -2226,6 +2233,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
||||
// modifies m_silent_time_estimator_enabled
|
||||
DoExport::init_gcode_processor(print.config(), m_processor, m_silent_time_estimator_enabled);
|
||||
const bool is_bbl_printers = print.is_BBL_printer();
|
||||
const bool is_qidi_printers = print.is_QIDI_printer();
|
||||
m_calib_config.clear();
|
||||
// resets analyzer's tracking data
|
||||
m_last_height = 0.f;
|
||||
@@ -2516,7 +2524,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
||||
throw Slic3r::SlicingError(_(L("No object can be printed. Maybe too small")));
|
||||
has_wipe_tower = print.has_wipe_tower() && tool_ordering.has_wipe_tower();
|
||||
// Orca: support all extruder priming
|
||||
initial_extruder_id = (!is_bbl_printers && has_wipe_tower && !print.config().single_extruder_multi_material_priming) ?
|
||||
initial_extruder_id = (!is_bbl_printers && has_wipe_tower && !print.config().single_extruder_multi_material_priming && !is_qidi_printers) ?
|
||||
// The priming towers will be skipped.
|
||||
tool_ordering.all_extruders().back() :
|
||||
// Don't skip the priming towers.
|
||||
|
||||
@@ -250,6 +250,7 @@ public:
|
||||
std::string unretract() { return m_writer.unlift() + m_writer.unretract(); }
|
||||
std::string set_extruder(unsigned int extruder_id, double print_z, bool by_object=false);
|
||||
bool is_BBL_Printer();
|
||||
bool is_QIDI_Printer();
|
||||
|
||||
// SoftFever
|
||||
std::string set_object_info(Print* print);
|
||||
|
||||
@@ -888,7 +888,7 @@ static std::vector<std::string> s_Preset_print_options {
|
||||
"infill_direction", "solid_infill_direction", "counterbore_hole_bridging","infill_shift_step", "sparse_infill_rotate_template", "solid_infill_rotate_template", "symmetric_infill_y_axis","skeleton_infill_density", "infill_lock_depth", "skin_infill_depth", "skin_infill_density",
|
||||
"align_infill_direction_to_model", "extra_solid_infills",
|
||||
"minimum_sparse_infill_area", "reduce_infill_retraction","internal_solid_infill_pattern","gap_fill_target",
|
||||
"ironing_type", "ironing_pattern", "ironing_flow", "ironing_speed", "ironing_spacing", "ironing_angle", "ironing_inset",
|
||||
"ironing_type", "ironing_pattern", "ironing_flow", "ironing_speed", "ironing_spacing", "ironing_angle", "ironing_angle_fixed", "ironing_inset",
|
||||
"support_ironing", "support_ironing_pattern", "support_ironing_flow", "support_ironing_spacing",
|
||||
"max_travel_detour_distance",
|
||||
"fuzzy_skin", "fuzzy_skin_thickness", "fuzzy_skin_point_distance", "fuzzy_skin_first_layer", "fuzzy_skin_noise_type", "fuzzy_skin_mode", "fuzzy_skin_scale", "fuzzy_skin_octaves", "fuzzy_skin_persistence",
|
||||
|
||||
@@ -535,6 +535,9 @@ VendorType PresetBundle::get_current_vendor_type()
|
||||
{
|
||||
if(vendor_name.compare("BBL") == 0)
|
||||
t = VendorType::Marlin_BBL;
|
||||
|
||||
if(vendor_name.compare("Qidi") == 0)
|
||||
t = VendorType::Klipper_Qidi;
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,8 @@ enum class VendorType {
|
||||
Unknown = 0,
|
||||
Klipper,
|
||||
Marlin,
|
||||
Marlin_BBL
|
||||
Marlin_BBL,
|
||||
Klipper_Qidi
|
||||
};
|
||||
namespace Slic3r {
|
||||
|
||||
@@ -144,6 +145,8 @@ public:
|
||||
VendorType get_current_vendor_type();
|
||||
// Vendor related handy functions
|
||||
bool is_bbl_vendor() { return get_current_vendor_type() == VendorType::Marlin_BBL; }
|
||||
bool is_qidi_vendor() { return get_current_vendor_type() == VendorType::Klipper_Qidi; }
|
||||
|
||||
// Whether using bbl network for print upload
|
||||
bool use_bbl_network();
|
||||
// Whether using bbl's device tab
|
||||
|
||||
@@ -3079,7 +3079,7 @@ void Print::_make_wipe_tower()
|
||||
// BBS
|
||||
const unsigned int number_of_extruders = (unsigned int)(m_config.filament_colour.values.size());
|
||||
|
||||
const auto bUseWipeTower2 = is_BBL_printer() ? false : true;
|
||||
const auto bUseWipeTower2 = is_BBL_printer() || is_QIDI_printer() ? false : true;
|
||||
// Let the ToolOrdering class know there will be initial priming extrusions at the start of the print.
|
||||
m_wipe_tower_data.tool_ordering = ToolOrdering(*this, (unsigned int) -1, bUseWipeTower2 ? true : false);
|
||||
m_wipe_tower_data.tool_ordering.sort_and_build_data(*this, (unsigned int)-1, bUseWipeTower2 ? true : false);
|
||||
@@ -3263,7 +3263,7 @@ void Print::_make_wipe_tower()
|
||||
wipe_volumes.push_back(std::vector<float>(flush_matrix.begin()+i*number_of_extruders, flush_matrix.begin()+(i+1)*number_of_extruders));
|
||||
|
||||
// Orca: itertate over wipe_volumes and change the non-zero values to the prime_volume
|
||||
if ((!m_config.purge_in_prime_tower || !m_config.single_extruder_multi_material) && !is_BBL_printer()) {
|
||||
if ((!m_config.purge_in_prime_tower || !m_config.single_extruder_multi_material) && !is_BBL_printer() && !is_QIDI_printer()) {
|
||||
for (unsigned int i = 0; i < number_of_extruders; ++i) {
|
||||
for (unsigned int j = 0; j < number_of_extruders; ++j) {
|
||||
if (wipe_volumes[i][j] > 0) {
|
||||
|
||||
@@ -1065,6 +1065,8 @@ public:
|
||||
//SoftFever
|
||||
bool &is_BBL_printer() { return m_isBBLPrinter; }
|
||||
const bool is_BBL_printer() const { return m_isBBLPrinter; }
|
||||
bool &is_QIDI_printer() { return m_isQIDIPrinter; }
|
||||
const bool is_QIDI_printer() const { return m_isQIDIPrinter; }
|
||||
CalibMode& calib_mode() { return m_calib_params.mode; }
|
||||
const CalibMode calib_mode() const { return m_calib_params.mode; }
|
||||
void set_calib_params(const Calib_Params& params);
|
||||
@@ -1132,6 +1134,7 @@ private:
|
||||
|
||||
//SoftFever
|
||||
bool m_isBBLPrinter;
|
||||
bool m_isQIDIPrinter;
|
||||
|
||||
// Ordered collections of extrusion paths to build skirt loops and brim.
|
||||
ExtrusionEntityCollection m_skirt;
|
||||
|
||||
@@ -3890,6 +3890,13 @@ void PrintConfigDef::init_fff_params()
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionFloat(0));
|
||||
|
||||
def = this->add("ironing_angle_fixed", coBool);
|
||||
def->label = L("Fixed ironing angle");
|
||||
def->category = L("Quality");
|
||||
def->tooltip = L("Use a fixed absolute angle for ironing.");
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionBool(false));
|
||||
|
||||
def = this->add("layer_change_gcode", coString);
|
||||
def->label = L("Layer change G-code");
|
||||
def->tooltip = L("This G-code is inserted at every layer change after the Z lift.");
|
||||
|
||||
@@ -1086,6 +1086,7 @@ PRINT_CONFIG_CLASS_DEFINE(
|
||||
((ConfigOptionFloat, ironing_direction))
|
||||
((ConfigOptionFloat, ironing_speed))
|
||||
((ConfigOptionFloat, ironing_angle))
|
||||
((ConfigOptionBool, ironing_angle_fixed))
|
||||
// Detect bridging perimeters
|
||||
((ConfigOptionBool, detect_overhang_wall))
|
||||
((ConfigOptionInt, wall_filament))
|
||||
|
||||
@@ -681,6 +681,7 @@ StringObjectException BackgroundSlicingProcess::validate(StringObjectException *
|
||||
assert(m_print == m_fff_print);
|
||||
|
||||
m_fff_print->is_BBL_printer() = wxGetApp().preset_bundle->is_bbl_vendor();
|
||||
m_fff_print->is_QIDI_printer() = wxGetApp().preset_bundle->is_qidi_vendor();
|
||||
return m_print->validate(warning, collison_polygons, height_polygons);
|
||||
}
|
||||
|
||||
|
||||
@@ -1259,6 +1259,8 @@ bool GLCanvas3D::init()
|
||||
// init dark mode status
|
||||
on_change_color_mode(wxGetApp().app_config->get("dark_color_mode") == "1", false);
|
||||
|
||||
m_show_world_axes = wxGetApp().app_config->get("show_axes") == "true";
|
||||
|
||||
BOOST_LOG_TRIVIAL(info) <<__FUNCTION__<< " enter";
|
||||
glsafe(::glClearColor(1.0f, 1.0f, 1.0f, 1.0f));
|
||||
glsafe(::glClearDepth(1.0f));
|
||||
@@ -1535,6 +1537,17 @@ ModelInstanceEPrintVolumeState GLCanvas3D::check_volumes_outside_state(ObjectFil
|
||||
return state;
|
||||
}
|
||||
|
||||
void GLCanvas3D::toggle_world_axes_visibility(bool force_show)
|
||||
{
|
||||
if (force_show) {
|
||||
m_show_world_axes = true;
|
||||
} else {
|
||||
m_show_world_axes = !m_show_world_axes;
|
||||
}
|
||||
wxGetApp().app_config->set_bool("show_axes", m_show_world_axes);
|
||||
set_as_dirty();
|
||||
}
|
||||
|
||||
void GLCanvas3D::toggle_selected_volume_visibility(bool selected_visible)
|
||||
{
|
||||
m_render_sla_auxiliaries = !selected_visible;
|
||||
@@ -2086,7 +2099,7 @@ void GLCanvas3D::render(bool only_init)
|
||||
_render_background();
|
||||
|
||||
//BBS add partplater rendering logic
|
||||
bool only_current = false, only_body = false, show_axes = true, no_partplate = false;
|
||||
bool only_current = false, only_body = false, no_partplate = false;
|
||||
bool show_grid = true;
|
||||
GLGizmosManager::EType gizmo_type = m_gizmos.get_current_type();
|
||||
if (!m_main_toolbar.is_enabled()) {
|
||||
@@ -2106,7 +2119,7 @@ void GLCanvas3D::render(bool only_init)
|
||||
_render_sla_slices();
|
||||
_render_selection();
|
||||
if (!no_partplate)
|
||||
_render_bed(camera.get_view_matrix(), camera.get_projection_matrix(), !camera.is_looking_downward(), show_axes);
|
||||
_render_bed(camera.get_view_matrix(), camera.get_projection_matrix(), !camera.is_looking_downward(), m_show_world_axes);
|
||||
if (!no_partplate) //BBS: add outline logic
|
||||
_render_platelist(camera.get_view_matrix(), camera.get_projection_matrix(), !camera.is_looking_downward(), only_current, only_body, hover_id, true, show_grid);
|
||||
_render_objects(GLVolumeCollection::ERenderType::Transparent, !m_gizmos.is_running());
|
||||
@@ -2116,7 +2129,7 @@ void GLCanvas3D::render(bool only_init)
|
||||
_render_objects(GLVolumeCollection::ERenderType::Opaque, !m_gizmos.is_running());
|
||||
_render_sla_slices();
|
||||
_render_selection();
|
||||
_render_bed(camera.get_view_matrix(), camera.get_projection_matrix(), !camera.is_looking_downward(), show_axes);
|
||||
_render_bed(camera.get_view_matrix(), camera.get_projection_matrix(), !camera.is_looking_downward(), m_show_world_axes);
|
||||
_render_platelist(camera.get_view_matrix(), camera.get_projection_matrix(), !camera.is_looking_downward(), only_current, true, hover_id);
|
||||
// BBS: GUI refactor: add canvas size as parameters
|
||||
_render_gcode(cnv_size.get_width(), cnv_size.get_height());
|
||||
@@ -2124,9 +2137,9 @@ void GLCanvas3D::render(bool only_init)
|
||||
/* assemble render*/
|
||||
else if (m_canvas_type == ECanvasType::CanvasAssembleView) {
|
||||
//BBS: add outline logic
|
||||
if (m_show_world_axes) {
|
||||
m_axes.render();
|
||||
}
|
||||
//if (m_show_world_axes) {
|
||||
// m_axes.render();
|
||||
//}
|
||||
_render_objects(GLVolumeCollection::ERenderType::Opaque, !m_gizmos.is_running());
|
||||
_render_selection();
|
||||
//_render_bed(camera.get_view_matrix(), camera.get_projection_matrix(), !camera.is_looking_downward(), show_axes);
|
||||
@@ -6073,6 +6086,7 @@ void GLCanvas3D::_render_3d_navigator()
|
||||
}
|
||||
|
||||
const float size = 128 * sc;
|
||||
m_axis_button_pos[0] = size - 10;
|
||||
const auto result = ImGuizmo::ViewManipulate(cameraView, cameraProjection, ImGuizmo::OPERATION::ROTATE, ImGuizmo::MODE::WORLD, nullptr,
|
||||
camDistance, ImVec2(viewManipulateLeft, viewManipulateTop - size), ImVec2(size, size),
|
||||
0x00101010);
|
||||
@@ -6108,6 +6122,7 @@ void GLCanvas3D::_render_3d_navigator()
|
||||
|
||||
request_extra_frame();
|
||||
}
|
||||
_render_camera_toolbar();
|
||||
}
|
||||
|
||||
#define ENABLE_THUMBNAIL_GENERATOR_DEBUG_OUTPUT 0
|
||||
@@ -8608,6 +8623,51 @@ void GLCanvas3D::_render_return_toolbar() const
|
||||
imgui.end();
|
||||
}
|
||||
|
||||
void GLCanvas3D::_render_camera_toolbar()
|
||||
{
|
||||
float font_size = ImGui::GetFontSize();
|
||||
float sc = get_scale();
|
||||
ImVec2 button_icon_size = ImVec2(font_size * 2.5, font_size * 2.5);
|
||||
|
||||
ImGuiWrapper &imgui = *wxGetApp().imgui();
|
||||
float window_width = button_icon_size.x + imgui.scaled(2.0f);
|
||||
float window_height = button_icon_size.y + imgui.scaled(2.0f);
|
||||
|
||||
Size cnv_size = get_canvas_size();
|
||||
m_axis_button_pos[1] = cnv_size.get_height() - button_icon_size[1] - 20 * sc;
|
||||
imgui.set_next_window_pos(m_axis_button_pos[0], m_axis_button_pos[1], ImGuiCond_Always, 0, 0);
|
||||
#ifdef __WINDOWS__
|
||||
imgui.set_next_window_size(window_width, window_height, ImGuiCond_Always);
|
||||
#endif
|
||||
|
||||
imgui.begin(_L("Toggle Axis"), ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoMove |
|
||||
ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse);//
|
||||
|
||||
ImTextureID normal_id = m_gizmos.get_icon_texture_id(m_is_dark ? GLGizmosManager::MENU_ICON_NAME::IC_AXIS_TOGGLE_DARK : GLGizmosManager::MENU_ICON_NAME::IC_AXIS_TOGGLE);
|
||||
ImTextureID hover_id = m_gizmos.get_icon_texture_id(m_is_dark ? GLGizmosManager::MENU_ICON_NAME::IC_AXIS_TOGGLE_DARK_HOVER : GLGizmosManager::MENU_ICON_NAME::IC_AXIS_TOGGLE_HOVER);
|
||||
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, {0, 0});
|
||||
|
||||
if (ImGui::ImageButton3(normal_id, hover_id, button_icon_size, ImVec2(0, 0), ImVec2(1, 1), -1,
|
||||
ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1), ImVec2(10, 0))) {
|
||||
//select_view("plate");
|
||||
|
||||
if (m_canvas_type == ECanvasType::CanvasView3D || m_canvas_type == ECanvasType::CanvasPreview) {
|
||||
toggle_world_axes_visibility(false);
|
||||
}
|
||||
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
auto temp_tooltip = _L("Toggle Axis");
|
||||
auto width = ImGui::CalcTextSize(temp_tooltip.c_str()).x + imgui.scaled(2.0f);
|
||||
imgui.tooltip(temp_tooltip, width);
|
||||
}
|
||||
ImGui::PopStyleVar(2);
|
||||
|
||||
imgui.end();
|
||||
}
|
||||
|
||||
void GLCanvas3D::_render_separator_toolbar_right() const
|
||||
{
|
||||
if (!m_separator_toolbar.is_enabled())
|
||||
|
||||
@@ -543,6 +543,8 @@ private:
|
||||
mutable IMToolbar m_sel_plate_toolbar;
|
||||
mutable GLToolbar m_assemble_view_toolbar;
|
||||
mutable IMReturnToolbar m_return_toolbar;
|
||||
mutable Vec2i32 m_axis_button_pos = {128, 5};
|
||||
mutable float m_sc{1};
|
||||
mutable float m_paint_toolbar_width;
|
||||
|
||||
//BBS: add canvas type for assemble view usage
|
||||
@@ -626,7 +628,7 @@ private:
|
||||
|
||||
PrinterTechnology current_printer_technology() const;
|
||||
|
||||
bool m_show_world_axes{false};
|
||||
bool m_show_world_axes{true};
|
||||
Bed3D::Axes m_axes;
|
||||
//BBS:record key botton frequency
|
||||
int auto_orient_count = 0;
|
||||
@@ -822,7 +824,7 @@ public:
|
||||
void set_color_clip_plane(const Vec3d& cp_normal, double offset) { m_volumes.set_color_clip_plane(cp_normal, offset); }
|
||||
void set_color_clip_plane_colors(const std::array<ColorRGBA, 2>& colors) { m_volumes.set_color_clip_plane_colors(colors); }
|
||||
|
||||
void set_show_world_axes(bool flag) { m_show_world_axes = flag; }
|
||||
void toggle_world_axes_visibility(bool force_show = false);
|
||||
void refresh_camera_scene_box();
|
||||
void set_color_by(const std::string& value);
|
||||
|
||||
@@ -1244,6 +1246,7 @@ private:
|
||||
void _render_imgui_select_plate_toolbar();
|
||||
void _render_assemble_view_toolbar() const;
|
||||
void _render_return_toolbar() const;
|
||||
void _render_camera_toolbar();
|
||||
void _render_separator_toolbar_right() const;
|
||||
void _render_separator_toolbar_left() const;
|
||||
void _render_collapse_toolbar() const;
|
||||
|
||||
@@ -183,8 +183,9 @@ void GLGizmosManager::switch_gizmos_icon_filename()
|
||||
|
||||
bool GLGizmosManager::init()
|
||||
{
|
||||
bool result = init_icon_textures();
|
||||
if (!result) return result;
|
||||
if (!m_gizmos.empty())
|
||||
return true;
|
||||
init_icon_textures();
|
||||
|
||||
m_background_texture.metadata.filename = m_is_dark ? "toolbar_background_dark.png" : "toolbar_background.png";
|
||||
m_background_texture.metadata.left = 16;
|
||||
@@ -241,9 +242,12 @@ bool GLGizmosManager::init()
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
std::map<int, void *> GLGizmosManager::icon_list = {};
|
||||
bool GLGizmosManager::init_icon_textures()
|
||||
{
|
||||
if (icon_list.size() > 0) {
|
||||
return true;
|
||||
}
|
||||
ImTextureID texture_id;
|
||||
|
||||
icon_list.clear();
|
||||
@@ -277,6 +281,26 @@ bool GLGizmosManager::init_icon_textures()
|
||||
else
|
||||
return false;
|
||||
|
||||
if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/axis_toggle.svg", 64, 64, texture_id))
|
||||
icon_list.insert(std::make_pair((int) IC_AXIS_TOGGLE, texture_id));
|
||||
else
|
||||
return false;
|
||||
|
||||
if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/axis_toggle_hover.svg", 64, 64, texture_id))
|
||||
icon_list.insert(std::make_pair((int) IC_AXIS_TOGGLE_HOVER, texture_id));
|
||||
else
|
||||
return false;
|
||||
|
||||
if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/axis_toggle_dark.svg", 64, 64, texture_id))
|
||||
icon_list.insert(std::make_pair((int) IC_AXIS_TOGGLE_DARK, texture_id));
|
||||
else
|
||||
return false;
|
||||
|
||||
if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/axis_toggle_hover_dark.svg", 64, 64, texture_id))
|
||||
icon_list.insert(std::make_pair((int) IC_AXIS_TOGGLE_DARK_HOVER, texture_id));
|
||||
else
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ private:
|
||||
void on_set_color_timer(wxTimerEvent& evt);
|
||||
|
||||
// key MENU_ICON_NAME, value = ImtextureID
|
||||
std::map<int, void*> icon_list;
|
||||
static std::map<int, void*> icon_list;
|
||||
|
||||
bool m_is_dark = false;
|
||||
|
||||
@@ -170,6 +170,10 @@ public:
|
||||
IC_TOOLBAR_TOOLTIP,
|
||||
IC_TOOLBAR_TOOLTIP_HOVER,
|
||||
IC_NAME_COUNT,
|
||||
IC_AXIS_TOGGLE,
|
||||
IC_AXIS_TOGGLE_HOVER,
|
||||
IC_AXIS_TOGGLE_DARK,
|
||||
IC_AXIS_TOGGLE_DARK_HOVER,
|
||||
};
|
||||
|
||||
explicit GLGizmosManager(GLCanvas3D& parent);
|
||||
|
||||
@@ -2339,6 +2339,7 @@ void TabPrint::build()
|
||||
optgroup->append_single_option_line("ironing_spacing", "quality_settings_ironing#line-spacing");
|
||||
optgroup->append_single_option_line("ironing_inset", "quality_settings_ironing#inset");
|
||||
optgroup->append_single_option_line("ironing_angle", "quality_settings_ironing#angle-offset");
|
||||
optgroup->append_single_option_line("ironing_angle_fixed", "quality_settings_ironing#fixed-angle");
|
||||
|
||||
optgroup = page->new_optgroup(L("Wall generator"), L"param_wall_generator");
|
||||
optgroup->append_single_option_line("wall_generator", "quality_settings_wall_generator");
|
||||
@@ -5044,6 +5045,11 @@ void TabPrinter::toggle_options()
|
||||
is_BBL_printer = wxGetApp().preset_bundle->is_bbl_vendor();
|
||||
}
|
||||
|
||||
bool is_QIDI_printer = false;
|
||||
if (m_preset_bundle) {
|
||||
is_QIDI_printer = wxGetApp().preset_bundle->is_qidi_vendor();
|
||||
}
|
||||
|
||||
bool have_multiple_extruders = true;
|
||||
//m_extruders_count > 1;
|
||||
//if (m_active_page->title() == "Custom G-code") {
|
||||
@@ -5076,7 +5082,7 @@ void TabPrinter::toggle_options()
|
||||
"extra_loading_move",
|
||||
"high_current_on_filament_swap",
|
||||
})
|
||||
toggle_option(el, !is_BBL_printer);
|
||||
toggle_option(el, !is_BBL_printer && !is_QIDI_printer);
|
||||
|
||||
auto bSEMM = m_config->opt_bool("single_extruder_multi_material");
|
||||
if (!bSEMM && m_config->opt_bool("manual_filament_change")) {
|
||||
@@ -5086,7 +5092,7 @@ void TabPrinter::toggle_options()
|
||||
}
|
||||
toggle_option("extruders_count", !bSEMM);
|
||||
toggle_option("manual_filament_change", bSEMM);
|
||||
toggle_option("purge_in_prime_tower", bSEMM && !is_BBL_printer);
|
||||
toggle_option("purge_in_prime_tower", bSEMM && (!is_BBL_printer && !is_QIDI_printer));
|
||||
}
|
||||
wxString extruder_number;
|
||||
long val = 1;
|
||||
|
||||
Reference in New Issue
Block a user