Fix OpenSCAD move sync #244

Merged
Irev-Dev merged 1 commits from kurt/241 into main 2021-03-13 08:36:47 +01:00
Irev-Dev commented 2021-03-13 07:32:36 +01:00 (Migrated from github.com)

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.js function -> getPositions

resolves #241

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.js` function -> `getPositions` resolves #241
Irev-Dev (Migrated from github.com) reviewed 2021-03-13 07:39:16 +01:00
@@ -18,3 +19,3 @@
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},${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`
Irev-Dev (Migrated from github.com) commented 2021-03-13 07:39:15 +01:00

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 🤷

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 🤷
Irev-Dev (Migrated from github.com) reviewed 2021-03-13 07:48:03 +01:00
@@ -45,4 +62,1 @@
message: 'successful render',
},
}
}
Irev-Dev (Migrated from github.com) commented 2021-03-13 07:48:03 +01:00

Most of this is white space change from indentation, adding a try catch block, unrelated to the ide viewer :/

Most of this is white space change from indentation, adding a try catch block, unrelated to the ide viewer :/
franknoirot (Migrated from github.com) approved these changes 2021-03-13 08:20:38 +01:00
franknoirot (Migrated from github.com) left a comment

Looks good! magic numbers be darned haha

Looks good! magic numbers be darned haha
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: h3n3/cadhub#244