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: px, y: py, z: pz } = position
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)
try {

View File

@@ -116,7 +116,7 @@ const IdeViewer = () => {
</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'
}`}
onMouseDown={() => setIsDragging(true)}

View File

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