Format project

This commit is contained in:
Kurt Hutten
2021-11-30 15:23:16 +11:00
parent 172e19165f
commit fac1968a74
9 changed files with 28 additions and 19 deletions

View File

@@ -9,13 +9,16 @@ const stl = async (req, _context, callback) => {
console.log('eventBody', eventBody)
const { file, settings } = JSON.parse(eventBody)
const { error, consoleMessage, fullPath, tempFile } = await runCQ({ file, settings })
const { error, consoleMessage, fullPath, tempFile } = await runCQ({
file,
settings,
})
await storeAssetAndReturnUrl({
error,
callback,
fullPath,
consoleMessage,
tempFile
tempFile,
})
}

View File

@@ -104,7 +104,7 @@ export async function storeAssetAndReturnUrl({
callback,
fullPath,
consoleMessage,
tempFile
tempFile,
}: {
error: string
callback: Function

View File

@@ -3,10 +3,7 @@ import { nanoid } from 'nanoid'
export const runCurv = async ({
file,
settings: {
size: { x = 500, y = 500 } = {},
parameters,
} = {}, // TODO add view settings
settings: { size: { x = 500, y = 500 } = {}, parameters } = {}, // TODO add view settings
} = {}): Promise<{
error?: string
consoleMessage?: string
@@ -83,7 +80,8 @@ export const stlExport = async ({ file, settings: { parameters } } = {}) => {
const stlPath = `/tmp/${tempFile}/output.stl`
const command = [
'(cd /tmp && curv',
'-o', stlPath,
'-o',
stlPath,
'-O jit',
'-O vcount=350000',
`/tmp/${tempFile}/main.curv`,

View File

@@ -19,7 +19,7 @@ export const schema = gql`
childForks: [Project]!
}
# should match enum in api/db/schema.prisma
# should match enum in api/db/schema.prisma
enum CadPackage {
openscad
cadquery