Fix OpenSCAD move sync #244
Reference in New Issue
Block a user
Delete Branch "kurt/241"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
woohoo
https://user-images.githubusercontent.com/29681384/111022054-79146180-8424-11eb-81f0-56d2c58b7d17.mov
Hard to capture in a title. when you move the object with right-click drag, that axis move away from the shape.
main changes are in
web/src/components/IdeViewer/IdeViewer.jsfunction ->getPositionsresolves #241
@@ -18,3 +19,3 @@const { x: px, y: py, z: pz } = positionconst cameraArg = `--camera=${px},${py},${pz},${rx},${ry},${rz},300`const cameraArg = `--camera=${px},${py},${pz},${rx},${ry},${rz},${dist}`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`Turns out this dist value is important, I don't exactly know why openscad needs this since it can be dirived from the other values, ie dist is just
sqrt(px^2 + py^2 + pz^2)Oh maybe it's expecting a unit vector for px-z? but it also fine with larger values . . . I don't know 🤷
@@ -45,4 +62,1 @@message: 'successful render',},}}Most of this is white space change from indentation, adding a try catch block, unrelated to the ide viewer :/
Looks good! magic numbers be darned haha