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:
|
dimensions:
|
||||||
x: 200
|
x: 200
|
||||||
y: 200
|
y: 200
|
||||||
|
@ -2,11 +2,12 @@ import * as THREE from 'three';
|
|||||||
|
|
||||||
export default function calculateLayersIntersections(lines, settings) {
|
export default function calculateLayersIntersections(lines, settings) {
|
||||||
const {
|
const {
|
||||||
|
dimensions: { z: dimensionsZ },
|
||||||
layerHeight,
|
layerHeight,
|
||||||
dimensions: { z: dimensionsZ }
|
zOffset
|
||||||
} = settings;
|
} = settings;
|
||||||
|
|
||||||
const numLayers = Math.floor(dimensionsZ / layerHeight);
|
const numLayers = Math.floor((dimensionsZ - zOffset) / layerHeight);
|
||||||
|
|
||||||
const layerIntersectionIndexes = Array.from(Array(numLayers)).map(() => []);
|
const layerIntersectionIndexes = Array.from(Array(numLayers)).map(() => []);
|
||||||
const layerIntersectionPoints = 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);
|
layerIntersectionIndexes[layerIndex].push(lineIndex);
|
||||||
|
|
||||||
const y = layerIndex * layerHeight;
|
const y = layerIndex * layerHeight + zOffset;
|
||||||
|
|
||||||
let x, z;
|
let x, z;
|
||||||
if (line.start.y === line.end.y) {
|
if (line.start.y === line.end.y) {
|
||||||
|
@ -12,7 +12,8 @@ export default function slicesToGCode(slices, settings) {
|
|||||||
travelSpeed,
|
travelSpeed,
|
||||||
retraction,
|
retraction,
|
||||||
travel,
|
travel,
|
||||||
combing
|
combing,
|
||||||
|
zOffset
|
||||||
} = settings;
|
} = settings;
|
||||||
|
|
||||||
const filamentSurfaceArea = Math.pow((filamentThickness / 2), 2) * Math.PI;
|
const filamentSurfaceArea = Math.pow((filamentThickness / 2), 2) * Math.PI;
|
||||||
@ -29,7 +30,7 @@ export default function slicesToGCode(slices, settings) {
|
|||||||
let isFirstLayer = true;
|
let isFirstLayer = true;
|
||||||
for (let layer = 0; layer < slices.length; layer ++) {
|
for (let layer = 0; layer < slices.length; layer ++) {
|
||||||
const slice = slices[layer];
|
const slice = slices[layer];
|
||||||
const z = layer * layerHeight;
|
const z = layer * layerHeight + zOffset;
|
||||||
|
|
||||||
if (layer === 1) {
|
if (layer === 1) {
|
||||||
gcode.turnFanOn();
|
gcode.turnFanOn();
|
||||||
|
Loading…
Reference in New Issue
Block a user