# geometrically confused

5 messages
Open this post in threaded view
|

## geometrically confused

 This post has NOT been accepted by the mailing list yet. This is a very dumb question, but I keep having trouble wrapping my head around the geometry of openScad (I know, right hand rule... but I'm having trouble picturing things).  I am trying to make a surface of four planes where the "center" of those four planes (the vertex where they all meet) is the lowest point, and the highest points are the outermost vertexes of the four planes (diagonal from the center). So this is what I've done so far: module quarterPlane() {   rotate([2.25, -2.25, 0]) {     cube([23.49,19,.02]);   } } module halfPlane() {   quarterPlane();   mirror([0,1,0]) quarterPlane(); } halfPlane(); mirror([1,0,0]) halfPlane(); I'm concerned that I may have gaps, or not the geometry I'm looking for. Also I made the y rotation -2.25 because that looked better in the visualization window but my "intuition" originally told me to use 2.25 degrees instead. -How can I best internalize openScad geometry? -How can I test for gaps between objects? -Does my example look ok?
Open this post in threaded view
|

## Re: geometrically confused

 Rotation is a really difficult issue. The part is rotated around the axis, not around its own center. So you get different results depending on whether you translate it before or after rotating. To rotate a part around its own center, it needs to be placed with its center at 0 on the axes that you want to rotate around. rotate([0,20,0])  {     color("red")     translate([-3,0,0])     cube([3,3,3]);     translate([0, 6, 0])     cube([3,3,3]); } One cube appears to be rotated "up" (red) and the other "down" even though both were rotated 20*. The difference lies in their initial positions. Be very observant about where your parts are created, even before you start translating/rotating. Rotation is like tying a string from each of the vertices and to the axis that you are rotating about, then moving the vertices by x degrees. The direction of rotation is also difficult to predict. I don't use the right hand rule. Instead I imagine a protractor centered at [0,0,0]. Rotate the view so that you are "standing" on the POSITIVE side of the axis you are rotating around and looking towards zero. Imagine (you don't have to imagine it, as I drew it for us in the code below - I'm definetely saving this for future use!) the full circle of 360 degrees. If you have an object placed at 120 and rotate it 30 degrees around the x axis it should end up at 150. module protractor(c) {     color(c)     for (i=[0:30:359]) {         rotate([i, 0, 0])         translate([0, 100, 0])         rotate([0,90,0])         linear_extrude(height=1)         text(str(i));                 rotate([i,0,0])         translate([0, 0, 10])         cylinder(h=90, r=0.5);     } } // rotate around the x axis protractor("red"); // rotate around the y axis //rotate([0,0,90]) //protractor("chartreuse"); // rotate around the z axis //rotate([0, 90, 0]) //protractor("blue"); I hope this helps! Regards, Bananapeel :)
Open this post in threaded view
|

## Re: geometrically confused

 This post has NOT been accepted by the mailing list yet. Thanks Bananapeel.  I think it will take me a while understand the geometry here.  I think I'll play with your protractor to better inform myself. If anyone has tips on my last two questions, please chime in.