curves-only fix to handle small epsilon in flat face vertices

This commit is contained in:
Stewart Allen 2021-04-26 09:19:38 -04:00
commit 904c600552
3 changed files with 6 additions and 6 deletions

View file

@ -288,12 +288,12 @@
if (false && fdm && lastPos) {
let dE = (absE ? pos.E - lastPos.E : pos.E);
let dV = Math.sqrt(
(Math.pow(pos.X - lastPos.X ,2)) +
(Math.pow(pos.Y - lastPos.Y ,2))
(Math.pow(pos.X - lastPos.X, 2)) +
(Math.pow(pos.Y - lastPos.Y, 2))
);
let dR = (dE / dV); // filament per mm
if (dR < 0.025 || dR > 0.35) {
console.log(height.round(2), pos.Z.round(2), dV.round(2), dR.round(3));
if (dV > 2 && dE > 0.001 && (dR < 0.025 || dR > 0.35)) {
console.log(height.toFixed(2), dV.toFixed(2), dE.toFixed(3), dR.toFixed(5));
}
}
// add point to current sequence

View file

@ -140,7 +140,7 @@
function push_point(x,y,z) {
const newP = newPoint(x,y,z);
// todo: merge co-linear, not just co-planar
if (lastP && lastP.z === z) {
if (lastP && Math.abs(lastP.z - z) < 0.005) {
if (curvesOnly) {
end_poly();
} else {

View file

@ -599,7 +599,7 @@ kiri.lang['en-us'] = {
ag_nozl_s: "nozzle",
ag_nozl_l: "select output nozzle or head",
ag_peel_s: "peel guard",
ag_peel_l: ["starting at this belt z positoin","periodically roll the print off and","back on to the belt to unstick it","and prevent rolling deflection"],
ag_peel_l: ["starting at this belt z position","periodically roll the print off and","back on to the belt to unstick it","and prevent rolling deflection"],
ag_paws_s: "pause layers",
ag_paws_l: ["comma-separated list of layers","to inject pause commands before"],
// ag_loop_s: "loop layers",