# Newbie rotation confusion.

8 messages
Open this post in threaded view
|

## Newbie rotation confusion.

 Having now subscribed to the mailing list hopefully this will now be posted. Sorry if it's posted twice. What I'm trying to do is understand how to get a cube at the origin with it's corners on the axes. Firstly, I tried rotating by 45° about x and y with no success. I then rotated 45° about the X axis with rotate(45,[1,0,0]){     color("cyan") cube(10,center=true); } and looked down the Y axis. What I see is this. I now realize that I'm not looking at a square anymore but a rectangle with sides 10 and 14.14 (10 x root 2) and so to align the corners with the Z axis I need to rotate by atan(1.414) = 54.7°. I do this with rotate(45,[1,0,0]){     rotate(54.7,[0,1,0]){         color("cyan") cube(10,center=true);     } } and the result is What am I doing wrong? Is there a simple way to get a cube at the origin with it's corners on the axes? Mike. -- Sent from: http://forum.openscad.org/_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: Newbie rotation confusion.

 >Is there a simple way to get a cube at the origin with it's corners on the axes?No it is physically impossible.On 7 September 2018 at 10:06, Aurum wrote:Having now subscribed to the mailing list hopefully this will now be posted. Sorry if it's posted twice. What I'm trying to do is understand how to get a cube at the origin with it's corners on the axes. Firstly, I tried rotating by 45° about x and y with no success. I then rotated 45° about the X axis with rotate(45,[1,0,0]){     color("cyan") cube(10,center=true); } and looked down the Y axis. What I see is this. I now realize that I'm not looking at a square anymore but a rectangle with sides 10 and 14.14 (10 x root 2) and so to align the corners with the Z axis I need to rotate by atan(1.414) = 54.7°. I do this with rotate(45,[1,0,0]){     rotate(54.7,[0,1,0]){         color("cyan") cube(10,center=true);     } } and the result is What am I doing wrong? Is there a simple way to get a cube at the origin with it's corners on the axes? Mike. -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: Newbie rotation confusion.

Open this post in threaded view
|

## Re: Newbie rotation confusion.

Open this post in threaded view
|

## Re: Newbie rotation confusion.

 Thank you, it makes sense now. I'm thinking of the axis coming out of each face and (incorrectly) visualized them coming out of the corners. Actually, that double pyramid shape will achieve the effect I'm after. I'm assuming cube(10,10,0.001) gives the pyramid. Time to play some more. Thanks all, Mike. -- Sent from: http://forum.openscad.org/_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: Newbie rotation confusion.

 >I'm assuming cube(10,10,0.001) gives the pyramid.It gives approximately a square. The hull of that and one rotated 90 degrees gives the pyramid.Hull only works on 3D shapes unfortunately.On 7 September 2018 at 11:57, Aurum wrote:Thank you, it makes sense now. I'm thinking of the axis coming out of each face and (incorrectly) visualized them coming out of the corners. Actually, that double pyramid shape will achieve the effect I'm after. I'm assuming cube(10,10,0.001) gives the pyramid. Time to play some more. Thanks all, Mike. -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org