This commit is contained in:
casperlamboo 2016-10-13 14:24:53 +02:00
parent fdff42b4a5
commit c34be4595a
2 changed files with 5 additions and 4 deletions

View File

@ -15,5 +15,7 @@ export default function addBrim(slices, settings) {
brimOffset /= PRECISION;
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);
const y = layerIndex * layerHeight;
let x, z;
let x, z;
if (line.start.y === line.end.y) {
x = line.start.x;
z = line.start.z;
}
else {
} else {
const alpha = (y - line.start.y) / (line.end.y - line.start.y);
x = line.end.x * alpha + line.start.x * (1 - alpha);
z = line.end.z * alpha + line.start.z * (1 - alpha);