Point fixes and asymmetry tests

This commit is contained in:
Bán Dénes 2020-05-31 20:33:23 +02:00
parent cdb081a377
commit afdc467daf
4 changed files with 44 additions and 22 deletions

14
helpers/utils.js Normal file
View file

@ -0,0 +1,14 @@
const m = require('makerjs')
const fs = require('fs-extra')
exports.deepcopy = (value) => JSON.parse(JSON.stringify(value))
exports.dump_model = (model, file='model', json=false) => {
const assembly = m.model.originate({
model,
units: 'mm'
})
fs.writeFileSync(`${file}.dxf`, m.exporter.toDXF(assembly))
if (json) fs.writeFileSync(`${file}.json`, JSON.stringify(assembly, null, ' '))
}