mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-14 16:05:55 +08:00
fix fill
also protect spacing in case of.
This commit is contained in:
parent
b8548f5a87
commit
7560c7d955
@ -431,6 +431,8 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive:
|
||||
f->no_overlap_expolygons.push_back(expoly);
|
||||
}
|
||||
|
||||
//init the surface with the current polygon
|
||||
surface_fill.surface.expolygon = std::move(expoly);
|
||||
//make fill
|
||||
f->fill_surface_extrusion(&surface_fill.surface, surface_fill.params, m_regions[surface_fill.region_id]->fills.entities);
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ void Fill3DHoneycomb::_fill_surface_single(
|
||||
{
|
||||
// no rotation is supported for this infill pattern
|
||||
BoundingBox bb = expolygon.contour.bounding_box();
|
||||
coord_t distance = coord_t(scale_(this->spacing) / params.density);
|
||||
coord_t distance = coord_t(scale_(this->get_spacing()) / params.density);
|
||||
|
||||
// align bounding box to a multiple of our honeycomb grid module
|
||||
// (a module is 2*$distance since one $distance half-module is
|
||||
@ -171,7 +171,7 @@ void Fill3DHoneycomb::_fill_surface_single(
|
||||
if (params.connection == icNotConnected)
|
||||
append(polylines_out, std::move(polylines_chained));
|
||||
else
|
||||
this->connect_infill(std::move(polylines_chained), expolygon, polylines_out, this->spacing, params);
|
||||
this->connect_infill(std::move(polylines_chained), expolygon, polylines_out, this->get_spacing(), params);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -601,7 +601,7 @@ void Filler::_fill_surface_single(
|
||||
if (params.connection == InfillConnection::icNotConnected || all_polylines.size() <= 1)
|
||||
append(polylines_out, std::move(all_polylines));
|
||||
else
|
||||
connect_infill(chain_polylines(std::move(all_polylines)), expolygon, polylines_out, this->spacing, params);
|
||||
connect_infill(chain_polylines(std::move(all_polylines)), expolygon, polylines_out, this->get_spacing(), params);
|
||||
|
||||
#ifdef ADAPTIVE_CUBIC_INFILL_DEBUG_OUTPUT
|
||||
{
|
||||
|
@ -65,7 +65,7 @@ Fill* Fill::new_from_type(const std::string &type)
|
||||
Polylines Fill::fill_surface(const Surface *surface, const FillParams ¶ms) const
|
||||
{
|
||||
// Perform offset.
|
||||
Slic3r::ExPolygons expp = offset_ex(surface->expolygon, double(scale_(0 - 0.5 * this->spacing)));
|
||||
Slic3r::ExPolygons expp = offset_ex(surface->expolygon, double(scale_(0 - 0.5 * this->get_spacing())));
|
||||
// Create the infills for each of the regions.
|
||||
Polylines polylines_out;
|
||||
for (size_t i = 0; i < expp.size(); ++ i)
|
||||
@ -209,7 +209,7 @@ void Fill::fill_surface_extrusion(const Surface *surface, const FillParams ¶
|
||||
|
||||
coord_t Fill::_line_spacing_for_density(float density) const
|
||||
{
|
||||
return coord_t(scale_(this->spacing) / density);
|
||||
return coord_t(scale_(this->get_spacing()) / density);
|
||||
}
|
||||
|
||||
/// cut poly between poly.point[idx_1] & poly.point[idx_1+1]
|
||||
@ -476,7 +476,7 @@ Fill::connect_infill(const Polylines &infill_ordered, const ExPolygon &boundary,
|
||||
Polylines polylines_frontier = to_polylines(((Polygons)boundary));
|
||||
|
||||
Polylines polylines_blocker;
|
||||
coord_t clip_size = scale_(this->spacing) * 2;
|
||||
coord_t clip_size = scale_(this->get_spacing()) * 2;
|
||||
for (const Polyline &polyline : infill_ordered) {
|
||||
if (polyline.length() > 2.01 * clip_size) {
|
||||
polylines_blocker.push_back(polyline);
|
||||
@ -486,7 +486,7 @@ Fill::connect_infill(const Polylines &infill_ordered, const ExPolygon &boundary,
|
||||
}
|
||||
|
||||
//length between two lines
|
||||
coordf_t ideal_length = (1 / params.density) * this->spacing;
|
||||
coordf_t ideal_length = (1 / params.density) * this->get_spacing();
|
||||
|
||||
Polylines polylines_connected_first;
|
||||
bool first = true;
|
||||
@ -496,8 +496,8 @@ Fill::connect_infill(const Polylines &infill_ordered, const ExPolygon &boundary,
|
||||
Points &pts_end = polylines_connected_first.back().points;
|
||||
const Point &last_point = pts_end.back();
|
||||
const Point &first_point = polyline.points.front();
|
||||
if (last_point.distance_to(first_point) < scale_(this->spacing) * 10) {
|
||||
Points pts_frontier = getFrontier(polylines_frontier, last_point, first_point, scale_(this->spacing), polylines_blocker, scale_(ideal_length) * 2);
|
||||
if (last_point.distance_to(first_point) < scale_(this->get_spacing()) * 10) {
|
||||
Points pts_frontier = getFrontier(polylines_frontier, last_point, first_point, scale_(this->get_spacing()), polylines_blocker, scale_(ideal_length) * 2);
|
||||
if (!pts_frontier.empty()) {
|
||||
// The lines can be connected.
|
||||
pts_end.insert(pts_end.end(), pts_frontier.begin(), pts_frontier.end());
|
||||
@ -522,7 +522,7 @@ Fill::connect_infill(const Polylines &infill_ordered, const ExPolygon &boundary,
|
||||
const Point &first_point = polyline.points.front();
|
||||
|
||||
Polylines before = polylines_frontier;
|
||||
Points pts_frontier = getFrontier(polylines_frontier, last_point, first_point, scale_(this->spacing), polylines_blocker);
|
||||
Points pts_frontier = getFrontier(polylines_frontier, last_point, first_point, scale_(this->get_spacing()), polylines_blocker);
|
||||
if (!pts_frontier.empty()) {
|
||||
// The lines can be connected.
|
||||
pts_end.insert(pts_end.end(), pts_frontier.begin(), pts_frontier.end());
|
||||
@ -559,7 +559,7 @@ Fill::connect_infill(const Polylines &infill_ordered, const ExPolygon &boundary,
|
||||
Points pts_frontier = getFrontier(polylines_frontier,
|
||||
switch_id1 ? polylines_connected[idx1].first_point() : polylines_connected[idx1].last_point(),
|
||||
switch_id2 ? polylines_connected[min_idx].last_point() : polylines_connected[min_idx].first_point(),
|
||||
scale_(this->spacing), polylines_blocker);
|
||||
scale_(this->get_spacing()), polylines_blocker);
|
||||
if (!pts_frontier.empty()) {
|
||||
if (switch_id1) polylines_connected[idx1].reverse();
|
||||
if (switch_id2) polylines_connected[min_idx].reverse();
|
||||
@ -573,7 +573,7 @@ Fill::connect_infill(const Polylines &infill_ordered, const ExPolygon &boundary,
|
||||
|
||||
//try to create some loops if possible
|
||||
for (Polyline &polyline : polylines_connected) {
|
||||
Points pts_frontier = getFrontier(polylines_frontier, polyline.last_point(), polyline.first_point(), scale_(this->spacing), polylines_blocker);
|
||||
Points pts_frontier = getFrontier(polylines_frontier, polyline.last_point(), polyline.first_point(), scale_(this->get_spacing()), polylines_blocker);
|
||||
if (!pts_frontier.empty()) {
|
||||
polyline.points.insert(polyline.points.end(), pts_frontier.begin(), pts_frontier.end());
|
||||
polyline.points.insert(polyline.points.begin(), polyline.points.back());
|
||||
|
@ -98,7 +98,7 @@ public:
|
||||
FillAdaptive::Octree* adapt_fill_octree = nullptr;
|
||||
protected:
|
||||
// in unscaled coordinates, please use init (after settings all others settings) as some algos want to modify the value
|
||||
coordf_t spacing;
|
||||
coordf_t spacing_priv;
|
||||
|
||||
public:
|
||||
virtual ~Fill() {}
|
||||
@ -107,8 +107,8 @@ public:
|
||||
static Fill* new_from_type(const std::string &type);
|
||||
|
||||
void set_bounding_box(const Slic3r::BoundingBox &bbox) { bounding_box = bbox; }
|
||||
virtual void init_spacing(coordf_t spacing, const FillParams ¶ms) { this->spacing = spacing; }
|
||||
coordf_t get_spacing() const { return spacing; }
|
||||
virtual void init_spacing(coordf_t spacing, const FillParams ¶ms) { this->spacing_priv = spacing; }
|
||||
coordf_t get_spacing() const { return spacing_priv; }
|
||||
|
||||
// Do not sort the fill lines to optimize the print head path?
|
||||
virtual bool no_sort() const { return false; }
|
||||
@ -124,7 +124,7 @@ protected:
|
||||
Fill() :
|
||||
layer_id(size_t(-1)),
|
||||
z(0.),
|
||||
spacing(0.),
|
||||
spacing_priv(0.),
|
||||
// Infill / perimeter overlap.
|
||||
overlap(0.),
|
||||
// Initial angle is undefined.
|
||||
|
@ -14,7 +14,7 @@ FillConcentric::init_spacing(coordf_t spacing, const FillParams ¶ms)
|
||||
{
|
||||
Fill::init_spacing(spacing, params);
|
||||
if (params.density > 0.9999f && !params.dont_adjust) {
|
||||
this->spacing = unscale<double>(this->_adjust_solid_spacing(bounding_box.size()(0), _line_spacing_for_density(params.density)));
|
||||
this->spacing_priv = unscale<double>(this->_adjust_solid_spacing(bounding_box.size()(0), _line_spacing_for_density(params.density)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,13 +32,13 @@ FillConcentric::_fill_surface_single(
|
||||
coord_t distance = _line_spacing_for_density(params.density);
|
||||
if (params.density > 0.9999f && !params.dont_adjust) {
|
||||
//it's == this->_adjust_solid_spacing(bounding_box.size()(0), _line_spacing_for_density(params.density)) because of the init_spacing()
|
||||
distance = scale_(this->spacing);
|
||||
distance = scale_(this->get_spacing());
|
||||
}
|
||||
|
||||
Polygons loops = (Polygons)expolygon;
|
||||
Polygons last = loops;
|
||||
while (! last.empty()) {
|
||||
last = offset2(last, -double(distance + scale_(this->spacing) /2), +double(scale_(this->spacing) /2));
|
||||
last = offset2(last, -double(distance + scale_(this->get_spacing()) /2), +double(scale_(this->get_spacing()) /2));
|
||||
loops.insert(loops.end(), last.begin(), last.end());
|
||||
}
|
||||
|
||||
@ -79,7 +79,7 @@ FillConcentricWGapFill::fill_surface_extrusion(
|
||||
ExtrusionEntitiesPtr &out) const {
|
||||
|
||||
// Perform offset.
|
||||
Slic3r::ExPolygons expp = offset_ex(surface->expolygon, double(scale_(0 - 0.5 * this->spacing)));
|
||||
Slic3r::ExPolygons expp = offset_ex(surface->expolygon, double(scale_(0 - 0.5 * this->get_spacing())));
|
||||
// Create the infills for each of the regions.
|
||||
Polylines polylines_out;
|
||||
for (size_t i = 0; i < expp.size(); ++i) {
|
||||
@ -91,14 +91,14 @@ FillConcentricWGapFill::fill_surface_extrusion(
|
||||
//polylines_out);
|
||||
ExPolygon expolygon = expp[i];
|
||||
|
||||
coordf_t init_spacing = this->spacing;
|
||||
coordf_t init_spacing = this->get_spacing();
|
||||
|
||||
// no rotation is supported for this infill pattern
|
||||
BoundingBox bounding_box = expolygon.contour.bounding_box();
|
||||
|
||||
coord_t distance = _line_spacing_for_density(params.density);
|
||||
if (params.density > 0.9999f && !params.dont_adjust) {
|
||||
distance = scale_(this->spacing);
|
||||
distance = scale_(this->get_spacing());
|
||||
}
|
||||
|
||||
ExPolygons gaps;
|
||||
@ -106,7 +106,7 @@ FillConcentricWGapFill::fill_surface_extrusion(
|
||||
Polygons last = loops;
|
||||
bool first = true;
|
||||
while (!last.empty()) {
|
||||
Polygons next_onion = offset2(last, -double(distance + scale_(this->spacing) / 2), +double(scale_(this->spacing) / 2));
|
||||
Polygons next_onion = offset2(last, -double(distance + scale_(this->get_spacing()) / 2), +double(scale_(this->get_spacing()) / 2));
|
||||
loops.insert(loops.end(), next_onion.begin(), next_onion.end());
|
||||
append(gaps, diff_ex(
|
||||
offset(last, -0.5f * distance),
|
||||
@ -171,7 +171,7 @@ FillConcentricWGapFill::fill_surface_extrusion(
|
||||
}
|
||||
|
||||
// external gapfill
|
||||
ExPolygons gapfill_areas = diff_ex({ surface->expolygon }, offset_ex(expp, double(scale_(0.5 * this->spacing))));
|
||||
ExPolygons gapfill_areas = diff_ex({ surface->expolygon }, offset_ex(expp, double(scale_(0.5 * this->get_spacing()))));
|
||||
gapfill_areas = union_ex(gapfill_areas, true);
|
||||
if (gapfill_areas.size() > 0) {
|
||||
const double minarea = scale_(params.config->gap_fill_min_area.get_abs_value(params.flow.width)) * params.flow.scaled_width();
|
||||
|
@ -162,7 +162,7 @@ void FillGyroid::_fill_surface_single(
|
||||
// Density adjusted to have a good %of weight.
|
||||
double density_adjusted = std::max(0., params.density * DensityAdjust);
|
||||
// Distance between the gyroid waves in scaled coordinates.
|
||||
coord_t distance = coord_t(scale_(this->spacing) / density_adjusted);
|
||||
coord_t distance = coord_t(scale_(this->get_spacing()) / density_adjusted);
|
||||
|
||||
// align bounding box to a multiple of our grid module
|
||||
bb.merge(_align_to_grid(bb.min, Point(2*M_PI*distance, 2*M_PI*distance)));
|
||||
@ -171,7 +171,7 @@ void FillGyroid::_fill_surface_single(
|
||||
Polylines polylines = make_gyroid_waves(
|
||||
(double)scale_(this->z),
|
||||
density_adjusted,
|
||||
this->spacing,
|
||||
this->get_spacing(),
|
||||
ceil(bb.size()(0) / distance) + 1.,
|
||||
ceil(bb.size()(1) / distance) + 1.);
|
||||
|
||||
@ -185,7 +185,7 @@ void FillGyroid::_fill_surface_single(
|
||||
// remove too small bits (larger than longer)
|
||||
polylines.erase(
|
||||
//FIXME what is the small size? Removing tiny extrusions disconnects walls!
|
||||
std::remove_if(polylines.begin(), polylines.end(), [this](const Polyline &pl) { return pl.length() < scale_(this->spacing * 3); }),
|
||||
std::remove_if(polylines.begin(), polylines.end(), [this](const Polyline &pl) { return pl.length() < scale_(this->get_spacing() * 3); }),
|
||||
polylines.end());
|
||||
|
||||
if (! polylines.empty()) {
|
||||
@ -195,7 +195,7 @@ void FillGyroid::_fill_surface_single(
|
||||
if (params.connection == icNotConnected){
|
||||
append(polylines_out, std::move(polylines));
|
||||
} else {
|
||||
this->connect_infill(std::move(polylines), expolygon, polylines_out, this->spacing, params);
|
||||
this->connect_infill(std::move(polylines), expolygon, polylines_out, this->get_spacing(), params);
|
||||
}
|
||||
// new paths must be rotated back
|
||||
if (std::abs(infill_angle) >= EPSILON) {
|
||||
|
@ -16,12 +16,12 @@ void FillHoneycomb::_fill_surface_single(
|
||||
Polylines &polylines_out) const
|
||||
{
|
||||
// cache hexagons math
|
||||
CacheID cache_id(params.density, this->spacing);
|
||||
CacheID cache_id(params.density, this->get_spacing());
|
||||
Cache::iterator it_m = FillHoneycomb::cache.find(cache_id);
|
||||
if (it_m == FillHoneycomb::cache.end()) {
|
||||
it_m = FillHoneycomb::cache.insert(it_m, std::pair<CacheID, CacheData>(cache_id, CacheData()));
|
||||
CacheData &m = it_m->second;
|
||||
coord_t min_spacing = scale_(this->spacing);
|
||||
coord_t min_spacing = scale_(this->get_spacing());
|
||||
m.distance = coord_t(double(min_spacing) / params.density);
|
||||
m.hex_side = coord_t(double(m.distance) / (sqrt(3)/2));
|
||||
m.hex_width = m.distance * 2; // $m->{hex_width} == $m->{hex_side} * sqrt(3);
|
||||
|
@ -14,7 +14,7 @@ void FillPlanePath::_fill_surface_single(
|
||||
{
|
||||
expolygon.rotate(- direction.first);
|
||||
|
||||
coord_t distance_between_lines = coord_t(scale_(this->spacing) / params.density);
|
||||
coord_t distance_between_lines = coord_t(scale_(this->get_spacing()) / params.density);
|
||||
|
||||
// align infill across layers using the object's bounding box
|
||||
// Rotated bounding box of the whole object.
|
||||
|
@ -8,8 +8,8 @@
|
||||
namespace Slic3r {
|
||||
|
||||
void FillRectilinear::init_spacing(coordf_t spacing, const FillParams ¶ms) {
|
||||
this->spacing = spacing;
|
||||
this->_min_spacing = scale_(this->spacing);
|
||||
this->spacing_priv = spacing;
|
||||
this->_min_spacing = scale_(this->get_spacing());
|
||||
assert(params.density > 0.0001f);
|
||||
this->_line_spacing = coord_t(coordf_t(this->_min_spacing) / params.density);
|
||||
this->_diagonal_distance = this->_line_spacing * 2;
|
||||
@ -17,7 +17,7 @@ void FillRectilinear::init_spacing(coordf_t spacing, const FillParams ¶ms) {
|
||||
// define flow spacing according to requested density
|
||||
if (params.density > 0.9999f && !params.dont_adjust) {
|
||||
this->_line_spacing = this->_adjust_solid_spacing(bounding_box.size()(0), this->_line_spacing);
|
||||
this->spacing = unscale<double>(this->_line_spacing);
|
||||
this->spacing_priv = unscale<double>(this->_line_spacing);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2549,8 +2549,8 @@ bool FillRectilinear2::fill_surface_by_lines(const Surface *surface, const FillP
|
||||
ExPolygonWithOffset poly_with_offset(
|
||||
surface->expolygon,
|
||||
- rotate_vector.first,
|
||||
float(scale_(0 /*this->overlap*/ - (0.5 - INFILL_OVERLAP_OVER_SPACING) * this->spacing)),
|
||||
float(scale_(0 /*this->overlap*/ - 0.5 * this->spacing)));
|
||||
float(scale_(0 /*this->overlap*/ - (0.5 - INFILL_OVERLAP_OVER_SPACING) * this->get_spacing())),
|
||||
float(scale_(0 /*this->overlap*/ - 0.5 * this->get_spacing())));
|
||||
if (poly_with_offset.n_contours_inner == 0) {
|
||||
// Not a single infill line fits.
|
||||
//Prusa: maybe one shall trigger the gap fill here?
|
||||
@ -2563,7 +2563,7 @@ bool FillRectilinear2::fill_surface_by_lines(const Surface *surface, const FillP
|
||||
// define flow spacing according to requested density
|
||||
if (params.full_infill() && !params.dont_adjust || line_spacing == 0 ) {
|
||||
//it's == this->_adjust_solid_spacing(bounding_box.size()(0), line_spacing) because of the init_spacing
|
||||
line_spacing = scale_(this->spacing);
|
||||
line_spacing = scale_(this->get_spacing());
|
||||
} else {
|
||||
// extend bounding box so that our pattern will be aligned with other layers
|
||||
// Transform the reference point to the rotated coordinate system.
|
||||
@ -2730,7 +2730,7 @@ Polylines FillStars::fill_surface(const Surface *surface, const FillParams ¶
|
||||
Polylines polylines_out;
|
||||
if (! fill_surface_by_lines(surface, params2, 0.f, 0.f, polylines_out) ||
|
||||
! fill_surface_by_lines(surface, params2, float(M_PI / 3.), 0.f, polylines_out) ||
|
||||
! fill_surface_by_lines(surface, params3, float(2. * M_PI / 3.), float(0.5 * this->spacing / params2.density), polylines_out)) {
|
||||
! fill_surface_by_lines(surface, params3, float(2. * M_PI / 3.), float(0.5 * this->get_spacing() / params2.density), polylines_out)) {
|
||||
printf("FillStars::fill_surface() failed to fill a region.\n");
|
||||
}
|
||||
return polylines_out;
|
||||
@ -2765,7 +2765,7 @@ FillRectilinear2Peri::fill_surface_extrusion(const Surface *surface, const FillP
|
||||
// === extrude perimeter ===
|
||||
Polylines polylines_1;
|
||||
//generate perimeter:
|
||||
ExPolygons path_perimeter = offset2_ex(surface->expolygon, scale_(-this->spacing), scale_(this->spacing / 2));
|
||||
ExPolygons path_perimeter = offset2_ex(surface->expolygon, scale_(-this->get_spacing()), scale_(this->get_spacing() / 2));
|
||||
for (ExPolygon &expolygon : path_perimeter) {
|
||||
expolygon.contour.make_counter_clockwise();
|
||||
polylines_1.push_back(expolygon.contour.split_at_index(0));
|
||||
@ -2799,7 +2799,7 @@ FillRectilinear2Peri::fill_surface_extrusion(const Surface *surface, const FillP
|
||||
Polylines polylines_2;
|
||||
bool canFill = true;
|
||||
//50% overlap with the new perimeter
|
||||
ExPolygons path_inner = offset2_ex(surface->expolygon, scale_(-this->spacing * 1.5), scale_(this->spacing));
|
||||
ExPolygons path_inner = offset2_ex(surface->expolygon, scale_(-this->get_spacing() * 1.5), scale_(this->get_spacing()));
|
||||
for (ExPolygon &expolygon : path_inner) {
|
||||
Surface surfInner(*surface, expolygon);
|
||||
if (!fill_surface_by_lines(&surfInner, params, 0.f, 0.f, polylines_2)) {
|
||||
@ -2861,7 +2861,7 @@ coord_t FillScatteredRectilinear::_line_spacing_for_density(float density) const
|
||||
*/
|
||||
(void) density;
|
||||
|
||||
return coord_t(scale_(this->spacing) / 1.0);
|
||||
return coord_t(scale_(this->get_spacing()) / 1.0);
|
||||
}
|
||||
|
||||
Polylines FillScatteredRectilinear::fill_surface(const Surface *surface, const FillParams ¶ms) const
|
||||
@ -2869,7 +2869,7 @@ Polylines FillScatteredRectilinear::fill_surface(const Surface *surface, const F
|
||||
Polylines polylines_out;
|
||||
|
||||
// Offset the pattern randomly using the current layer index as the generator
|
||||
float offset = randomFloatFromSeed((uint32_t) layer_id) * 0.5f * this->spacing;
|
||||
float offset = randomFloatFromSeed((uint32_t) layer_id) * 0.5f * this->get_spacing();
|
||||
|
||||
if (!fill_surface_by_lines(surface, params, 0.f, offset, polylines_out)) {
|
||||
printf("FillScatteredRectilinear::fill_surface() failed to fill a region.\n");
|
||||
|
@ -1539,8 +1539,8 @@ bool FillRectilinear3::fill_surface_by_lines(const Surface *surface, const FillP
|
||||
// On the polygons of poly_with_offset, the infill lines will be connected.
|
||||
FillRectilinear3_Internal::ExPolygonWithOffset poly_with_offset(
|
||||
surface->expolygon,
|
||||
float(scale_(- (0.5 - INFILL_OVERLAP_OVER_SPACING) * this->spacing)),
|
||||
float(scale_(- 0.5 * this->spacing)));
|
||||
float(scale_(- (0.5 - INFILL_OVERLAP_OVER_SPACING) * this->get_spacing())),
|
||||
float(scale_(- 0.5 * this->get_spacing())));
|
||||
if (poly_with_offset.n_contours_inner == 0) {
|
||||
// Not a single infill line fits.
|
||||
//FIXME maybe one shall trigger the gap fill here?
|
||||
@ -1570,7 +1570,7 @@ Polylines FillRectilinear3::fill_surface(const Surface *surface, const FillParam
|
||||
{
|
||||
Polylines polylines_out;
|
||||
std::vector<FillDirParams> fill_dir_params;
|
||||
fill_dir_params.emplace_back(FillDirParams(this->spacing, 0.f));
|
||||
fill_dir_params.emplace_back(FillDirParams(this->get_spacing(), 0.f));
|
||||
if (! fill_surface_by_lines(surface, params, fill_dir_params, polylines_out))
|
||||
printf("FillRectilinear3::fill_surface() failed to fill a region.\n");
|
||||
//if (params.full_infill() && ! params.dont_adjust)
|
||||
@ -1587,8 +1587,8 @@ Polylines FillGrid3::fill_surface(const Surface *surface, const FillParams ¶
|
||||
params2.density *= 0.5f;
|
||||
Polylines polylines_out;
|
||||
std::vector<FillDirParams> fill_dir_params;
|
||||
fill_dir_params.emplace_back(FillDirParams(this->spacing, 0.f));
|
||||
fill_dir_params.emplace_back(FillDirParams(this->spacing, float(M_PI / 2.)));
|
||||
fill_dir_params.emplace_back(FillDirParams(this->get_spacing(), 0.f));
|
||||
fill_dir_params.emplace_back(FillDirParams(this->get_spacing(), float(M_PI / 2.)));
|
||||
if (! fill_surface_by_lines(surface, params2, fill_dir_params, polylines_out))
|
||||
printf("FillGrid3::fill_surface() failed to fill a region.\n");
|
||||
return polylines_out;
|
||||
@ -1601,9 +1601,9 @@ Polylines FillTriangles3::fill_surface(const Surface *surface, const FillParams
|
||||
params2.density *= 0.333333333f;
|
||||
Polylines polylines_out;
|
||||
std::vector<FillDirParams> fill_dir_params;
|
||||
fill_dir_params.emplace_back(FillDirParams(this->spacing, 0.));
|
||||
fill_dir_params.emplace_back(FillDirParams(this->spacing, M_PI / 3.));
|
||||
fill_dir_params.emplace_back(FillDirParams(this->spacing, 2. * M_PI / 3.));
|
||||
fill_dir_params.emplace_back(FillDirParams(this->get_spacing(), 0.));
|
||||
fill_dir_params.emplace_back(FillDirParams(this->get_spacing(), M_PI / 3.));
|
||||
fill_dir_params.emplace_back(FillDirParams(this->get_spacing(), 2. * M_PI / 3.));
|
||||
if (! fill_surface_by_lines(surface, params2, fill_dir_params, polylines_out))
|
||||
printf("FillTriangles3::fill_surface() failed to fill a region.\n");
|
||||
return polylines_out;
|
||||
@ -1616,9 +1616,9 @@ Polylines FillStars3::fill_surface(const Surface *surface, const FillParams &par
|
||||
params2.density *= 0.333333333f;
|
||||
Polylines polylines_out;
|
||||
std::vector<FillDirParams> fill_dir_params;
|
||||
fill_dir_params.emplace_back(FillDirParams(this->spacing, 0.));
|
||||
fill_dir_params.emplace_back(FillDirParams(this->spacing, M_PI / 3.));
|
||||
fill_dir_params.emplace_back(FillDirParams(this->spacing, 2. * M_PI / 3., 0.5 * this->spacing / params2.density));
|
||||
fill_dir_params.emplace_back(FillDirParams(this->get_spacing(), 0.));
|
||||
fill_dir_params.emplace_back(FillDirParams(this->get_spacing(), M_PI / 3.));
|
||||
fill_dir_params.emplace_back(FillDirParams(this->get_spacing(), 2. * M_PI / 3., 0.5 * this->get_spacing() / params2.density));
|
||||
if (! fill_surface_by_lines(surface, params2, fill_dir_params, polylines_out))
|
||||
printf("FillStars3::fill_surface() failed to fill a region.\n");
|
||||
return polylines_out;
|
||||
@ -1632,9 +1632,9 @@ Polylines FillCubic3::fill_surface(const Surface *surface, const FillParams &par
|
||||
Polylines polylines_out;
|
||||
std::vector<FillDirParams> fill_dir_params;
|
||||
coordf_t dx = sqrt(0.5) * z;
|
||||
fill_dir_params.emplace_back(FillDirParams(this->spacing, 0., dx));
|
||||
fill_dir_params.emplace_back(FillDirParams(this->spacing, M_PI / 3., -dx));
|
||||
fill_dir_params.emplace_back(FillDirParams(this->spacing, 2. * M_PI / 3., dx));
|
||||
fill_dir_params.emplace_back(FillDirParams(this->get_spacing(), 0., dx));
|
||||
fill_dir_params.emplace_back(FillDirParams(this->get_spacing(), M_PI / 3., -dx));
|
||||
fill_dir_params.emplace_back(FillDirParams(this->get_spacing(), 2. * M_PI / 3., dx));
|
||||
if (! fill_surface_by_lines(surface, params2, fill_dir_params, polylines_out))
|
||||
printf("FillCubic3::fill_surface() failed to fill a region.\n");
|
||||
return polylines_out;
|
||||
|
@ -103,7 +103,7 @@ namespace Slic3r {
|
||||
|
||||
void FillSmooth::fill_surface_extrusion(const Surface *surface, const FillParams ¶ms, ExtrusionEntitiesPtr &out) const
|
||||
{
|
||||
coordf_t init_spacing = this->spacing;
|
||||
coordf_t init_spacing = this->get_spacing();
|
||||
|
||||
// compute the volume to extrude
|
||||
double volumeToOccupy = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user