mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-11-22 13:37:58 +01:00
compensate for higher layer height
This commit is contained in:
parent
0c7f08735f
commit
4482bf1f73
@ -2,4 +2,4 @@ export const PRECISION = 0.01;
|
|||||||
export const VERSION = '0.0.18';
|
export const VERSION = '0.0.18';
|
||||||
export const LOCAL_STORAGE_KEY = 'PRINTER_SETTINGS';
|
export const LOCAL_STORAGE_KEY = 'PRINTER_SETTINGS';
|
||||||
export const MIN_AREA = 1; // holes smaller as 1mm2 get removed
|
export const MIN_AREA = 1; // holes smaller as 1mm2 get removed
|
||||||
export const Z_OFFSET = 0.15;
|
export const Z_OFFSET = 0.3;
|
||||||
|
@ -11,9 +11,8 @@ export const POSITION_Y = 'Y';
|
|||||||
export const POSITION_Z = 'Z';
|
export const POSITION_Z = 'Z';
|
||||||
|
|
||||||
export default class {
|
export default class {
|
||||||
constructor(nozzleToFilamentRatio) {
|
constructor(layerHeight) {
|
||||||
this._nozzleToFilamentRatio = nozzleToFilamentRatio;
|
this._nozzleToFilamentRatio = 1;
|
||||||
|
|
||||||
this._gcode = [`; Generated with Doodle3D Slicer V${VERSION}`];
|
this._gcode = [`; Generated with Doodle3D Slicer V${VERSION}`];
|
||||||
this._currentValues = {};
|
this._currentValues = {};
|
||||||
this._nozzlePosition = new THREE.Vector2(0, 0);
|
this._nozzlePosition = new THREE.Vector2(0, 0);
|
||||||
@ -27,6 +26,12 @@ export default class {
|
|||||||
this._gcode.push(command);
|
this._gcode.push(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateLayerHeight(layerHeight, nozzleDiameter, filamentThickness) {
|
||||||
|
const filamentSurfaceArea = Math.pow((filamentThickness / 2), 2) * Math.PI;
|
||||||
|
const lineSurfaceArea = nozzleDiameter * layerHeight;
|
||||||
|
this._nozzleToFilamentRatio = lineSurfaceArea / filamentSurfaceArea;
|
||||||
|
}
|
||||||
|
|
||||||
turnFanOn(fanSpeed) {
|
turnFanOn(fanSpeed) {
|
||||||
this._isFanOn = true;
|
this._isFanOn = true;
|
||||||
|
|
||||||
|
@ -15,11 +15,8 @@ export default function slicesToGCode(slices, settings) {
|
|||||||
combing
|
combing
|
||||||
} = settings;
|
} = settings;
|
||||||
|
|
||||||
const filamentSurfaceArea = Math.pow((filamentThickness / 2), 2) * Math.PI;
|
const gcode = new GCode();
|
||||||
const lineSurfaceArea = nozzleDiameter * layerHeight;
|
gcode.updateLayerHeight(Z_OFFSET, nozzleDiameter, filamentThickness)
|
||||||
const nozzleToFilamentRatio = lineSurfaceArea / filamentSurfaceArea;
|
|
||||||
|
|
||||||
const gcode = new GCode(nozzleToFilamentRatio);
|
|
||||||
|
|
||||||
if (settings.startCode) gcode.addGCode(settings.startCode, settings);
|
if (settings.startCode) gcode.addGCode(settings.startCode, settings);
|
||||||
|
|
||||||
@ -34,6 +31,7 @@ export default function slicesToGCode(slices, settings) {
|
|||||||
const z = layer * layerHeight + Z_OFFSET;
|
const z = layer * layerHeight + Z_OFFSET;
|
||||||
|
|
||||||
if (layer === 1) {
|
if (layer === 1) {
|
||||||
|
gcode.updateLayerHeight(layerHeight, nozzleDiameter, filamentThickness);
|
||||||
gcode.turnFanOn();
|
gcode.turnFanOn();
|
||||||
isFirstLayer = false;
|
isFirstLayer = false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user