Rotate a cube model to stand on one of its corners
 
Notifications
Clear all

Rotate a cube model to stand on one of its corners  

  RSS
ninjabunny
(@ninjabunny)
New Member
Rotate a cube model to stand on one of its corners

Hi everyone, is there a way to rotate a solid cube to stand on one of its corners?

Posted : 07/02/2022 1:18 am
Swiss_Cheese
(@swiss_cheese)
Noble Member
RE: Rotate a cube model to stand on one of its corners

Yes, here's one of several ways to do it. Select the box, then select the rotate tool, Rotate the box 45 degrees on the Y axis, then Rotate the Box 45 degrees on the X axis and you have what you were looking for.

 

Good Luck

 

Swiss_Cheese

The Filament Whisperer

Posted : 07/02/2022 3:39 am
ninjabunny
(@ninjabunny)
New Member
Topic starter answered:
RE: Rotate a cube model to stand on one of its corners

I tried this. the first tilt is good. the second tilt does not yield the 45 degrees I seek. pls try on your slicer. it is not... "perfectly" on the corner

Posted : 07/02/2022 5:31 am
Neophyl
(@neophyl)
Illustrious Member
RE: Rotate a cube model to stand on one of its corners

Looks like another bug.

Posted : 07/02/2022 12:40 pm
towlerg
(@towlerg)
Noble Member
RE: Rotate a cube model to stand on one of its corners

What amkes you think the second rotate is not 45deg?

If I do that in 2.3.3 and depending on print setting profile it slices OK but doesn't put down external perimeters for the first few layer or reports that "there is an object with no extrusions on the first layer". Which is very weird as all profiles have the first layer set to 0.2!

Posted : 07/02/2022 3:12 pm
ninjabunny
(@ninjabunny)
New Member
Topic starter answered:
RE: Rotate a cube model to stand on one of its corners

So the cube is on its corner, however, all the angles dont look like they are even. when i put the supports on the buildplate, they also suggest that it is "uneven"

Posted : 07/02/2022 3:27 pm
Neophyl
(@neophyl)
Illustrious Member
RE: Rotate a cube model to stand on one of its corners

I did it in both 2.4.0 and 2.4.1 and its quite obvious that the cube is not vertical on the corner after the second rotate.  The corners should be directly above each other and they are not.  Dont need to print it to see that.  Its really really obvious, even before slicing.

This isnt about if the cube would print, its about the rotate function being messed up when more than one rotate is performed on an object.

Posted : 07/02/2022 3:44 pm
Swiss_Cheese
(@swiss_cheese)
Noble Member
RE: Rotate a cube model to stand on one of its corners

😉 I keep saying it. I'm done reporting them.

The Filament Whisperer

Posted : 07/02/2022 4:39 pm
JimB
 JimB
(@jimb)
Estimable Member
RE: Rotate a cube model to stand on one of its corners

Rotation of 45 and 45 won't work if you are trying to get two corners (lowest and highest) directly above each other.

When you do the first rotate x by 45 and look at the cube from the edge  (y going front to back), the top to bottom of the cube (height, h) is taller then the length of an edge (call that x).  So you need to effectively rotate a rectangle (size x by h) so to opposite corners are above each other.  So divide the rectangle in half (corner-to-opposite-corner) and use a bit a trig to find the angle between the base and the diagonal.  And subtract that from 90 degrees.

For a cube of size x, the the height when rotated 45 degrees is (from the Pythagorean theorem): h = sqrt(2 * x^2).The rotation then is 90 - arctan(h/x)

or 35.26 degrees

Posted : 07/02/2022 4:58 pm
Neophyl
(@neophyl)
Illustrious Member
RE: Rotate a cube model to stand on one of its corners

Yes you can do some complex math etc, but if I do the same in some design software, for instance Blender and rotate X 45 followed by Y 45  I end up with the cube being perfectly corner to corner in a central line.  No math needed.  Blender (unless you redefine it) has the origin in the center and works quite well about this.  PS also has the origin in the center of the cube but doesn't do this.    Software functions like this should make things simpler. 
Its not intuitive to say the least.

Posted : 07/02/2022 5:09 pm
ninjabunny
(@ninjabunny)
New Member
Topic starter answered:
RE: Rotate a cube model to stand on one of its corners

So is there anything i can do besides learning how to do it in other software before import?

seems like something that is useful

Posted : 07/02/2022 6:38 pm
blauzahn
(@blauzahn)
Reputable Member
RE: Rotate a cube model to stand on one of its corners

 

@Neophyl: It depends, whether you view along x or y after having made the 2 rotations. To me, Prusa-Slicer looks ok. Compare it with this in OpenSCAD:

rotate([0,45,0]) rotate([45,0,0]) cube([100,100,100], center=true);

And the rotation alone is invariant whether center=true or false.

Posted : 07/02/2022 6:42 pm
Neophyl
(@neophyl)
Illustrious Member
RE: Rotate a cube model to stand on one of its corners

As I don’t use openscad I’m afraid I can’t look at it. If openscad is doing the same then personally I would also view that as faulty. 
Doing the same in blender gives exactly the result I would expect with it being equal on any view, xy or z, and from the sounds of it what the original poster expects too. 
We obviously have different expectations. 

Then again as I actually use design software to do my modelling and not the slicer this particular software issue won’t effect me, I manipulate in cad and then load/reload the models.  

Posted : 07/02/2022 6:51 pm
blauzahn
(@blauzahn)
Reputable Member
RE: Rotate a cube model to stand on one of its corners

FreeCAD yields the same result as OpenSCAD. Of course, that +1 other program doesn't qualify as proof either but, unless they all do rely on the same faulty algorithm/library, the probability for it being correct increases:-)

Posted : 07/02/2022 7:16 pm
Jerry liked
Swiss_Cheese
(@swiss_cheese)
Noble Member
RE: Rotate a cube model to stand on one of its corners

I believe, it's a matter of expectation also, I didn't give it another thought last night when I answered. but I wasn't thinking

like the OP. I consider the coordinate system in Slicer to be very convoluted. However, In slicer it is 45 & 35.26 or the opposites.

I don't use slicer as a modeling tool either.

The Filament Whisperer

Posted : 07/02/2022 10:48 pm
Robin
(@robin)
Prominent Member
RE:

It's not a matter of right and wrong, or if you use the center of the object or not. It's about the frame of reference.

If you rotate the frame of reference you get what Neophyl expects and what blender does (which makes sense since blender is about animating objects. If you turn your head 45 deg to the right it should end up in the same relative position to your body regardless of the position of your body. So if you turn the body in blender the frame of reference is turned with it.

CAD programs and the Slicer maintain their frame of reference and turn the object within it, therefor you have to calculate the angle for the above problem of turning the cube onto it's corner. 

If you turn it 45° on the x axis the frame of reference is the same for the object and the printer build space, the axis are aligned. For the second rotation they are not, you want to turn the cube 45° around it's y axis, not the printers y axis. Slicer does not do that, even if you switch to "local coordinates" it always rotates around the printers axis...

If at first you don't succeed, skydiving is not for you.

Posted : 08/02/2022 11:53 am
Share: