Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/local/dev' into superslicer_var…
Browse files Browse the repository at this point in the history
…iant
  • Loading branch information
supermerill committed Nov 29, 2024
2 parents 1d95a89 + c621417 commit 9a6ff34
Show file tree
Hide file tree
Showing 17 changed files with 288 additions and 100 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ccpp_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
build_dep:
runs-on: macos-12
runs-on: macos-13

steps:
- uses: actions/checkout@v3
Expand All @@ -36,7 +36,7 @@ jobs:
run: ./BuildMacOS.sh -d

build:
runs-on: macos-12
runs-on: macos-13
needs: build_dep

steps:
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/ccpp_mac_arm_rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ jobs:
- uses: actions/checkout@v3
- name: mkdir in deps
run: mkdir deps/build
- name: update automake for mpfr
run: |
curl -O -L http://ftpmirror.gnu.org/automake/automake-1.16.5.tar.gz
tar -xzf automake-1.16.5.tar.gz
cd automake-*
./configure
make
sudo make install
automake --version
- name: dep cache
id: cache-action
uses: actions/cache@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ccpp_mac_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
build_dep:
runs-on: macos-12
runs-on: macos-13

steps:
- uses: actions/checkout@v3
Expand All @@ -33,7 +33,7 @@ jobs:
run: ./BuildMacOS.sh -bd

build:
runs-on: macos-12
runs-on: macos-13
needs: build_dep

steps:
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/ccpp_mac_rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,21 @@ on:

jobs:
build_dep:
runs-on: macos-12
runs-on: macos-13

steps:
- uses: actions/checkout@v3
- name: mkdir in deps
run: mkdir deps/build
- name: update automake for mpfr
run: |
curl -O -L http://ftpmirror.gnu.org/automake/automake-1.16.5.tar.gz
tar -xzf automake-1.16.5.tar.gz
cd automake-*
./configure
make
sudo make install
automake --version
- name: dep cache
id: cache-action
uses: actions/cache@v3
Expand All @@ -24,7 +33,7 @@ jobs:
run: ./BuildMacOS.sh -d

build:
runs-on: macos-12
runs-on: macos-13
needs: build_dep

steps:
Expand Down
2 changes: 1 addition & 1 deletion resources/ui_layout/default/freq_fff.ui
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ group:freq_settings_event:no_title:no_search:
# setting:brim_width
# setting:label$Infill:width$8:sidetext$ :fill_density

setting:simple:script:percent:depends$fill_density$solid_infill_every_layers:hints$0$none$5$5$10$10$15$15 $25$25$35$35$50$50$75$75$100$solid:depends$fill_density$solid_infill_every_layers:label$Fill density:tooltip$Density of internal infill, expressed in the range 0% - 100%:width$6:sidetext$%:sidetext_width$4:label$Fill density:tooltip$Density of internal infill, expressed in the range 0% - 100%.\nSet 0 to remove any sparse infill.\nA value of 100% will activate 'solid_infill_every_layers' to have solid infill, with the solid infill pattern.:s_fill_density
setting:simple:script:percent:depends$fill_density$solid_infill_every_layers:hints$0$none$4$4$5.5$5.5$7.5$7.5$10$10$13$13 $18$18$23$23$31$31$42$42$55$55$75$75$100$solid:depends$fill_density$solid_infill_every_layers:label$Fill density:tooltip$Density of internal infill, expressed in the range 0% - 100%:width$6:sidetext$%:sidetext_width$4:label$Fill density:tooltip$Density of internal infill, expressed in the range 0% - 100%.\nSet 0 to remove any sparse infill.\nA value of 100% will activate 'solid_infill_every_layers' to have solid infill, with the solid infill pattern.:s_fill_density

