This commit is contained in:
Kurt Hutten
2021-03-13 17:10:15 +11:00
parent 23e34a0a64
commit e5149f2c95
3 changed files with 10 additions and 7 deletions

View File

@@ -17,7 +17,7 @@ module.exports.runScad = async ({
const { x: rx, y: ry, z: rz } = rotation const { x: rx, y: ry, z: rz } = rotation
const { x: px, y: py, z: pz } = position const { x: px, y: py, z: pz } = position
const cameraArg = `--camera=${px},${py},${pz},${rx},${ry},${rz},300` const cameraArg = `--camera=${px},${py},${pz},${rx},${ry},${rz},300`
const command = `xvfb-run --auto-servernum --server-args "-screen 0 1024x768x24" openscad -o /tmp/${tempFile}/output.png ${cameraArg} --imgsize=${x},${y} /tmp/${tempFile}/main.scad` const command = `xvfb-run --auto-servernum --server-args "-screen 0 1024x768x24" openscad -o /tmp/${tempFile}/output.png ${cameraArg} --imgsize=${x},${y} --colorscheme DeepOcean /tmp/${tempFile}/main.scad`
console.log('command', command) console.log('command', command)
try { try {

View File

@@ -116,7 +116,7 @@ const IdeViewer = () => {
</div> </div>
)} )}
<div <div
className={`opacity-0 opacity- absolute inset-0 transition-opacity duration-500 ${ className={`opacity-0 absolute inset-0 transition-opacity duration-500 ${
isDragging ? 'opacity-100' : 'hover:opacity-50' isDragging ? 'opacity-100' : 'hover:opacity-50'
}`} }`}
onMouseDown={() => setIsDragging(true)} onMouseDown={() => setIsDragging(true)}

View File

@@ -4,11 +4,14 @@ import { cadPackages } from 'src/helpers/cadPackages'
export const useIdeState = () => { export const useIdeState = () => {
const initialState = { const initialState = {
ideType: 'openScad', ideType: 'openScad',
consoleMessages: [ consoleMessages: [{ type: 'message', message: 'Initialising OpenSCAD' }],
{ type: 'error', message: 'line 15 is being very naughty' }, code: `difference(){
{ type: 'message', message: '5 bodies produced' }, union(){
], cube(60);
code: 'cube(60);sphere(25);', sphere(25);
}
translate([30,30,30])cylinder(r=25,h=100);
}`,
objectData: { objectData: {
type: 'stl', type: 'stl',
data: 'some binary', data: 'some binary',