fix grid size calculation

This commit is contained in:
casperlamboo 2018-01-18 12:38:35 +01:00
parent a892d6ff89
commit 961337138b
2 changed files with 4 additions and 2 deletions

View File

@ -22,7 +22,7 @@ export default function generateInfills(slices, settings) {
const bottomSkinCount = Math.ceil(bottomThickness / layerHeight);
const topSkinCount = Math.ceil(topThickness / layerHeight);
const nozzleRadius = nozzleDiameter / 2;
const outerFillTemplateSize = Math.sqrt(2 * Math.pow(nozzleDiameter, 2));
const outerFillTemplateSize = nozzleDiameter;
for (let layer = 0; layer < slices.length; layer ++) {
const slice = slices[layer];

View File

@ -1,8 +1,10 @@
import Shape from 'clipper-js';
export default function getFillTemplate(bounds, size, even, uneven) {
export default function getFillTemplate(bounds, gridSize, even, uneven) {
const paths = [];
const size = Math.sqrt(2 * Math.pow(gridSize, 2));
const left = Math.floor(bounds.left / size) * size;
const right = Math.ceil(bounds.right / size) * size;
const top = Math.floor(bounds.top / size) * size;