Skip to content

Commit

Permalink
Merge branch 'stable'
Browse files Browse the repository at this point in the history
  • Loading branch information
supermerill committed Jan 4, 2022
2 parents 4e7222a + f0289f3 commit 23dc9d0
Show file tree
Hide file tree
Showing 16 changed files with 479 additions and 344 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ccpp_mac_arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
ref: 'debug_macos'
ref: 'Nigthly'
- name: build deps & slicer
run: ./BuildMacOS.sh -ia
- name: Upload artifact
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/ccpp_mac_arm_rc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: C/C++ debug arm macos

on:
push:
branches:
- rc

jobs:
build:

runs-on: macos-11

steps:
- uses: actions/checkout@v2
with:
ref: 'rc'
- name: build deps & slicer
run: ./BuildMacOS.sh -ia
- name: Upload artifact
uses: actions/[email protected]
with:
name: nightly_macos_arm_debug.dmg
path: build/${{ github.event.repository.name }}.dmg
- name: Upload artifact
uses: actions/[email protected]
with:
name: nightly_arm_macos.tar
path: build/${{ github.event.repository.name }}.tar
11 changes: 11 additions & 0 deletions create_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def get_version():
found_linux_appimage_gtk2 = False;
found_linux_appimage_gtk3 = False;
found_macos = False;
found_macos_arm = False;
print("there is "+ str(artifacts["total_count"])+ " artifacts in the repo");
for entry in artifacts["artifacts"]:
if entry["name"] == "rc_win64" and not found_win:
Expand All @@ -67,6 +68,14 @@ def get_version():
z = zipfile.ZipFile(io.BytesIO(resp.content));
z.extractall(release_path);
os.rename(release_path+"/"+program_name+".dmg", release_path+"/"+program_name+"_"+version+"_macos_"+date_str+".dmg");
if entry["name"] == "rc_arm_macos.dmg" and not found_macos_arm:
found_macos_arm = True;
print("ask for: "+entry["archive_download_url"]);
resp = requests.get(entry["archive_download_url"], headers={'Authorization': 'token ' + github_auth_token,}, allow_redirects=True);
print("macos-arm: " +str(resp));
z = zipfile.ZipFile(io.BytesIO(resp.content));
z.extractall(release_path);
os.rename(release_path+"/"+program_name+".dmg", release_path+"/"+program_name+"_"+version+"_macos_arm_"+date_str+".dmg");
if entry["name"] == "rc-"+program_name+"-gtk2.AppImage" and not found_linux_appimage_gtk2:
found_linux_appimage_gtk2 = True;
print("ask for: "+entry["archive_download_url"]);
Expand Down Expand Up @@ -98,3 +107,5 @@ def get_version():
except:
with zipfile.ZipFile(base_path+"_bof.tar.zip", 'w') as myzip:
myzip.write(base_path+".tar");

