Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync OpenSCAD and three.js camera to allow of zoom to fit #564

Open
Irev-Dev opened this issue Oct 17, 2021 · 1 comment
Open

Sync OpenSCAD and three.js camera to allow of zoom to fit #564

Irev-Dev opened this issue Oct 17, 2021 · 1 comment

Comments

@Irev-Dev
Copy link
Owner

We can use a feature of OpenSCAD --viewall to 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.

Screen.Recording.2021-10-17.at.11.07.17.am.mp4

You should work off the kurt/openscad-view-all branch (and it might help to see the diff for this branch, but not necessary 38ab79a)

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.ts
  • app/web/src/helpers/hooks/useIdeState.ts
  • app/web/src/components/IdeViewer/IdeViewer.tsx

Follow 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

@Irev-Dev
Copy link
Owner Author

I'm going to make a start on this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant