This commit is contained in:
casperlamboo 2016-10-13 14:24:53 +02:00 committed by Simon Voordouw
parent 785898f466
commit 2fc909c45d
2 changed files with 5 additions and 4 deletions

View File

@ -15,5 +15,7 @@ export default function addBrim(slices, settings) {
brimOffset /= PRECISION; brimOffset /= PRECISION;
const fistLayer = slices[0]; const fistLayer = slices[0];
fistLayer.brim = fistLayer.getOutline().offset(brimOffset, offsetOptions); fistLayer.brim = fistLayer
.getOutline()
.offset(brimOffset, offsetOptions);
} }

View File

@ -26,13 +26,12 @@ export default function calculateLayersIntersections(lines, settings) {
layerIntersectionIndexes[layerIndex].push(lineIndex); layerIntersectionIndexes[layerIndex].push(lineIndex);
const y = layerIndex * layerHeight; const y = layerIndex * layerHeight;
let x, z;
let x, z;
if (line.start.y === line.end.y) { if (line.start.y === line.end.y) {
x = line.start.x; x = line.start.x;
z = line.start.z; z = line.start.z;
} } else {
else {
const alpha = (y - line.start.y) / (line.end.y - line.start.y); const alpha = (y - line.start.y) / (line.end.y - line.start.y);
x = line.end.x * alpha + line.start.x * (1 - alpha); x = line.end.x * alpha + line.start.x * (1 - alpha);
z = line.end.z * alpha + line.start.z * (1 - alpha); z = line.end.z * alpha + line.start.z * (1 - alpha);