Update default cq stl quality
This commit is contained in:
@@ -1,10 +1,12 @@
|
|||||||
const { makeFile, runCommand } = require('../common/utils')
|
const { makeFile, runCommand } = require('../common/utils')
|
||||||
const { nanoid } = require('nanoid')
|
const { nanoid } = require('nanoid')
|
||||||
|
|
||||||
module.exports.runCQ = async ({ file, settings = {} } = {}) => {
|
module.exports.runCQ = async ({ file, settings: {
|
||||||
|
deflection = 0.3
|
||||||
|
} = {} } = {}) => {
|
||||||
const tempFile = await makeFile(file, '.py', nanoid)
|
const tempFile = await makeFile(file, '.py', nanoid)
|
||||||
const fullPath = `/tmp/${tempFile}/output.stl`
|
const fullPath = `/tmp/${tempFile}/output.stl`
|
||||||
const command = `cq-cli/cq-cli --codec stl --infile /tmp/${tempFile}/main.py --outfile ${fullPath}`
|
const command = `cq-cli/cq-cli --codec stl --infile /tmp/${tempFile}/main.py --outfile ${fullPath} --outputopts "deflection:${deflection};angularDeflection:${deflection};"`
|
||||||
console.log('command', command)
|
console.log('command', command)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ import {
|
|||||||
|
|
||||||
export const render = async ({ code }) => {
|
export const render = async ({ code }) => {
|
||||||
const body = JSON.stringify({
|
const body = JSON.stringify({
|
||||||
settings: {},
|
settings: {
|
||||||
|
deflection: 0.2
|
||||||
|
},
|
||||||
file: code,
|
file: code,
|
||||||
})
|
})
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user