mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-12-23 03:23:48 +01:00
fix z offset
This commit is contained in:
parent
8e5e000a12
commit
8c546e31b3
@ -17,15 +17,15 @@ export default function calculateLayersIntersections(lines, settings) {
|
||||
|
||||
if (isFlat) continue;
|
||||
|
||||
const min = Math.ceil(Math.min(line.start.y, line.end.y) / layerHeight);
|
||||
const max = Math.floor(Math.max(line.start.y, line.end.y) / layerHeight);
|
||||
const min = Math.ceil((Math.min(line.start.y, line.end.y) - zOffset) / layerHeight);
|
||||
const max = Math.floor((Math.max(line.start.y, line.end.y) - zOffset) / layerHeight);
|
||||
|
||||
for (let layerIndex = min; layerIndex <= max; layerIndex ++) {
|
||||
if (layerIndex >= 0 && layerIndex < numLayers) {
|
||||
|
||||
layerIntersectionIndexes[layerIndex].push(lineIndex);
|
||||
|
||||
const y = layerIndex * layerHeight;
|
||||
const y = layerIndex * layerHeight + zOffset;
|
||||
|
||||
let x, z;
|
||||
if (line.start.y === line.end.y) {
|
||||
|
Loading…
Reference in New Issue
Block a user