Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion js/Cam.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,9 @@ jscut.priv.cam = jscut.priv.cam || {};

var currentZ = safeZ;
var finishedZ = topZ;
while (finishedZ > botZ) {
// Hide floating-point arithmetic imprecision and work with g-code precision
// to avoid possible duplication of the last pass
while (Number(finishedZ.toFixed(decimal)) > Number(botZ.toFixed(decimal))) {
var nextZ = Math.max(finishedZ - passDepth, botZ);
if (currentZ < safeZ && (!path.safeToClose || tabGeometry.length > 0)) {
gcode += retractGcode;
Expand Down