Format project
This commit is contained in:
@@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ export async function storeAssetAndReturnUrl({
|
||||
callback,
|
||||
fullPath,
|
||||
consoleMessage,
|
||||
tempFile
|
||||
tempFile,
|
||||
}: {
|
||||
error: string
|
||||
callback: Function
|
||||
|
||||
@@ -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`,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user