From 03f95b75705e9ff52b9fe5a564158dcbeff31ab1 Mon Sep 17 00:00:00 2001 From: casperlamboo Date: Sun, 11 Feb 2018 23:50:57 +0100 Subject: [PATCH] rename vectorutils --- src/sliceActions/applyPrecision.js | 2 +- src/sliceActions/createLines.js | 2 +- src/sliceActions/helpers/GCode.js | 2 +- src/sliceActions/helpers/comb.js | 2 +- src/sliceActions/helpers/{VectorUtils.js => vector2D.js} | 3 +-- src/sliceActions/intersectionsToShapes.js | 2 +- src/sliceActions/optimizePaths.js | 2 +- src/sliceActions/slicesToGCode.js | 2 +- 8 files changed, 8 insertions(+), 9 deletions(-) rename src/sliceActions/helpers/{VectorUtils.js => vector2D.js} (93%) diff --git a/src/sliceActions/applyPrecision.js b/src/sliceActions/applyPrecision.js index b1cbad2..a234eee 100644 --- a/src/sliceActions/applyPrecision.js +++ b/src/sliceActions/applyPrecision.js @@ -1,4 +1,4 @@ -import { divide } from './helpers/VectorUtils.js'; +import { divide } from './helpers/vector2D.js'; import { PRECISION } from '../constants.js' export default function applyPrecision(layers) { diff --git a/src/sliceActions/createLines.js b/src/sliceActions/createLines.js index 3ccc624..0c8cf20 100644 --- a/src/sliceActions/createLines.js +++ b/src/sliceActions/createLines.js @@ -1,4 +1,4 @@ -import { normalize } from './helpers/VectorUtils.js'; +import { normalize } from './helpers/vector2D.js'; function addLine(geometry, lineLookup, lines, a, b, faceIndex) { let index; diff --git a/src/sliceActions/helpers/GCode.js b/src/sliceActions/helpers/GCode.js index 0004843..65e36a5 100644 --- a/src/sliceActions/helpers/GCode.js +++ b/src/sliceActions/helpers/GCode.js @@ -1,4 +1,4 @@ -import { scale, distanceTo } from './VectorUtils.js'; +import { scale, distanceTo } from './vector2D.js'; import { PRECISION, VERSION } from '../../constants.js'; export const MOVE = 'G'; diff --git a/src/sliceActions/helpers/comb.js b/src/sliceActions/helpers/comb.js index 7828e9f..5561bb1 100644 --- a/src/sliceActions/helpers/comb.js +++ b/src/sliceActions/helpers/comb.js @@ -1,5 +1,5 @@ import Shape from 'clipper-js'; -import { subtract, add, scale, normalize, dot, length, distanceTo } from './VectorUtils.js'; +import { subtract, add, scale, normalize, dot, length, distanceTo } from './vector2D.js'; import { PRECISION } from '../../constants.js'; const TOLERANCE = 1 / PRECISION; diff --git a/src/sliceActions/helpers/VectorUtils.js b/src/sliceActions/helpers/vector2D.js similarity index 93% rename from src/sliceActions/helpers/VectorUtils.js rename to src/sliceActions/helpers/vector2D.js index da7e197..a6aac06 100644 --- a/src/sliceActions/helpers/VectorUtils.js +++ b/src/sliceActions/helpers/vector2D.js @@ -30,5 +30,4 @@ export const normalize = (v) => { x: v.x / l, y: v.y / l }; -} -export const clone = (v) => ({ x: v.x, y: v.y }); +}; diff --git a/src/sliceActions/intersectionsToShapes.js b/src/sliceActions/intersectionsToShapes.js index 1d0f736..3328ebd 100644 --- a/src/sliceActions/intersectionsToShapes.js +++ b/src/sliceActions/intersectionsToShapes.js @@ -1,4 +1,4 @@ -import { subtract, normal, normalize, dot, almostEquals } from './helpers/VectorUtils.js'; +import { subtract, normal, normalize, dot, almostEquals } from './helpers/vector2D.js'; export default function intersectionsToShapes(intersectionLayers, faces, openObjectIndexes, settings) { const layers = []; diff --git a/src/sliceActions/optimizePaths.js b/src/sliceActions/optimizePaths.js index 1392311..7f249d9 100644 --- a/src/sliceActions/optimizePaths.js +++ b/src/sliceActions/optimizePaths.js @@ -1,4 +1,4 @@ -import { length, distanceTo } from './helpers/VectorUtils.js'; +import { length, distanceTo } from './helpers/vector2D.js'; import Shape from 'clipper-js'; export default function optimizePaths(slices, settings) { diff --git a/src/sliceActions/slicesToGCode.js b/src/sliceActions/slicesToGCode.js index 58a3ea8..cc379ad 100644 --- a/src/sliceActions/slicesToGCode.js +++ b/src/sliceActions/slicesToGCode.js @@ -1,6 +1,6 @@ import GCode from './helpers/GCode.js'; import comb from './helpers/comb.js'; -import { divide } from './helpers/VectorUtils.js'; +import { divide } from './helpers/vector2D.js'; import { PRECISION, Z_OFFSET } from '../constants.js'; const PROFILE_TYPES = ['support', 'innerShell', 'outerShell', 'innerInfill', 'outerInfill', 'brim'];