Points practically done

This commit is contained in:
Bán Dénes 2020-05-30 15:17:53 +02:00
parent f9460f6c45
commit cdb081a377
6 changed files with 301 additions and 259 deletions

View file

@ -3,6 +3,9 @@ const path = require('path')
const yaml = require('js-yaml')
const yargs = require('yargs')
const points_lib = require('./helpers/points')
const outline_lib = require('./helpers/outline')
const args = yargs
.option('config', {
alias: 'c',
@ -16,8 +19,13 @@ const args = yargs
describe: 'Output folder',
type: 'string'
})
.option('outline', {
.option('debug', {
default: false,
hidden: true,
type: 'boolean'
})
.option('outline', {
default: true,
describe: 'Generate 2D outlines',
type: 'boolean'
})
@ -34,12 +42,20 @@ const args = yargs
.argv
if (!args.outline && !args.pcb && !args.case) {
yargs.showHelp("log")
yargs.showHelp('log')
console.log('Nothing to do...')
process.exit(0)
}
const config = yaml.load(fs.readFileSync(args.c).toString())
const points = require('./helpers/points').parse(config)
const points = points_lib.parse(config)
console.log(points)
if (args.debug) {
points_lib.dump(points)
}
// if (args.outline) {
// outline_lib.draw(points, config)
// }
console.log('Done.')