mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-15 05:15:58 +08:00
Merge branch 'CI' into dev
This commit is contained in:
commit
72dd10eba4
@ -3552,8 +3552,6 @@ std::string GCode::extrude_loop(const ExtrusionLoop &original_loop, const std::s
|
||||
// extrude along the path
|
||||
std::string gcode;
|
||||
for (ExtrusionPaths::iterator path = paths.begin(); path != paths.end(); ++path) {
|
||||
// description += ExtrusionLoop::role_to_string(loop.loop_role());
|
||||
// description += ExtrusionEntity::role_to_string(path->role);
|
||||
path->simplify(SCALED_RESOLUTION);
|
||||
gcode += this->_extrude(*path, description, speed);
|
||||
}
|
||||
@ -3649,8 +3647,6 @@ std::string GCode::extrude_multi_path(const ExtrusionMultiPath &multipath, const
|
||||
// extrude along the path
|
||||
std::string gcode;
|
||||
for (ExtrusionPath path : multipath.paths) {
|
||||
// description += ExtrusionLoop::role_to_string(loop.loop_role());
|
||||
// description += ExtrusionEntity::role_to_string(path->role);
|
||||
path.simplify(SCALED_RESOLUTION);
|
||||
gcode += this->_extrude(path, description, speed);
|
||||
}
|
||||
@ -3902,7 +3898,7 @@ void GCode::_write(FILE* file, const char *what)
|
||||
|
||||
//const char * gcode_pp = _post_process(what).c_str();
|
||||
std::string str_preproc{ what };
|
||||
//_post_process(str_preproc);
|
||||
_post_process(str_preproc);
|
||||
|
||||
const std::string str_ana = m_analyzer.process_gcode(str_preproc);
|
||||
|
||||
@ -3980,7 +3976,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, const std::string &descri
|
||||
double e_per_mm = path.mm3_per_mm
|
||||
* m_writer.tool()->e_per_mm3()
|
||||
* this->config().print_extrusion_multiplier.get_abs_value(1);
|
||||
if (this->m_layer_index <= 0) e_per_mm *= this->config().first_layer_flow_ratio.get_abs_value(1);
|
||||
if (std::abs(this->m_layer->height - this->m_layer->print_z) < EPSILON) e_per_mm *= this->config().first_layer_flow_ratio.get_abs_value(1);
|
||||
if (m_writer.extrusion_axis().empty()) e_per_mm = 0;
|
||||
if (path.polyline.lines().size() > 0) {
|
||||
//get last direction //TODO: save it
|
||||
@ -4009,7 +4005,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, const std::string &descri
|
||||
// the coeff is below 0.01 i the angle is higher than 125, so it's not useful
|
||||
if (idx_angle > 60) {
|
||||
//don't compensate if the angle is under 35, as it's already a 50% compensation, it's enough!
|
||||
if (idx_angle > 144) angle = 144;
|
||||
if (idx_angle > 144) idx_angle = 144;
|
||||
//surface extruded in path.width is path.width * path.width
|
||||
// define R = path.width/2 and a = angle/2
|
||||
// then i have to print only 4RR + RR(2a-sin(2a))/2 - RR*sina*sina*tana if i want to remove the bits out of the external curve, if the internal overlap go to the exterior.
|
||||
@ -4020,7 +4016,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, const std::string &descri
|
||||
//double removed = std::sin(A); removed = removed * removed * std::tan(A) / 4;
|
||||
//double coeff = 1. + added - removed;
|
||||
//we have to remove coeff percentage on path.width length
|
||||
double coeff = cut_corner_cache[idx_angle];
|
||||
double coeff = cut_corner_cache[idx_angle-30];
|
||||
//the length, do half of the work on width/4 and the other half on width/2
|
||||
coordf_t length1 = (path.width) / 4;
|
||||
coordf_t line_length = unscaled(line.length());
|
||||
|
@ -545,6 +545,8 @@ std::string GCodeWriter::_retract(double length, double restart_extra, const std
|
||||
}
|
||||
|
||||
double dE = m_tool->retract(length, restart_extra);
|
||||
assert(dE >= 0);
|
||||
assert(dE < 10000000);
|
||||
if (dE != 0) {
|
||||
if (this->config.use_firmware_retraction) {
|
||||
if (FLAVOR_IS(gcfMachinekit))
|
||||
@ -573,6 +575,8 @@ std::string GCodeWriter::unretract()
|
||||
gcode << "M101 ; extruder on\n";
|
||||
|
||||
double dE = m_tool->unretract();
|
||||
assert(dE >= 0);
|
||||
assert(dE < 10000000);
|
||||
if (dE != 0) {
|
||||
if (this->config.use_firmware_retraction) {
|
||||
if (FLAVOR_IS(gcfMachinekit))
|
||||
|
@ -280,7 +280,6 @@ void PerimeterGenerator::process()
|
||||
|
||||
if (!unsupported_filtered.empty()) {
|
||||
|
||||
|
||||
//add this directly to the infill list.
|
||||
// this will avoid to throw wrong offsets into a good polygons
|
||||
this->fill_surfaces->append(
|
||||
@ -308,9 +307,7 @@ void PerimeterGenerator::process()
|
||||
} else {
|
||||
surface->expolygon = last[0];
|
||||
for (size_t idx = 1; idx < last.size(); idx++) {
|
||||
Surface new_surf = *surface;
|
||||
new_surf.expolygon = last[idx];
|
||||
all_surfaces.push_back(new_surf);
|
||||
all_surfaces.emplace_back(*surface, last[idx]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -438,7 +435,7 @@ void PerimeterGenerator::process()
|
||||
// look for thin walls
|
||||
if (this->config->thin_walls) {
|
||||
// detect edge case where a curve can be split in multiple small chunks.
|
||||
std::vector<float> divs = {2.2f,1.75f,1.5f}; //don't go too far, it's not possible to print thinw wall after that
|
||||
std::vector<float> divs = { 2.1f, 1.9f, 2.2f, 1.75f, 1.5f}; //don't go too far, it's not possible to print thin wall after that
|
||||
size_t idx_div = 0;
|
||||
while (next_onion.size() > last.size() && idx_div < divs.size()) {
|
||||
float div = divs[idx_div];
|
||||
@ -447,7 +444,7 @@ void PerimeterGenerator::process()
|
||||
last,
|
||||
-(float)((ext_perimeter_width / 2) + (ext_min_spacing / div) - 1),
|
||||
+(float)((ext_min_spacing / div) - 1));
|
||||
if (next_onion.size() > next_onion_secondTry.size() * 1.2 || next_onion.size() - next_onion_secondTry.size() > 3) {
|
||||
if (next_onion.size() > next_onion_secondTry.size() * 1.2 && next_onion.size() > next_onion_secondTry.size() + 2) {
|
||||
next_onion = next_onion_secondTry;
|
||||
}
|
||||
idx_div++;
|
||||
|
@ -1839,7 +1839,7 @@ void PrintConfigDef::init_fff_params()
|
||||
def->enum_labels.push_back(L("Automatic, only for small areas"));
|
||||
def->enum_labels.push_back(L("Anchored"));
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionEnum<DenseInfillAlgo>(dfaAutomatic));
|
||||
def->set_default_value(new ConfigOptionEnum<DenseInfillAlgo>(dfaAutoNotFull));
|
||||
|
||||
def = this->add("infill_extruder", coInt);
|
||||
def->label = L("Infill extruder");
|
||||
|
@ -112,25 +112,25 @@ inline bool equal_layering(const SlicingParameters &sp1, const SlicingParameters
|
||||
assert(sp2.valid);
|
||||
return sp1.base_raft_layers == sp2.base_raft_layers &&
|
||||
sp1.interface_raft_layers == sp2.interface_raft_layers &&
|
||||
sp1.base_raft_layer_height == sp2.base_raft_layer_height &&
|
||||
sp1.interface_raft_layer_height == sp2.interface_raft_layer_height &&
|
||||
sp1.contact_raft_layer_height == sp2.contact_raft_layer_height &&
|
||||
std::abs(sp1.base_raft_layer_height - sp2.base_raft_layer_height) < EPSILON &&
|
||||
std::abs(sp1.interface_raft_layer_height - sp2.interface_raft_layer_height) < EPSILON &&
|
||||
std::abs(sp1.contact_raft_layer_height - sp2.contact_raft_layer_height) < EPSILON &&
|
||||
sp1.contact_raft_layer_height_bridging == sp2.contact_raft_layer_height_bridging &&
|
||||
sp1.layer_height == sp2.layer_height &&
|
||||
sp1.min_layer_height == sp2.min_layer_height &&
|
||||
sp1.max_layer_height == sp2.max_layer_height &&
|
||||
std::abs(sp1.layer_height - sp2.layer_height) < EPSILON &&
|
||||
std::abs(sp1.min_layer_height - sp2.min_layer_height) < EPSILON &&
|
||||
std::abs(sp1.max_layer_height - sp2.max_layer_height) < EPSILON &&
|
||||
// sp1.max_suport_layer_height == sp2.max_suport_layer_height &&
|
||||
sp1.first_print_layer_height == sp2.first_print_layer_height &&
|
||||
sp1.first_object_layer_height == sp2.first_object_layer_height &&
|
||||
std::abs(sp1.first_print_layer_height - sp2.first_print_layer_height) < EPSILON &&
|
||||
std::abs(sp1.first_object_layer_height - sp2.first_object_layer_height) < EPSILON &&
|
||||
sp1.first_object_layer_bridging == sp2.first_object_layer_bridging &&
|
||||
sp1.soluble_interface == sp2.soluble_interface &&
|
||||
sp1.gap_raft_object == sp2.gap_raft_object &&
|
||||
sp1.gap_object_support == sp2.gap_object_support &&
|
||||
sp1.gap_support_object == sp2.gap_support_object &&
|
||||
sp1.raft_base_top_z == sp2.raft_base_top_z &&
|
||||
sp1.raft_interface_top_z == sp2.raft_interface_top_z &&
|
||||
sp1.raft_contact_top_z == sp2.raft_contact_top_z &&
|
||||
sp1.object_print_z_min == sp2.object_print_z_min;
|
||||
std::abs(sp1.gap_raft_object - sp2.gap_raft_object) < EPSILON &&
|
||||
std::abs(sp1.gap_object_support - sp2.gap_object_support) < EPSILON &&
|
||||
std::abs(sp1.gap_support_object - sp2.gap_support_object) < EPSILON &&
|
||||
std::abs(sp1.raft_base_top_z - sp2.raft_base_top_z) < EPSILON &&
|
||||
std::abs(sp1.raft_interface_top_z - sp2.raft_interface_top_z) < EPSILON &&
|
||||
std::abs(sp1.raft_contact_top_z - sp2.raft_contact_top_z) < EPSILON &&
|
||||
std::abs(sp1.object_print_z_min - sp2.object_print_z_min) < EPSILON;
|
||||
}
|
||||
|
||||
typedef std::pair<coordf_t,coordf_t> t_layer_height_range;
|
||||
|
Loading…
x
Reference in New Issue
Block a user