Rough changes to make the CadQuery integration work with the customizer

This commit is contained in:
Jeremy Wright
2021-10-07 14:46:57 -04:00
parent 32d6ef27ad
commit 0a13b7aea7
4 changed files with 20 additions and 6 deletions

View File

@@ -11,21 +11,34 @@ export const runCQ = async ({
)
const fullPath = `/tmp/${tempFile}/output.gz`
const stlPath = `/tmp/${tempFile}/output.stl`
const customizerPath = `/tmp/${tempFile}/customizer.param`
const command = [
`cq-cli/cq-cli`,
`--codec stl`,
`--infile /tmp/${tempFile}/main.py`,
`--outfile ${stlPath}`,
`--outputopts "deflection:${deflection};angularDeflection:${deflection};"`,
`--params ${customizerPath}`,
].join(' ')
const command2 = [
`cq-cli/cq-cli`,
`--getparams true`,
`--infile /tmp/${tempFile}/main.py`,
`--outfile ${customizerPath}`,
]
console.log('command', command)
let consoleMessage = ''
try {
consoleMessage = await runCommand(command, 30000)
consoleMessage2 = await runCommand(command2, 30000)
const params = JSON.parse(
await readFile(customizerPath, { encoding: 'ascii'})
).parameters
await writeFiles(
[
{
file: JSON.stringify({
customizerParams: params,
consoleMessage,
type: 'stl',
}),