mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-12-23 11:33:49 +01:00
move set settings to constructor
This commit is contained in:
parent
be1d1bbac3
commit
726b30621c
@ -10,7 +10,7 @@ const POSITION_Y = 'Y';
|
||||
const POSITION_Z = 'Z';
|
||||
|
||||
export default class {
|
||||
constructor () {
|
||||
constructor (settings) {
|
||||
this.gcode = '';
|
||||
this.current = {};
|
||||
|
||||
@ -19,6 +19,10 @@ export default class {
|
||||
this.isRetracted = false;
|
||||
this.isFanOn = false;
|
||||
this._nozzlePosition = new THREE.Vector2(0, 0);
|
||||
|
||||
if (settings !== undefined) {
|
||||
this.setSettings(settings);
|
||||
}
|
||||
}
|
||||
|
||||
_addGCode (command) {
|
||||
|
@ -3,7 +3,7 @@ import GCode from '../gcode.js';
|
||||
export default function slicesToGCode(slices, settings) {
|
||||
console.log('slices to gcode');
|
||||
|
||||
const gcode = new GCode().setSettings(settings);
|
||||
const gcode = new GCode(settings);
|
||||
|
||||
for (let layer = 0; layer < slices.length; layer ++) {
|
||||
const slice = slices[layer];
|
||||
|
Loading…
Reference in New Issue
Block a user