mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-11-23 05:57:57 +01:00
normalize cleanDelta with precision
This commit is contained in:
parent
f70723d6dc
commit
0bc84ed0a2
@ -1,7 +1,9 @@
|
|||||||
import Shape from 'Doodle3D/clipper-js';
|
import Shape from 'Doodle3D/clipper-js';
|
||||||
import Slice from '../Slice.js';
|
import Slice from '../Slice.js';
|
||||||
|
|
||||||
import { CLEAN_DELTA } from '../constants.js';
|
import { CLEAN_DELTA, 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 = [];
|
||||||
@ -12,11 +14,11 @@ export default function shapesToSlices(shapes, settings) {
|
|||||||
closedShapes = new Shape(closedShapes, true, true, true, true)
|
closedShapes = new Shape(closedShapes, true, true, true, true)
|
||||||
.fixOrientation()
|
.fixOrientation()
|
||||||
.simplify('pftNonZero')
|
.simplify('pftNonZero')
|
||||||
.clean(CLEAN_DELTA)
|
.clean(cleanDelta)
|
||||||
.seperateShapes();
|
.seperateShapes();
|
||||||
|
|
||||||
openShapes = new Shape(openShapes, false, true, true, true)
|
openShapes = new Shape(openShapes, false, true, true, true)
|
||||||
.clean(CLEAN_DELTA);
|
.clean(cleanDelta);
|
||||||
|
|
||||||
const slice = new Slice();
|
const slice = new Slice();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user