setting:simple:script:bool:depends$brim_width:label$Brim:tooltip$Set the brim. Will be set to 5mm if nothing was previously set.:s_brim
freq_purging_volumes
Expand Down
3 changes: 2 additions & 1 deletion src/libslic3r/Brim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,8 @@ void make_brim_ears(const Print& print, const Flow& flow, const PrintObjectPtrs&
decimated_polygon.points = MultiPoint::douglas_peucker(poly.contour.points, SCALED_EPSILON);
}
}
for (const Point& p : decimated_polygon.convex_points(brim_config.brim_ears_max_angle.value* PI / 180.0)) {
Points pts = decimated_polygon.convex_points(0, brim_config.brim_ears_max_angle.value * PI / 180.0);
for (const Point& p : pts) {
pt_ears.push_back(p);
pt_ears.back() += (copy_pt.shift);
}
Expand Down
2 changes: 2 additions & 0 deletions src/libslic3r/ExtrusionEntity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ class ExtrusionPath3D : public ExtrusionPath {
typedef std::vector<ExtrusionPath3D> ExtrusionPaths3D;

// Single continuous extrusion path, possibly with varying extrusion thickness, extrusion height or bridging / non bridging.
// it's like an unsortable collection of only unreversable THING
template <typename THING = ExtrusionEntity>
class ExtrusionMultiEntity : public ExtrusionEntity {
public:
Expand Down Expand Up @@ -423,6 +424,7 @@ class ExtrusionMultiEntity : public ExtrusionEntity {
};

// Single continuous extrusion path, possibly with varying extrusion thickness, extrusion height or bridging / non bridging.
// it's like an unsortable collection of only unreversable ExtrusionPaths
class ExtrusionMultiPath : public ExtrusionMultiEntity<ExtrusionPath> {
public:

Expand Down
9 changes: 6 additions & 3 deletions src/libslic3r/ExtrusionEntityCollection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ ExtrusionEntityCollection ExtrusionEntityCollection::flatten(bool preserve_order

void ExtrusionEntityCollection::flatten(bool preserve_ordering, ExtrusionEntityCollection& out) const
{
if (!this->can_sort() && preserve_ordering) {
if (!this->can_sort() && preserve_ordering && this->entities().size() > 1) {
out.append(this->flatten(preserve_ordering));
}else{
} else {
FlatenEntities flattener(preserve_ordering);
flattener.use(*this);
//tranfert owner of entities.
Expand All @@ -204,7 +204,10 @@ void ExtrusionEntityCollection::flatten(bool preserve_ordering, ExtrusionEntityC
}

void FlatenEntities::use(const ExtrusionEntityCollection &coll) {
if ((!coll.can_sort() || !this->to_fill.can_sort()) && preserve_ordering) {
if (coll.entities().size() == 1) {
// only one element, sort or reverse are meaningless.
coll.entities().front()->visit(*this);
} else if ((!coll.can_sort() || !this->to_fill.can_sort()) && preserve_ordering) {
FlatenEntities unsortable(coll, preserve_ordering);
for (const ExtrusionEntity* entity : coll.entities()) {
entity->visit(unsortable);
Expand Down
5 changes: 3 additions & 2 deletions src/libslic3r/ExtrusionEntityCollection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ class FlatenEntities : public ExtrusionVisitorConst {
ExtrusionEntityCollection to_fill;
bool preserve_ordering;
public:
using ExtrusionVisitorConst::use;
FlatenEntities(bool preserve_ordering) : preserve_ordering(preserve_ordering) {}
FlatenEntities(ExtrusionEntityCollection pattern, bool preserve_ordering) : preserve_ordering(preserve_ordering) {
to_fill.set_can_sort_reverse(pattern.can_sort(), pattern.can_reverse());
Expand All @@ -212,8 +213,8 @@ class FlatenEntities : public ExtrusionVisitorConst {
return to_fill;
};
ExtrusionEntityCollection&& flatten(const ExtrusionEntityCollection &to_flatten) &&;
virtual void default_use(const ExtrusionEntity &entity) override { to_fill.append(entity); }
virtual void use(const ExtrusionEntityCollection &coll) override;
void default_use(const ExtrusionEntity &entity) override { to_fill.append(entity); }
void use(const ExtrusionEntityCollection &coll) override;
};

inline void extrusion_entities_append_paths(ExtrusionEntityCollection &dst, Polylines &polylines, ExtrusionRole role, double mm3_per_mm, float width, float height, bool can_reverse = true)
Expand Down
34 changes: 21 additions & 13 deletions src/libslic3r/GCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3210,7 +3210,7 @@ LayerResult GCodeGenerator::process_layer(
set_extra_lift(m_last_layer_z, layer.id(), print.config(), m_writer, first_extruder_id);
gcode += this->change_layer(print_z); // this will increase m_layer_index
//forget wipe from previous layer
gcode += "; m_wipe.reset_path(); after change_layer\n";
//gcode += "; m_wipe.reset_path(); after change_layer\n";
assert(m_new_z_target || is_approx(print_z, m_writer.get_unlifted_position().z(), EPSILON));
}
m_layer = &layer;
Expand Down Expand Up @@ -4316,10 +4316,10 @@ void GCodeGenerator::seam_notch(const ExtrusionLoop& original_loop,
if (is_hole_loop) {
//test if convex (as it's clockwise bc it's a hole, we have to do the opposite)
// 3.07 instead of PI to allow for some convex outliers (sometimes, stl can be a bit imprecise)
is_convex = polygon_to_test.convex_points(3.07).empty();
is_convex = polygon_to_test.convex_points(0, 3.07).empty();
} else {
// 3.3 instead of PI to allow for some concave outliers (sometimes, stl can be a bit imprecise)
is_convex = polygon_to_test.concave_points(3.3).empty();
is_convex = polygon_to_test.concave_points(0, 3.3).empty();
}
if (is_convex) {
// Computing circle center
Expand Down Expand Up @@ -5295,8 +5295,14 @@ std::string GCodeGenerator::extrude_entity(const ExtrusionEntityReference &entit

void GCodeGenerator::use(const ExtrusionEntityCollection &collection) {
if (!collection.can_sort() /*|| collection.role() == ExtrusionRole::Mixed*/ || collection.entities().size() <= 1) {
for (const ExtrusionEntity* next_entity : collection.entities()) {
next_entity->visit(*this);
if (this->visitor_flipped && collection.can_reverse()) {
for (size_t idx = collection.entities().size() - 1; idx <collection.entities().size(); --idx) {
collection.entities()[idx]->visit(*this);
}
} else {
for (const ExtrusionEntity *next_entity : collection.entities()) {
next_entity->visit(*this);
}
}
} else {
bool reversed = this->visitor_flipped;
Expand All @@ -5315,7 +5321,9 @@ std::string GCodeGenerator::extrude_path(const ExtrusionPath &path, const std::s
for (int i = 1; i < simplifed_path.polyline.size(); ++i)
assert(!simplifed_path.polyline.get_point(i - 1).coincides_with_epsilon(simplifed_path.polyline.get_point(i)));
if (this->visitor_flipped) {
assert(path.can_reverse());
// in a multipath, the multipath can be reversed, but all individual path are marqued as 'unreversable', even if they can be reversed by the multipath.
// hence, it's possible to have a !can_reverse and a visitor_flipped from the multipath.
//assert(path.can_reverse());
simplifed_path.reverse();
}

Expand Down Expand Up @@ -5567,9 +5575,9 @@ void GCodeGenerator::extrude_infill(const ExtrudeArgs& print_args, const LayerIs
}
if (!temp_fill_extrusions.empty()) {
set_region_for_extrude(print, nullptr, &layerm, gcode);
for (const ExtrusionEntityReference &fill :
chain_extrusion_references(temp_fill_extrusions, last_pos_defined() ? &last_pos() : nullptr)) {
gcode += this->extrude_entity(fill, "infill"sv);
std::vector<ExtrusionEntityReference> fills_eer = chain_extrusion_references(temp_fill_extrusions, last_pos_defined() ? &last_pos() : nullptr);
for (const ExtrusionEntityReference &fill_eer : fills_eer) {
gcode += this->extrude_entity(fill_eer, "infill"sv);
}
}
}
Expand Down Expand Up @@ -6614,20 +6622,20 @@ std::string GCodeGenerator::_before_extrude(const ExtrusionPath &path, const std
poly_start.clip_end(length * ratio);
poly_end.clip_start(length * (1 - ratio));
}
gcode += "; acceleration to travel\n";
//gcode += "; acceleration to travel\n";
m_writer.set_travel_acceleration((uint32_t) floor(travel_acceleration + 0.5));
this->write_travel_to(gcode, poly_start,
"move to first " + description + " point (acceleration)");
// travel acceleration should be already set at startup via special gcode, and so it's
// automatically used by G0.
gcode += "; decel to extrusion\n";
//gcode += "; decel to extrusion\n";
m_writer.set_travel_acceleration((uint32_t) floor(acceleration + 0.5));
this->write_travel_to(gcode, poly_end,
"move to first " + description + " point (deceleration)");
// restore travel accel and ensure the new extrusion accel is set
m_writer.set_travel_acceleration((uint32_t) floor(travel_acceleration + 0.5));
m_writer.set_acceleration((uint32_t) floor(acceleration + 0.5));
gcode += "; end travel\n";
//gcode += "; end travel\n";
assert(!moved_to_point);
moved_to_point = true;
}
Expand Down Expand Up @@ -6677,7 +6685,7 @@ std::string GCodeGenerator::_before_extrude(const ExtrusionPath &path, const std
m_delayed_layer_change.clear();
gcode += unlift;
//now that we move to the new layer, forget previous layer wipe (if any).
gcode += "; m_wipe.reset_path(); after m_delayed_layer_change\n";
//gcode += "; m_wipe.reset_path(); after m_delayed_layer_change\n";
}
gcode += m_writer.unretract();

Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/Geometry/MedialAxis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2024,7 +2024,7 @@ check_circular(ExPolygon& expolygon, coord_t max_variation) {
if (expolygon.holes.size() > 0) return 0;

//test if convex
if (expolygon.contour.concave_points().empty() && expolygon.contour.points.size() > 3) {
if (expolygon.contour.concave_points(0, PI).empty() && expolygon.contour.points.size() > 3) {
// Computing circle center
Point center = expolygon.contour.centroid();
coordf_t radius_min = std::numeric_limits<float>::max(), radius_max = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/PerimeterGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3674,7 +3674,7 @@ void PerimeterGenerator::processs_no_bridge(const Parameters params, Surfaces& a
if (contour_bigger.size() == 1) poly_unsupp_bigger.contour = contour_bigger[0];

//check convex, has some bridge, not overhang
if (contour_simplified.size() == 1 && contour_bigger.size() == 1 && contour_simplified[0].concave_points().size() == 0
if (contour_simplified.size() == 1 && contour_bigger.size() == 1 && contour_simplified[0].concave_points(0, PI).size() == 0
&& intersection_ex(bridgeable, ExPolygons{ poly_unsupp }).size() > 0
&& diff_ex(ExPolygons{ poly_unsupp_bigger }, union_ex(for_union(last, offset_ex(bridgeable, bridged_infill_margin + params.get_perimeter_spacing() / 2))), ApplySafetyOffset::Yes).size() == 0
) {
Expand Down
Loading

0 comments on commit 9a6ff34

Please sign in to comment.