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