Always clean with clean delta 1

Making constant clean delta obsolete because it is already implied by
the const precision
This commit is contained in:
casperlamboo 2017-09-14 23:27:07 +02:00
parent 8db1feecb4
commit 8ea613e36e
2 changed files with 4 additions and 7 deletions

View File

@ -1,2 +1 @@
export const CLEAN_DELTA = 0.05;
export const PRECISION = 0.01; export const PRECISION = 0.01;

View File

@ -1,9 +1,7 @@
import Shape from 'clipper-js'; import Shape from 'clipper-js';
import Slice from './helpers/Slice.js'; import Slice from './helpers/Slice.js';
import { CLEAN_DELTA, PRECISION } from '../constants.js'; import { PRECISION } from '../constants.js';
const cleanDelta = CLEAN_DELTA / PRECISION;
export default function shapesToSlices(shapes, settings) { export default function shapesToSlices(shapes, settings) {
const sliceLayers = []; const sliceLayers = [];
@ -14,14 +12,14 @@ export default function shapesToSlices(shapes, settings) {
fillShapes = new Shape(fillShapes, true, true, true, true) fillShapes = new Shape(fillShapes, true, true, true, true)
.fixOrientation() .fixOrientation()
.simplify('pftNonZero') .simplify('pftNonZero')
.clean(cleanDelta) .clean(1)
.seperateShapes(); .seperateShapes();
lineShapesClosed = new Shape(lineShapesClosed, true, true, true, true) lineShapesClosed = new Shape(lineShapesClosed, true, true, true, true)
.clean(cleanDelta); .clean(1);
lineShapesOpen = new Shape(lineShapesOpen, false, true, true, true) lineShapesOpen = new Shape(lineShapesOpen, false, true, true, true)
.clean(cleanDelta); .clean(1);
const slice = new Slice(); const slice = new Slice();