Sync OpenSCAD and three.js camera to allow of zoom to fit #564
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
We can use a feature of OpenSCAD
--viewallto make sure the parts is not cut off on first load, but when we use the feature we need to sync up the camera position in OpenSCAD to our three.js camera so that later renders still work.All of this information is already provided to you, you just need to sync if the cameras with the info that comes back from openSCAD.
This video has a more thorough explanation as well as some tips on which files need to be changed.
https://user-images.githubusercontent.com/29681384/137605255-3a331dd0-dfcf-4c53-84ca-68b8cb67aea9.mp4
You should work off the
kurt/openscad-view-allbranch (and it might help to see the diff for this branch, but not necessary38ab79a80b)After you have seeded your db going to http://localhost:8910/u/local-user-1/demo-project1/ide will show you the hinge from video.
Files of interest are:
app/web/src/helpers/cadPackages/openScad/openScadController.tsapp/web/src/helpers/hooks/useIdeState.tsapp/web/src/components/IdeViewer/IdeViewer.tsxFollow the instructions in CONTRIBUTING.md to get setup, and of course ask for help here or in the dev-help discord channel.
If you'd like to contribute the CadHub but this issue is taken or you'd prefer something else, have a look at #535 to see if there's something else you would like
I'm going to make a start on this one.