mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-12 04:49:00 +08:00
Dense sparse infill
(also a bit of cleaning)
This commit is contained in:
parent
d21c33e9b5
commit
3de81fc960
@ -164,8 +164,15 @@ void make_fill(LayerRegion &layerm, ExtrusionEntityCollection &out)
|
|||||||
fill_pattern = (surface.is_external() && ! is_bridge) ?
|
fill_pattern = (surface.is_external() && ! is_bridge) ?
|
||||||
(surface.is_top() ? layerm.region()->config.top_fill_pattern.value : layerm.region()->config.bottom_fill_pattern.value) :
|
(surface.is_top() ? layerm.region()->config.top_fill_pattern.value : layerm.region()->config.bottom_fill_pattern.value) :
|
||||||
ipRectilinear;
|
ipRectilinear;
|
||||||
} else if (density <= 0)
|
} else {
|
||||||
continue;
|
if (layerm.region()->config.infill_dense_layers.getInt() > 0
|
||||||
|
&& surface.maxNbLayersOnTop < layerm.region()->config.infill_dense_layers.getInt() + layerm.region()->config.top_solid_layers.getInt()
|
||||||
|
&& surface.maxNbLayersOnTop >= layerm.region()->config.top_solid_layers.getInt()){
|
||||||
|
density = layerm.region()->config.infill_dense_density.getFloat();
|
||||||
|
}
|
||||||
|
if (density <= 0)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// get filler object
|
// get filler object
|
||||||
std::unique_ptr<Fill> f = std::unique_ptr<Fill>(Fill::new_from_type(fill_pattern));
|
std::unique_ptr<Fill> f = std::unique_ptr<Fill>(Fill::new_from_type(fill_pattern));
|
||||||
@ -222,15 +229,14 @@ void make_fill(LayerRegion &layerm, ExtrusionEntityCollection &out)
|
|||||||
// Used by the concentric infill pattern to clip the loops to create extrusion paths.
|
// Used by the concentric infill pattern to clip the loops to create extrusion paths.
|
||||||
f->loop_clipping = scale_(flow.nozzle_diameter) * LOOP_CLIPPING_LENGTH_OVER_NOZZLE_DIAMETER;
|
f->loop_clipping = scale_(flow.nozzle_diameter) * LOOP_CLIPPING_LENGTH_OVER_NOZZLE_DIAMETER;
|
||||||
// f->layer_height = h;
|
// f->layer_height = h;
|
||||||
//give the overlap size, it's not the real value (it can depend of the external_perimeter_extrusion_width)
|
//give the overlap size, it's not the real value (it can depend of the external_perimeter_extrusion_width)
|
||||||
f->overlap = layerm.region()->config.infill_overlap.get_abs_value(flow.nozzle_diameter);
|
f->overlap = layerm.region()->config.infill_overlap.get_abs_value(flow.nozzle_diameter);
|
||||||
// apply half spacing using this flow's own spacing and generate infill
|
// apply half spacing using this flow's own spacing and generate infill
|
||||||
FillParams params;
|
FillParams params;
|
||||||
params.density = 0.01 * density;
|
params.density = 0.01 * density;
|
||||||
params.dont_adjust = false;
|
params.dont_adjust = false;
|
||||||
params.fill_exactly = layerm.region()->config.enforce_full_fill_volume.getBool();
|
params.fill_exactly = layerm.region()->config.enforce_full_fill_volume.getBool();
|
||||||
|
|
||||||
|
|
||||||
// calculate actual flow from spacing (which might have been adjusted by the infill
|
// calculate actual flow from spacing (which might have been adjusted by the infill
|
||||||
// pattern generator)
|
// pattern generator)
|
||||||
if (using_internal_flow) {
|
if (using_internal_flow) {
|
||||||
@ -240,12 +246,12 @@ void make_fill(LayerRegion &layerm, ExtrusionEntityCollection &out)
|
|||||||
} else {
|
} else {
|
||||||
flow = Flow::new_from_spacing(f->spacing, flow.nozzle_diameter, h, is_bridge || f->use_bridge_flow());
|
flow = Flow::new_from_spacing(f->spacing, flow.nozzle_diameter, h, is_bridge || f->use_bridge_flow());
|
||||||
}
|
}
|
||||||
|
|
||||||
float flow_percent = 1;
|
float flow_percent = 1;
|
||||||
if(surface.is_overBridge()){
|
if(surface.is_overBridge()){
|
||||||
params.flow_mult = layerm.region()->config.over_bridge_flow_ratio;
|
params.flow_mult = layerm.region()->config.over_bridge_flow_ratio;
|
||||||
}
|
}
|
||||||
|
|
||||||
f->fill_surface_extrusion(&surface, params, flow, out);
|
f->fill_surface_extrusion(&surface, params, flow, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,6 +205,7 @@ public:
|
|||||||
void _make_perimeters();
|
void _make_perimeters();
|
||||||
void _infill();
|
void _infill();
|
||||||
void clip_fill_surfaces();
|
void clip_fill_surfaces();
|
||||||
|
void count_distance_top();
|
||||||
void discover_horizontal_shells();
|
void discover_horizontal_shells();
|
||||||
void combine_infill();
|
void combine_infill();
|
||||||
void _generate_support_material();
|
void _generate_support_material();
|
||||||
|
@ -827,6 +827,53 @@ PrintConfigDef::PrintConfigDef()
|
|||||||
def->min = 1;
|
def->min = 1;
|
||||||
def->default_value = new ConfigOptionInt(1);
|
def->default_value = new ConfigOptionInt(1);
|
||||||
|
|
||||||
|
def = this->add("infill_dense_layers", coInt);
|
||||||
|
def->label = L("Number of dense layers");
|
||||||
|
def->category = L("Infill");
|
||||||
|
def->tooltip = L("Set the number of denser infill layer you want between the normal sparse infill and the top layers. 0 to disable");
|
||||||
|
def->sidetext = L("layers");
|
||||||
|
def->cli = "infill-dense-layers=i";
|
||||||
|
def->min = 0;
|
||||||
|
def->default_value = new ConfigOptionInt(0);
|
||||||
|
|
||||||
|
def = this->add("infill_dense_density", coPercent);
|
||||||
|
def->gui_type = "f_enum_open";
|
||||||
|
def->gui_flags = "show_value";
|
||||||
|
def->label = L("Dense fill density");
|
||||||
|
def->category = L("Infill");
|
||||||
|
def->tooltip = L("Density of the dense internal infill, expressed in the range 0% - 100%.");
|
||||||
|
def->sidetext = L("%");
|
||||||
|
def->cli = "infill-dense-density=s";
|
||||||
|
def->min = 0;
|
||||||
|
def->max = 100;
|
||||||
|
def->enum_values.push_back("0");
|
||||||
|
def->enum_values.push_back("4");
|
||||||
|
def->enum_values.push_back("5.5");
|
||||||
|
def->enum_values.push_back("7.5");
|
||||||
|
def->enum_values.push_back("10");
|
||||||
|
def->enum_values.push_back("13");
|
||||||
|
def->enum_values.push_back("18");
|
||||||
|
def->enum_values.push_back("23");
|
||||||
|
def->enum_values.push_back("31");
|
||||||
|
def->enum_values.push_back("42");
|
||||||
|
def->enum_values.push_back("55");
|
||||||
|
def->enum_values.push_back("75");
|
||||||
|
def->enum_values.push_back("100");
|
||||||
|
def->enum_labels.push_back("0");
|
||||||
|
def->enum_labels.push_back("4");
|
||||||
|
def->enum_labels.push_back("5.5");
|
||||||
|
def->enum_labels.push_back("7.5");
|
||||||
|
def->enum_labels.push_back("10");
|
||||||
|
def->enum_labels.push_back("13");
|
||||||
|
def->enum_labels.push_back("18");
|
||||||
|
def->enum_labels.push_back("23");
|
||||||
|
def->enum_labels.push_back("31");
|
||||||
|
def->enum_labels.push_back("42");
|
||||||
|
def->enum_labels.push_back("55");
|
||||||
|
def->enum_labels.push_back("75");
|
||||||
|
def->enum_labels.push_back("100");
|
||||||
|
def->default_value = new ConfigOptionPercent(42);
|
||||||
|
|
||||||
def = this->add("infill_extruder", coInt);
|
def = this->add("infill_extruder", coInt);
|
||||||
def->label = L("Infill extruder");
|
def->label = L("Infill extruder");
|
||||||
def->category = L("Extruders");
|
def->category = L("Extruders");
|
||||||
|
@ -29,7 +29,7 @@ enum GCodeFlavor {
|
|||||||
|
|
||||||
enum InfillPattern {
|
enum InfillPattern {
|
||||||
ipRectilinear, ipGrid, ipTriangles, ipStars, ipCubic, ipLine, ipConcentric, ipHoneycomb, ip3DHoneycomb,
|
ipRectilinear, ipGrid, ipTriangles, ipStars, ipCubic, ipLine, ipConcentric, ipHoneycomb, ip3DHoneycomb,
|
||||||
ipGyroid, ipHilbertCurve, ipArchimedeanChords, ipOctagramSpiral, ipSmooth, ipSmoothHilbert, ipSmoothTriple,
|
ipGyroid, ipHilbertCurve, ipArchimedeanChords, ipOctagramSpiral, ipSmooth, ipSmoothHilbert, ipSmoothTriple,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum SupportMaterialPattern {
|
enum SupportMaterialPattern {
|
||||||
@ -242,12 +242,12 @@ protected:
|
|||||||
m_defaults = defaults;
|
m_defaults = defaults;
|
||||||
m_keys.clear();
|
m_keys.clear();
|
||||||
m_keys.reserve(m_map_name_to_offset.size());
|
m_keys.reserve(m_map_name_to_offset.size());
|
||||||
for (const auto &kvp : defs->options) {
|
for (const auto &kvp : defs->options) {
|
||||||
// Find the option given the option name kvp.first by an offset from (char*)m_defaults.
|
// Find the option given the option name kvp.first by an offset from (char*)m_defaults.
|
||||||
ConfigOption *opt = this->optptr(kvp.first, m_defaults);
|
ConfigOption *opt = this->optptr(kvp.first, m_defaults);
|
||||||
if (opt == nullptr)
|
if (opt == nullptr)
|
||||||
// This option is not defined by the ConfigBase of type T.
|
// This option is not defined by the ConfigBase of type T.
|
||||||
continue;
|
continue;
|
||||||
m_keys.emplace_back(kvp.first);
|
m_keys.emplace_back(kvp.first);
|
||||||
const ConfigOptionDef *def = defs->get(kvp.first);
|
const ConfigOptionDef *def = defs->get(kvp.first);
|
||||||
assert(def != nullptr);
|
assert(def != nullptr);
|
||||||
@ -392,7 +392,7 @@ public:
|
|||||||
ConfigOptionEnum<InfillPattern> top_fill_pattern;
|
ConfigOptionEnum<InfillPattern> top_fill_pattern;
|
||||||
ConfigOptionEnum<InfillPattern> bottom_fill_pattern;
|
ConfigOptionEnum<InfillPattern> bottom_fill_pattern;
|
||||||
ConfigOptionBool enforce_full_fill_volume;
|
ConfigOptionBool enforce_full_fill_volume;
|
||||||
ConfigOptionFloat external_infill_margin;
|
ConfigOptionFloat external_infill_margin;
|
||||||
ConfigOptionFloatOrPercent external_perimeter_extrusion_width;
|
ConfigOptionFloatOrPercent external_perimeter_extrusion_width;
|
||||||
ConfigOptionFloatOrPercent external_perimeter_speed;
|
ConfigOptionFloatOrPercent external_perimeter_speed;
|
||||||
ConfigOptionBool external_perimeters_first;
|
ConfigOptionBool external_perimeters_first;
|
||||||
@ -407,6 +407,8 @@ public:
|
|||||||
ConfigOptionInt infill_every_layers;
|
ConfigOptionInt infill_every_layers;
|
||||||
ConfigOptionFloatOrPercent infill_overlap;
|
ConfigOptionFloatOrPercent infill_overlap;
|
||||||
ConfigOptionFloat infill_speed;
|
ConfigOptionFloat infill_speed;
|
||||||
|
ConfigOptionInt infill_dense_layers;
|
||||||
|
ConfigOptionPercent infill_dense_density;
|
||||||
ConfigOptionBool overhangs;
|
ConfigOptionBool overhangs;
|
||||||
ConfigOptionInt perimeter_extruder;
|
ConfigOptionInt perimeter_extruder;
|
||||||
ConfigOptionFloatOrPercent perimeter_extrusion_width;
|
ConfigOptionFloatOrPercent perimeter_extrusion_width;
|
||||||
@ -450,6 +452,8 @@ protected:
|
|||||||
OPT_PTR(infill_every_layers);
|
OPT_PTR(infill_every_layers);
|
||||||
OPT_PTR(infill_overlap);
|
OPT_PTR(infill_overlap);
|
||||||
OPT_PTR(infill_speed);
|
OPT_PTR(infill_speed);
|
||||||
|
OPT_PTR(infill_dense_layers);
|
||||||
|
OPT_PTR(infill_dense_density);
|
||||||
OPT_PTR(overhangs);
|
OPT_PTR(overhangs);
|
||||||
OPT_PTR(perimeter_extruder);
|
OPT_PTR(perimeter_extruder);
|
||||||
OPT_PTR(perimeter_extrusion_width);
|
OPT_PTR(perimeter_extrusion_width);
|
||||||
@ -753,7 +757,7 @@ class FullPrintConfig :
|
|||||||
public HostConfig
|
public HostConfig
|
||||||
{
|
{
|
||||||
STATIC_PRINT_CONFIG_CACHE_DERIVED(FullPrintConfig)
|
STATIC_PRINT_CONFIG_CACHE_DERIVED(FullPrintConfig)
|
||||||
FullPrintConfig() : PrintObjectConfig(0), PrintRegionConfig(0), PrintConfig(0), HostConfig(0) { initialize_cache(); *this = s_cache_FullPrintConfig.defaults(); }
|
FullPrintConfig() : PrintObjectConfig(0), PrintRegionConfig(0), PrintConfig(0), HostConfig(0) { initialize_cache(); *this = s_cache_FullPrintConfig.defaults(); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Validate the FullPrintConfig. Returns an empty string on success, otherwise an error message is returned.
|
// Validate the FullPrintConfig. Returns an empty string on success, otherwise an error message is returned.
|
||||||
|
@ -156,9 +156,9 @@ bool PrintObject::invalidate_state_by_config_options(const std::vector<t_config_
|
|||||||
|| opt_key == "first_layer_height"
|
|| opt_key == "first_layer_height"
|
||||||
|| opt_key == "raft_layers") {
|
|| opt_key == "raft_layers") {
|
||||||
steps.emplace_back(posSlice);
|
steps.emplace_back(posSlice);
|
||||||
this->reset_layer_height_profile();
|
this->reset_layer_height_profile();
|
||||||
}
|
}
|
||||||
else if (
|
else if (
|
||||||
opt_key == "clip_multipart_objects"
|
opt_key == "clip_multipart_objects"
|
||||||
|| opt_key == "elefant_foot_compensation"
|
|| opt_key == "elefant_foot_compensation"
|
||||||
|| opt_key == "support_material_contact_distance"
|
|| opt_key == "support_material_contact_distance"
|
||||||
@ -189,10 +189,12 @@ bool PrintObject::invalidate_state_by_config_options(const std::vector<t_config_
|
|||||||
|| opt_key == "infill_only_where_needed"
|
|| opt_key == "infill_only_where_needed"
|
||||||
|| opt_key == "infill_every_layers"
|
|| opt_key == "infill_every_layers"
|
||||||
|| opt_key == "solid_infill_every_layers"
|
|| opt_key == "solid_infill_every_layers"
|
||||||
|
|| opt_key == "infill_dense_layers"
|
||||||
|
|| opt_key == "infill_dense_density"
|
||||||
|| opt_key == "bottom_solid_layers"
|
|| opt_key == "bottom_solid_layers"
|
||||||
|| opt_key == "top_solid_layers"
|
|| opt_key == "top_solid_layers"
|
||||||
|| opt_key == "solid_infill_below_area"
|
|| opt_key == "solid_infill_below_area"
|
||||||
|| opt_key == "external_infill_margin"
|
|| opt_key == "external_infill_margin"
|
||||||
|| opt_key == "infill_extruder"
|
|| opt_key == "infill_extruder"
|
||||||
|| opt_key == "solid_infill_extruder"
|
|| opt_key == "solid_infill_extruder"
|
||||||
|| opt_key == "infill_extrusion_width"
|
|| opt_key == "infill_extrusion_width"
|
||||||
@ -239,8 +241,8 @@ bool PrintObject::invalidate_state_by_config_options(const std::vector<t_config_
|
|||||||
// these options only affect G-code export, so nothing to invalidate
|
// these options only affect G-code export, so nothing to invalidate
|
||||||
} else {
|
} else {
|
||||||
// for legacy, if we can't handle this option let's invalidate all steps
|
// for legacy, if we can't handle this option let's invalidate all steps
|
||||||
this->reset_layer_height_profile();
|
this->reset_layer_height_profile();
|
||||||
this->invalidate_all_steps();
|
this->invalidate_all_steps();
|
||||||
invalidated = true;
|
invalidated = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -366,15 +368,18 @@ void PrintObject::_prepare_infill()
|
|||||||
// the following step needs to be done before combination because it may need
|
// the following step needs to be done before combination because it may need
|
||||||
// to remove only half of the combined infill
|
// to remove only half of the combined infill
|
||||||
this->bridge_over_infill();
|
this->bridge_over_infill();
|
||||||
this->replaceSurfaceType( stInternalSolid, stInternalOverBridge, stInternalBridge);
|
this->replaceSurfaceType( stInternalSolid, stInternalOverBridge, stInternalBridge);
|
||||||
this->replaceSurfaceType( stInternalSolid, stInternalOverBridge, stBottomBridge);
|
this->replaceSurfaceType( stInternalSolid, stInternalOverBridge, stBottomBridge);
|
||||||
this->replaceSurfaceType( stTop, stTopOverBridge, stInternalBridge);
|
this->replaceSurfaceType( stTop, stTopOverBridge, stInternalBridge);
|
||||||
this->replaceSurfaceType( stTop, stTopOverBridge, stBottomBridge);
|
this->replaceSurfaceType( stTop, stTopOverBridge, stBottomBridge);
|
||||||
|
|
||||||
// combine fill surfaces to honor the "infill every N layers" option
|
// combine fill surfaces to honor the "infill every N layers" option
|
||||||
this->combine_infill();
|
this->combine_infill();
|
||||||
|
|
||||||
|
// count the distance from the nearest top surface, to allow to use denser infill
|
||||||
|
// if neded and if infill_dense_layers is positive.
|
||||||
|
this->count_distance_top();
|
||||||
|
|
||||||
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
||||||
for (size_t region_id = 0; region_id < this->print()->regions.size(); ++ region_id) {
|
for (size_t region_id = 0; region_id < this->print()->regions.size(); ++ region_id) {
|
||||||
for (const Layer *layer : this->layers) {
|
for (const Layer *layer : this->layers) {
|
||||||
@ -390,6 +395,38 @@ void PrintObject::_prepare_infill()
|
|||||||
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */
|
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PrintObject::count_distance_top(){
|
||||||
|
|
||||||
|
for (int idx_region = 0; idx_region < this->_print->regions.size(); ++idx_region) {
|
||||||
|
|
||||||
|
//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);
|
||||||
|
if (previousOne != NULL && previousOne->region()->config.infill_dense_layers.getInt() > 0){
|
||||||
|
for (int idx_layer = this->layers.size() - 2; idx_layer >= 0; --idx_layer){
|
||||||
|
LayerRegion *layerm = this->layers[idx_layer]->get_region(idx_region);
|
||||||
|
for (Surface &surf : layerm->fill_surfaces.surfaces){
|
||||||
|
if (!surf.is_top()){
|
||||||
|
surf.maxNbLayersOnTop = 65000;
|
||||||
|
//find the surface which intersect with the smalle maxNb possible
|
||||||
|
for (Surface &upp : previousOne->fill_surfaces.surfaces){
|
||||||
|
// i'm using that because the result is better & different than
|
||||||
|
// upp.expolygon.overlaps(surf.expolygon), surf.expolygon.overlaps(upp.expolygon)
|
||||||
|
if (intersection_ex(surf, upp).size() > 0){
|
||||||
|
surf.maxNbLayersOnTop = std::min(surf.maxNbLayersOnTop, (unsigned short)(upp.maxNbLayersOnTop + 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
surf.maxNbLayersOnTop = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
previousOne = layerm;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// This function analyzes slices of a region (SurfaceCollection slices).
|
// This function analyzes slices of a region (SurfaceCollection slices).
|
||||||
// Each region slice (instance of Surface) is analyzed, whether it is supported or whether it is the top surface.
|
// Each region slice (instance of Surface) is analyzed, whether it is supported or whether it is the top surface.
|
||||||
// Initially all slices are of type stInternal.
|
// Initially all slices are of type stInternal.
|
||||||
@ -487,7 +524,6 @@ void PrintObject::detect_surfaces_type()
|
|||||||
diff(layerm_slices_surfaces, to_polygons(lower_layer->slices), true),
|
diff(layerm_slices_surfaces, to_polygons(lower_layer->slices), true),
|
||||||
-offset, offset),
|
-offset, offset),
|
||||||
surface_type_bottom_other);
|
surface_type_bottom_other);
|
||||||
|
|
||||||
// if user requested internal shells, we need to identify surfaces
|
// if user requested internal shells, we need to identify surfaces
|
||||||
// lying on other slices not belonging to this region
|
// lying on other slices not belonging to this region
|
||||||
if (interface_shells) {
|
if (interface_shells) {
|
||||||
@ -504,7 +540,6 @@ void PrintObject::detect_surfaces_type()
|
|||||||
stBottom);
|
stBottom);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// if no lower layer, all surfaces of this one are solid
|
// if no lower layer, all surfaces of this one are solid
|
||||||
// we clone surfaces because we're going to clear the slices collection
|
// we clone surfaces because we're going to clear the slices collection
|
||||||
@ -512,22 +547,6 @@ void PrintObject::detect_surfaces_type()
|
|||||||
for (Surface &surface : bottom)
|
for (Surface &surface : bottom)
|
||||||
surface.surface_type = surface_type_bottom_1st;
|
surface.surface_type = surface_type_bottom_1st;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Any surface lying on the void is a true bottom bridge (an overhang)
|
|
||||||
// and we have to conpensate if we are over that
|
|
||||||
// Surfaces bottomOverBridge;
|
|
||||||
// if(under_lower_layer){
|
|
||||||
// surfaces_append(
|
|
||||||
// bottomOverBridge,
|
|
||||||
// offset2_ex(
|
|
||||||
// diff(layerm_slices_surfaces, to_polygons(under_lower_layer->slices), true),
|
|
||||||
// -offset, offset),
|
|
||||||
// stInternalOverBridge);
|
|
||||||
// std::cout<<idx_layer<<" under_lower_layer "<<under_lower_layer->slices.expolygons.size()<<" > "<<bottomOverBridge.size()<<", bot="<<bottom.size()<<"\n";
|
|
||||||
// for(int i=0;i<under_lower_layer->slices.expolygons.size();i++) std::cout<<" area of under_lower_layer "<<under_lower_layer->slices.expolygons[i].area()<<"\n";
|
|
||||||
// for(int i=0;i<bottom.size();i++) std::cout<<" area of bottom "<<bottom[i].area()<<"\n";
|
|
||||||
// for(int i=0;i<bottomOverBridge.size();i++) std::cout<<" area of overbridge "<<bottomOverBridge[i].area()<<"\n";
|
|
||||||
// }
|
|
||||||
|
|
||||||
// now, if the object contained a thin membrane, we could have overlapping bottom
|
// now, if the object contained a thin membrane, we could have overlapping bottom
|
||||||
// and top surfaces; let's do an intersection to discover them and consider them
|
// and top surfaces; let's do an intersection to discover them and consider them
|
||||||
@ -563,12 +582,6 @@ void PrintObject::detect_surfaces_type()
|
|||||||
{
|
{
|
||||||
Polygons topbottom = to_polygons(top);
|
Polygons topbottom = to_polygons(top);
|
||||||
polygons_append(topbottom, to_polygons(bottom));
|
polygons_append(topbottom, to_polygons(bottom));
|
||||||
// ExPolygons overExPolygons = diff_ex(to_polygons(bottomOverBridge), topbottom, false);
|
|
||||||
// surfaces_append(surfaces_out,
|
|
||||||
// overExPolygons,
|
|
||||||
// stInternalOverBridge);
|
|
||||||
// for(int i=0;i<overExPolygons.size();i++) std::cout<<" area of overExPolygons "<<overExPolygons[i].area()<<"\n";
|
|
||||||
// polygons_append(topbottom, to_polygons(bottomOverBridge));
|
|
||||||
surfaces_append(surfaces_out,
|
surfaces_append(surfaces_out,
|
||||||
diff_ex(layerm_slices_surfaces, topbottom, false),
|
diff_ex(layerm_slices_surfaces, topbottom, false),
|
||||||
stInternal);
|
stInternal);
|
||||||
@ -785,8 +798,8 @@ void PrintObject::discover_vertical_shells()
|
|||||||
PROFILE_BLOCK(discover_vertical_shells_region_layer);
|
PROFILE_BLOCK(discover_vertical_shells_region_layer);
|
||||||
|
|
||||||
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
||||||
static size_t debug_idx = 0;
|
static size_t debug_idx = 0;
|
||||||
++ debug_idx;
|
++ debug_idx;
|
||||||
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */
|
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */
|
||||||
|
|
||||||
Layer *layer = this->layers[idx_layer];
|
Layer *layer = this->layers[idx_layer];
|
||||||
@ -811,13 +824,13 @@ void PrintObject::discover_vertical_shells()
|
|||||||
#if 0
|
#if 0
|
||||||
// #ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
// #ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
||||||
{
|
{
|
||||||
Slic3r::SVG svg_cummulative(debug_out_path("discover_vertical_shells-perimeters-before-union-run%d.svg", debug_idx), this->bounding_box());
|
Slic3r::SVG svg_cummulative(debug_out_path("discover_vertical_shells-perimeters-before-union-run%d.svg", debug_idx), this->bounding_box());
|
||||||
for (int n = (int)idx_layer - n_extra_bottom_layers; n <= (int)idx_layer + n_extra_top_layers; ++ n) {
|
for (int n = (int)idx_layer - n_extra_bottom_layers; n <= (int)idx_layer + n_extra_top_layers; ++ n) {
|
||||||
if (n < 0 || n >= (int)this->layers.size())
|
if (n < 0 || n >= (int)this->layers.size())
|
||||||
continue;
|
continue;
|
||||||
ExPolygons &expolys = this->layers[n]->perimeter_expolygons;
|
ExPolygons &expolys = this->layers[n]->perimeter_expolygons;
|
||||||
for (size_t i = 0; i < expolys.size(); ++ i) {
|
for (size_t i = 0; i < expolys.size(); ++ i) {
|
||||||
Slic3r::SVG svg(debug_out_path("discover_vertical_shells-perimeters-before-union-run%d-layer%d-expoly%d.svg", debug_idx, n, i), get_extents(expolys[i]));
|
Slic3r::SVG svg(debug_out_path("discover_vertical_shells-perimeters-before-union-run%d-layer%d-expoly%d.svg", debug_idx, n, i), get_extents(expolys[i]));
|
||||||
svg.draw(expolys[i]);
|
svg.draw(expolys[i]);
|
||||||
svg.draw_outline(expolys[i].contour, "black", scale_(0.05));
|
svg.draw_outline(expolys[i].contour, "black", scale_(0.05));
|
||||||
svg.draw_outline(expolys[i].holes, "blue", scale_(0.05));
|
svg.draw_outline(expolys[i].holes, "blue", scale_(0.05));
|
||||||
@ -857,7 +870,7 @@ void PrintObject::discover_vertical_shells()
|
|||||||
}
|
}
|
||||||
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
||||||
{
|
{
|
||||||
Slic3r::SVG svg(debug_out_path("discover_vertical_shells-perimeters-before-union-%d.svg", debug_idx), get_extents(shell));
|
Slic3r::SVG svg(debug_out_path("discover_vertical_shells-perimeters-before-union-%d.svg", debug_idx), get_extents(shell));
|
||||||
svg.draw(shell);
|
svg.draw(shell);
|
||||||
svg.draw_outline(shell, "black", scale_(0.05));
|
svg.draw_outline(shell, "black", scale_(0.05));
|
||||||
svg.Close();
|
svg.Close();
|
||||||
@ -984,8 +997,8 @@ void PrintObject::discover_vertical_shells()
|
|||||||
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
||||||
{
|
{
|
||||||
SVG::export_expolygons(debug_out_path("discover_vertical_shells-new_internal-%d.svg", debug_idx), get_extents(shell), new_internal, "black", "blue", scale_(0.05));
|
SVG::export_expolygons(debug_out_path("discover_vertical_shells-new_internal-%d.svg", debug_idx), get_extents(shell), new_internal, "black", "blue", scale_(0.05));
|
||||||
SVG::export_expolygons(debug_out_path("discover_vertical_shells-new_internal_void-%d.svg", debug_idx), get_extents(shell), new_internal_void, "black", "blue", scale_(0.05));
|
SVG::export_expolygons(debug_out_path("discover_vertical_shells-new_internal_void-%d.svg", debug_idx), get_extents(shell), new_internal_void, "black", "blue", scale_(0.05));
|
||||||
SVG::export_expolygons(debug_out_path("discover_vertical_shells-new_internal_solid-%d.svg", debug_idx), get_extents(shell), new_internal_solid, "black", "blue", scale_(0.05));
|
SVG::export_expolygons(debug_out_path("discover_vertical_shells-new_internal_solid-%d.svg", debug_idx), get_extents(shell), new_internal_solid, "black", "blue", scale_(0.05));
|
||||||
}
|
}
|
||||||
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */
|
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */
|
||||||
|
|
||||||
@ -1000,11 +1013,11 @@ void PrintObject::discover_vertical_shells()
|
|||||||
BOOST_LOG_TRIVIAL(debug) << "Discovering vertical shells for region " << idx_region << " in parallel - end";
|
BOOST_LOG_TRIVIAL(debug) << "Discovering vertical shells for region " << idx_region << " in parallel - end";
|
||||||
|
|
||||||
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
|
||||||
for (size_t idx_layer = 0; idx_layer < this->layers.size(); ++idx_layer) {
|
for (size_t idx_layer = 0; idx_layer < this->layers.size(); ++idx_layer) {
|
||||||
LayerRegion *layerm = this->layers[idx_layer]->get_region(idx_region);
|
LayerRegion *layerm = this->layers[idx_layer]->get_region(idx_region);
|
||||||
layerm->export_region_slices_to_svg_debug("4_discover_vertical_shells-final");
|
layerm->export_region_slices_to_svg_debug("4_discover_vertical_shells-final");
|
||||||
layerm->export_region_fill_surfaces_to_svg_debug("4_discover_vertical_shells-final");
|
layerm->export_region_fill_surfaces_to_svg_debug("4_discover_vertical_shells-final");
|
||||||
}
|
}
|
||||||
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */
|
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */
|
||||||
} // for each region
|
} // for each region
|
||||||
|
|
||||||
@ -1162,29 +1175,29 @@ void PrintObject::replaceSurfaceType(SurfaceType st_to_replace, SurfaceType st_r
|
|||||||
// extract the stInternalSolid surfaces that might be transformed into bridges
|
// extract the stInternalSolid surfaces that might be transformed into bridges
|
||||||
Polygons internal_solid;
|
Polygons internal_solid;
|
||||||
layerm->fill_surfaces.filter_by_type(st_to_replace, &internal_solid);
|
layerm->fill_surfaces.filter_by_type(st_to_replace, &internal_solid);
|
||||||
|
|
||||||
double internsolidareainit=0;
|
double internsolidareainit=0;
|
||||||
for (ExPolygon &ex : union_ex(internal_solid)) internsolidareainit+=ex.area();
|
for (ExPolygon &ex : union_ex(internal_solid)) internsolidareainit+=ex.area();
|
||||||
|
|
||||||
Polygons internal_over_tot_init;
|
Polygons internal_over_tot_init;
|
||||||
layerm->fill_surfaces.filter_by_type(st_replacement, &internal_over_tot_init);
|
layerm->fill_surfaces.filter_by_type(st_replacement, &internal_over_tot_init);
|
||||||
double totoverareaInit=0;
|
double totoverareaInit=0;
|
||||||
for (ExPolygon &ex : union_ex(internal_over_tot_init)) totoverareaInit+=ex.area();
|
for (ExPolygon &ex : union_ex(internal_over_tot_init)) totoverareaInit+=ex.area();
|
||||||
|
|
||||||
Polygons stBottom_init;
|
Polygons stBottom_init;
|
||||||
layerm->fill_surfaces.filter_by_type(stBottom, &stBottom_init);
|
layerm->fill_surfaces.filter_by_type(stBottom, &stBottom_init);
|
||||||
double bottomeareainit=0;
|
double bottomeareainit=0;
|
||||||
for (ExPolygon &ex : union_ex(stBottom_init)) bottomeareainit+=ex.area();
|
for (ExPolygon &ex : union_ex(stBottom_init)) bottomeareainit+=ex.area();
|
||||||
|
|
||||||
Polygons stBottomBridge_init;
|
Polygons stBottomBridge_init;
|
||||||
layerm->fill_surfaces.filter_by_type(stBottomBridge, &stBottomBridge_init);
|
layerm->fill_surfaces.filter_by_type(stBottomBridge, &stBottomBridge_init);
|
||||||
double bottombridgearea=0;
|
double bottombridgearea=0;
|
||||||
for (ExPolygon &ex : union_ex(stBottomBridge_init)) bottombridgearea+=ex.area();
|
for (ExPolygon &ex : union_ex(stBottomBridge_init)) bottombridgearea+=ex.area();
|
||||||
|
|
||||||
Polygons stIntBridge_init;
|
Polygons stIntBridge_init;
|
||||||
layerm->fill_surfaces.filter_by_type(st_under_it, &stIntBridge_init);
|
layerm->fill_surfaces.filter_by_type(st_under_it, &stIntBridge_init);
|
||||||
double intbridgeareainit=0;
|
double intbridgeareainit=0;
|
||||||
for (ExPolygon &ex : union_ex(stIntBridge_init)) intbridgeareainit+=ex.area();
|
for (ExPolygon &ex : union_ex(stIntBridge_init)) intbridgeareainit+=ex.area();
|
||||||
|
|
||||||
// check whether the lower area is deep enough for absorbing the extra flow
|
// check whether the lower area is deep enough for absorbing the extra flow
|
||||||
// (for obvious physical reasons but also for preventing the bridge extrudates
|
// (for obvious physical reasons but also for preventing the bridge extrudates
|
||||||
@ -1200,22 +1213,22 @@ void PrintObject::replaceSurfaceType(SurfaceType st_to_replace, SurfaceType st_r
|
|||||||
// iterate through regions and collect internal surfaces
|
// iterate through regions and collect internal surfaces
|
||||||
Polygons lower_internal;
|
Polygons lower_internal;
|
||||||
FOREACH_LAYERREGION(lower_layer, lower_layerm_it){
|
FOREACH_LAYERREGION(lower_layer, lower_layerm_it){
|
||||||
Polygons lower_internal_OK;
|
Polygons lower_internal_OK;
|
||||||
Polygons lower_internal_Bridge;
|
Polygons lower_internal_Bridge;
|
||||||
Polygons lower_internal_Over;
|
Polygons lower_internal_Over;
|
||||||
(*lower_layerm_it)->fill_surfaces.filter_by_type(st_replacement, &lower_internal_OK);
|
(*lower_layerm_it)->fill_surfaces.filter_by_type(st_replacement, &lower_internal_OK);
|
||||||
(*lower_layerm_it)->fill_surfaces.filter_by_type(st_under_it, &lower_internal_Bridge);
|
(*lower_layerm_it)->fill_surfaces.filter_by_type(st_under_it, &lower_internal_Bridge);
|
||||||
(*lower_layerm_it)->fill_surfaces.filter_by_type(st_to_replace, &lower_internal_Over);
|
(*lower_layerm_it)->fill_surfaces.filter_by_type(st_to_replace, &lower_internal_Over);
|
||||||
double okarea =0, bridgearea=0, overarea=0;
|
double okarea =0, bridgearea=0, overarea=0;
|
||||||
for (ExPolygon &ex : union_ex(lower_internal_OK)) okarea+=ex.area();
|
for (ExPolygon &ex : union_ex(lower_internal_OK)) okarea+=ex.area();
|
||||||
for (ExPolygon &ex : union_ex(lower_internal_Bridge)) bridgearea+=ex.area();
|
for (ExPolygon &ex : union_ex(lower_internal_Bridge)) bridgearea+=ex.area();
|
||||||
for (ExPolygon &ex : union_ex(lower_internal_Over)) overarea+=ex.area();
|
for (ExPolygon &ex : union_ex(lower_internal_Over)) overarea+=ex.area();
|
||||||
|
|
||||||
(*lower_layerm_it)->fill_surfaces.filter_by_type(st_under_it, &lower_internal);
|
(*lower_layerm_it)->fill_surfaces.filter_by_type(st_under_it, &lower_internal);
|
||||||
}
|
}
|
||||||
double sumarea=0;
|
double sumarea=0;
|
||||||
for (ExPolygon &ex : union_ex(lower_internal)) sumarea+=ex.area();
|
for (ExPolygon &ex : union_ex(lower_internal)) sumarea+=ex.area();
|
||||||
|
|
||||||
// intersect such lower internal surfaces with the candidate solid surfaces
|
// intersect such lower internal surfaces with the candidate solid surfaces
|
||||||
to_overextrude_pp = intersection(to_overextrude_pp, lower_internal);
|
to_overextrude_pp = intersection(to_overextrude_pp, lower_internal);
|
||||||
}
|
}
|
||||||
@ -1244,21 +1257,21 @@ void PrintObject::replaceSurfaceType(SurfaceType st_to_replace, SurfaceType st_r
|
|||||||
to_overextrude = intersection_ex(to_polygons(to_overextrude), internal_solid, true);
|
to_overextrude = intersection_ex(to_polygons(to_overextrude), internal_solid, true);
|
||||||
// build the new collection of fill_surfaces
|
// build the new collection of fill_surfaces
|
||||||
layerm->fill_surfaces.remove_type(st_to_replace);
|
layerm->fill_surfaces.remove_type(st_to_replace);
|
||||||
double overareafinal = 0, solidareafinal=0;
|
double overareafinal = 0, solidareafinal=0;
|
||||||
for (ExPolygon &ex : to_overextrude){
|
for (ExPolygon &ex : to_overextrude){
|
||||||
overareafinal += ex.area();
|
overareafinal += ex.area();
|
||||||
layerm->fill_surfaces.surfaces.push_back(Surface(st_replacement, ex));
|
layerm->fill_surfaces.surfaces.push_back(Surface(st_replacement, ex));
|
||||||
}
|
}
|
||||||
for (ExPolygon &ex : not_to_overextrude){
|
for (ExPolygon &ex : not_to_overextrude){
|
||||||
solidareafinal += ex.area();
|
solidareafinal += ex.area();
|
||||||
layerm->fill_surfaces.surfaces.push_back(Surface(st_to_replace, ex));
|
layerm->fill_surfaces.surfaces.push_back(Surface(st_to_replace, ex));
|
||||||
}
|
}
|
||||||
Polygons internal_over_tot;
|
Polygons internal_over_tot;
|
||||||
layerm->fill_surfaces.filter_by_type(stInternalOverBridge, &internal_over_tot);
|
layerm->fill_surfaces.filter_by_type(stInternalOverBridge, &internal_over_tot);
|
||||||
double totoverarea=0;
|
double totoverarea=0;
|
||||||
for (ExPolygon &ex : union_ex(internal_over_tot)) totoverarea+=ex.area();
|
for (ExPolygon &ex : union_ex(internal_over_tot)) totoverarea+=ex.area();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
# exclude infill from the layers below if needed
|
# exclude infill from the layers below if needed
|
||||||
# see discussion at https://github.com/alexrj/Slic3r/issues/240
|
# see discussion at https://github.com/alexrj/Slic3r/issues/240
|
||||||
# Update: do not exclude any infill. Sparse infill is able to absorb the excess material.
|
# Update: do not exclude any infill. Sparse infill is able to absorb the excess material.
|
||||||
@ -1450,8 +1463,8 @@ void PrintObject::_slice()
|
|||||||
goto end;
|
goto end;
|
||||||
delete layer;
|
delete layer;
|
||||||
this->layers.pop_back();
|
this->layers.pop_back();
|
||||||
if (! this->layers.empty())
|
if (! this->layers.empty())
|
||||||
this->layers.back()->upper_layer = nullptr;
|
this->layers.back()->upper_layer = nullptr;
|
||||||
}
|
}
|
||||||
end:
|
end:
|
||||||
;
|
;
|
||||||
@ -1478,11 +1491,11 @@ end:
|
|||||||
// Multiple regions, growing, shrinking or just clipping one region by the other.
|
// Multiple regions, growing, shrinking or just clipping one region by the other.
|
||||||
// When clipping the regions, priority is given to the first regions.
|
// When clipping the regions, priority is given to the first regions.
|
||||||
Polygons processed;
|
Polygons processed;
|
||||||
for (size_t region_id = 0; region_id < layer->regions.size(); ++ region_id) {
|
for (size_t region_id = 0; region_id < layer->regions.size(); ++ region_id) {
|
||||||
LayerRegion *layerm = layer->regions[region_id];
|
LayerRegion *layerm = layer->regions[region_id];
|
||||||
ExPolygons slices = to_expolygons(std::move(layerm->slices.surfaces));
|
ExPolygons slices = to_expolygons(std::move(layerm->slices.surfaces));
|
||||||
if (scale)
|
if (scale)
|
||||||
slices = offset_ex(slices, delta);
|
slices = offset_ex(slices, delta);
|
||||||
if (region_id > 0 && clip)
|
if (region_id > 0 && clip)
|
||||||
// Trim by the slices of already processed regions.
|
// Trim by the slices of already processed regions.
|
||||||
slices = diff_ex(to_polygons(std::move(slices)), processed);
|
slices = diff_ex(to_polygons(std::move(slices)), processed);
|
||||||
@ -1756,7 +1769,7 @@ void PrintObject::_infill()
|
|||||||
### $_->fill_surfaces->clear for map @{$_->regions}, @{$object->layers};
|
### $_->fill_surfaces->clear for map @{$_->regions}, @{$object->layers};
|
||||||
*/
|
*/
|
||||||
|
|
||||||
this->state.set_done(posInfill);
|
this->state.set_done(posInfill);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only active if config->infill_only_where_needed. This step trims the sparse infill,
|
// Only active if config->infill_only_where_needed. This step trims the sparse infill,
|
||||||
@ -2015,7 +2028,7 @@ void PrintObject::discover_horizontal_shells()
|
|||||||
// Use an existing surface as a template, it carries the bridge angle etc.
|
// Use an existing surface as a template, it carries the bridge angle etc.
|
||||||
*group.front());
|
*group.front());
|
||||||
}
|
}
|
||||||
EXTERNAL:;
|
EXTERNAL:;
|
||||||
} // foreach type (stTop, stBottom, stBottomBridge)
|
} // foreach type (stTop, stBottom, stBottomBridge)
|
||||||
} // for each layer
|
} // for each layer
|
||||||
} // for each region
|
} // for each region
|
||||||
@ -2076,12 +2089,12 @@ void PrintObject::combine_infill()
|
|||||||
// loop through layers to which we have assigned layers to combine
|
// loop through layers to which we have assigned layers to combine
|
||||||
for (size_t layer_idx = 0; layer_idx < this->layers.size(); ++ layer_idx) {
|
for (size_t layer_idx = 0; layer_idx < this->layers.size(); ++ layer_idx) {
|
||||||
size_t num_layers = combine[layer_idx];
|
size_t num_layers = combine[layer_idx];
|
||||||
if (num_layers <= 1)
|
if (num_layers <= 1)
|
||||||
continue;
|
continue;
|
||||||
// Get all the LayerRegion objects to be combined.
|
// Get all the LayerRegion objects to be combined.
|
||||||
std::vector<LayerRegion*> layerms;
|
std::vector<LayerRegion*> layerms;
|
||||||
layerms.reserve(num_layers);
|
layerms.reserve(num_layers);
|
||||||
for (size_t i = layer_idx + 1 - num_layers; i <= layer_idx; ++ i)
|
for (size_t i = layer_idx + 1 - num_layers; i <= layer_idx; ++ i)
|
||||||
layerms.emplace_back(this->layers[i]->regions[region_id]);
|
layerms.emplace_back(this->layers[i]->regions[region_id]);
|
||||||
// We need to perform a multi-layer intersection, so let's split it in pairs.
|
// We need to perform a multi-layer intersection, so let's split it in pairs.
|
||||||
// Initialize the intersection with the candidates of the lowest layer.
|
// Initialize the intersection with the candidates of the lowest layer.
|
||||||
@ -2151,7 +2164,7 @@ void PrintObject::reset_layer_height_profile()
|
|||||||
{
|
{
|
||||||
// Reset the layer_heigth_profile.
|
// Reset the layer_heigth_profile.
|
||||||
this->layer_height_profile.clear();
|
this->layer_height_profile.clear();
|
||||||
this->layer_height_profile_valid = false;
|
this->layer_height_profile_valid = false;
|
||||||
// Reset the source layer_height_profile if it exists at the ModelObject.
|
// Reset the source layer_height_profile if it exists at the ModelObject.
|
||||||
this->model_object()->layer_height_profile.clear();
|
this->model_object()->layer_height_profile.clear();
|
||||||
this->model_object()->layer_height_profile_valid = false;
|
this->model_object()->layer_height_profile_valid = false;
|
||||||
|
@ -41,35 +41,42 @@ public:
|
|||||||
unsigned short thickness_layers; // in layers
|
unsigned short thickness_layers; // in layers
|
||||||
double bridge_angle; // in radians, ccw, 0 = East, only 0+ (negative means undefined)
|
double bridge_angle; // in radians, ccw, 0 = East, only 0+ (negative means undefined)
|
||||||
unsigned short extra_perimeters;
|
unsigned short extra_perimeters;
|
||||||
|
unsigned short maxNbLayersOnTop;
|
||||||
|
|
||||||
Surface(const Slic3r::Surface &rhs)
|
Surface(const Slic3r::Surface &rhs)
|
||||||
: surface_type(rhs.surface_type), expolygon(rhs.expolygon),
|
: surface_type(rhs.surface_type), expolygon(rhs.expolygon),
|
||||||
thickness(rhs.thickness), thickness_layers(rhs.thickness_layers),
|
thickness(rhs.thickness), thickness_layers(rhs.thickness_layers),
|
||||||
bridge_angle(rhs.bridge_angle), extra_perimeters(rhs.extra_perimeters)
|
bridge_angle(rhs.bridge_angle), extra_perimeters(rhs.extra_perimeters),
|
||||||
|
maxNbLayersOnTop(rhs.maxNbLayersOnTop)
|
||||||
{};
|
{};
|
||||||
|
|
||||||
Surface(SurfaceType _surface_type, const ExPolygon &_expolygon)
|
Surface(SurfaceType _surface_type, const ExPolygon &_expolygon)
|
||||||
: surface_type(_surface_type), expolygon(_expolygon),
|
: surface_type(_surface_type), expolygon(_expolygon),
|
||||||
thickness(-1), thickness_layers(1), bridge_angle(-1), extra_perimeters(0)
|
thickness(-1), thickness_layers(1), bridge_angle(-1), extra_perimeters(0),
|
||||||
|
maxNbLayersOnTop(0)
|
||||||
{};
|
{};
|
||||||
Surface(const Surface &other, const ExPolygon &_expolygon)
|
Surface(const Surface &other, const ExPolygon &_expolygon)
|
||||||
: surface_type(other.surface_type), expolygon(_expolygon),
|
: surface_type(other.surface_type), expolygon(_expolygon),
|
||||||
thickness(other.thickness), thickness_layers(other.thickness_layers),
|
thickness(other.thickness), thickness_layers(other.thickness_layers),
|
||||||
bridge_angle(other.bridge_angle), extra_perimeters(other.extra_perimeters)
|
bridge_angle(other.bridge_angle), extra_perimeters(other.extra_perimeters),
|
||||||
|
maxNbLayersOnTop(other.maxNbLayersOnTop)
|
||||||
{};
|
{};
|
||||||
Surface(Surface &&rhs)
|
Surface(Surface &&rhs)
|
||||||
: surface_type(rhs.surface_type), expolygon(std::move(rhs.expolygon)),
|
: surface_type(rhs.surface_type), expolygon(std::move(rhs.expolygon)),
|
||||||
thickness(rhs.thickness), thickness_layers(rhs.thickness_layers),
|
thickness(rhs.thickness), thickness_layers(rhs.thickness_layers),
|
||||||
bridge_angle(rhs.bridge_angle), extra_perimeters(rhs.extra_perimeters)
|
bridge_angle(rhs.bridge_angle), extra_perimeters(rhs.extra_perimeters),
|
||||||
|
maxNbLayersOnTop(rhs.maxNbLayersOnTop)
|
||||||
{};
|
{};
|
||||||
Surface(SurfaceType _surface_type, const ExPolygon &&_expolygon)
|
Surface(SurfaceType _surface_type, const ExPolygon &&_expolygon)
|
||||||
: surface_type(_surface_type), expolygon(std::move(_expolygon)),
|
: surface_type(_surface_type), expolygon(std::move(_expolygon)),
|
||||||
thickness(-1), thickness_layers(1), bridge_angle(-1), extra_perimeters(0)
|
thickness(-1), thickness_layers(1), bridge_angle(-1), extra_perimeters(0),
|
||||||
|
maxNbLayersOnTop(0)
|
||||||
{};
|
{};
|
||||||
Surface(const Surface &other, const ExPolygon &&_expolygon)
|
Surface(const Surface &other, const ExPolygon &&_expolygon)
|
||||||
: surface_type(other.surface_type), expolygon(std::move(_expolygon)),
|
: surface_type(other.surface_type), expolygon(std::move(_expolygon)),
|
||||||
thickness(other.thickness), thickness_layers(other.thickness_layers),
|
thickness(other.thickness), thickness_layers(other.thickness_layers),
|
||||||
bridge_angle(other.bridge_angle), extra_perimeters(other.extra_perimeters)
|
bridge_angle(other.bridge_angle), extra_perimeters(other.extra_perimeters),
|
||||||
|
maxNbLayersOnTop(other.maxNbLayersOnTop)
|
||||||
{};
|
{};
|
||||||
|
|
||||||
Surface& operator=(const Surface &rhs)
|
Surface& operator=(const Surface &rhs)
|
||||||
@ -80,6 +87,7 @@ public:
|
|||||||
thickness_layers = rhs.thickness_layers;
|
thickness_layers = rhs.thickness_layers;
|
||||||
bridge_angle = rhs.bridge_angle;
|
bridge_angle = rhs.bridge_angle;
|
||||||
extra_perimeters = rhs.extra_perimeters;
|
extra_perimeters = rhs.extra_perimeters;
|
||||||
|
maxNbLayersOnTop = rhs.maxNbLayersOnTop;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,6 +99,7 @@ public:
|
|||||||
thickness_layers = rhs.thickness_layers;
|
thickness_layers = rhs.thickness_layers;
|
||||||
bridge_angle = rhs.bridge_angle;
|
bridge_angle = rhs.bridge_angle;
|
||||||
extra_perimeters = rhs.extra_perimeters;
|
extra_perimeters = rhs.extra_perimeters;
|
||||||
|
maxNbLayersOnTop = rhs.maxNbLayersOnTop;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,7 +113,7 @@ public:
|
|||||||
bool is_internal() const;
|
bool is_internal() const;
|
||||||
bool is_bottom() const;
|
bool is_bottom() const;
|
||||||
bool is_bridge() const;
|
bool is_bridge() const;
|
||||||
bool is_overBridge() const;
|
bool is_overBridge() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::vector<Surface> Surfaces;
|
typedef std::vector<Surface> Surfaces;
|
||||||
@ -151,12 +160,12 @@ inline ExPolygons to_expolygons(const Surfaces &src)
|
|||||||
|
|
||||||
inline ExPolygons to_expolygons(Surfaces &&src)
|
inline ExPolygons to_expolygons(Surfaces &&src)
|
||||||
{
|
{
|
||||||
ExPolygons expolygons;
|
ExPolygons expolygons;
|
||||||
expolygons.reserve(src.size());
|
expolygons.reserve(src.size());
|
||||||
for (Surfaces::const_iterator it = src.begin(); it != src.end(); ++it)
|
for (Surfaces::const_iterator it = src.begin(); it != src.end(); ++it)
|
||||||
expolygons.emplace_back(ExPolygon(std::move(it->expolygon)));
|
expolygons.emplace_back(ExPolygon(std::move(it->expolygon)));
|
||||||
src.clear();
|
src.clear();
|
||||||
return expolygons;
|
return expolygons;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline ExPolygons to_expolygons(const SurfacesPtr &src)
|
inline ExPolygons to_expolygons(const SurfacesPtr &src)
|
||||||
|
@ -297,9 +297,10 @@ const std::vector<std::string>& Preset::print_options()
|
|||||||
"ooze_prevention", "standby_temperature_delta", "interface_shells", "extrusion_width", "first_layer_extrusion_width",
|
"ooze_prevention", "standby_temperature_delta", "interface_shells", "extrusion_width", "first_layer_extrusion_width",
|
||||||
"perimeter_extrusion_width", "external_perimeter_extrusion_width", "infill_extrusion_width", "solid_infill_extrusion_width",
|
"perimeter_extrusion_width", "external_perimeter_extrusion_width", "infill_extrusion_width", "solid_infill_extrusion_width",
|
||||||
"top_infill_extrusion_width", "support_material_extrusion_width", "infill_overlap", "bridge_flow_ratio",
|
"top_infill_extrusion_width", "support_material_extrusion_width", "infill_overlap", "bridge_flow_ratio",
|
||||||
"over_bridge_flow_ratio", "clip_multipart_objects", "enforce_full_fill_volume", "external_infill_margin",
|
"over_bridge_flow_ratio", "clip_multipart_objects", "enforce_full_fill_volume", "external_infill_margin",
|
||||||
"elefant_foot_compensation", "xy_size_compensation", "threads", "resolution", "wipe_tower", "wipe_tower_x", "wipe_tower_y",
|
"elefant_foot_compensation", "xy_size_compensation", "threads", "resolution", "wipe_tower", "wipe_tower_x", "wipe_tower_y",
|
||||||
"wipe_tower_width", "wipe_tower_rotation_angle", "wipe_tower_bridging", "only_one_perimeter_top", "compatible_printers", "compatible_printers_condition","inherits"
|
"wipe_tower_width", "wipe_tower_rotation_angle", "wipe_tower_bridging", "only_one_perimeter_top", "compatible_printers",
|
||||||
|
"compatible_printers_condition", "inherits", "infill_dense_layers", "infill_dense_density"
|
||||||
};
|
};
|
||||||
return s_opts;
|
return s_opts;
|
||||||
}
|
}
|
||||||
|
@ -856,6 +856,10 @@ void TabPrint::build()
|
|||||||
optgroup = page->new_optgroup(_(L("Reducing printing time")));
|
optgroup = page->new_optgroup(_(L("Reducing printing time")));
|
||||||
optgroup->append_single_option_line("infill_every_layers");
|
optgroup->append_single_option_line("infill_every_layers");
|
||||||
optgroup->append_single_option_line("infill_only_where_needed");
|
optgroup->append_single_option_line("infill_only_where_needed");
|
||||||
|
line = { _(L("Use denser infill below top layers")), "" };
|
||||||
|
line.append_option(optgroup->get_option("infill_dense_layers"));
|
||||||
|
line.append_option(optgroup->get_option("infill_dense_density"));
|
||||||
|
optgroup->append_line(line);
|
||||||
|
|
||||||
optgroup = page->new_optgroup(_(L("Advanced")));
|
optgroup = page->new_optgroup(_(L("Advanced")));
|
||||||
optgroup->append_single_option_line("solid_infill_every_layers");
|
optgroup->append_single_option_line("solid_infill_every_layers");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user