Changes after discussing CadHub integration

This commit is contained in:
Jeremy Wright
2021-10-13 10:16:59 -04:00
parent 3ad14576b5
commit 7843eff647

View File

@@ -26,20 +26,13 @@ export const runCQ = async ({
`--outfile ${stlPath}`, `--outfile ${stlPath}`,
`--outputopts "deflection:${deflection};angularDeflection:${deflection};"`, `--outputopts "deflection:${deflection};angularDeflection:${deflection};"`,
`--params /tmp/${tempFile}/params.json`, `--params /tmp/${tempFile}/params.json`,
].join(' ') `--getparams ${customizerPath}`
const customizerCommand = [
`./cq-cli/cq-cli.py`,
`--getparams true`,
`--infile /tmp/${tempFile}/main.py`,
`--outfile ${customizerPath}`,
`--rawparamsoutfile /tmp/${tempFile}/params.json`
].join(' ') ].join(' ')
console.log('command', mainCommand) console.log('command', mainCommand)
let consoleMessage = '' let consoleMessage = ''
try { try {
;[consoleMessage] = await Promise.all([ ;[consoleMessage] = await Promise.all([
runCommand(mainCommand, 30000), runCommand(mainCommand, 30000),
runCommand(customizerCommand, 30000),
]) ])
const params = JSON.parse( const params = JSON.parse(
await readFile(customizerPath, { encoding: 'ascii' }) await readFile(customizerPath, { encoding: 'ascii' })