-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
Rotation by input & snap angle input #978
base: main
Are you sure you want to change the base?
Conversation
barely functional, requires: - A way to store and retrieve rotation angle for x, y, z - Update the getters to pass the rotation x, y, z back to the qml - Tidy up and remove duplicates -> make code generic
Retrieve the node quaternion rotation, try to get the rotation on axis from the data
getter will return the value in degrees to be consumed in the qml setter will store value in radians to remain consistent if the value is in use elsewhere.
@nallath Any thoughts on this one? It sort of goes hand-in-hand with the "Y" axis Translate tool. |
Saving sanity mostly
Y and Z are flipped between the model data and what is displayed for user. Make comments more relevant to changes
- Life is short & figuring out Quaternions is not, instead of trying to get the value from object, get the value from user rotations and store the last rotation per axis - Works for single and multiple objects being rotated at once - Reset values with rotation reset
@GregValiant ☝️ Final bit that needs to be added is resetting the value when another model is selected (switching between multiple models). |
I was never here
I thought you were on holiday. Couldn't stand it heh? I was using the previous iteration and didn't have any issues. I've just brought in the latest and greatest (but not the Quaternion thing) and I'll let you know. At first glance it's fine. Jaime had merged the PR for the translate tool "Y". I was looking into something else and saw a conflict with "one at a time". I have a comment in that PR #980 and I was wondering if you needed a break (tee hee hee) if you would look at that. He hasn't responded and I don't know if he's busy or he left on his holiday but I think it needs to be considered as right now it looks like a show-stopper to me. |
Yeah, something like that xD |
Input is empty, the user types in the value, rotation is applied and the field clears
Test Results2 407 tests 2 392 ✅ 23s ⏱️ Results for commit ad5366c. ♻️ This comment has been updated with latest results. |
Removing elements leads to unstable behavior, so rather have a solid base that just resets to 0 than a flaky front
RotateTool.zip |
I know we had something like this previously, but purposefully took them out because they'd mess up scaling, mirroring, etc. For example: rotation_and_scaling.mp4 |
Thanks for the check and feedback. Did not check that part. I'll try to see if I can figure out what goes wrong where and either:
|
That looks like how it always acted because the bounding box doesn't rotate but rather stretches to fit the model. Any rotation must be the last transformation. |
I think the only way around the weirdness that occurs when scaling a rotated body is to rotate the bounding box and have the part coordinate system tied to it. When you rotate the model, the local coordinate system rotates with it. I don't see that happening. |
You're right, it does already happen -- woke up way to early with the thought to check this, but you'd beaten me to it. -- That'll teach me to review stuff when I'm tired. Anyway, I think this works because the rotation fields get set back to So the concept looks good (though I haven't looked at the code properly yet) -- I've only taken off a few days this year, so now I'm really going into my month-long holiday == see you on the other side! 👋🏻 |
I'm sure this will still be sitting here when you get back. I'd been using my bare bones version of the Rotation change (along with the Translation Tool "Y" flip) for a while, and I haven't seen any adverse behavior. I have the latest versions of both installed and it's all good. Those two changes did require some head scratching (does Hellaholic have hair?) BUT altering "Quaternions" has been avoided. That's gotta be worth something right there. The CAD packages I'm familiar with (Inventor and SolidWorks) do not store "current rotation angles" anywhere. The only way to get the current angle is to adjust the coordinate system the way you need it, and then to add a dimension to the workspace. The angle is always subjective to the view rather than being absolute. |
You need a model that is more fun. GV_SupportShape.-.UltiMaker.Cura.2024-12-12.16-42-06.mp4I think it just needs a tooltip change. |
Had an idea to get around the issue, but not sure how practical it would be. It involves Quaternions. So the outline is:
First need to get things working with Conan 2 xD |
"Re-apply rotation through the stored Quaternion or matrix" I'm catching up on my reviews. It's been about 3 weeks now and I haven't had any problems with this at all. The changes to the Translate Tool have likewise been fine. |
I'm trying to understand the scale behavior, but it doesn't seem to be as "Simple" as the rotation. The compound rotation is not the issue, at any given time, there is only one Quaternion that describes the model. It will get messy with the operations a bit since it adds a step but that wasn't the issue. So a very long story short, it's a big project to refactor the scale, and cannot be a simple adjustment by me (QA) :P |
It would have to be a heck of an inspiration. For now I'll stick with the thought that the bounding box has to rotate, and the Model Coordinate System must rotate with it. That would keep the Model Coordinate System always at right angles to the faces of the bounding box. Everything else leads to "Quaternion Madness". which is inCurable. (Yes, it's a horrible pun. No, I will not apologize.) |
Because QT doesn't have both an "enabled" state and a "visible" state for controls, this is pretty clumsy. I have noticed that the odd scaling behavior of a rotated model only occurs when "NonUniformScale" is True.
If it was possible to "lock" the uniformScalingCheckbox and change the label text - the dummies wouldn't be needed. This sort of thing is the reason I call myself the King of Workarounds. |
Add rotation by input fields
Rotate by input
Snap angle update
Based on the idea of GregValiant