From ca886afa25f87d0da444c8e4bbf722c1792ec6e8 Mon Sep 17 00:00:00 2001 From: casperlamboo Date: Mon, 12 Feb 2018 11:13:50 +0100 Subject: [PATCH] rename file --- src/sliceActions/applyPrecision.js | 2 +- src/sliceActions/createLines.js | 2 +- src/sliceActions/helpers/GCode.js | 2 +- src/sliceActions/helpers/comb.js | 2 +- .../helpers/{vector2D.js => vector2.js} | 18 +++++++++--------- src/sliceActions/intersectionsToShapes.js | 2 +- src/sliceActions/optimizePaths.js | 2 +- src/sliceActions/slicesToGCode.js | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) rename src/sliceActions/helpers/{vector2D.js => vector2.js} (74%) diff --git a/src/sliceActions/applyPrecision.js b/src/sliceActions/applyPrecision.js index a234eee..6f20854 100644 --- a/src/sliceActions/applyPrecision.js +++ b/src/sliceActions/applyPrecision.js @@ -1,4 +1,4 @@ -import { divide } from './helpers/vector2D.js'; +import { divide } from './helpers/vector2.js'; import { PRECISION } from '../constants.js' export default function applyPrecision(layers) { diff --git a/src/sliceActions/createLines.js b/src/sliceActions/createLines.js index 7dcb51b..2147290 100644 --- a/src/sliceActions/createLines.js +++ b/src/sliceActions/createLines.js @@ -1,4 +1,4 @@ -import { normalize } from './helpers/vector2D.js'; +import { normalize } from './helpers/vector2.js'; function addLine(vertices, lineLookup, lines, a, b, faceIndex) { let index; diff --git a/src/sliceActions/helpers/GCode.js b/src/sliceActions/helpers/GCode.js index 65e36a5..18dfa96 100644 --- a/src/sliceActions/helpers/GCode.js +++ b/src/sliceActions/helpers/GCode.js @@ -1,4 +1,4 @@ -import { scale, distanceTo } from './vector2D.js'; +import { scale, distanceTo } from './vector2.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 5561bb1..538cda9 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 './vector2D.js'; +import { subtract, add, scale, normalize, dot, length, distanceTo } from './vector2.js'; import { PRECISION } from '../../constants.js'; const TOLERANCE = 1 / PRECISION; diff --git a/src/sliceActions/helpers/vector2D.js b/src/sliceActions/helpers/vector2.js similarity index 74% rename from src/sliceActions/helpers/vector2D.js rename to src/sliceActions/helpers/vector2.js index a6aac06..bf10575 100644 --- a/src/sliceActions/helpers/vector2D.js +++ b/src/sliceActions/helpers/vector2.js @@ -6,17 +6,17 @@ export const add = (a, b) => ({ x: a.x + b.x, y: a.y + b.y }); -export const scale = (a, factor) => ({ - x: a.x * factor, - y: a.y * factor +export const scale = (v, factor) => ({ + x: v.x * factor, + y: v.y * factor }); -export const divide = (a, factor) => ({ - x: a.x / factor, - y: a.y / factor +export const divide = (v, factor) => ({ + x: v.x / factor, + y: v.y / factor }); -export const normal = (a) => ({ - x: -a.y, - y: a.x +export const normal = (v) => ({ + x: -v.y, + y: v.x }); export const equals = (a, b) => a.x === b.x && a.y === b.y; export const almostEquals = (a, b) => Math.abs(a.x - b.x) < 0.001 && Math.abs(a.y - b.y) < 0.001; diff --git a/src/sliceActions/intersectionsToShapes.js b/src/sliceActions/intersectionsToShapes.js index 8630004..5d5646b 100644 --- a/src/sliceActions/intersectionsToShapes.js +++ b/src/sliceActions/intersectionsToShapes.js @@ -1,4 +1,4 @@ -import { subtract, normal, normalize, dot, almostEquals } from './helpers/vector2D.js'; +import { subtract, normal, normalize, dot, almostEquals } from './helpers/vector2.js'; export default function intersectionsToShapes(layerPoints, layerFaceIndexes, faces, openObjectIndexes, settings) { const layers = []; diff --git a/src/sliceActions/optimizePaths.js b/src/sliceActions/optimizePaths.js index 7f249d9..bdafffe 100644 --- a/src/sliceActions/optimizePaths.js +++ b/src/sliceActions/optimizePaths.js @@ -1,4 +1,4 @@ -import { length, distanceTo } from './helpers/vector2D.js'; +import { length, distanceTo } from './helpers/vector2.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 cc379ad..2708f75 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/vector2D.js'; +import { divide } from './helpers/vector2.js'; import { PRECISION, Z_OFFSET } from '../constants.js'; const PROFILE_TYPES = ['support', 'innerShell', 'outerShell', 'innerInfill', 'outerInfill', 'brim'];