Skip to content

Commit

Permalink
Merge superslicer commit '882285' into nematx
Browse files Browse the repository at this point in the history
  • Loading branch information
supermerill committed Jul 1, 2024
2 parents db66a87 + 8822851 commit ecd0cae
Show file tree
Hide file tree
Showing 28 changed files with 482 additions and 269 deletions.
14 changes: 9 additions & 5 deletions resources/ui_layout/default/print.ui
Original file line number Diff line number Diff line change
Expand Up @@ -317,16 +317,17 @@ group:Options for support material and raft
group:Options for support material interface
setting:support_material_interface_layer_height
line:Pattern
setting:support_material_interface_pattern
setting:label$Interface spacing:support_material_interface_spacing
setting:label$Top:support_material_top_interface_pattern
setting:label$Bottom:support_material_bottom_interface_pattern
setting:label$Spacing:support_material_interface_spacing
end_line
line:Pattern Angle
setting:label$_:support_material_interface_angle
setting:label$Increment:support_material_interface_angle_increment
end_line
line:Layer count
setting:support_material_interface_layers
setting:support_material_bottom_interface_layers
setting:label$Top:support_material_interface_layers
setting:label$Bottom:support_material_bottom_interface_layers
end_line
setting:support_material_interface_contact_loops

Expand Down Expand Up @@ -501,7 +502,10 @@ group:Wipe tower
setting:wipe_tower_rotation_angle
setting:wipe_tower_bridging
setting:wipe_tower_no_sparse_layers
setting:single_extruder_multi_material_priming
line:Priming
setting:single_extruder_multi_material_priming
setting:priming_position
end_line
group:Advanced
setting:interface_shells
setting:mmu_segmented_region_max_width
Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/Fill/Fill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive:
f->fill_surface_extrusion(&surface_fill.surface, surface_fill.params, fills_by_priority[(size_t)surface_fill.params.priority]->set_entities());
#if _DEBUG
//check no over or underextrusion if fill_exactly
if (surface_fill.params.fill_exactly && surface_fill.params.density == 1) {
if (surface_fill.params.fill_exactly && surface_fill.params.density == 1 && !surface_fill.params.flow.bridge()) {
ExtrusionVolume compute_volume;
ExtrusionVolume compute_volume_no_gap_fill(false);
const size_t idx_end = fills_by_priority[(size_t)surface_fill.params.priority]->entities().size();
Expand Down
8 changes: 5 additions & 3 deletions src/libslic3r/Fill/FillBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3654,9 +3654,11 @@ FillWithPerimeter::fill_surface_extrusion(const Surface* surface, const FillPara

// === extrude perimeter & associated surface at the same time, in the right order ===
//generate perimeter:
ExPolygons path_perimeter = offset2_ex(ExPolygons{ surface->expolygon },
scale_d(-this->get_spacing()), scale_d(this->get_spacing() / 2),
ClipperLib::jtMiter, scale_d(this->get_spacing()) * 10);
coord_t offset_for_overlap = scale_d(this->get_spacing() / 2) * ((1 - overlap_ratio) / 2);
ExPolygons path_perimeter = offset2_ex(ExPolygons{surface->expolygon},
scale_d(-this->get_spacing()) / 2 - offset_for_overlap,
offset_for_overlap,
ClipperLib::jtMiter, scale_d(this->get_spacing()) * 10);
//fix a bug that can happens when (positive) offsetting with a big miter limit and two island merge. See https://github.com/supermerill/SuperSlicer/issues/609
path_perimeter = intersection_ex(path_perimeter, offset_ex(surface->expolygon, scale_d(-this->get_spacing() / 2)));
for (ExPolygon& expolygon : path_perimeter) {
Expand Down
8 changes: 5 additions & 3 deletions src/libslic3r/Fill/FillBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ namespace NaiveConnect {
class FillWithPerimeter : public Fill
{
public:
// bewteen 0 (0%) and 1 (100%) overlap
float overlap_ratio = 0;
std::unique_ptr<Fill> infill{ nullptr };
float ratio_fill_inside = 0.f;
FillWithPerimeter() : Fill() {}
Expand All @@ -265,9 +267,9 @@ class ExtrusionSetRole : public ExtrusionVisitor {
ExtrusionSetRole(ExtrusionRole role) : new_role(role) {}
void use(ExtrusionPath &path) override { path.set_role(new_role); }
void use(ExtrusionPath3D &path3D) override { path3D.set_role(new_role); }
void use(ExtrusionMultiPath &multipath) override { for (ExtrusionPath path : multipath.paths) path.set_role(new_role); }
void use(ExtrusionMultiPath3D &multipath) override { for (ExtrusionPath path : multipath.paths) path.set_role(new_role); }
void use(ExtrusionLoop &loop) override { for (ExtrusionPath path : loop.paths) path.set_role(new_role); }
void use(ExtrusionMultiPath &multipath) override { for (ExtrusionPath &path : multipath.paths) path.set_role(new_role); }
void use(ExtrusionMultiPath3D &multipath) override { for (ExtrusionPath &path : multipath.paths) path.set_role(new_role); }
void use(ExtrusionLoop &loop) override { for (ExtrusionPath &path : loop.paths) path.set_role(new_role); }
void use(ExtrusionEntityCollection &collection) override { for (ExtrusionEntity *entity : collection.entities()) entity->visit(*this); }
};

Expand Down
11 changes: 7 additions & 4 deletions src/libslic3r/Fill/FillConcentric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,11 +363,14 @@ FillConcentricWGapFill::fill_surface_extrusion(
// }
// //goto_next_polyline:
//}
if (!polylines.empty() && !is_bridge(good_role)) {
bool fill_bridge = is_bridge(good_role) || params.flow.bridge();
// allow bridged gapfill, mostly for support bottom interface.
assert(!is_bridge(good_role));
if (!polylines.empty()) {
ExtrusionEntitiesPtr gap_fill_entities = Geometry::thin_variable_width(polylines, erGapFill, params.flow, scale_t(params.config->get_computed_value("resolution_internal")), true);
if (!gap_fill_entities.empty()) {
//set role if needed
if (good_role != erSolidInfill) {
// set role if needed
if (fill_bridge || (good_role != erSolidInfill && good_role != erTopSolidInfill)) {
ExtrusionSetRole set_good_role(good_role);
for (ExtrusionEntity* ptr : gap_fill_entities)
ptr->visit(set_good_role);
Expand Down Expand Up @@ -395,7 +398,7 @@ FillConcentricWGapFill::fill_surface_extrusion(
// external gapfill
ExPolygons gapfill_areas = diff_ex(ExPolygons{ surface->expolygon }, offset_ex(expp, double(scale_(0.5 * this->get_spacing()))));
gapfill_areas = union_safety_offset_ex(gapfill_areas);
if (gapfill_areas.size() > 0) {
if (gapfill_areas.size() > 0 && no_overlap_expolygons.size() > 0) {
double minarea = double(params.flow.scaled_width()) * double(params.flow.scaled_width());
if (params.config != nullptr) minarea = scale_d(params.config->gap_fill_min_area.get_abs_value(params.flow.width())) * double(params.flow.scaled_width());
for (int i = 0; i < gapfill_areas.size(); i++) {
Expand Down
18 changes: 12 additions & 6 deletions src/libslic3r/Format/BBConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ void init()
key_translation_map["sparse_infill_pattern"] = "fill_pattern";
key_translation_map["filename_format"] = "output_filename_format";
key_translation_map["support_base_pattern"] = "support_material_pattern";
key_translation_map["support_interface_pattern"] = "support_material_interface_pattern";
key_translation_map["support_interface_pattern"] = "support_material_top_interface_pattern";
key_translation_map["top_surface_pattern"] = "top_fill_pattern";
key_translation_map["support_object_xy_distance"] = "support_material_xy_spacing";
key_translation_map["fuzzy_skin_point_distance"] = "fuzzy_skin_point_dist";
Expand Down Expand Up @@ -425,7 +425,7 @@ void init()
//key_translation_map["single"]="retract_lift_above";
//key_translation_map["single"]="retract_lift_below";
//key_translation_map["single"]="wipe";
//patern
//pattern
value_translation_map["fill_pattern"]["monotonicline"] = "monotoniclines"; //2.7
value_translation_map["fill_pattern"]["zig-zag"] = "rectilinear";
value_translation_map["fill_pattern"]["tri-hexagon"] = "stars";
Expand All @@ -435,15 +435,17 @@ void init()
value_translation_map["solid_fill_pattern"] = value_translation_map["fill_pattern"];
value_translation_map["brim_ears_pattern"] = value_translation_map["fill_pattern"];
value_translation_map["bridge_fill_pattern"] = value_translation_map["fill_pattern"];
value_translation_map["support_material_interface_pattern"] = value_translation_map["fill_pattern"];
value_translation_map["support_material_top_interface_pattern"] = value_translation_map["fill_pattern"];
value_translation_map["support_material_bottom_interface_pattern"] = value_translation_map["fill_pattern"];
//specific
value_translation_map["fill_pattern"]["default"] = "gyroid";
value_translation_map["top_fill_pattern"]["default"] = "monotonic";
value_translation_map["bottom_fill_pattern"]["default"] = "monotonic";
value_translation_map["solid_fill_pattern"]["default"] = "rectilinear";
value_translation_map["brim_ears_pattern"]["default"] = "concentric";
value_translation_map["bridge_fill_pattern"]["default"] = "rectilinear";
value_translation_map["support_material_interface_pattern"]["default"] = "auto";
value_translation_map["support_material_top_interface_pattern"]["default"] = "auto";
value_translation_map["support_material_bottom_interface_pattern"]["default"] = "auto";
//value_translation_map["support_material_interface_pattern"]["rectilinear_interlaced"] = "???"; //can't convert let the config_substitutions emit the warning

//others
Expand Down Expand Up @@ -508,8 +510,12 @@ void complicated_convert(t_config_option_key &opt_key, std::string &value, const
value = "1";
}
}
if ("enable_overhang_speed") {

//if ("enable_overhang_speed") {
//
//}
if ("support_material_top_interface_pattern" == opt_key || "support_interface_pattern" == opt_key) {
output["support_material_top_interface_pattern"] = value;
output["support_material_bottom_interface_pattern"] = value;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/GCode/AvoidCrossingPerimeters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1209,7 +1209,7 @@ static ExPolygons get_boundary(const Layer &layer, std::vector<std::pair<ExPolyg
ExPolygons boundary;
auto old_2_new_expolygons = inner_offset(layer.lslices, 1.5 * perimeter_spacing);
for (const std::pair<ExPolygon, ExPolygon> &old_2_new_expoly : old_2_new_expolygons) {
assert(old_2_new_expoly.first.contains(old_2_new_expoly.second.contour.split_at_index(0)));
assert(old_2_new_expoly.first.contains(old_2_new_expoly.second.contour.split_at_index(0)) || old_2_new_expoly.first == old_2_new_expoly.second);
boundary.push_back(old_2_new_expoly.second);
slice_2_boundary.push_back(std::move(old_2_new_expoly));
}
Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/GCode/PressureAdvance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class PressureAdvance
//void _print_in_middle_G1(BufferData& line_to_split, float nb_sec, const std::string& line_to_write);
void write_buffer_data();
double compute_pressure_change_mm_filament(const BufferData& command);
void PressureAdvance::update_last_move(size_t last_move_idx, double junction_axle_speed);
void update_last_move(size_t last_move_idx, double junction_axle_speed);

double get_pressure_factor() {
double val = this->m_config.extruder_pressure_factor.get_float(m_current_extruder);
Expand Down
Loading

0 comments on commit ecd0cae

Please sign in to comment.