From f330aad040ff388fcf070e1a864c623252ccee6f Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Thu, 20 Jul 2017 11:51:48 +0200 Subject: [PATCH] Clipper-js dependency --- package-lock.json | 13 +++++++++++++ package.json | 4 +++- src/sliceActions/addBrim.js | 2 +- src/sliceActions/generateInfills.js | 2 +- src/sliceActions/generateOutlines.js | 2 +- src/sliceActions/generateSupport.js | 2 +- src/sliceActions/getFillTemplate.js | 2 +- src/sliceActions/helpers/Slice.js | 2 +- src/sliceActions/intersectionsToShapes.js | 2 +- src/sliceActions/optimizePaths.js | 2 +- src/sliceActions/shapesToSlices.js | 2 +- 11 files changed, 25 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index a692aac..5e04e6c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -817,6 +817,19 @@ "readdirp": "2.1.0" } }, + "clipper-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clipper-js/-/clipper-js-1.0.2.tgz", + "integrity": "sha1-5EiR3eZULMfQvMbvloTUWQVxSJM=", + "requires": { + "clipper-lib": "6.2.1" + } + }, + "clipper-lib": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/clipper-lib/-/clipper-lib-6.2.1.tgz", + "integrity": "sha1-Jm2Ox1dcWJ8F8j6c0APeUOIxF7Y=" + }, "commander": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", diff --git a/package.json b/package.json index 9fe33b4..a2e2d77 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,9 @@ "build:main:settings": "cp -r src/settings lib", "build:module:settings": "cp -r src/settings module" }, - "dependencies": {}, + "dependencies": { + "clipper-js": "^1.0.2" + }, "devDependencies": { "babel-cli": "^6.24.1", "babel-plugin-transform-object-rest-spread": "^6.23.0", diff --git a/src/sliceActions/addBrim.js b/src/sliceActions/addBrim.js index 9812598..db10b28 100644 --- a/src/sliceActions/addBrim.js +++ b/src/sliceActions/addBrim.js @@ -1,4 +1,4 @@ -import Shape from 'Doodle3D/clipper-js'; +import Shape from 'clipper-js'; import { PRECISION } from '../constants.js'; const offsetOptions = { diff --git a/src/sliceActions/generateInfills.js b/src/sliceActions/generateInfills.js index e959475..40ed2a6 100644 --- a/src/sliceActions/generateInfills.js +++ b/src/sliceActions/generateInfills.js @@ -1,6 +1,6 @@ import { PRECISION } from '../constants.js' import getFillTemplate from './getFillTemplate.js'; -import Shape from 'Doodle3D/clipper-js'; +import Shape from 'clipper-js'; export default function generateInfills(slices, settings) { let { diff --git a/src/sliceActions/generateOutlines.js b/src/sliceActions/generateOutlines.js index d98ccdf..9fca57b 100644 --- a/src/sliceActions/generateOutlines.js +++ b/src/sliceActions/generateOutlines.js @@ -1,4 +1,4 @@ -import Shape from 'Doodle3D/clipper-js'; +import Shape from 'clipper-js'; export default function calculateOutlines(slices, settings) { for (let layer = 0; layer < slices.length; layer ++) { diff --git a/src/sliceActions/generateSupport.js b/src/sliceActions/generateSupport.js index d8d2e37..8e9e0c3 100644 --- a/src/sliceActions/generateSupport.js +++ b/src/sliceActions/generateSupport.js @@ -1,5 +1,5 @@ import getFillTemplate from './getFillTemplate.js'; -import Shape from 'Doodle3D/clipper-js'; +import Shape from 'clipper-js'; import { PRECISION } from '../constants.js'; export default function generateSupport(slices, settings) { diff --git a/src/sliceActions/getFillTemplate.js b/src/sliceActions/getFillTemplate.js index 03b6428..98ee8be 100644 --- a/src/sliceActions/getFillTemplate.js +++ b/src/sliceActions/getFillTemplate.js @@ -1,4 +1,4 @@ -import Shape from 'Doodle3D/clipper-js'; +import Shape from 'clipper-js'; export default function getFillTemplate(bounds, size, even, uneven) { const paths = []; diff --git a/src/sliceActions/helpers/Slice.js b/src/sliceActions/helpers/Slice.js index 4e1002e..968f70a 100644 --- a/src/sliceActions/helpers/Slice.js +++ b/src/sliceActions/helpers/Slice.js @@ -1,4 +1,4 @@ -import Shape from 'Doodle3D/clipper-js'; +import Shape from 'clipper-js'; export default class { constructor() { diff --git a/src/sliceActions/intersectionsToShapes.js b/src/sliceActions/intersectionsToShapes.js index 6e24ce2..c46fc05 100644 --- a/src/sliceActions/intersectionsToShapes.js +++ b/src/sliceActions/intersectionsToShapes.js @@ -1,5 +1,5 @@ import * as THREE from 'three'; -import Shape from 'Doodle3D/clipper-js'; +import Shape from 'clipper-js'; export default function intersectionsToShapes(layerIntersectionIndexes, layerIntersectionPoints, lines, settings) { const layers = []; diff --git a/src/sliceActions/optimizePaths.js b/src/sliceActions/optimizePaths.js index cc5fec5..5f47af5 100644 --- a/src/sliceActions/optimizePaths.js +++ b/src/sliceActions/optimizePaths.js @@ -1,5 +1,5 @@ import * as THREE from 'three'; -import Shape from 'Doodle3D/clipper-js'; +import Shape from 'clipper-js'; export default function optimizePaths(slices, settings) { const start = new THREE.Vector2(0, 0); diff --git a/src/sliceActions/shapesToSlices.js b/src/sliceActions/shapesToSlices.js index f77eaee..ea0e5be 100644 --- a/src/sliceActions/shapesToSlices.js +++ b/src/sliceActions/shapesToSlices.js @@ -1,4 +1,4 @@ -import Shape from 'Doodle3D/clipper-js'; +import Shape from 'clipper-js'; import Slice from './helpers/Slice.js'; import { CLEAN_DELTA, PRECISION } from '../constants.js';