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

Cad view controls #45

Open
Jojain opened this issue May 18, 2021 · 2 comments
Open

Cad view controls #45

Jojain opened this issue May 18, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@Jojain
Copy link
Contributor

Jojain commented May 18, 2021

Is there a way to modify the controls of the cadviewport ?
By this I mean :

  • Changing the keybinds/mousebinds of translation, rotation and zoom in the view
  • Changing the sensitivity of translation, rotations and zoom

Almost every CAD software use a different set of key/mouse bindings to navigate the 3D view so it's often frustrating when you don't have a consistent set across all of them

@bernhard-42
Copy link
Owner

Changing the sensitivity of translation, rotations and zoom

While not nice, one can do this now via:

d = show( ... )
d.cq_view.renderer.controls[0].rotateSpeed = 3
d.cq_view.renderer.controls[0].panSpeed = 5
d.cq_view.renderer.controls[0].zoomSpeed = 2

The panSpeed (translation) depends on the size of the object and it will currently be calculated as (bb.xsize + bb.ysize + bb.zsize) / 300 with bb being the bounding box of of the object.

I could add these as parameters to the default system, so one can set them via set_defaults

@bernhard-42
Copy link
Owner

Changing the keybinds/mousebinds of translation, rotation and zoom in the view

Well, threejs can since r99 (see https://stackoverflow.com/a/54154920 ), however pythreejs is stuck with r97 ( https://github.com/jupyter-widgets/pythreejs/blob/150ff1c10c868b17fefa63d19153b5ee1fe87f66/js/package.json#L40)

Opened jupyter-widgets/pythreejs#359 for this.

@bernhard-42 bernhard-42 added the enhancement New feature or request label Sep 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants