Skip to content

Commit

Permalink
fixes (crash, notch, boost, support)
Browse files Browse the repository at this point in the history
  • Loading branch information
supermerill committed Jun 11, 2024
2 parents 5c8cc63 + 67279c5 commit cfba10f
Show file tree
Hide file tree
Showing 33 changed files with 265 additions and 187 deletions.
2 changes: 1 addition & 1 deletion resources/ui_layout/default/freq_fff.ui
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#logs
page:print:
page:Frequent settings:
group:freq_settings_event:no_title:no_search:
line:
setting:simple:script:enum$none$None$bp$Support on build plate only$se$For support enforcers only$ev$Everywhere:depends$support_material$support_material_auto$support_material_buildplate_only:label$Supports:tooltip$Select what kind of support do you need:full_width:s_support_fff
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 @@ -939,7 +939,7 @@ void Layer::make_ironing()
fill.init_spacing(ironing_params.line_spacing, fill_params);
fill.can_angle_cross = region_config.fill_angle_cross.value;
fill.angle = float(ironing_params.angle);
fill.link_max_length = (coord_t)scale_(3. * fill.get_spacing());
fill.link_max_length = scale_t(3. * fill.get_spacing());
double extrusion_height = ironing_params.height * fill.get_spacing() / nozzle_dmr;
//FIXME FLOW decide if it's good
// note: don't use filament_max_overlap, as it's a top surface
Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/Fill/Fill3DHoneycomb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ void Fill3DHoneycomb::_fill_surface_single(
if (params.connection == icNotConnected || polylines.size() <= 1)
append(polylines_out, chain_polylines(std::move(polylines)));
else
this->connect_infill(std::move(polylines), expolygon, polylines_out, this->get_spacing(), params);
this->connect_infill(std::move(polylines), expolygon, polylines_out, scale_t(this->get_spacing()), params);
}

} // namespace Slic3r
2 changes: 1 addition & 1 deletion src/libslic3r/Fill/FillAdaptive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ void Filler::_fill_surface_single(
if (params.connection == InfillConnection::icNotConnected || all_polylines_with_hooks.size() <= 1)
append(polylines_out, chain_polylines(std::move(all_polylines_with_hooks)));
else
connect_infill(std::move(all_polylines_with_hooks), expolygon, polylines_out, this->get_spacing(), params);
connect_infill(std::move(all_polylines_with_hooks), expolygon, polylines_out, scale_t(this->get_spacing()), params);

#ifdef ADAPTIVE_CUBIC_INFILL_DEBUG_OUTPUT
{
Expand Down
79 changes: 39 additions & 40 deletions src/libslic3r/Fill/FillBase.cpp

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions src/libslic3r/Fill/FillBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,26 +215,26 @@ class Fill
}

public:
static void connect_infill(Polylines&& infill_ordered, const ExPolygon& boundary, Polylines& polylines_out, const double spacing, const FillParams& params);
static void connect_infill(Polylines&& infill_ordered, const ExPolygon& boundary, Polylines& polylines_out, const coord_t spacing, const FillParams& params);
//for rectilinear
static void connect_infill(Polylines&& infill_ordered, const ExPolygon& boundary, const Polygons& polygons_src, Polylines& polylines_out, const double spacing, const FillParams& params);
static void connect_infill(Polylines&& infill_ordered, const ExPolygon& boundary, const Polygons& polygons_src, Polylines& polylines_out, const coord_t spacing, const FillParams& params);

static void connect_base_support(Polylines &&infill_ordered, const std::vector<const Polygon*> &boundary_src, const BoundingBox &bbox, Polylines &polylines_out, const double spacing, const FillParams &params);
static void connect_base_support(Polylines &&infill_ordered, const Polygons &boundary_src, const BoundingBox &bbox, Polylines &polylines_out, const double spacing, const FillParams &params);
static void connect_base_support(Polylines &&infill_ordered, const std::vector<const Polygon*> &boundary_src, const BoundingBox &bbox, Polylines &polylines_out, const coord_t line_spacing, const FillParams &params);
static void connect_base_support(Polylines &&infill_ordered, const Polygons &boundary_src, const BoundingBox &bbox, Polylines &polylines_out, const coord_t line_spacing, const FillParams &params);

static coord_t _adjust_solid_spacing(const coord_t width, const coord_t distance, const double factor_max = 1.2);
};

namespace FakePerimeterConnect {
void connect_infill(Polylines&& infill_ordered, const ExPolygon& boundary, Polylines& polylines_out, const double spacing, const FillParams& params);
void connect_infill(Polylines&& infill_ordered, const Polygons& boundary, const BoundingBox& bbox, Polylines& polylines_out, const double spacing, const FillParams& params);
void connect_infill(Polylines&& infill_ordered, const std::vector<const Polygon*>& boundary, const BoundingBox& bbox, Polylines& polylines_out, double spacing, const FillParams& params);
void connect_infill(Polylines&& infill_ordered, const ExPolygon& boundary, Polylines& polylines_out, const coord_t spacing, const FillParams& params);
void connect_infill(Polylines&& infill_ordered, const Polygons& boundary, const BoundingBox& bbox, Polylines& polylines_out, const coord_t spacing, const FillParams& params);
void connect_infill(Polylines&& infill_ordered, const std::vector<const Polygon*>& boundary, const BoundingBox& bbox, Polylines& polylines_out, coord_t spacing, const FillParams& params);
}
namespace PrusaSimpleConnect {
void connect_infill(Polylines& infill_ordered, const ExPolygon& boundary, Polylines& polylines_out, const double spacing, const FillParams& params);
void connect_infill(Polylines& infill_ordered, const ExPolygon& boundary, Polylines& polylines_out, const coord_t spacing, const FillParams& params);
}
namespace NaiveConnect {
void connect_infill(Polylines&& infill_ordered, const ExPolygon& boundary, Polylines& polylines_out, const double spacing, const FillParams& params);
void connect_infill(Polylines&& infill_ordered, const ExPolygon& boundary, Polylines& polylines_out, const coord_t spacing, const FillParams& params);
}

// composite filler
Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/Fill/FillGyroid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ void FillGyroid::_fill_surface_single(
if (params.connection == icNotConnected){
append(polylines_out, chain_polylines(polylines));
} else {
this->connect_infill(chain_polylines(polylines), expolygon, polylines_out, this->get_spacing(), params);
this->connect_infill(chain_polylines(polylines), expolygon, polylines_out, scale_t(this->get_spacing()), params);
}
// new paths must be rotated back
if (std::abs(infill_angle) >= EPSILON) {
Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/Fill/FillHoneycomb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void FillHoneycomb::_fill_surface_single(
if (params.connection == icNotConnected || all_polylines.size() <= 1)
append(polylines_out, chain_polylines(std::move(all_polylines)));
else
connect_infill(std::move(all_polylines), expolygon, polylines_out, this->get_spacing(), params);
connect_infill(std::move(all_polylines), expolygon, polylines_out, scale_t(this->get_spacing()), params);
}

} // namespace Slic3r
2 changes: 1 addition & 1 deletion src/libslic3r/Fill/FillLightning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void Filler::_fill_surface_single(
if (params.dont_connect() || fill_lines.size() <= 1) {
append(polylines_out, chain_polylines(std::move(fill_lines)));
} else
connect_infill(std::move(fill_lines), expolygon, polylines_out, this->get_spacing(), params);
connect_infill(std::move(fill_lines), expolygon, polylines_out, scale_t(this->get_spacing()), params);
}

void GeneratorDeleter::operator()(Generator *p) {
Expand Down
4 changes: 2 additions & 2 deletions src/libslic3r/Fill/FillPlanePath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void FillPlanePath::_fill_surface_single(
{
expolygon.rotate(- direction.first);

coord_t distance_between_lines = coord_t(scale_(this->get_spacing()) / params.density);
coord_t distance_between_lines = scale_t(this->get_spacing() / params.density);

// align infill across layers using the object's bounding box
// Rotated bounding box of the whole object.
Expand Down Expand Up @@ -67,7 +67,7 @@ void FillPlanePath::_fill_surface_single(
if (params.dont_connect() || params.density > 0.5 || all_poly.size() <= 1)
chained = chain_polylines(std::move(all_poly));
else
connect_infill(std::move(all_poly), expolygon, chained, this->get_spacing(), params);
connect_infill(std::move(all_poly), expolygon, chained, scale_t(this->get_spacing()), params);
// paths must be repositioned and rotated back
for (Polyline &pl : chained) {
pl.translate(double(shift.x()), double(shift.y()));
Expand Down
5 changes: 3 additions & 2 deletions src/libslic3r/Fill/FillRectilinear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3162,7 +3162,7 @@ bool FillRectilinear::fill_surface_by_multilines(const Surface *surface, FillPar
fill_lines = chain_polylines(std::move(fill_lines));
append(polylines_out, std::move(fill_lines));
} else
connect_infill(std::move(fill_lines), surface->expolygon, poly_with_offset_base.polygons_outer, polylines_out, this->get_spacing(), params);
connect_infill(std::move(fill_lines), surface->expolygon, poly_with_offset_base.polygons_outer, polylines_out, scale_t(this->get_spacing()), params);

return true;
}
Expand Down Expand Up @@ -3242,8 +3242,9 @@ Polylines FillSupportBase::fill_surface(const Surface *surface, const FillParams
coord_t line_spacing = _line_spacing_for_density(params);
// Create infill lines, keep them vertical.
make_fill_lines(poly_with_offset, rotate_vector.second.rotated(- rotate_vector.first), 0, 0, line_spacing, 0, fill_lines, params);

// Both the poly_with_offset and polylines_out are rotated, so the infill lines are strictly vertical.
connect_base_support(std::move(fill_lines), poly_with_offset.polygons_outer, poly_with_offset.bounding_box_outer(), polylines_out, this->get_spacing(), params);
connect_base_support(std::move(fill_lines), poly_with_offset.polygons_outer, poly_with_offset.bounding_box_outer(), polylines_out, _line_spacing_for_density(params), params);
// Rotate back by rotate_vector.first
const double cos_a = cos(rotate_vector.first);
const double sin_a = sin(rotate_vector.first);
Expand Down
Loading

0 comments on commit cfba10f

Please sign in to comment.