diff --git a/src/sliceActions/calculateLayersIntersections.js b/src/sliceActions/calculateLayersIntersections.js index 76b0e9f..114bc2b 100644 --- a/src/sliceActions/calculateLayersIntersections.js +++ b/src/sliceActions/calculateLayersIntersections.js @@ -9,9 +9,9 @@ export default function calculateLayersIntersections(lines, settings) { const layerIntersectionPoints = Array.from(Array(numLayers)).map(() => []); for (let lineIndex = 0; lineIndex < lines.length; lineIndex ++) { - const line = lines[lineIndex].line; + const { line, isFlat } = lines[lineIndex]; - if (line.isFlat) continue; + 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); diff --git a/src/sliceActions/createLines.js b/src/sliceActions/createLines.js index 188f1c3..5a6e3fc 100644 --- a/src/sliceActions/createLines.js +++ b/src/sliceActions/createLines.js @@ -25,7 +25,7 @@ export default function createLines(geometry, settings) { const lookupB = lineLookup[`${face.c}_${face.b}`]; const lookupC = lineLookup[`${face.a}_${face.c}`]; - const isFlat = face.normal.y !== 1 && face.normal.y !== -1; + const isFlat = face.normal.y > 0.999 || face.normal.y < -0.999; // only add unique lines // returns index of said line