fix default line width

This commit is contained in:
casperlamboo 2017-11-13 17:01:00 +01:00
parent ba486249a4
commit ae29fe9999
3 changed files with 5 additions and 4 deletions

View File

@ -3,7 +3,7 @@
"module": { "module": {
"presets": [ "presets": [
["env", { ["env", {
"targets": { node: "6" }, "targets": { "node": "6" },
"modules": false "modules": false
}], }],
"stage-0", "stage-0",

View File

@ -1 +1 @@
export const LINE_WIDTH = 1.0; export const LINE_WIDTH = 2.0;

View File

@ -8,6 +8,7 @@ import ShapeMesh from '../d3/ShapeMesh.js';
import { applyMatrixOnShape, pathToVectorPath } from '../utils/vectorUtils.js'; import { applyMatrixOnShape, pathToVectorPath } from '../utils/vectorUtils.js';
import { shapeToPoints } from '../shape/shapeToPoints.js'; import { shapeToPoints } from '../shape/shapeToPoints.js';
import { SHAPE_TYPE_PROPERTIES } from '../constants/shapeTypeProperties.js'; import { SHAPE_TYPE_PROPERTIES } from '../constants/shapeTypeProperties.js';
import { LINE_WIDTH } from '../constants/exportConstants.js';
import { bufferToBase64 } from '../utils/binaryUtils.js'; import { bufferToBase64 } from '../utils/binaryUtils.js';
const THREE_BSP = ThreeBSP(THREE); const THREE_BSP = ThreeBSP(THREE);
@ -31,7 +32,7 @@ function createExportGeometry(shapeData, offsetSingleWalls, lineWidth) {
shapes = shapes.map(shape => shape shapes = shapes.map(shape => shape
.scaleUp(SCALE) .scaleUp(SCALE)
.round() .round()
.offset(lineWidth * 2 * SCALE, { jointType: 'jtSquare', endType: 'etOpenButt' }) .offset(lineWidth / 2 * SCALE, { jointType: 'jtSquare', endType: 'etOpenButt' })
.simplify('pftNonZero') .simplify('pftNonZero')
.scaleDown(SCALE) .scaleDown(SCALE)
); );
@ -66,7 +67,7 @@ function createExportGeometry(shapeData, offsetSingleWalls, lineWidth) {
export function generateExportMesh(state, options = {}) { export function generateExportMesh(state, options = {}) {
const { const {
experimentalColorUnionExport = false, experimentalColorUnionExport = false,
exportLineWidth = 2, exportLineWidth = LINE_WIDTH,
offsetSingleWalls = true, offsetSingleWalls = true,
matrix = ROTATION_MATRIX matrix = ROTATION_MATRIX
} = options; } = options;