mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-12-23 11:33:49 +01:00
use deconstruction in move
This commit is contained in:
parent
caf62e58d5
commit
0eb2a3994f
24
src/gcode.js
24
src/gcode.js
@ -68,8 +68,10 @@ export default class {
|
||||
}
|
||||
|
||||
moveTo (x, y, layer) {
|
||||
const layerHeight = this.settings.config['layerHeight'];
|
||||
const travelSpeed = this.settings.config['travelSpeed'];
|
||||
const {
|
||||
layerHeight,
|
||||
travelSpeed
|
||||
} = this.settings;
|
||||
|
||||
const z = (layer + 1) * layerHeight;
|
||||
const speed = travelSpeed * 60;
|
||||
@ -90,15 +92,21 @@ export default class {
|
||||
lineTo (x, y, layer, type) {
|
||||
const newNozzlePosition = new THREE.Vector2(x, y);
|
||||
|
||||
const layerHeight = this.settings.config['layerHeight'];
|
||||
const nozzleDiameter = this.settings.config['nozzleDiameter'];
|
||||
const filamentThickness = this.settings.config['filamentThickness'];
|
||||
const travelSpeed = this.settings.config['travelSpeed'];
|
||||
const {
|
||||
layerHeight,
|
||||
nozzleDiameter,
|
||||
filamentThickness,
|
||||
travelSpeed
|
||||
} = this.settings;
|
||||
|
||||
const profile = this.settings.config[(this.bottom ? 'bottom' : type)];
|
||||
|
||||
const speed = profile['speed'] * 60;
|
||||
const flowRate = profile['flowRate'];
|
||||
let {
|
||||
speed,
|
||||
flowRate
|
||||
} = profile;
|
||||
|
||||
speed *= 60;
|
||||
const z = (layer + 1) * layerHeight;
|
||||
|
||||
const lineLength = this._nozzlePosition.distanceTo(newNozzlePosition);
|
||||
|
Loading…
Reference in New Issue
Block a user