print("DONT FORGET TO PUSH YOUR MASTER");
373 changes: 175 additions & 198 deletions resources/localization/fr/Slic3r.po

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/libslic3r/Fill/FillRectilinear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@ static void connect_segment_intersections_by_contours(
itsct.prev_on_contour_quality = SegmentIntersection::LinkQuality::TooLong;
if (itsct.next_on_contour_quality == SegmentIntersection::LinkQuality::Valid)
itsct.next_on_contour_quality = SegmentIntersection::LinkQuality::TooLong;
} else if (link_max_length > 0) {
} else if (link_max_length > 0 && false /*FIXME SuperSlicer::2141*/) {
// Measure length of the links.
if (itsct.prev_on_contour_quality == SegmentIntersection::LinkQuality::Valid &&
(same_prev ?
Expand Down
195 changes: 108 additions & 87 deletions src/libslic3r/GCode.cpp

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions src/libslic3r/GCode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,11 @@ class GCode : ExtrusionVisitorConst {
// For crossing perimeter retraction detection (contain the layer & nozzle widdth used to construct it)
// !!!! not thread-safe !!!! if threaded per layer, please store it in the thread.
struct SliceOffsetted {
ExPolygons slices; const Layer* layer; coord_t diameter;
} m_layer_slices_offseted{ {},nullptr, 0};
ExPolygons slices;
ExPolygons slices_offsetted;
const Layer* layer;
coord_t diameter;
} m_layer_slices_offseted{ {},{},nullptr, 0};
double m_volumetric_speed;
// Support for the extrusion role markers. Which marker is active?
ExtrusionRole m_last_extrusion_role;
Expand Down
9 changes: 8 additions & 1 deletion src/libslic3r/GCode/SpiralVase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ std::string SpiralVase::process_layer(const std::string &gcode)
// Tapering the absolute extruder distances requires to process every extrusion value after the first transition
// layer.
bool transition = m_transition_layer && m_config->use_relative_e_distances.value;
if (transition)
new_gcode += "; Began spiral\n";
bool keep_first_travel = m_transition_layer;
float layer_height_factor = layer_height / total_layer_length;
float len = 0.f;
m_reader.parse_buffer(gcode, [&new_gcode, &z, total_layer_length, layer_height_factor, transition, &len]
m_reader.parse_buffer(gcode, [&keep_first_travel , &new_gcode, &z, total_layer_length, layer_height_factor, transition, &len]
(GCodeReader &reader, GCodeReader::GCodeLine line) {
if (line.cmd_is("G1")) {
if (line.has_z()) {
Expand All @@ -71,12 +74,16 @@ std::string SpiralVase::process_layer(const std::string &gcode)
if (dist_XY > 0) {
// horizontal move
if (line.extruding(reader)) {
keep_first_travel = false;
len += dist_XY;
line.set(reader, Z, z + len * layer_height_factor);
if (transition && line.has(E))
// Transition layer, modulate the amount of extrusion from zero to the final value.
line.set(reader, E, line.value(E) * len / total_layer_length);
new_gcode += line.raw() + '\n';
} else if (keep_first_travel) {
//we can travel until the first spiral extrusion
new_gcode += line.raw() + '\n';
}
return;

Expand Down
4 changes: 3 additions & 1 deletion src/libslic3r/GCode/SpiralVase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ class SpiralVase {
m_enabled = en;
}

std::string process_layer(const std::string &gcode);
std::string process_layer(const std::string& gcode);

bool is_transition_layer() { return m_transition_layer; }

private:
const PrintConfig *m_config;
Expand Down
15 changes: 11 additions & 4 deletions src/libslic3r/GCodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,19 @@ std::string to_string_nozero(double value, int32_t max_precision) {
ss << std::fixed << std::setprecision(int(std::min(15 - long10, int(max_precision)))) << value;
std::string ret = ss.str();
uint8_t nb_del = 0;
for (uint8_t i = uint8_t(ss.tellp()) - 1; i > 0; i--) {
if (ret[i] == '0')
if (ret.find('.') != std::string::npos) {
uint8_t idx_char;
for (idx_char = uint8_t(ss.tellp()) - 1; idx_char > 0; idx_char--) {
if (ret[idx_char] == '0')
nb_del++;
else
break;
}
// remove the '.' at the end of the int
if (idx_char > 0 && ret[idx_char] == '.')
nb_del++;
else
break;
}

if (nb_del > 0)
return ret.substr(0, ret.size() - nb_del);
else
Expand Down
55 changes: 50 additions & 5 deletions src/libslic3r/MedialAxis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,8 @@ MedialAxis::remove_bits(ThickPolylines &pp)
///reorder, in case of change
std::sort(pp.begin(), pp.end(), [](const ThickPolyline & a, const ThickPolyline & b) { return a.length() < b.length(); });
}

//TODO: check if there is a U-turn (almost 180° direction change) : remove it.
}

void
Expand Down Expand Up @@ -1492,6 +1494,40 @@ MedialAxis::remove_too_short_polylines(ThickPolylines& pp, const coord_t min_siz
}
if (changes) concatThickPolylines(pp);
}

//remove points too near each other
changes = true;
while (changes) {
changes = false;

coordf_t shortest_size = (coordf_t)min_size;
size_t shortest_idx = -1;
for (size_t polyidx = 0; polyidx < pp.size(); ++polyidx) {
ThickPolyline& tp = pp[polyidx];
for (size_t pt_idx = 1; pt_idx < tp.points.size() - 1; pt_idx++) {
if (tp.points[pt_idx - 1].coincides_with_epsilon(tp.points[pt_idx])) {
tp.points.erase(tp.points.begin() + pt_idx);
tp.width.erase(tp.width.begin() + pt_idx);
pt_idx--;
changes = true;
}
}
//check last segment
if (tp.points.size() > 2 && tp.points[tp.points.size() - 2].coincides_with_epsilon(tp.points.back())) {
tp.points.erase(tp.points.end() - 2);
tp.width.erase(tp.width.end() - 2);
changes = true;
}
//delete null-length polylines
if (tp.length() < SCALED_EPSILON && tp.first_point().coincides_with_epsilon(tp.last_point())) {
pp.erase(pp.begin() + polyidx);
--polyidx;
changes = true;
}
}
if (changes) concatThickPolylines(pp);
}

}

void
Expand Down Expand Up @@ -2037,7 +2073,7 @@ thin_variable_width(const ThickPolylines &polylines, ExtrusionRole role, Flow fl
// variable extrusion within a single move; this value shall only affect the amount
// of segments, and any pruning shall be performed before we apply this tolerance
const coord_t tolerance = flow.scaled_width() / 10;//scale_(0.05);

ExtrusionEntityCollection coll;
for (const ThickPolyline &p : polylines) {
ExtrusionPaths paths;
Expand All @@ -2052,8 +2088,8 @@ thin_variable_width(const ThickPolylines &polylines, ExtrusionRole role, Flow fl
const coordf_t prev_line_len = saved_line_len;
saved_line_len = line_len;

assert(line.a_width >= 0);
assert(line.b_width >= 0);
assert(line.a_width >= 0 && !std::isnan(line.a_width));
assert(line.b_width >= 0 && !std::isnan(line.b_width));
coord_t thickness_delta = std::abs(line.a_width - line.b_width);

// split lines ?
Expand Down Expand Up @@ -2108,7 +2144,16 @@ thin_variable_width(const ThickPolylines &polylines, ExtrusionRole role, Flow fl
coordf_t width = prev_line_len * (prev_line.a_width + prev_line.b_width) / 2;
width += line_len * (line.a_width + line.b_width) / 2;
prev_line.b = line.b;
coordf_t new_length = prev_line.length();
const coordf_t new_length = prev_line.length();
if (new_length < SCALED_EPSILON) {
// too short, remove it and restart
if (i > 1) {
line.a = lines[i - 2].b;
}
lines.erase(lines.begin() + i-1);
i-=2;
continue;
}
width /= new_length;
prev_line.a_width = width;
prev_line.b_width = width;
Expand All @@ -2131,7 +2176,7 @@ thin_variable_width(const ThickPolylines &polylines, ExtrusionRole role, Flow fl
// but we can't extrude with a negative spacing, so we have to gradually fall back to spacing if the width is too small.

// default: extrude a thin wall that doesn't go outside of the specified width.
double wanted_width = unscaled(line.a_width);
coordf_t wanted_width = unscaled(line.a_width);
if (role == erGapFill) {
// Convert from spacing to extrusion width based on the extrusion model
// of a square extrusion ended with semi circles.
Expand Down
38 changes: 27 additions & 11 deletions src/libslic3r/PerimeterGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -960,25 +960,41 @@ void PerimeterGenerator::process()

// if brim will be printed, reverse the order of perimeters so that
// we continue inwards after having finished the brim
// be careful to not print thin walls before perimeters (gapfill will be added after so don't worry for them)
// TODO: add test for perimeter order
if (this->config->external_perimeters_first ||
(this->layer->id() == 0 && this->object_config->brim_width.value > 0)) {
if (this->config->external_perimeters_nothole.value ||
(this->layer->id() == 0 && this->object_config->brim_width.value > 0)) {
if (this->config->external_perimeters_hole.value ||
(this->layer->id() == 0 && this->object_config->brim_width.value > 0)) {
entities.reverse();
const bool brim_first_layer = this->layer->id() == 0 && (this->object_config->brim_width.value > 0 || this->object_config->brim_width_interior.value > 0);
if (this->config->external_perimeters_first || brim_first_layer) {
if (this->config->external_perimeters_nothole.value || brim_first_layer) {
if (this->config->external_perimeters_hole.value || brim_first_layer) {
//reverse only not-thin wall
ExtrusionEntityCollection coll2;
for (const auto loop : entities.entities) {
if ( (loop->is_loop() && loop->role() != erThinWall)) {
coll2.entities.push_back(loop);
}
}
coll2.reverse();
for (const auto loop : entities.entities) {
if (!((loop->is_loop() && loop->role() != erThinWall))) {
coll2.entities.push_back(loop);
}
}
//note: this hacky thing is possible because coll2.entities contains in fact entities's entities
//if you does entities = coll2, you'll delete entities's entities and then you have nothing.
entities.entities = coll2.entities;
//and you have to empty coll2 or it will delete his content, hence crashing our hack
coll2.entities.clear();
} else {
//reverse only not-hole perimeters
ExtrusionEntityCollection coll2;
for (const auto loop : entities.entities) {
if (loop->is_loop() && !(((ExtrusionLoop*)loop)->loop_role() & ExtrusionLoopRole::elrHole) != 0) {
if ((loop->is_loop() && loop->role() != erThinWall) && !(((ExtrusionLoop*)loop)->loop_role() & ExtrusionLoopRole::elrHole) != 0) {
coll2.entities.push_back(loop);
}
}
coll2.reverse();
for (const auto loop : entities.entities) {
if (!loop->is_loop() || (((ExtrusionLoop*)loop)->loop_role() & ExtrusionLoopRole::elrHole) != 0) {
if (!((loop->is_loop() && loop->role() != erThinWall) && (((ExtrusionLoop*)loop)->loop_role() & ExtrusionLoopRole::elrHole) != 0)) {
coll2.entities.push_back(loop);
}
}
Expand All @@ -992,13 +1008,13 @@ void PerimeterGenerator::process()
//reverse the hole, and put them in first place.
ExtrusionEntityCollection coll2;
for (const auto loop : entities.entities) {
if (loop->is_loop() && (((ExtrusionLoop*)loop)->loop_role() & ExtrusionLoopRole::elrHole) != 0) {
if ((loop->is_loop() && loop->role() != erThinWall) && (((ExtrusionLoop*)loop)->loop_role() & ExtrusionLoopRole::elrHole) != 0) {
coll2.entities.push_back(loop);
}
}
coll2.reverse();
for (const auto loop : entities.entities) {
if (!loop->is_loop() || !(((ExtrusionLoop*)loop)->loop_role() & ExtrusionLoopRole::elrHole) != 0) {
if (!((loop->is_loop() && loop->role() != erThinWall) && (((ExtrusionLoop*)loop)->loop_role() & ExtrusionLoopRole::elrHole) != 0)) {
coll2.entities.push_back(loop);
}
}
Expand Down
16 changes: 9 additions & 7 deletions src/libslic3r/PrintConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,8 @@ void PrintConfigDef::init_fff_params()
def = this->add("extrusion_width", coFloatOrPercent);
def->label = L("Default extrusion width");
def->category = OptionCategory::width;
def->tooltip = L("Set this to a non-zero value to allow a manual extrusion width. "
def->tooltip = L("This is the DEFAULT extrusion width. It's ONLY used to REPLACE 0-width fields. It's useless when all other width fields have a value."
"Set this to a non-zero value to allow a manual extrusion width. "
"If left to zero, Slic3r derives extrusion widths from the nozzle diameter "
"(see the tooltips for perimeter extrusion width, infill extrusion width etc). "
"If expressed as percentage (for example: 105%), it will be computed over nozzle diameter."
Expand All @@ -1275,7 +1276,8 @@ void PrintConfigDef::init_fff_params()
def = this->add("extrusion_spacing", coFloatOrPercent);
def->label = L("Default extrusion spacing");
def->category = OptionCategory::width;
def->tooltip = L("Like Default extrusion width but spacing is the distance between two lines (as they overlap a bit, it's not the same)."
def->tooltip = L("This is the DEFAULT extrusion spacing. It's convert to a width and this width can be used to REPLACE 0-width fields. It's useless when all width fields have a value."
"Like Default extrusion width but spacing is the distance between two lines (as they overlap a bit, it's not the same)."
"\nYou can set either 'Spacing', or 'Width'; the other will be calculated, using the perimeter 'Overlap' percentages and default layer height.");
def->sidetext = L("mm or %");
def->ratio_over = "nozzle_diameter";
Expand Down Expand Up @@ -3372,8 +3374,8 @@ void PrintConfigDef::init_fff_params()
def = this->add("resolution_internal", coFloat);
def->label = L("Internal resolution");
def->category = OptionCategory::slicing;
def->tooltip = L("Minimum detail resolution, used for internal strutures (gapfill and some infill patterns)."
"\nDon't put a too small value (0.05mm is way too low for many printers), as it may creates too many very small segments that may difficult to display and print.");
def->tooltip = L("Minimum detail resolution, used for internal structures (gapfill and some infill patterns)."
"\nDon't put a too-small value (0.05mm is way too low for many printers), as it may create too many very small segments that may be difficult to display and print.");
def->sidetext = L("mm");
def->min = 0.001;
def->precision = 8;
Expand Down Expand Up @@ -4573,16 +4575,16 @@ void PrintConfigDef::init_fff_params()
def = this->add("wipe", coBools);
def->label = L("Wipe while retracting");
def->category = OptionCategory::extruders;
def->tooltip = L("This flag will move the nozzle while retracting to minimize the possible blob "
"on leaky extruders.");
def->tooltip = L("This flag will move the nozzle while retracting to minimize the possible blob on leaky extruders."
"\nNote that as a wipe only happens when there is a retraction, the 'only retract when crossing perimeters' print setting can greatly reduce the number of wipes.");
def->mode = comAdvanced;
def->is_vector_extruder = true;
def->set_default_value(new ConfigOptionBools{ false });

def = this->add("wipe_only_crossing", coBools);
def->label = L("Wipe only when crossing perimeters");
def->category = OptionCategory::extruders;
def->tooltip = L("Don't wipe when you don't cross a perimeter.");
def->tooltip = L("Don't wipe when you don't cross a perimeter. Need 'only_retract_when_crossing_perimeters'and 'wipe' enabled.");
def->mode = comAdvanced;
def->is_vector_extruder = true;
def->set_default_value(new ConfigOptionBools{ true });
Expand Down
Loading

0 comments on commit 23dc9d0

Please sign in to comment.