mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-11-22 05:37:55 +01:00
cleanup
This commit is contained in:
parent
701d736cc0
commit
6be1291923
@ -38,7 +38,7 @@ export default class GCode {
|
||||
turnFanOn(fanSpeed) {
|
||||
this._isFanOn = true;
|
||||
|
||||
const gcode = { [M_COMMAND]: 106 }
|
||||
const gcode = { [M_COMMAND]: 106 };
|
||||
if (typeof fanSpeed !== 'undefined') gcode[FAN_SPEED] = fanSpeed;
|
||||
|
||||
this._addGCode(gcode);
|
||||
|
@ -14,19 +14,11 @@ import { hslToRgb } from './helpers/color.js';
|
||||
// // import removePrecision from './removePrecision.js';
|
||||
|
||||
export default function(settings, geometry, openObjectIndexes, constructLinePreview, onProgress) {
|
||||
const totalStages = 11;
|
||||
let current = -1;
|
||||
const updateProgress = (action) => {
|
||||
current ++;
|
||||
if (typeof onProgress !== 'undefined') {
|
||||
onProgress({
|
||||
progress: {
|
||||
done: current,
|
||||
total: totalStages,
|
||||
action
|
||||
}
|
||||
});
|
||||
}
|
||||
const total = 11;
|
||||
let done = -1;
|
||||
const updateProgress = action => {
|
||||
done ++;
|
||||
if (onProgress) onProgress({ progress: { done, total, action } });
|
||||
};
|
||||
|
||||
updateProgress('Constructing unique lines from geometry');
|
||||
@ -70,9 +62,9 @@ export default function(settings, geometry, openObjectIndexes, constructLinePrev
|
||||
return gcode;
|
||||
}
|
||||
|
||||
const PRECISION_INVERSE = 1000;
|
||||
const PRECISION = 1000;
|
||||
function toFixedTrimmed(value) {
|
||||
return (Math.round(value * PRECISION_INVERSE) / PRECISION_INVERSE).toString();
|
||||
return (Math.round(value * PRECISION) / PRECISION).toString();
|
||||
}
|
||||
|
||||
function gcodeToString(gcode) {
|
||||
|
@ -96,9 +96,7 @@ function sliceAsync(settings, geometry, openObjectIndexes, constructLinePreview,
|
||||
break;
|
||||
}
|
||||
case 'PROGRESS': {
|
||||
if (typeof onProgress !== 'undefined') {
|
||||
onProgress(data);
|
||||
}
|
||||
if (typeof onProgress !== 'undefined') onProgress(data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user