fix isFlat check

This commit is contained in:
casperlamboo 2017-07-18 16:55:27 +02:00
parent 65f1e96ed8
commit 83f543b62b
2 changed files with 3 additions and 3 deletions

View File

@ -9,9 +9,9 @@ export default function calculateLayersIntersections(lines, settings) {
const layerIntersectionPoints = Array.from(Array(numLayers)).map(() => []); const layerIntersectionPoints = Array.from(Array(numLayers)).map(() => []);
for (let lineIndex = 0; lineIndex < lines.length; lineIndex ++) { 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 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 max = Math.floor(Math.max(line.start.y, line.end.y) / layerHeight);

View File

@ -25,7 +25,7 @@ export default function createLines(geometry, settings) {
const lookupB = lineLookup[`${face.c}_${face.b}`]; const lookupB = lineLookup[`${face.c}_${face.b}`];
const lookupC = lineLookup[`${face.a}_${face.c}`]; 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 // only add unique lines
// returns index of said line // returns index of said line