mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-12-11 16:00:17 -07:00
Merge branch 'main' into enh-update-wxwidgets
This commit is contained in:
commit
6a97dfcb58
14 changed files with 52 additions and 25 deletions
|
|
@ -511,9 +511,11 @@ find_package(glfw3 REQUIRED)
|
|||
|
||||
# Find the Cereal serialization library
|
||||
find_package(cereal REQUIRED)
|
||||
set_target_properties(cereal PROPERTIES IMPORTED_GLOBAL TRUE)
|
||||
if (NOT TARGET cereal::cereal)
|
||||
set_target_properties(cereal PROPERTIES IMPORTED_GLOBAL TRUE)
|
||||
add_library(cereal::cereal ALIAS cereal)
|
||||
else ()
|
||||
set_target_properties(cereal::cereal PROPERTIES IMPORTED_GLOBAL TRUE)
|
||||
endif ()
|
||||
|
||||
# l10n
|
||||
|
|
|
|||
|
|
@ -487,7 +487,7 @@ std::vector<SurfaceFill> group_fills(const Layer &layer)
|
|||
params.bridge = is_bridge || Fill::use_bridge_flow(params.pattern);
|
||||
params.flow = params.bridge ?
|
||||
//BBS: always enable thick bridge for internal bridge
|
||||
layerm.bridging_flow(extrusion_role, (surface.is_bridge() && !surface.is_external()) || object_config.thick_bridges) :
|
||||
layerm.bridging_flow(extrusion_role, (surface.is_bridge() && !surface.is_external()) || object_config.thick_bridges, params.extrusion_role == erInternalBridgeInfill) :
|
||||
layerm.flow(extrusion_role, (surface.thickness == -1) ? layer.height : surface.thickness);
|
||||
|
||||
// Calculate flow spacing for infill pattern generation.
|
||||
|
|
|
|||
|
|
@ -183,7 +183,8 @@ void Layer::make_perimeters()
|
|||
&& config.infill_wall_overlap == other_config.infill_wall_overlap
|
||||
&& config.fuzzy_skin == other_config.fuzzy_skin
|
||||
&& config.fuzzy_skin_thickness == other_config.fuzzy_skin_thickness
|
||||
&& config.fuzzy_skin_point_distance == other_config.fuzzy_skin_point_distance)
|
||||
&& config.fuzzy_skin_point_distance == other_config.fuzzy_skin_point_distance
|
||||
&& config.fuzzy_skin_first_layer == other_config.fuzzy_skin_first_layer)
|
||||
{
|
||||
other_layerm->perimeters.clear();
|
||||
other_layerm->fills.clear();
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ public:
|
|||
|
||||
Flow flow(FlowRole role) const;
|
||||
Flow flow(FlowRole role, double layer_height) const;
|
||||
Flow bridging_flow(FlowRole role, bool thick_bridge = false) const;
|
||||
Flow bridging_flow(FlowRole role, bool thick_bridge = false, bool internal_bridge = false) const;
|
||||
|
||||
void slices_to_fill_surfaces_clipped();
|
||||
void prepare_fill_surfaces();
|
||||
|
|
|
|||
|
|
@ -32,14 +32,16 @@ Flow LayerRegion::flow(FlowRole role, double layer_height) const
|
|||
return m_region->flow(*m_layer->object(), role, layer_height, m_layer->id() == 0);
|
||||
}
|
||||
|
||||
Flow LayerRegion::bridging_flow(FlowRole role, bool thick_bridge) const
|
||||
Flow LayerRegion::bridging_flow(FlowRole role, bool thick_bridge, bool internal_bridge) const
|
||||
{
|
||||
const PrintRegion ®ion = this->region();
|
||||
const PrintRegionConfig ®ion_config = region.config();
|
||||
const PrintObject &print_object = *this->layer()->object();
|
||||
Flow bridge_flow;
|
||||
auto nozzle_diameter = float(print_object.print()->config().nozzle_diameter.get_at(region.extruder(role) - 1));
|
||||
if (thick_bridge) {
|
||||
if(internal_bridge) { // internal bridge is using the thick bridge logic with the internal bridge flow ratio
|
||||
bridge_flow = Flow::bridging_flow(float(sqrt(region_config.internal_bridge_flow)) * nozzle_diameter, nozzle_diameter);
|
||||
} else if (thick_bridge) {
|
||||
// The old Slic3r way (different from all other slicers): Use rounded extrusions.
|
||||
// Get the configured nozzle_diameter for the extruder associated to the flow role requested.
|
||||
// Here this->extruder(role) - 1 may underflow to MAX_INT, but then the get_at() will follback to zero'th element, so everything is all right.
|
||||
|
|
|
|||
|
|
@ -68,16 +68,14 @@ static void fuzzy_polygon(Polygon &poly, double fuzzy_skin_thickness, double fuz
|
|||
{ // 'a' is the (next) new point between p0 and p1
|
||||
Vec2d p0p1 = (p1 - *p0).cast<double>();
|
||||
double p0p1_size = p0p1.norm();
|
||||
// so that p0p1_size - dist_last_point evaulates to dist_left_over - p0p1_size
|
||||
double dist_last_point = dist_left_over + p0p1_size * 2.;
|
||||
for (double p0pa_dist = dist_left_over; p0pa_dist < p0p1_size;
|
||||
double p0pa_dist = dist_left_over;
|
||||
for (; p0pa_dist < p0p1_size;
|
||||
p0pa_dist += min_dist_between_points + double(rand()) * range_random_point_dist / double(RAND_MAX))
|
||||
{
|
||||
double r = double(rand()) * (fuzzy_skin_thickness * 2.) / double(RAND_MAX) - fuzzy_skin_thickness;
|
||||
out.emplace_back(*p0 + (p0p1 * (p0pa_dist / p0p1_size) + perp(p0p1).cast<double>().normalized() * r).cast<coord_t>());
|
||||
dist_last_point = p0pa_dist;
|
||||
}
|
||||
dist_left_over = p0p1_size - dist_last_point;
|
||||
dist_left_over = p0pa_dist - p0p1_size;
|
||||
p0 = &p1;
|
||||
}
|
||||
while (out.size() < 3) {
|
||||
|
|
@ -96,7 +94,7 @@ static void fuzzy_extrusion_line(Arachne::ExtrusionLine& ext_lines, double fuzzy
|
|||
{
|
||||
const double min_dist_between_points = fuzzy_skin_point_dist * 3. / 4.; // hardcoded: the point distance may vary between 3/4 and 5/4 the supplied value
|
||||
const double range_random_point_dist = fuzzy_skin_point_dist / 2.;
|
||||
double dist_left_over = double(rand()) * (min_dist_between_points / 2) / double(RAND_MAX); // the distance to be traversed on the line before making the first new point
|
||||
double dist_left_over = double(rand()) * (min_dist_between_points / 2) / double(RAND_MAX); // the distance to be traversed on the line before making the first new point
|
||||
|
||||
auto* p0 = &ext_lines.front();
|
||||
std::vector<Arachne::ExtrusionJunction> out;
|
||||
|
|
@ -110,14 +108,12 @@ static void fuzzy_extrusion_line(Arachne::ExtrusionLine& ext_lines, double fuzzy
|
|||
// 'a' is the (next) new point between p0 and p1
|
||||
Vec2d p0p1 = (p1.p - p0->p).cast<double>();
|
||||
double p0p1_size = p0p1.norm();
|
||||
// so that p0p1_size - dist_last_point evaulates to dist_left_over - p0p1_size
|
||||
double dist_last_point = dist_left_over + p0p1_size * 2.;
|
||||
for (double p0pa_dist = dist_left_over; p0pa_dist < p0p1_size; p0pa_dist += min_dist_between_points + double(rand()) * range_random_point_dist / double(RAND_MAX)) {
|
||||
double p0pa_dist = dist_left_over;
|
||||
for (; p0pa_dist < p0p1_size; p0pa_dist += min_dist_between_points + double(rand()) * range_random_point_dist / double(RAND_MAX)) {
|
||||
double r = double(rand()) * (fuzzy_skin_thickness * 2.) / double(RAND_MAX) - fuzzy_skin_thickness;
|
||||
out.emplace_back(p0->p + (p0p1 * (p0pa_dist / p0p1_size) + perp(p0p1).cast<double>().normalized() * r).cast<coord_t>(), p1.w, p1.perimeter_index);
|
||||
dist_last_point = p0pa_dist;
|
||||
}
|
||||
dist_left_over = p0p1_size - dist_last_point;
|
||||
dist_left_over = p0pa_dist - p0p1_size;
|
||||
p0 = &p1;
|
||||
}
|
||||
|
||||
|
|
@ -2093,8 +2089,7 @@ void PerimeterGenerator::process_arachne()
|
|||
current_position = best_path->junctions.back().p; //Pick the other end from where we started.
|
||||
}
|
||||
}
|
||||
|
||||
if (this->layer_id > 0 && this->config->fuzzy_skin != FuzzySkinType::None) {
|
||||
if ((this->config->fuzzy_skin_first_layer || this->layer_id>0) && this->config->fuzzy_skin != FuzzySkinType::None) {
|
||||
std::vector<PerimeterGeneratorArachneExtrusion*> closed_loop_extrusions;
|
||||
for (PerimeterGeneratorArachneExtrusion& extrusion : ordered_extrusions)
|
||||
if (extrusion.extrusion->inset_idx == 0) {
|
||||
|
|
|
|||
|
|
@ -732,7 +732,7 @@ static std::vector<std::string> s_Preset_print_options {
|
|||
"minimum_sparse_infill_area", "reduce_infill_retraction","internal_solid_infill_pattern",
|
||||
"ironing_type", "ironing_pattern", "ironing_flow", "ironing_speed", "ironing_spacing", "ironing_angle",
|
||||
"max_travel_detour_distance",
|
||||
"fuzzy_skin", "fuzzy_skin_thickness", "fuzzy_skin_point_distance",
|
||||
"fuzzy_skin", "fuzzy_skin_thickness", "fuzzy_skin_point_distance", "fuzzy_skin_first_layer",
|
||||
"max_volumetric_extrusion_rate_slope", "max_volumetric_extrusion_rate_slope_segment_length",
|
||||
"inner_wall_speed", "outer_wall_speed", "sparse_infill_speed", "internal_solid_infill_speed",
|
||||
"top_surface_speed", "support_speed", "support_object_xy_distance", "support_interface_speed",
|
||||
|
|
@ -749,7 +749,7 @@ static std::vector<std::string> s_Preset_print_options {
|
|||
"sparse_infill_filament", "solid_infill_filament", "support_filament", "support_interface_filament",
|
||||
"ooze_prevention", "standby_temperature_delta", "interface_shells", "line_width", "initial_layer_line_width",
|
||||
"inner_wall_line_width", "outer_wall_line_width", "sparse_infill_line_width", "internal_solid_infill_line_width",
|
||||
"top_surface_line_width", "support_line_width", "infill_wall_overlap", "bridge_flow",
|
||||
"top_surface_line_width", "support_line_width", "infill_wall_overlap", "bridge_flow", "internal_bridge_flow",
|
||||
"elefant_foot_compensation", "elefant_foot_compensation_layers", "xy_contour_compensation", "xy_hole_compensation", "resolution", "enable_prime_tower",
|
||||
"prime_tower_width", "prime_tower_brim_width", "prime_volume",
|
||||
"wipe_tower_no_sparse_layers", "compatible_printers", "compatible_printers_condition", "inherits",
|
||||
|
|
|
|||
|
|
@ -776,6 +776,15 @@ void PrintConfigDef::init_fff_params()
|
|||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionFloat(1));
|
||||
|
||||
def = this->add("internal_bridge_flow", coFloat);
|
||||
def->label = L("Internal bridge flow");
|
||||
def->category = L("Quality");
|
||||
def->tooltip = L("This value governs the thickness of the internal bridge layer. This is the first layer over sparse infill. Decrease this value slightly (for example 0.9) to improve surface quality over sparse infill.");
|
||||
def->min = 0;
|
||||
def->max = 2.0;
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionFloat(1));
|
||||
|
||||
def = this->add("top_solid_infill_flow_ratio", coFloat);
|
||||
def->label = L("Top surface flow ratio");
|
||||
def->category = L("Advanced");
|
||||
|
|
@ -2092,6 +2101,13 @@ def = this->add("filament_loading_speed", coFloats);
|
|||
def->mode = comSimple;
|
||||
def->set_default_value(new ConfigOptionFloat(0.8));
|
||||
|
||||
def = this->add("fuzzy_skin_first_layer", coBool);
|
||||
def->label = L("Apply fuzzy skin to first layer");
|
||||
def->category = L("Others");
|
||||
def->tooltip = L("Whether to apply fuzzy skin on the first layer");
|
||||
def->mode = comSimple;
|
||||
def->set_default_value(new ConfigOptionBool(0));
|
||||
|
||||
def = this->add("filter_out_gap_fill", coFloat);
|
||||
def->label = L("Filter out tiny gaps");
|
||||
def->category = L("Layers and Perimeters");
|
||||
|
|
@ -5711,6 +5727,11 @@ std::map<std::string, std::string> validate(const FullPrintConfig &cfg, bool und
|
|||
error_message.emplace("bridge_flow", L("invalid value ") + std::to_string(cfg.bridge_flow));
|
||||
}
|
||||
|
||||
// --bridge-flow-ratio
|
||||
if (cfg.bridge_flow <= 0) {
|
||||
error_message.emplace("internal_bridge_flow", L("invalid value ") + std::to_string(cfg.internal_bridge_flow));
|
||||
}
|
||||
|
||||
// extruder clearance
|
||||
if (cfg.extruder_clearance_radius <= 0) {
|
||||
error_message.emplace("extruder_clearance_radius", L("invalid value ") + std::to_string(cfg.extruder_clearance_radius));
|
||||
|
|
|
|||
|
|
@ -796,6 +796,7 @@ PRINT_CONFIG_CLASS_DEFINE(
|
|||
((ConfigOptionFloat, bottom_shell_thickness))
|
||||
((ConfigOptionFloat, bridge_angle))
|
||||
((ConfigOptionFloat, bridge_flow))
|
||||
((ConfigOptionFloat, internal_bridge_flow))
|
||||
((ConfigOptionFloat, bridge_speed))
|
||||
((ConfigOptionFloatOrPercent, internal_bridge_speed))
|
||||
((ConfigOptionBool, ensure_vertical_shell_thickness))
|
||||
|
|
@ -810,6 +811,7 @@ PRINT_CONFIG_CLASS_DEFINE(
|
|||
((ConfigOptionEnum<FuzzySkinType>, fuzzy_skin))
|
||||
((ConfigOptionFloat, fuzzy_skin_thickness))
|
||||
((ConfigOptionFloat, fuzzy_skin_point_distance))
|
||||
((ConfigOptionBool, fuzzy_skin_first_layer))
|
||||
((ConfigOptionFloat, gap_infill_speed))
|
||||
((ConfigOptionInt, sparse_infill_filament))
|
||||
((ConfigOptionFloatOrPercent, sparse_infill_line_width))
|
||||
|
|
|
|||
|
|
@ -1095,6 +1095,7 @@ bool PrintObject::invalidate_state_by_config_options(
|
|||
|| opt_key == "fuzzy_skin"
|
||||
|| opt_key == "fuzzy_skin_thickness"
|
||||
|| opt_key == "fuzzy_skin_point_distance"
|
||||
|| opt_key == "fuzzy_skin_first_layer"
|
||||
|| opt_key == "detect_overhang_wall"
|
||||
|| opt_key == "overhang_reverse"
|
||||
|| opt_key == "overhang_reverse_internal_only"
|
||||
|
|
@ -1106,7 +1107,7 @@ bool PrintObject::invalidate_state_by_config_options(
|
|||
|| opt_key == "overhang_speed_classic") {
|
||||
steps.emplace_back(posPerimeters);
|
||||
steps.emplace_back(posSupportMaterial);
|
||||
} else if (opt_key == "bridge_flow") {
|
||||
} else if (opt_key == "bridge_flow" || opt_key == "internal_bridge_flow") {
|
||||
if (m_config.support_top_z_distance > 0.) {
|
||||
// Only invalidate due to bridging if bridging is enabled.
|
||||
// If later "support_top_z_distance" is modified, the complete PrintObject is invalidated anyway.
|
||||
|
|
|
|||
|
|
@ -702,7 +702,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
|
|||
toggle_line("flush_into_objects", !is_global_config);
|
||||
|
||||
bool has_fuzzy_skin = (config->opt_enum<FuzzySkinType>("fuzzy_skin") != FuzzySkinType::None);
|
||||
for (auto el : { "fuzzy_skin_thickness", "fuzzy_skin_point_distance"})
|
||||
for (auto el : { "fuzzy_skin_thickness", "fuzzy_skin_point_distance", "fuzzy_skin_first_layer"})
|
||||
toggle_line(el, has_fuzzy_skin);
|
||||
|
||||
bool have_arachne = config->opt_enum<PerimeterGeneratorType>("wall_generator") == PerimeterGeneratorType::Arachne;
|
||||
|
|
|
|||
|
|
@ -4038,7 +4038,7 @@ void GCodeViewer::render_shells()
|
|||
shader->start_using();
|
||||
shader->set_uniform("emission_factor", 0.1f);
|
||||
const Camera& camera = wxGetApp().plater()->get_camera();
|
||||
m_shells.volumes.render(GLVolumeCollection::ERenderType::Transparent, true, camera.get_view_matrix(), camera.get_projection_matrix());
|
||||
m_shells.volumes.render(GLVolumeCollection::ERenderType::Transparent, false, camera.get_view_matrix(), camera.get_projection_matrix());
|
||||
shader->set_uniform("emission_factor", 0.0f);
|
||||
shader->stop_using();
|
||||
|
||||
|
|
|
|||
|
|
@ -310,7 +310,8 @@ ObjectList::ObjectList(wxWindow* parent) :
|
|||
|
||||
ObjectList::~ObjectList()
|
||||
{
|
||||
delete m_objects_model;
|
||||
if (m_objects_model)
|
||||
m_objects_model->DecRef();
|
||||
}
|
||||
|
||||
void ObjectList::set_min_height()
|
||||
|
|
|
|||
|
|
@ -1896,6 +1896,7 @@ void TabPrint::build()
|
|||
optgroup->append_single_option_line("wall_infill_order");
|
||||
optgroup->append_single_option_line("print_flow_ratio");
|
||||
optgroup->append_single_option_line("bridge_flow");
|
||||
optgroup->append_single_option_line("internal_bridge_flow");
|
||||
optgroup->append_single_option_line("bridge_density");
|
||||
optgroup->append_single_option_line("thick_bridges");
|
||||
optgroup->append_single_option_line("top_solid_infill_flow_ratio");
|
||||
|
|
@ -2108,6 +2109,7 @@ void TabPrint::build()
|
|||
optgroup->append_single_option_line("fuzzy_skin");
|
||||
optgroup->append_single_option_line("fuzzy_skin_point_distance");
|
||||
optgroup->append_single_option_line("fuzzy_skin_thickness");
|
||||
optgroup->append_single_option_line("fuzzy_skin_first_layer");
|
||||
|
||||
|
||||
optgroup = page->new_optgroup(L("G-code output"), L"param_gcode");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue