Skip to content

Conversation

@mbway
Copy link
Contributor

@mbway mbway commented Jan 26, 2021

Some changes to the 3D view that I find useful:

  • I changed view rotation to behave like blender in a way that I find much more usable. I'm not sure if the behaviour has a specific name, but I would describe it as 'orbit':
    • x movement rotates the view about the world z-axis passing through the point that the camera is looking at
    • y movement rotates the view about the local y-axis passing through the point that the camera is looking at
    • I find with the previous rotation handling, that it is very hard to look at something without the view being tilted in an undesirable way
    • I added an option in the preferences to switch between this mode and the original (with orbit set as default)
  • zoom handles scroll delta properly. This is especially important for laptop trackpads where wheel events are triggered even for tiny movements but with a small delta. Before the change the delta value was not taken into account which caused erratic zooming that was difficult to control.
  • the toolbar background color is set to grey so that the icons are more visible when a dark theme is used
    • another approach would be to create icons for dark mode but this is simpler
    • also set tooltip backgrounds to improve legibility
  • unrelated to the view, I added support for exiting the application with Ctrl+C

Demo of the new rotation behaviour:

orbit.mp4

toolbar before and after:

toolbar_before

toolbar_after

@codecov
Copy link

codecov bot commented Jan 26, 2021

Codecov Report

❌ Patch coverage is 45.61404% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.00%. Comparing base (d746c8e) to head (897d52b).
⚠️ Report is 93 commits behind head on master.

Files with missing lines Patch % Lines
cq_editor/widgets/occt_widget.py 45.00% 20 Missing and 2 partials ⚠️
cq_editor/main_window.py 55.55% 3 Missing and 1 partial ⚠️
cq_editor/widgets/viewer.py 33.33% 3 Missing and 1 partial ⚠️
cq_editor/__main__.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@ ## master #220 +/- ## ========================================== - Coverage 89.26% 88.00% -1.26%  ========================================== Files 19 19 Lines 1583 1617 +34 Branches 157 164 +7 ========================================== + Hits 1413 1423 +10  - Misses 139 159 +20  - Partials 31 35 +4 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@marcus7070
Copy link
Member

I've pulled and built this. I'm a huge fan of that orbital movement! ctrl-c also works nice. I don't have a dark theme at hand so I didn't test that aspect.

@mbway mbway force-pushed the view_improvements branch from 6b5d728 to 5b65f4d Compare May 28, 2021 20:43
@mbway
Copy link
Contributor Author

mbway commented Jun 19, 2021

I don't really mind that this hasn't been merged because I created this functionality for my own use as well, but is there a reason that no-one has looked at this for 5 months?

@adam-urbanczyk
Copy link
Member

Thanks for opening the PR. Lack of time / you want to change the default behavior without first discussing.

@mbway
Copy link
Contributor Author

mbway commented Jun 19, 2021

apologies if I didn't follow the correct procedure. I didn't see any instructions for contributors so I assumed any discussion would happen here. I'm fine with setting the original behaviour as the default, that would be trivial to change

@adam-urbanczyk
Copy link
Member

If you want to change something it is better to open an issue first. I'll try to take a look but TBH this is not the highest prio ATM and I'm rather conservative regarding adding new functionality/complicating the codebase.

BTW: The ctrl-c is stuff is definitely worth adding.

@mbway
Copy link
Contributor Author

mbway commented Jul 25, 2021

by the way, I found that FreeCAD calls this mode 'Turntable' (in preferences > Display > Navigation > Orbit Style)

@roel-v
Copy link
Contributor

roel-v commented Jan 12, 2024

Any chance this can be picked up again? I too find the default navigation behavior a lot more difficult to use than the way it works in Blender. I wanted to work on this myself but I'm quite happy to see there is already a patch. Should this maybe be split into separate pull requests for each of the issues it covers?

@mbway
Copy link
Contributor Author

mbway commented Jan 12, 2024

I haven't used CQ-editor in ages but I merged with master and renamed the setting to match blender terminology that I think was established after this PR, or maybe I just didn't find it before.

image

I haven't tested extensively but in a quick test everything seems to be working

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

Labels

None yet

4 participants