Skip to content

Commit

Permalink
style(all): formatting changes from lint
Browse files Browse the repository at this point in the history
Co-authored-by: JAG <jeff.gay@hayate.co.jp>
  • Loading branch information
z3dev and JAG authored Jun 6, 2024
1 parent c263907 commit a6565a3
Show file tree
Hide file tree
Showing 40 changed files with 85 additions and 88 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/code-evaluation/rebuildGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const rebuildGeometry = (data, callback) => {
lookupCounts: solidsData.lookupCounts
})
} catch (error) {
callback({
callback(null, {
type: 'errors',
name: error.name ? error.name : 'Error',
message: error.message ? error.message : error.toString(),
Expand All @@ -80,6 +80,6 @@ export const rebuildGeometry = (data, callback) => {
lineNumber: error.lineNumber ? error.lineNumber : '',
columnNumber: error.columnNumber ? error.columnNumber : '',
stack: error.stack ? error.stack : ''
}, null)
})
}
}
2 changes: 1 addition & 1 deletion packages/examples/core/offsets/offset.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const main = () => {
expandedGeom2Edge,
expandedGeom2Chamfer,
expandedGeom2Round,
contractedGeom2,
contractedGeom2
]),

translate([50, 10, 0], [
Expand Down
2 changes: 1 addition & 1 deletion packages/io/3mf-deserializer/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ export default {
nodeResolve(),
banner('<%= pkg.description %>\n@module <%= pkg.name %>\n@version <%= pkg.version %>\n@license <%= pkg.license %>'),
versionInjector({ injectInComments: { fileRegexp: /\.(html)$/ }, logLevel: 'warn' }),
terser({ compress: { module: true }, mangle: false, format: { comments: 'some'} })
terser({ compress: { module: true }, mangle: false, format: { comments: 'some' } })
]
}
2 changes: 0 additions & 2 deletions packages/io/3mf-deserializer/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ const deserialize = (options, input) => {
return options.output === 'script' ? translateModels(options, models) : instantiateModels(options, models)
}

const isBuffer = (obj) => (obj.byteLength !== undefined && typeof obj.slice === 'function')

const mimeType = 'model/3mf'

export {
Expand Down
4 changes: 2 additions & 2 deletions packages/io/3mf-deserializer/src/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export const parseModel = (options, source) => {
// parse the 3MF contents (XML)
const { objects, materials, colorgroups, items } = parse(source)
if (objects.length === 0) {
throw new Error('3MF parsing failed, no valid 3MF objects retrieved')
}
throw new Error('3MF parsing failed, no valid 3MF objects retrieved')
}

// get a list of objects to include in the results
const buildItems = []
Expand Down
11 changes: 5 additions & 6 deletions packages/io/3mf-deserializer/src/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,10 @@ const getProperty = (object, triangle) => {
}

const create3mfParser = (src, storage) => {
let { items, materials, colorgroups, objects } = storage
const { items, materials, colorgroups, objects } = storage

let model = null
let objLast = null // last object found
let objList = []

// create a parser for the XML
const parser = new saxes.SaxesParser()
Expand Down Expand Up @@ -272,10 +271,10 @@ const create3mfParser = (src, storage) => {
}

export const parse = (src) => {
let items = [] // build items list
let materials = [] // materials list
let colorgroups = [] // colorgroups list
let objects = [] // objects list
const items = [] // build items list
const materials = [] // materials list
const colorgroups = [] // colorgroups list
const objects = [] // objects list

create3mfParser(src, { items, materials, colorgroups, objects })
return { items, materials, colorgroups, objects }
Expand Down
2 changes: 1 addition & 1 deletion packages/io/3mf-serializer/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ export default {
commonjs(),
nodeResolve(),
banner('<%= pkg.description %>\n@module <%= pkg.name %>\n@version <%= pkg.version %>\n@license <%= pkg.license %>'),
terser({ compress: { module: true }, mangle: false, format: { comments: 'some'} })
terser({ compress: { module: true }, mangle: false, format: { comments: 'some' } })
]
}
2 changes: 1 addition & 1 deletion packages/io/dxf-deserializer/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ export default {
nodeResolve(),
banner('<%= pkg.description %>\n@module <%= pkg.name %>\n@version <%= pkg.version %>\n@license <%= pkg.license %>'),
versionInjector({ injectInComments: { fileRegexp: /\.(html)$/ }, logLevel: 'warn' }),
terser({ compress: { module: true }, mangle: false, format: { comments: 'some'} })
terser({ compress: { module: true }, mangle: false, format: { comments: 'some' } })
]
}
4 changes: 2 additions & 2 deletions packages/io/dxf-serializer/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
{
file: 'dist/jscad-dxf-serializer.min.js',
format: 'umd',
name: 'jscadDxfSerializer',
name: 'jscadDxfSerializer'
},
{
file: 'dist/jscad-dxf-serializer.es.js',
Expand All @@ -20,6 +20,6 @@ export default {
plugins: [
nodeResolve(),
banner('<%= pkg.description %>\n@module <%= pkg.name %>\n@version <%= pkg.version %>\n@license <%= pkg.license %>'),
terser({ compress: { module: true }, mangle: false, format: { comments: 'some'} })
terser({ compress: { module: true }, mangle: false, format: { comments: 'some' } })
]
}
2 changes: 1 addition & 1 deletion packages/io/json-deserializer/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ export default {
nodeResolve(),
banner('<%= pkg.description %>\n@module <%= pkg.name %>\n@version <%= pkg.version %>\n@license <%= pkg.license %>'),
versionInjector({ injectInComments: { fileRegexp: /\.(html)$/ }, logLevel: 'warn' }),
terser({ compress: { module: true }, mangle: false, format: { comments: 'some'} })
terser({ compress: { module: true }, mangle: false, format: { comments: 'some' } })
]
}
2 changes: 1 addition & 1 deletion packages/io/json-serializer/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ export default {
plugins: [
nodeResolve(),
banner('<%= pkg.description %>\n@module <%= pkg.name %>\n@version <%= pkg.version %>\n@license <%= pkg.license %>'),
terser({ compress: { module: true }, mangle: false, format: { comments: 'some'} })
terser({ compress: { module: true }, mangle: false, format: { comments: 'some' } })
]
}
2 changes: 1 addition & 1 deletion packages/io/obj-deserializer/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ export default {
nodeResolve(),
banner('<%= pkg.description %>\n@module <%= pkg.name %>\n@version <%= pkg.version %>\n@license <%= pkg.license %>'),
versionInjector({ injectInComments: { fileRegexp: /\.(html)$/ }, logLevel: 'warn' }),
terser({ compress: { module: true }, mangle: false, format: { comments: 'some'} })
terser({ compress: { module: true }, mangle: false, format: { comments: 'some' } })
]
}
2 changes: 1 addition & 1 deletion packages/io/obj-serializer/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ export default {
plugins: [
nodeResolve(),
banner('<%= pkg.description %>\n@module <%= pkg.name %>\n@version <%= pkg.version %>\n@license <%= pkg.license %>'),
terser({ compress: { module: true }, mangle: false, format: { comments: 'some'} })
terser({ compress: { module: true }, mangle: false, format: { comments: 'some' } })
]
}
2 changes: 1 addition & 1 deletion packages/io/stl-deserializer/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ export default {
nodeResolve(),
banner('<%= pkg.description %>\n@module <%= pkg.name %>\n@version <%= pkg.version %>\n@license <%= pkg.license %>'),
versionInjector({ injectInComments: { fileRegexp: /\.(html)$/ }, logLevel: 'warn' }),
terser({ compress: { module: true }, mangle: false, format: { comments: 'some'} })
terser({ compress: { module: true }, mangle: false, format: { comments: 'some' } })
]
}
2 changes: 1 addition & 1 deletion packages/io/stl-deserializer/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const formatAsJscad = (data, addMetaData, version, filename) => {
//
`
}
code += `import * from '@jscad/modeling'\n`
code += 'import * from \'@jscad/modeling\'\n'
code += data.join('\n')
code += `
export const main = () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/io/stl-serializer/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ export default {
plugins: [
nodeResolve(),
banner('<%= pkg.description %>\n@module <%= pkg.name %>\n@version <%= pkg.version %>\n@license <%= pkg.license %>'),
terser({ compress: { module: true }, mangle: false, format: { comments: 'some'} })
terser({ compress: { module: true }, mangle: false, format: { comments: 'some' } })
]
}
2 changes: 1 addition & 1 deletion packages/io/svg-deserializer/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ export default {
nodeResolve(),
banner('<%= pkg.description %>\n@module <%= pkg.name %>\n@version <%= pkg.version %>\n@license <%= pkg.license %>'),
versionInjector({ injectInComments: { fileRegexp: /\.(html)$/ }, logLevel: 'warn' }),
terser({ compress: { module: true }, mangle: false, format: { comments: 'some'} })
terser({ compress: { module: true }, mangle: false, format: { comments: 'some' } })
]
}
24 changes: 13 additions & 11 deletions packages/io/svg-deserializer/src/shapesMapGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,9 @@ const expandPath = (obj, svgUnitsPmm, svgUnitsX, svgUnitsY, svgUnitsV, svgGroups
pc = false
}
const ensurePath = () => {
if (!paths[pathName]) paths[pathName] =
path2.fromPoints({}, [])
if (!paths[pathName]) {
paths[pathName] = path2.fromPoints({}, [])
}
}
for (let j = 0; j < obj.commands.length; j++) {
const co = obj.commands[j]
Expand Down Expand Up @@ -328,8 +329,8 @@ const expandPath = (obj, svgUnitsPmm, svgUnitsX, svgUnitsY, svgUnitsV, svgGroups
qy = cy + parseFloat(pts[i++])
cx = cx + parseFloat(pts[i++])
cy = cy + parseFloat(pts[i++])
const q1 = [p0[0] + (2/3) * (qx - p0[0]), p0[1] + (2/3) * (qy - p0[1])]
const q2 = [q1[0] + (1/3) * (cx - p0[0]), q1[1] + (1/3) * (cy - p0[1])]
const q1 = [p0[0] + (2 / 3) * (qx - p0[0]), p0[1] + (2 / 3) * (qy - p0[1])]
const q2 = [q1[0] + (1 / 3) * (cx - p0[0]), q1[1] + (1 / 3) * (cy - p0[1])]
ensurePath()
paths[pathName] = path2.appendBezier({
segments,
Expand All @@ -351,8 +352,8 @@ const expandPath = (obj, svgUnitsPmm, svgUnitsX, svgUnitsY, svgUnitsV, svgGroups
qy = parseFloat(pts[i++])
cx = parseFloat(pts[i++])
cy = parseFloat(pts[i++])
const q1 = [p0[0] + (2/3) * (qx - p0[0]), p0[1] + (2/3) * (qy - p0[1])]
const q2 = [q1[0] + (1/3) * (cx - p0[0]), q1[1] + (1/3) * (cy - p0[1])]
const q1 = [p0[0] + (2 / 3) * (qx - p0[0]), p0[1] + (2 / 3) * (qy - p0[1])]
const q2 = [q1[0] + (1 / 3) * (cx - p0[0]), q1[1] + (1 / 3) * (cy - p0[1])]
ensurePath()
paths[pathName] = path2.appendBezier({
segments,
Expand All @@ -372,8 +373,8 @@ const expandPath = (obj, svgUnitsPmm, svgUnitsX, svgUnitsY, svgUnitsV, svgGroups
const p0 = [cx, cy] // previous point
cx = cx + parseFloat(pts[i++])
cy = cy + parseFloat(pts[i++])
const q1 = [p0[0] + (2/3) * (qx - p0[0]), p0[1] + (2/3) * (qy - p0[1])]
const q2 = [q1[0] + (1/3) * (cx - p0[0]), q1[1] + (1/3) * (cy - p0[1])]
const q1 = [p0[0] + (2 / 3) * (qx - p0[0]), p0[1] + (2 / 3) * (qy - p0[1])]
const q2 = [q1[0] + (1 / 3) * (cx - p0[0]), q1[1] + (1 / 3) * (cy - p0[1])]
ensurePath()
paths[pathName] = path2.appendBezier({
segments,
Expand All @@ -393,8 +394,8 @@ const expandPath = (obj, svgUnitsPmm, svgUnitsX, svgUnitsY, svgUnitsV, svgGroups
const p0 = [cx, cy] // previous point
cx = parseFloat(pts[i++])
cy = parseFloat(pts[i++])
const q1 = [p0[0] + (2/3) * (qx - p0[0]), p0[1] + (2/3) * (qy - p0[1])]
const q2 = [q1[0] + (1/3) * (cx - p0[0]), q1[1] + (1/3) * (cy - p0[1])]
const q1 = [p0[0] + (2 / 3) * (qx - p0[0]), p0[1] + (2 / 3) * (qy - p0[1])]
const q2 = [q1[0] + (1 / 3) * (cx - p0[0]), q1[1] + (1 / 3) * (cy - p0[1])]
ensurePath()
paths[pathName] = path2.appendBezier({
segments,
Expand All @@ -419,7 +420,8 @@ const expandPath = (obj, svgUnitsPmm, svgUnitsX, svgUnitsY, svgUnitsV, svgGroups
cy = cy + parseFloat(pts[i++])
ensurePath()
paths[pathName] = path2.appendBezier({
segments, controlPoints: [
segments,
controlPoints: [
svg2cag([x1, y1], svgUnitsPmm),
svg2cag([bx, by], svgUnitsPmm),
svg2cag([cx, cy], svgUnitsPmm)
Expand Down
16 changes: 8 additions & 8 deletions packages/io/svg-deserializer/src/shapesMapJscad.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ const path = (obj, svgUnitsPmm, svgUnitsX, svgUnitsY, svgUnitsV, params, svgGrou
qy = cy + parseFloat(pts.shift())
cx = cx + parseFloat(pts.shift()) // end point
cy = cy + parseFloat(pts.shift())
const q1 = [p0[0] + (2/3) * (qx - p0[0]), p0[1] + (2/3) * (qy - p0[1])]
const q2 = [q1[0] + (1/3) * (cx - p0[0]), q1[1] + (1/3) * (cy - p0[1])]
const q1 = [p0[0] + (2 / 3) * (qx - p0[0]), p0[1] + (2 / 3) * (qy - p0[1])]
const q2 = [q1[0] + (1 / 3) * (cx - p0[0]), q1[1] + (1 / 3) * (cy - p0[1])]
tmpCode += `${indent}${pathName} = path2.appendBezier({segments: ${segments}, controlPoints: [[${svg2cag(q1, svgUnitsPmm)}], [${svg2cag(q2, svgUnitsPmm)}], [${svg2cag([cx, cy], svgUnitsPmm)}]]}, ${pathName})\n`
const rf = reflect(qx, qy, cx, cy)
qx = rf[0]
Expand All @@ -273,8 +273,8 @@ const path = (obj, svgUnitsPmm, svgUnitsX, svgUnitsY, svgUnitsV, params, svgGrou
qy = parseFloat(pts.shift())
cx = parseFloat(pts.shift()) // end point
cy = parseFloat(pts.shift())
const q1 = [p0[0] + (2/3) * (qx - p0[0]), p0[1] + (2/3) * (qy - p0[1])]
const q2 = [q1[0] + (1/3) * (cx - p0[0]), q1[1] + (1/3) * (cy - p0[1])]
const q1 = [p0[0] + (2 / 3) * (qx - p0[0]), p0[1] + (2 / 3) * (qy - p0[1])]
const q2 = [q1[0] + (1 / 3) * (cx - p0[0]), q1[1] + (1 / 3) * (cy - p0[1])]
tmpCode += `${indent}${pathName} = path2.appendBezier({segments: ${segments}, controlPoints: [[${svg2cag(q1, svgUnitsPmm)}], [${svg2cag(q2, svgUnitsPmm)}], [${svg2cag([cx, cy], svgUnitsPmm)}]]}, ${pathName})\n`
const rf = reflect(qx, qy, cx, cy)
qx = rf[0]
Expand All @@ -286,8 +286,8 @@ const path = (obj, svgUnitsPmm, svgUnitsX, svgUnitsY, svgUnitsV, params, svgGrou
const p0 = [cx, cy] // previous point
cx = cx + parseFloat(pts.shift()) // end point
cy = cy + parseFloat(pts.shift())
const q1 = [p0[0] + (2/3) * (qx - p0[0]), p0[1] + (2/3) * (qy - p0[1])]
const q2 = [q1[0] + (1/3) * (cx - p0[0]), q1[1] + (1/3) * (cy - p0[1])]
const q1 = [p0[0] + (2 / 3) * (qx - p0[0]), p0[1] + (2 / 3) * (qy - p0[1])]
const q2 = [q1[0] + (1 / 3) * (cx - p0[0]), q1[1] + (1 / 3) * (cy - p0[1])]
tmpCode += `${indent}${pathName} = path2.appendBezier({segments: ${segments}, controlPoints: [[[${svg2cag(q1, svgUnitsPmm)}], [${svg2cag(q2, svgUnitsPmm)}], [${svg2cag([cx, cy], svgUnitsPmm)}]]}, ${pathName})\n`
const rf = reflect(qx, qy, cx, cy)
qx = rf[0]
Expand All @@ -299,8 +299,8 @@ const path = (obj, svgUnitsPmm, svgUnitsX, svgUnitsY, svgUnitsV, params, svgGrou
const p0 = [cx, cy] // previous point
cx = parseFloat(pts.shift()) // end point
cy = parseFloat(pts.shift())
const q1 = [p0[0] + (2/3) * (qx - p0[0]), p0[1] + (2/3) * (qy - p0[1])]
const q2 = [q1[0] + (1/3) * (cx - p0[0]), q1[1] + (1/3) * (cy - p0[1])]
const q1 = [p0[0] + (2 / 3) * (qx - p0[0]), p0[1] + (2 / 3) * (qy - p0[1])]
const q2 = [q1[0] + (1 / 3) * (cx - p0[0]), q1[1] + (1 / 3) * (cy - p0[1])]
tmpCode += `${indent}${pathName} = path2.appendBezier({segments: ${segments}, controlPoints: [[[${svg2cag(q1, svgUnitsPmm)}], [${svg2cag(q2, svgUnitsPmm)}], [${svg2cag([cx, cy], svgUnitsPmm)}]]}, ${pathName})\n`
const rf = reflect(qx, qy, cx, cy)
qx = rf[0]
Expand Down
2 changes: 1 addition & 1 deletion packages/io/svg-serializer/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ export default {
nodeResolve(),
banner('<%= pkg.description %>\n@module <%= pkg.name %>\n@version <%= pkg.version %>\n@license <%= pkg.license %>'),
versionInjector({ injectInComments: { fileRegexp: /\.(html)$/ }, logLevel: 'warn' }),
terser({ compress: { module: true }, mangle: false, format: { comments: 'some'} })
terser({ compress: { module: true }, mangle: false, format: { comments: 'some' } })
]
}
2 changes: 1 addition & 1 deletion packages/io/x3d-deserializer/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ export default {
nodeResolve(),
banner('<%= pkg.description %>\n@module <%= pkg.name %>\n@version <%= pkg.version %>\n@license <%= pkg.license %>'),
versionInjector({ injectInComments: { fileRegexp: /\.(html)$/ }, logLevel: 'warn' }),
terser({ compress: { module: true }, mangle: false, format: { comments: 'some'} })
terser({ compress: { module: true }, mangle: false, format: { comments: 'some' } })
]
}
2 changes: 1 addition & 1 deletion packages/io/x3d-deserializer/src/objects.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { area, poly2 } from '@jscad/modeling'
import { area } from '@jscad/modeling'

export const x3dTypes = {
X3D: 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/io/x3d-serializer/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ export default {
plugins: [
nodeResolve(),
banner('<%= pkg.description %>\n@module <%= pkg.name %>\n@version <%= pkg.version %>\n@license <%= pkg.license %>'),
terser({ compress: { module: true }, mangle: false, format: { comments: 'some'} })
terser({ compress: { module: true }, mangle: false, format: { comments: 'some' } })
]
}
2 changes: 1 addition & 1 deletion packages/modeling/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ export default {
],
plugins: [
banner('<%= pkg.description %>\n@module <%= pkg.name %>\n@version <%= pkg.version %>\n@license <%= pkg.license %>'),
terser({ compress: { module: true }, mangle: false, format: { comments: 'some'} })
terser({ compress: { module: true }, mangle: false, format: { comments: 'some' } })
]
}
36 changes: 20 additions & 16 deletions packages/modeling/src/geometries/geom3/fromPointsConvex.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,30 @@ import test from 'ava'
import { fromPointsConvex, validate } from './index.js'

test('fromPointsConvex (uniquePoints)', (t) => {
let out = []
for(let x=-9;x<=9;++x)
for(let y=-9;y<=9;++y)
for(let z=-9;z<=9;++z)
if (x*x+y*y+z*z <= 96)
out.push([x,y,z])
const out = []
for (let x = -9; x <= 9; ++x) {
for (let y = -9; y <= 9; ++y) {
for (let z = -9; z <= 9; ++z) {
if (x * x + y * y + z * z <= 96) {
out.push([x, y, z])
}
}
}
}

let obs = fromPointsConvex(out)
const obs = fromPointsConvex(out)
validate(obs)
t.is(obs.polygons.length, 170)
t.true(obs.polygons.every((f) => ([3,4,8,9].indexOf(f.vertices.length) !== -1)))
t.true(obs.polygons.every((f) => ([3, 4, 8, 9].indexOf(f.vertices.length) !== -1)))

let c = [0,0,0,0,0,0,0,0,0,0]
const c = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
obs.polygons.forEach((f) => c[f.vertices.length]++)
t.is(c[3], 120);
t.is(c[4], 24);
t.is(c[8], 18);
t.is(c[9], 8);
t.is(c[3], 120)
t.is(c[4], 24)
t.is(c[8], 18)
t.is(c[9], 8)

let edges2 = 336*2
obs.polygons.forEach((f) => edges2 -= f.vertices.length)
t.is(edges2, 0);
let edges2 = 336 * 2
obs.polygons.forEach((f) => { edges2 -= f.vertices.length })
t.is(edges2, 0)
})
3 changes: 1 addition & 2 deletions packages/modeling/src/geometries/slice/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ export const validate = (object) => {
// contours must be coplanar
const contourPlane = poly3.plane(poly3.create(contour))
if (!plane.equals(slicePlane, contourPlane)) {
throw new Error(`slice contours must be coplanar`)
throw new Error('slice contours must be coplanar')
}


for (let i = 0; i < contour.length; i++) {
const vertex = contour[i]
// check for infinity, nan
Expand Down
2 changes: 1 addition & 1 deletion packages/modeling/src/maths/mat4/isOnlyTransformScale.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const isOnlyTransformScale = (matrix) => (
)

/**
* @param {number} num
* @param {number} num
* @returns {boolean}
*/
const isZero = (num) => Math.abs(num) < Number.EPSILON
Loading

0 comments on commit a6565a3

Please sign in to comment.