3D part design with OpenSCAD #113: More fun with for loops.

1 min read
By Bob
3D part design with OpenSCAD #113: More fun with for loops.

I was experimenting with the basket code I made quite some time ago to see if I could make some lamp shades, after simplifying it I came up with some different shapes that were interesting. This is unfinished but still shows that you don't need a lot of code to make some cool designs with OpenSCAD:

 /* [Lamp shade] */
 Show_shade=true;
 Height=242; //[1:.1:400]
 Diameter=70; //[1:.1:400]
 Density=8; //[1:1:30]
 Bowl_shape=1.6; //[-12:.1:12]
 separation=0;//[0:.01:100]
 Layers=20; //[1:1:20]
 Reed_thickness=2; //[.1:.01:20]
 Reed_shape=40; //[3:1:40]
 Twist_x=-180; //[-360:1:360]

 module Shade(){
  if (Show_shade){
  for(i=[0:Density:360]){
  for(z=[Twist_x,-Twist_x,Twist_x]){
  rotate([0,20,i])
  linear_extrude(height=Height,twist=z,slices= 
  Layers,scale=Bowl_shape)
  translate([Diameter,separation,0])
  rotate([0,20,i]) 
  circle(r=Reed_thickness,$fn=Reed_shape);
}}}}

 Shade();

Some examples: