discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Newbie with rotation problem

WT
Wim ten Brink
Thu, Mar 31, 2016 11:47 PM

All I want to do is have a cube with all corners intersecting the axis, thus,
it needs to be rotated. Rotating it 45 degrees like this should work, I
thought: rotate([45, 45, 45]) cube(20, center=true);
But it doesn't! I don't know why but the corners of the cube are not located
on any of the axis. Seems so simple to me, yet I can't understand why it's
not working...

So, question! How do I rotate a cube so all corners will be at one of the
three axis?

With kind regards,
Wim,
W.A. ten Brink.


With kind regards,
Wim,
W.A. ten Brink

View this message in context: http://forum.openscad.org/Newbie-with-rotation-problem-tp16873.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

All I want to do is have a cube with all corners intersecting the axis, thus, it needs to be rotated. Rotating it 45 degrees like this should work, I thought: rotate([45, 45, 45]) cube(20, center=true); But it doesn't! I don't know why but the corners of the cube are not located on any of the axis. Seems so simple to me, yet I can't understand why it's not working... So, question! How do I rotate a cube so all corners will be at one of the three axis? With kind regards, Wim, W.A. ten Brink. ----- With kind regards, Wim, W.A. ten Brink -- View this message in context: http://forum.openscad.org/Newbie-with-rotation-problem-tp16873.html Sent from the OpenSCAD mailing list archive at Nabble.com.
DM
doug moen
Fri, Apr 1, 2016 12:13 AM

I don't think it is geometrically possible for a cube to do this. A cube
has 12 vertexes, and you want 8 of those vertexes to be aligned with the
axes. It's not possible without warping the cube into an irregular
hexahedron. You can do this with an octahedron, which has 8 vertexes.

On 31 March 2016 at 19:47, Wim ten Brink openscad@wimtenbrink.nl wrote:

All I want to do is have a cube with all corners intersecting the axis,
thus,
it needs to be rotated. Rotating it 45 degrees like this should work, I
thought: rotate([45, 45, 45]) cube(20, center=true);
But it doesn't! I don't know why but the corners of the cube are not
located
on any of the axis. Seems so simple to me, yet I can't understand why it's
not working...

So, question! How do I rotate a cube so all corners will be at one of the
three axis?

With kind regards,
Wim,
W.A. ten Brink.


With kind regards,
Wim,
W.A. ten Brink

View this message in context:
http://forum.openscad.org/Newbie-with-rotation-problem-tp16873.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

I don't think it is geometrically possible for a cube to do this. A cube has 12 vertexes, and you want 8 of those vertexes to be aligned with the axes. It's not possible without warping the cube into an irregular hexahedron. You can do this with an octahedron, which has 8 vertexes. On 31 March 2016 at 19:47, Wim ten Brink <openscad@wimtenbrink.nl> wrote: > All I want to do is have a cube with all corners intersecting the axis, > thus, > it needs to be rotated. Rotating it 45 degrees like this should work, I > thought: rotate([45, 45, 45]) cube(20, center=true); > But it doesn't! I don't know why but the corners of the cube are not > located > on any of the axis. Seems so simple to me, yet I can't understand why it's > not working... > > So, question! How do I rotate a cube so all corners will be at one of the > three axis? > > With kind regards, > Wim, > W.A. ten Brink. > > > > ----- > With kind regards, > Wim, > W.A. ten Brink > -- > View this message in context: > http://forum.openscad.org/Newbie-with-rotation-problem-tp16873.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > > >
F
fred_dot_u
Fri, Apr 1, 2016 12:24 AM

I'm not sure where the 12 vertices comes from, as I count eight, four for the
top face and four for the bottom face, which are common to the sides, of
course.

For the original post, though, I don't believe what you seek is possible.
Consider that if you slice a cube across any plane that meets your
requirements, you do not get a square. I took four points that would
represent two of the axes, but they are not co-planar, so you can't make
them fit on those axes.

A regular octohedron would fit, but would not be a cube, of course. It has
six vertices, to match the axis intersection points.

Wim ten Brink, am I missing something with the vertex counts? They don't
match yours but geometry is challenging me at the moment.

--
View this message in context: http://forum.openscad.org/Newbie-with-rotation-problem-tp16873p16875.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I'm not sure where the 12 vertices comes from, as I count eight, four for the top face and four for the bottom face, which are common to the sides, of course. For the original post, though, I don't believe what you seek is possible. Consider that if you slice a cube across any plane that meets your requirements, you do not get a square. I took four points that would represent two of the axes, but they are not co-planar, so you can't make them fit on those axes. A regular octohedron would fit, but would not be a cube, of course. It has six vertices, to match the axis intersection points. Wim ten Brink, am I missing something with the vertex counts? They don't match yours but geometry is challenging me at the moment. -- View this message in context: http://forum.openscad.org/Newbie-with-rotation-problem-tp16873p16875.html Sent from the OpenSCAD mailing list archive at Nabble.com.
WT
Wim ten Brink
Fri, Apr 1, 2016 2:05 AM

Okay, dumb question... There are three axis, thus making 6 points where the
cube can go through an axis. But the cube has 8 corners so it will never
touch the axis with all sides...
So, how to create a shape that does have all corners on an axis? Oh, well...
This is what I was actually looking for:

hull(){
translate([10, 0, 0]) sphere(1);
translate([-10, 0, 0]) sphere(1);
translate([0, 10, 0]) sphere(1);
translate([0, -10, 0]) sphere(1);
translate([0, 0, 10]) sphere(1);
translate([0, 0, -10]) sphere(1);
}

Problem solved.


With kind regards,
Wim,
W.A. ten Brink

View this message in context: http://forum.openscad.org/Newbie-with-rotation-problem-tp16873p16876.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Okay, dumb question... There are three axis, thus making 6 points where the cube can go through an axis. But the cube has 8 corners so it will never touch the axis with all sides... So, how to create a shape that does have all corners on an axis? Oh, well... This is what I was actually looking for: > hull(){ > translate([10, 0, 0]) sphere(1); > translate([-10, 0, 0]) sphere(1); > translate([0, 10, 0]) sphere(1); > translate([0, -10, 0]) sphere(1); > translate([0, 0, 10]) sphere(1); > translate([0, 0, -10]) sphere(1); > } Problem solved. ----- With kind regards, Wim, W.A. ten Brink -- View this message in context: http://forum.openscad.org/Newbie-with-rotation-problem-tp16873p16876.html Sent from the OpenSCAD mailing list archive at Nabble.com.
RP
Ronaldo Persiano
Fri, Apr 1, 2016 5:03 AM

Or:

cylinder(r1=10,r2=0,h=10,$fn=4);
scale([1,1,-1]) cylinder(r1=10,r2=0,h=10,$fn=4);

2016-03-31 23:05 GMT-03:00 Wim ten Brink openscad@wimtenbrink.nl:

Okay, dumb question... There are three axis, thus making 6 points where the
cube can go through an axis. But the cube has 8 corners so it will never
touch the axis with all sides...
So, how to create a shape that does have all corners on an axis? Oh,
well...
This is what I was actually looking for:

hull(){
translate([10, 0, 0]) sphere(1);
translate([-10, 0, 0]) sphere(1);
translate([0, 10, 0]) sphere(1);
translate([0, -10, 0]) sphere(1);
translate([0, 0, 10]) sphere(1);
translate([0, 0, -10]) sphere(1);
}

Problem solved.


With kind regards,
Wim,
W.A. ten Brink

View this message in context:
http://forum.openscad.org/Newbie-with-rotation-problem-tp16873p16876.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Or: cylinder(r1=10,r2=0,h=10,$fn=4); scale([1,1,-1]) cylinder(r1=10,r2=0,h=10,$fn=4); 2016-03-31 23:05 GMT-03:00 Wim ten Brink <openscad@wimtenbrink.nl>: > Okay, dumb question... There are three axis, thus making 6 points where the > cube can go through an axis. But the cube has 8 corners so it will never > touch the axis with all sides... > So, how to create a shape that does have all corners on an axis? Oh, > well... > This is what I was actually looking for: > > > > hull(){ > > translate([10, 0, 0]) sphere(1); > > translate([-10, 0, 0]) sphere(1); > > translate([0, 10, 0]) sphere(1); > > translate([0, -10, 0]) sphere(1); > > translate([0, 0, 10]) sphere(1); > > translate([0, 0, -10]) sphere(1); > > } > > Problem solved. > > > > ----- > With kind regards, > Wim, > W.A. ten Brink > -- > View this message in context: > http://forum.openscad.org/Newbie-with-rotation-problem-tp16873p16876.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
M
macdarren
Fri, Apr 1, 2016 6:02 AM

Now that is an interesting use of a negative 'scale' never thought to use it
like that...

--
View this message in context: http://forum.openscad.org/Newbie-with-rotation-problem-tp16873p16878.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Now that is an interesting use of a negative 'scale' never thought to use it like that... -- View this message in context: http://forum.openscad.org/Newbie-with-rotation-problem-tp16873p16878.html Sent from the OpenSCAD mailing list archive at Nabble.com.
NH
nop head
Fri, Apr 1, 2016 7:23 AM

cylinder(r1=10,r2=0,h=10,$fn=4);
mirror([0,0,-1]) cylinder(r1=10,r2=0,h=10,$fn=4);

Is more readable I think.

On 1 April 2016 at 07:02, macdarren macdarren@mac.com wrote:

Now that is an interesting use of a negative 'scale' never thought to use
it
like that...

--
View this message in context:
http://forum.openscad.org/Newbie-with-rotation-problem-tp16873p16878.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

cylinder(r1=10,r2=0,h=10,$fn=4); mirror([0,0,-1]) cylinder(r1=10,r2=0,h=10,$fn=4); Is more readable I think. On 1 April 2016 at 07:02, macdarren <macdarren@mac.com> wrote: > Now that is an interesting use of a negative 'scale' never thought to use > it > like that... > > > > > -- > View this message in context: > http://forum.openscad.org/Newbie-with-rotation-problem-tp16873p16878.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
WT
Wim ten Brink
Fri, Apr 1, 2016 8:24 AM

Nice! Never considered that option. Normally, I expect round objects with
cylinders. :)

Still like my own, though, since I actually want those rounded edges. But
this is something to remember.


With kind regards,
Wim,
W.A. ten Brink

View this message in context: http://forum.openscad.org/Newbie-with-rotation-problem-tp16873p16880.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Nice! Never considered that option. Normally, I expect round objects with cylinders. :) Still like my own, though, since I actually want those rounded edges. But this is something to remember. ----- With kind regards, Wim, W.A. ten Brink -- View this message in context: http://forum.openscad.org/Newbie-with-rotation-problem-tp16873p16880.html Sent from the OpenSCAD mailing list archive at Nabble.com.
RP
Ronaldo Persiano
Fri, Apr 1, 2016 6:47 PM

Rounded

hull() {
sphere(1);
union() {
cylinder(r1=10,r2=0,h=10,$fn=4);
mirror([0,0,-1]) cylinder(r1=10,r2=0,h=10,$fn=4);
}
}

2016-04-01 5:24 GMT-03:00 Wim ten Brink openscad@wimtenbrink.nl:

Nice! Never considered that option. Normally, I expect round objects with
cylinders. :)

Still like my own, though, since I actually want those rounded edges. But
this is something to remember.


With kind regards,
Wim,
W.A. ten Brink

View this message in context:
http://forum.openscad.org/Newbie-with-rotation-problem-tp16873p16880.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Rounded hull() { sphere(1); union() { cylinder(r1=10,r2=0,h=10,$fn=4); mirror([0,0,-1]) cylinder(r1=10,r2=0,h=10,$fn=4); } } 2016-04-01 5:24 GMT-03:00 Wim ten Brink <openscad@wimtenbrink.nl>: > Nice! Never considered that option. Normally, I expect round objects with > cylinders. :) > > Still like my own, though, since I actually want those rounded edges. But > this is something to remember. > > > > ----- > With kind regards, > Wim, > W.A. ten Brink > -- > View this message in context: > http://forum.openscad.org/Newbie-with-rotation-problem-tp16873p16880.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
R
Ronaldo
Fri, Apr 1, 2016 7:11 PM

Sorry. That is what I mean:

minkowski() {
sphere(1);
union() {
cylinder(r1=10,r2=0,h=10,$fn=4);
mirror([0,0,-1]) cylinder(r1=10,r2=0,h=10,$fn=4);
}
}

--
View this message in context: http://forum.openscad.org/Newbie-with-rotation-problem-tp16873p16893.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Sorry. That is what I mean: minkowski() { sphere(1); union() { cylinder(r1=10,r2=0,h=10,$fn=4); mirror([0,0,-1]) cylinder(r1=10,r2=0,h=10,$fn=4); } } -- View this message in context: http://forum.openscad.org/Newbie-with-rotation-problem-tp16873p16893.html Sent from the OpenSCAD mailing list archive at Nabble.com.