This post has NOT been accepted by the mailing list yet.
hi there,
my very first own design will be a envelope holder. i want the front wall to be tilted in an adjustable angle. however I dont seem to understand the rotate function can anyone help me? $fn=30; //rear wall height=100; width=130; wall_thickness=6; bottom_width=50; //rear wall cube([width,wall_thickness,height]); //bottom wall translate([0,wall_thickness1,0]) cube([width,bottom_width,wall_thickness]); //front wall frontwall_y=wall_thickness+bottom_width1; translate([0,frontwall_y,0]) rotate([0,0,0]) cube([width,wall_thickness,height]); 
Does this help?
$fn=30; //rear wall height=100; width=130; wall_thickness=6; bottom_width=50; angle=30; module holder() { //rear wall cube([width,wall_thickness,height]); //bottom wall translate([0,wall_thickness1,0]) cube([width,bottom_width,wall_thickness]); //front wall frontwall_y=wall_thickness+bottom_width1; translate([0,frontwall_y,0]) rotate([0,0,0]) cube([width,wall_thickness,height]); } rotate([angle,0,0]) translate([width/2,0,0]) translate([0,(bottom_width/2+wall_thickness),0]) holder(); 
My apologies for not contributing fully. I believe the original intent would be to have a flat bottom, perpendicular rear and tilted only on the front wall. If I had more time, I'd provide the modified code to accomplish that, but I also think Eric's entry should provide a foundation for the solution.

I should have read that post better. A second try.
width=160; height=100; thickness=6; bottom=50; angle=15; cube([width,thickness,height]); cube([width,bottom+thickness,thickness]); translate([0,bottom,sin(angle)*thickness]) rotate([angle,0,0]) cube([width,thickness,height]); The sine(angle)*thickness is for the front wall not going 'through' the bottom. 
This post has NOT been accepted by the mailing list yet.
Excellent, thanks. Its still a bit hard to go from 2d to 3d programming. So learning by doing.
Thanks so much. if I wanted to close the sides, i need to make a polygon right? is there a function to do that  or do i need to make a large cube and substract from that? 
This post has NOT been accepted by the mailing list yet.
btw. here is the work in progress. now only need some help for the sides ;)
//object width=130; height=100; thickness=6; bottom=50; //front wall angle=15; //magnets magdiameter=8; magheight=5.1; // please add 0.1mm or something in order to add some glue behinde the object magdistance=magdiameter*1.8; //distance from wall edge //rear difference() { cube([width,thickness,height]); // the magnet holes are substracted from the cube (rear) // I made the cylinders 1mm higher than the variable because they have to break through the wall. so the translate moved the Y axis of the cylinder into the wall, but the cylinder is actually sticking out of the cube, but you cannot see the difference object translate([magdistance,magheight,magdistance]) rotate([90,0,0]) cylinder(magheight+1,magdiameter,magdiameter, $fn=100); //left translate([widthmagdistance,magheight,magdistance]) rotate([90,0,0]) cylinder(magheight+1,magdiameter,magdiameter, $fn=100); //right translate([width/2,magheight,magdistance]) rotate([90,0,0]) cylinder(magheight+1,magdiameter,magdiameter, $fn=100); //middle translate([magdistance,magheight,heightmagdistance]) rotate([90,0,0]) cylinder(magheight+1,magdiameter,magdiameter, $fn=100); //left translate([widthmagdistance,magheight,heightmagdistance]) rotate([90,0,0]) cylinder(magheight+1,magdiameter,magdiameter, $fn=100); //right translate([width/2,magheight,heightmagdistance]) rotate([90,0,0]) cylinder(magheight+1,magdiameter,magdiameter, $fn=100); //middle } //bottom cube([width,bottom+thickness,thickness]); //angled front wall //The sine(angle)*thickness is for the front wall not going 'through' the bottom. translate([0,bottom,sin(angle)*thickness]) rotate([angle,0,0]) cube([width,thickness,height]); 
In reply to this post by Sebastian Heyn
I think I would choose for a cube and a triangle where the triangle is made of the difference between two cubes. Some trigonometry is needed. The code could use some functions I suppose but this is just a quick example where one side is closed.
width=160; height=100; thickness=6; bottom=50; angle=15; cube([width,thickness,height]); cube([width,bottom+thickness,thickness]); translate([0,bottom,sin(angle)*thickness]) rotate([angle,0,0]) cube([width,thickness,height]); cube([thickness,bottom+thickness,height]); translate([thickness,bottom+thickness,0]) rotate([0,90,0]) difference() { cube([height,abs(tan(angle))*height,thickness]); rotate([0,0,atan(abs(tan(angle))*height/height)]) cube([sqrt(pow(abs(tan(angle))*height,2)+pow(height,2)),abs(tan(angle))*height,thickness]); } 
Administrator

In reply to this post by Sebastian Heyn
Sebastian, your post is still flagged as "This post has NOT been accepted by the mailing list yet", so nobody gets it unless they look.
You need to subscribe to the mailing list, and CLICK THE LINK in the registration email (check your spam folder).
Admin  PM me if you need anything,
or if I've done something stupid... Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! 
In reply to this post by Sebastian Heyn
Sebastian,
You may think in 2D for most part of your job and use linear_extrude to jump into the 3D world. Here is my approach that starts from the sides:

In reply to this post by MichaelAtOz
MichaelAtOz: Thanks for pointing this out. I now subscribed

In reply to this post by Ronaldo
thanks for that  and it got me completely confused. LOL

In reply to this post by Eric Buijs
Eric, there are alot of trigonometrical functions in there that i havent seen since I left school 20 years ago. And to cascade them even confuses me more. LOL. I need to do some studying now :(

Sebastian, sorry I didn't want to confuse you (and it was kind of late when I posted yesterday). I simplified the code by removing some redundancy and it looks less horrifying now. Start at the bottom of the code and add an exclamation mark before the last line and work your way up removing the previous exclamation mark. This gives a good idea of what’s going on. I already inserted the first exclamation mark below.
width=160; height=100; thickness=6; bottom=50; angle=20; cube([width,thickness,height]); cube([width,bottom+thickness,thickness]); translate([0,bottom,sin(angle)*thickness]) rotate([angle,0,0]) cube([width,thickness,height]); cube([thickness,bottom+thickness,height]); translate([thickness,bottom+thickness,0]) rotate([0,90,0]) difference() { cube([height,abs(tan(angle))*height,thickness]); !rotate([0,0,abs(angle)]) cube([sqrt(pow(abs(tan(angle))*height,2)+pow(height,2)),abs(tan(angle))*height,thickness]); } The difference() calculates the triangle. One cube is rotated over a second one resulting in a triangle. The part ‘sqrt(pow(abs(tan(angle))*height,2)+pow(height,2))’ is Pythagoras to calculate the length of the hypotenuse of the triangle that is rotated over the first. The abs(tan(angle))*height calculates the length of the side opposite of the variable angle. The larger the angle the larger the opposite side. I hope this help. 
Free forum by Nabble  Edit this page 