#518 cut corner typo fix.

This commit is contained in:
supermerill 2020-10-01 22:35:57 +02:00
parent 7d5b422985
commit 5479ce4b92
2 changed files with 24 additions and 20 deletions

View File

@ -3702,24 +3702,24 @@ void GCode::use(const ExtrusionEntityCollection &collection) {
std::string extrusion_role_2_string(const ExtrusionRole &er) { std::string extrusion_role_2_string(const ExtrusionRole &er) {
switch (er) { switch (er) {
case erNone: return " none"; case erNone: return "none";
case erPerimeter: return " perimeter"; case erPerimeter: return "perimeter";
case erExternalPerimeter: return " perimeter external"; case erExternalPerimeter: return "perimeter external";
case erOverhangPerimeter: return " perimeter overhang"; case erOverhangPerimeter: return "perimeter overhang";
case erInternalInfill: return " infill internal"; case erInternalInfill: return "infill internal";
case erSolidInfill: return " infill solid"; case erSolidInfill: return "infill solid";
case erTopSolidInfill: return " infill solid top"; case erTopSolidInfill: return "infill solid top";
case erBridgeInfill: return " infill bridge"; case erBridgeInfill: return "infill bridge";
case erThinWall: return " thin_wall"; case erThinWall: return "thin_wall";
case erGapFill: return " gap_fill"; case erGapFill: return "gap_fill";
case erSkirt: return " skirt"; case erSkirt: return "skirt";
case erSupportMaterial: return " support_material"; case erSupportMaterial: return "support_material";
case erSupportMaterialInterface: return " support_material_interface"; case erSupportMaterialInterface: return "support_material_interface";
case erWipeTower: return " wipe_tower"; case erWipeTower: return "wipe_tower";
case erMilling: return " milling"; case erMilling: return "milling";
case erCustom: return " custom"; case erCustom: return "custom";
case erMixed: return " mixed"; case erMixed: return "mixed";
case erCount: return " count"; case erCount: return "count";
} }
return " unkown"; return " unkown";
} }
@ -3976,7 +3976,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 // the coeff is below 0.01 i the angle is higher than 125, so it's not useful
if (idx_angle > 60) { if (idx_angle > 60) {
//don't compensate if the angle is under 35, as it's already a 50% compensation, it's enough! //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 //surface extruded in path.width is path.width * path.width
// define R = path.width/2 and a = angle/2 // 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. // 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.
@ -3987,7 +3987,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 removed = std::sin(A); removed = removed * removed * std::tan(A) / 4;
//double coeff = 1. + added - removed; //double coeff = 1. + added - removed;
//we have to remove coeff percentage on path.width length //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 //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 length1 = (path.width) / 4;
coordf_t line_length = unscaled(line.length()); coordf_t line_length = unscaled(line.length());

View File

@ -510,6 +510,8 @@ std::string GCodeWriter::_retract(double length, double restart_extra, const std
} }
double dE = m_tool->retract(length, restart_extra); double dE = m_tool->retract(length, restart_extra);
assert(dE >= 0);
assert(dE < 10000000);
if (dE != 0) { if (dE != 0) {
if (this->config.use_firmware_retraction) { if (this->config.use_firmware_retraction) {
if (FLAVOR_IS(gcfMachinekit)) if (FLAVOR_IS(gcfMachinekit))
@ -538,6 +540,8 @@ std::string GCodeWriter::unretract()
gcode << "M101 ; extruder on\n"; gcode << "M101 ; extruder on\n";
double dE = m_tool->unretract(); double dE = m_tool->unretract();
assert(dE >= 0);
assert(dE < 10000000);
if (dE != 0) { if (dE != 0) {
if (this->config.use_firmware_retraction) { if (this->config.use_firmware_retraction) {
if (FLAVOR_IS(gcfMachinekit)) if (FLAVOR_IS(gcfMachinekit))