mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-14 17:45:57 +08:00
bugfix dense infill
This commit is contained in:
parent
aab7dd32f3
commit
b489f86f95
@ -709,15 +709,24 @@ ExPolygons fit_to_size(ExPolygon polygon_to_cover, ExPolygon polygon_to_check, c
|
||||
return intersection_ex(polygon_reduced, growing_area);
|
||||
}
|
||||
|
||||
//FIXME: cerify it works if the part is split in 2 in the Z axis
|
||||
void PrintObject::count_distance_solid() {
|
||||
//if dense area * COEFF_SPLIT > sparse area then fill all with dense
|
||||
// sparse area = layer's fill area - solid area
|
||||
const float COEFF_SPLIT = 2;
|
||||
const int NB_DENSE_LAYERS = 1;
|
||||
for (size_t idx_region = 0; idx_region < this->m_print->regions().size(); ++idx_region) {
|
||||
for (const PrintRegion *region : this->m_print->regions()) {
|
||||
//count how many surface there are on each one
|
||||
LayerRegion *previousOne = NULL;
|
||||
if (this->layers().size() > 1) previousOne = this->layers()[this->layers().size() - 1]->get_region(idx_region);
|
||||
size_t top_z = this->layers().size() - 1;
|
||||
for (; top_z < this->layers().size() && previousOne == NULL; --top_z){
|
||||
for (LayerRegion * lregion : this->layers()[top_z]->regions()){
|
||||
if (lregion->region() == region){
|
||||
previousOne = lregion;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (previousOne != NULL && previousOne->region()->config().infill_dense.getBool() && previousOne->region()->config().fill_density<40) {
|
||||
for (Surface &surf : previousOne->fill_surfaces.surfaces) {
|
||||
if (surf.is_solid()) {
|
||||
@ -725,7 +734,16 @@ void PrintObject::count_distance_solid() {
|
||||
}
|
||||
}
|
||||
for (size_t idx_layer = this->layers().size() - 2; idx_layer < this->layers().size() - 1; --idx_layer) {
|
||||
LayerRegion *layerm = this->layers()[idx_layer]->get_region(idx_region);
|
||||
LayerRegion *layerm = NULL;
|
||||
for (LayerRegion * lregion : this->layers()[top_z]->regions()){
|
||||
if (lregion->region() == region){
|
||||
layerm = lregion;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (layerm == NULL){
|
||||
continue;
|
||||
}
|
||||
Surfaces surf_to_add;
|
||||
for (Surface &surf : layerm->fill_surfaces.surfaces) {
|
||||
if (!surf.is_solid()){
|
||||
|
Loading…
x
Reference in New Issue
Block a user