From ae29fe9999e1b02f924083906aaec5431fe9b454 Mon Sep 17 00:00:00 2001 From: casperlamboo Date: Mon, 13 Nov 2017 17:01:00 +0100 Subject: [PATCH] fix default line width --- .babelrc | 2 +- src/constants/exportConstants.js | 2 +- src/utils/exportUtils.js | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.babelrc b/.babelrc index 4e22b46..f36556a 100644 --- a/.babelrc +++ b/.babelrc @@ -3,7 +3,7 @@ "module": { "presets": [ ["env", { - "targets": { node: "6" }, + "targets": { "node": "6" }, "modules": false }], "stage-0", diff --git a/src/constants/exportConstants.js b/src/constants/exportConstants.js index dfafcd2..71f0a96 100644 --- a/src/constants/exportConstants.js +++ b/src/constants/exportConstants.js @@ -1 +1 @@ - export const LINE_WIDTH = 1.0; + export const LINE_WIDTH = 2.0; diff --git a/src/utils/exportUtils.js b/src/utils/exportUtils.js index 5a01da7..05f6c0b 100644 --- a/src/utils/exportUtils.js +++ b/src/utils/exportUtils.js @@ -8,6 +8,7 @@ import ShapeMesh from '../d3/ShapeMesh.js'; import { applyMatrixOnShape, pathToVectorPath } from '../utils/vectorUtils.js'; import { shapeToPoints } from '../shape/shapeToPoints.js'; import { SHAPE_TYPE_PROPERTIES } from '../constants/shapeTypeProperties.js'; +import { LINE_WIDTH } from '../constants/exportConstants.js'; import { bufferToBase64 } from '../utils/binaryUtils.js'; const THREE_BSP = ThreeBSP(THREE); @@ -31,7 +32,7 @@ function createExportGeometry(shapeData, offsetSingleWalls, lineWidth) { shapes = shapes.map(shape => shape .scaleUp(SCALE) .round() - .offset(lineWidth * 2 * SCALE, { jointType: 'jtSquare', endType: 'etOpenButt' }) + .offset(lineWidth / 2 * SCALE, { jointType: 'jtSquare', endType: 'etOpenButt' }) .simplify('pftNonZero') .scaleDown(SCALE) ); @@ -66,7 +67,7 @@ function createExportGeometry(shapeData, offsetSingleWalls, lineWidth) { export function generateExportMesh(state, options = {}) { const { experimentalColorUnionExport = false, - exportLineWidth = 2, + exportLineWidth = LINE_WIDTH, offsetSingleWalls = true, matrix = ROTATION_MATRIX } = options;