diff --git a/src/sliceActions/generateInfills.js b/src/sliceActions/generateInfills.js index 20335fd..e741493 100644 --- a/src/sliceActions/generateInfills.js +++ b/src/sliceActions/generateInfills.js @@ -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]; diff --git a/src/sliceActions/getFillTemplate.js b/src/sliceActions/getFillTemplate.js index 98ee8be..6b3db95 100644 --- a/src/sliceActions/getFillTemplate.js +++ b/src/sliceActions/getFillTemplate.js @@ -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;