Ultimaker / Cura

3D printer / slicing GUI built on top of the Uranium framework
GNU Lesser General Public License v3.0
6.07k stars 2.06k forks source link

Add rotation type-ins #2779

Open thesec opened 6 years ago

thesec commented 6 years ago

I'd like to edit the rotation angle per axis.

ChrisTerBeke commented 6 years ago

You mean an input field?

thesec commented 6 years ago

Yep 👍

ChrisTerBeke commented 6 years ago

Fair enough. Not sure why those don't exist yet indeed...

awhiemstra commented 6 years ago

Because a given rotation can be represented in multiple forms. The most common reasonably user-friendly representation for these kinds of inputs is Euler angles. But several combinations of Euler angles can represent the same rotation when represented as a quaternion or a matrix. This can lead to strange effects where suddenly your inputs flip around or not matching with the values you typed in.

In short, it does not exist yet because it is actually a pretty hard problem.

thesec commented 6 years ago

... already solved by other slicers and every CAD software you would not want the "world's most advanced 3D printing software" to stand behind ;D

Ghostkeeper commented 6 years ago

Let's do some competitor analysis then.

Other applications:

I'd say that my preference goes for a solution similar to AutoCAD where the user can enter a number while the rotation is going on. But since we require the user to hold the mouse button while rotating it could be a bit more difficult to use for Cura users.

thesec commented 6 years ago

Great overview, thanks @Ghostkeeper .

Blender has the most counterintuitive approach.

Simplest would be three text boxes X, Y and Z for entry in each axis and the angles applied as each box is confirmed explicitly by button or enter-key. Seems pretty WYSIWYG and straightforward as you do have the order only, not a matrix with each step taken.

Ghostkeeper commented 6 years ago

That's the Simplify3D approach, yes. Like I said though, that also has some disadvantages that awhiemstra and I pointed out.

DDDirk commented 6 years ago

In Blender you can see the angle at the bottom left. Or in the Properties Editor you can see the fields for each axis (if you don't see that, the visibility can be toggled with N). If you just use R, indeed that rotates from the viewpoint, which can rotate the model around all three axes at the same time, as can be seen in the Properties Editor. But you can also specify the axis after the R, eg RX40 (also indicated at the bottom left). Oh, and you can also first select an axis by choosing a viewpoint along that axis with NumPad 1, 3 or 7 and then just use R. That way you can see the grid behind it for reference (in orthogonal view; Num5).

All this can be done without ever touching the mouse. This is why I love Blender (well, one of the reasons). (An important reason some people hate Blender is propably the steep learning curve that makes them miss elementary stuff like this.)

thesec commented 6 years ago

This is not about blender, nor about keyboard shortcuts.

DDDirk commented 6 years ago

Inspiration was looked for elsewhere, and the Blender methods work very fast. Having the grid in the background can also be very useful. The usage of keyboard shortcuts is also very relevant if you have RSI. If you've never had that you will probably not understand the immense gravity of the problem.

thesec commented 6 years ago

Blender was already mentioned. Keyboard shortcuts remain OT, add them separately.

DDDirk commented 6 years ago

Yeah, but the info about Blender was wrong, so I corrected it.

And it's the most informative presentation, giving both the total angle from the viewpoint and the separate orthogonal angles. (Update: to see the former you might have to press T.) However, having this info next to the object in a floating box might indeed be handier. But being able to permanently see the cumulative rotation is also handy. For example, in Blender if you first press RX10 and then RX5, at the bottom left you see the current rotation (5°) and in the top right (yes, too far apart) the cumulative rotation (15°). How many text boxes can one want? :)

By OT do you mean On of Off Topic? :) I'd say On, unless it's about adopting shortkeys across the board. Without that, with every separate item, the input method should also be addressed. And I am an extremely strong supporter of using as many shortkeys as possible. RSI can really ruin one's life (once you have it it's a constant struggle for the rest of your life).

thesec commented 6 years ago

So you have RSI for entering coordinates only then? hrhr Make it another, separate thread.

herrdeh commented 6 years ago

Just my 2cts: Consistency matters! Therefore, the "rotate" control should work like the "move" control:

Open the panel when clicking - with 3 boxes for numbers,
Do the action {rotation) after number has been punched and "tab" key has
been hit or the input box is left otherwise.

Thus, the commands will be observed sequentially and no mess will occur. The numerical control will not do anything else than the graphical input does at the moment.

And the user does not have to get familiar with different behaviours in moving and rotating.

Ghostkeeper commented 6 years ago

Our project manager removed this from our planning. We won't be getting time to implement this any time soon.

ianpaschal commented 6 years ago

We just discussed this one as a team. Indeed, as Arjen said, when mucking about with matrices things get complicated fast (we actually have some other issues related to that... halp).

But, so long as the rotations are always relative and applied sequentially, this is no more likely to produce weird behavior than using the rotate tool. This is essentially the Simplify3D method, as seen in Ruben's analysis.

ianpaschal commented 6 years ago

Devs, CURA-5609

fieldOfView commented 6 years ago

Note that the Cura Lulzbot Edition has an implementation of "just three euler angles to represent the current rotation", and it is just about as buggy as one would expect.

Perhaps the trimesh module could be used to get a more reliable transformation tree and matrix decomposition (https://github.com/Ultimaker/Cura/issues/2875)

ianpaschal commented 6 years ago

The key here is not to try and represent the current rotation. That's the really hard part. One thing on my to do list today is to look at what libraries we can use to help us not reinvent the wheel (badly) when it comes to matrix decomposition.

But for this issue it should be possible to avoid that entirely by making the inputs relative (always reset to zero and apply as soon as the box loses focus, the latter of which is also the default behavior for other transform tools).

fieldOfView commented 6 years ago

But that would make the rotation boxes work differently than the move and scale boxes. In my opinion that would be quite bad, unless you make them also look/act differently than the aforementioned tools. So you could for example have three sets of "rotate by +/-90 degrees" buttons, but not fields. As soon as you have fields people expect them to behave "absolute" like the other fields.

ianpaschal commented 6 years ago

That's my concern as well but it's something we discussed this morning as a team and felt we wanted to go ahead and implement it anyway.

We also felt something like a ±90º button sort of defeated the purpose since the whole reason we want this is to lay something at 22.5º or whatever. Ok, not the whole reason, but enough new utility to justify adding new UI elements.

Luke is on vacation right now but we plan to build a basic implementation and confer with him when he's back how we can differentiate its behavior from absolute transforms. One that comes to mind is how it's done in 3dsMax: have a toggle to switch between absolute or relative type-in mode, perhaps this could exist for position, rotation, and scale, but simply be greyed out on "relative" for rotate mode so that it's clear it's functioning as intended, and that at least for now it's not possible to type in the absolute rotation values.

We'll see about that in the future. As I said, I'm reading through trimesh today as well as some other resources we pulled up.

I'm also looking at how this is handled in the very robust Three.js library which I have a ton of experience with. Thank god for very readable code with lots of whitespace.

fieldOfView commented 6 years ago

Thank god for very readable code with lots of whitespace.

...which contains no documentation on how to use it

ianpaschal commented 6 years ago

Yeah, not really the point. I don't want to figure out what the Matrix4 class is for, I just want to see the math written out.

The prop/function extractRotation can, I suspect, be used to extract the rotation. 🤔 😛

Aha! Confirmed in the documentation!

Anarasha commented 5 years ago

Now, I know this thread is old, but I had hoped this function existed so I tried to Google a way to add it. But if this is not viable currently, then perhaps a way to improve the current system is do what Meshmixer does - a graphically represented 5-degree increment snapping wheel that you aim for with your mouse so the rotation isn't that ruled by the object or how your camera is set currently. I constantly find myself overshooting by 30-40 degrees if my hand twitches and I'm not looking at the object from the side. I love Cura, but the lack of proper rotation control is beyond frustrating

FalconFour commented 5 years ago

Take a look at XYZprinting's software, called (appropriately) XYZprint. It really kicks Cura's butt in a lot of ways - because of how simple it is, yet what fantastically beautiful prints come out of it. It has a side panel that manipulate X/Y/Z position, and X/Y/Z rotation, for each selected model. It's allowed me to do some fantastically convoluted stacking stunts in a print area, and done far more with my XYZ printer than I can get done with Cura and other printers.

image

The thing that makes its rotation controls simple is that they PERSIST per each model. So, when you rotate by 180 degrees along the Z axis (common flat-on-bed rotation), the software now simply marks that the model is rotated on Z 180 degrees. So the controls just say "Z: 180". You can only go 360 degrees, so all you need is a 0-360 rotation for each axis, and you can create any rotation combination that way.

I find the current rotation controls in Cura to be absolutely insane and infuriating - that they seem to apply "un-sticky" to the object, so when you rotate an object, it's fixed in stone - you can't see how much it's been rotated (e.g. when I accidentally rotate something Y175 instead of Y180 and it's now floating half-through the bottom of the board, half above the board, but I can't see that from the top-down view). It's also almost like a software mini-game side-quest to try manipulating the mouse cursor in a way that will produce the desired rotation, like a 180 degree flip on the Y axis to turn a part upside down (I print a lot of flat parts).

All you really need to do is persist the rotation figures per model in each of X/Y/Z figures, so one can say 0/0/0 to reset to normal, or 0/0/180 to flip it around on Z, maybe decide later you want it flipped upside down instead so you go 0/180/180, see it needs to be rotated 90 degrees and go 0/180/90... stuff like that. Really easy to do in nearly any other software... in Cura it can be this simple without a lot of headache, unless you over-think how people would want to rotate objects.

Ghostkeeper commented 5 years ago

XYZPrint seems to have the same approach as Simplify3D print then (referring to my earlier post in this thread), except that the current rotation angles are shown and transformations are absolute. Try rotating first the Z to 90 degrees, then rotating the X axis and see if it rotates around the X axis or around the Y axis. I can't try that right now because XYZPrint doesn't support Linux :(

But of course being able to view the current rotation is another desire that we could take a look at. Of course, the current rotation is not unique though. If you would set every axis to 180 degrees in XYZPrint then it would be identical to having every axis to 0 degrees.

arielbernal commented 5 years ago

Cura 2019! and we still don't know how to rotate a 3D object? I'm not asking for a quaternion representation, just euler angles to the relative position and a reset rotations button will suffice. Repetier has it and it works. Of course the order in which you apply the transformations matters, but it doesn't prevent you to apply basic rotations with precision.

nallath commented 5 years ago

Well, we do. It's just that we're not able to explain why it's not that simple.

But as always; Pull requests are welcome!

Ghostkeeper commented 5 years ago

Repetier has it and it works.

Repetier has the same behaviour: http://dulek.net/work/repetier_nonuniform_scale.mkv

Edit: Change container format because Firefox wouldn't play mp4.

npm12017 commented 5 years ago

the real question to be asked is, Why are you even considering 3d printing, if you can't figure out how to rotate an object by typing three numbers for each axis to have the object rotated by i.e. trial and error.

When i used Simplified I changed the values accordingly until i was happy with the rotation of the object. In Cura, it is almost hair splitting just to do the same thing.

Blender does this well in three different ways: By pressing the R button followed by the number of degrees be it - or + number. Freeroam rotate by double tapping the R button. Typing in the numbers in three different fields like in simplified3D.

The problem with the Gizmo, when I click on the axis I want to rotate by, its not a permanent click, and as soon as i turn the gizmo the thin line becomes unselected.

It would be great if we could double click on the thin line, then highlights to rotate the mouse is then locked to it. Allowing the user to then double in empty space to exit the locked rotation mode.

tablatronix commented 4 years ago

Please add this, my computer lags so much (osx macbook) that the current UI is almost impossible to use.

FalconFour commented 4 years ago

Lulzbot's edition of Cura does this now, as it turns out. It's running on some stanky old Cura base, too. Why can't Cura proper get it figured out?

image (yes, a photo of a screen, but it's on a different system and I don't feel like Sneakernetting a screenshot ;) and yes, it's 180 and 90 but one degree off... don't blame me lol i didn't set this plate up)

colinig commented 4 years ago

image

image

Unclick snap rotation and u'll be able to rotate it degree by degree

Anarasha commented 4 years ago

image

image

Unclick snap rotation and u'll be able to rotate it degree by degree

I appreciate it, but what I meant with this was a textbox where you can type in how much to rotate it. This thread is 3 years old and I think everyone is still struggling with not being able to rotate with text input

tablatronix commented 4 years ago

What @Anarasha said. This is a terrible UI choice and NOT at all accessible

thesec commented 4 years ago

@tablatronix - the UI is not from @Anarasha but a quote from the previous comment. Making it or other accessible is off topic.

The initial request is now three years old and by now not only - imo - common across other slicers but also part of other Cura ports ...

With the task just "recently" reopened and set to "in progress" I guess some waiting and a few more targeted drops might get us an accessible UI into the Cura mainline :)

tablatronix commented 4 years ago

Sorry I typoed, I edited it, I meant to say "what they said", input boxes is what we are asking for not only snaps and mouse rotation.

Heikit69 commented 4 years ago

In my opinion 90°-rotate buttons in every direction would be great and help a lot

fieldOfView commented 4 years ago

I have created a pull request that implements rotate-by-90-degrees buttons: https://github.com/Ultimaker/Uranium/pull/612

msn444 commented 3 years ago

The 90-degree rotate buttons are good, but they would be perfect if they were 45-degree buttons instead!

leoheck commented 3 years ago

I would say 15 degrees.

Leandro Heck

On Wed, Dec 9, 2020 at 3:32 AM msn444 notifications@github.com wrote:

The 90-degree rotate buttons are good, but they would be perfect if they were 45-degree buttons instead!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Ultimaker/Cura/issues/2779#issuecomment-741564467, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJX7YHOLLFH4DEOC75X5H3ST4KY3ANCNFSM4EDUFCJA .

Heikit69 commented 3 years ago

Please don't do this. I love the 90 degrees

leoheck commented 3 years ago

90 and 45 are multiples of 15 dude. So, I will suggest something. Keep it moving 15 because it is fine grain

Also, even better. An input field. With the default value as 15, but the user can type the angle he wants. So, type the value. Let's say, 8 degrees... and the wheel will turn in steps of 8 degrees, customizable for any needs.

The same thing can be used for movement and scaling...

nallath commented 3 years ago

The main reason for adding the 90deg options is that you use that way more often (Since not everyone uses the same convention of Z being up from the buildplate). So switching them to 45 degree isn't a really good option. It adds extra effort for how most people use it.

The issue with type-ins is what kind of. Rotation in 3D space is messy (scale is too, but it's slightly more manageable). Rotating something with a set angle is super simple, but it does get tricky if you also want to display the current rotation. People do expect that if they type in a certain rotation (or first do rotation A and then Rotation B) that the numbers that they type in are what is displayed.

Ghostkeeper commented 3 years ago

The rotation handles already snap to 15 degrees when dragging them. I think that's plenty of functionality to handle the 15 and 45 degree cases.

Also, even better. An input field.

We're coming back full circle to the original feature request in this issue.

fvrmr commented 2 years ago

The CURA ticket mentioned before is removed from our backlog. So I will remove the in progress label and add defer. Since we don't believe we will work on this anytime soon.

ysu2 commented 2 years ago

It's a real shame that this is missing; currently I'm unable to grab the blue (y-axis) rotational circle even after multiple restarts. The input fields would go around this bug, otherwise I'm clueless what can I do - apart from transitioning to another slicer. :(

Claghorn commented 2 years ago

OK, here is a solution that solves all possible objections: If I right click on one of the rotation circles, I get a dialog that pops up asking for the amount to rotate it. Since I can only click on one at a time none of the spurious objections about multiple rotations being specified can be relevant. Actually you could do the same thing over on the side in the rotation dialog with a pull down list where I could pick exactly one axis to type the rotation value, I wouldn't even have to learn that right click is possible then.

Ghostkeeper commented 2 years ago

That's one of the solutions listed in one of the first replies in this topic, Claghorn: https://github.com/Ultimaker/Cura/issues/2779#issuecomment-346945766 . The solution that Slic3r had at the time.