mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-11-22 13:37:58 +01:00
add z offset
This commit is contained in:
parent
5bc7d09e8d
commit
2c2bbeda53
@ -1,3 +1,4 @@
|
||||
zOffset: 0.3
|
||||
dimensions:
|
||||
x: 200
|
||||
y: 200
|
||||
|
@ -2,11 +2,12 @@ import * as THREE from 'three';
|
||||
|
||||
export default function calculateLayersIntersections(lines, settings) {
|
||||
const {
|
||||
dimensions: { z: dimensionsZ },
|
||||
layerHeight,
|
||||
dimensions: { z: dimensionsZ }
|
||||
zOffset
|
||||
} = settings;
|
||||
|
||||
const numLayers = Math.floor(dimensionsZ / layerHeight);
|
||||
const numLayers = Math.floor((dimensionsZ - zOffset) / layerHeight);
|
||||
|
||||
const layerIntersectionIndexes = Array.from(Array(numLayers)).map(() => []);
|
||||
const layerIntersectionPoints = Array.from(Array(numLayers)).map(() => []);
|
||||
@ -24,7 +25,7 @@ export default function calculateLayersIntersections(lines, settings) {
|
||||
|
||||
layerIntersectionIndexes[layerIndex].push(lineIndex);
|
||||
|
||||
const y = layerIndex * layerHeight;
|
||||
const y = layerIndex * layerHeight + zOffset;
|
||||
|
||||
let x, z;
|
||||
if (line.start.y === line.end.y) {
|
||||
|
@ -12,7 +12,8 @@ export default function slicesToGCode(slices, settings) {
|
||||
travelSpeed,
|
||||
retraction,
|
||||
travel,
|
||||
combing
|
||||
combing,
|
||||
zOffset
|
||||
} = settings;
|
||||
|
||||
const filamentSurfaceArea = Math.pow((filamentThickness / 2), 2) * Math.PI;
|
||||
@ -29,7 +30,7 @@ export default function slicesToGCode(slices, settings) {
|
||||
let isFirstLayer = true;
|
||||
for (let layer = 0; layer < slices.length; layer ++) {
|
||||
const slice = slices[layer];
|
||||
const z = layer * layerHeight;
|
||||
const z = layer * layerHeight + zOffset;
|
||||
|
||||
if (layer === 1) {
|
||||
gcode.turnFanOn();
|
||||
|
Loading…
Reference in New Issue
Block a user