// Demo of the various modules in cadlib.h // allviews profile profile_arc profile_arc2 3darc // allviews half_cylinder quarter_cylinder quarter_concave // allviews triangle_isocel triangle_rectangle include include if (view=="profile"){ w1=10; w2=5; h1=5; h2=20; path=[[-w1,0],[-w1,h1],[-w2,h1],[-w2,h2],[w2,h2],[w2,h1],[w1,h1],[w1,0]]; len=50; thick=1.5; profile (path,len,thick,0,1); }else if (view=="profile_arc"){ w1=10; w2=5; h1=5; h2=20; path=[[-w1,0,0],[-w1,h1,0],[-w2,h1,0],[-w2,h2,7], [w2,h2,0],[w2,h1,0],[w1,h1,0],[w1,0,0]]; len=50; thick=1.5; profile_arc (path,len,thick,0,1,20); }else if (view=="profile_arc2"){ w1=10; w2=5; h1=5; h2=20; path=[[-w1,0,0],[-w1,h1,15],[-w2,h2,7], [w2,h2,0],[w2,h1,0],[w1,h1,0],[w1,0,0]]; len=50; thick=1.5; profile_arc (path,len,thick,0,1,20); }else if (view=="3darc"){ ray=30; thick=2; len=50; stepa=360/10; precision=20; for (a=[0:9]){ start_angle=a*stepa+5; end_angle=start_angle+stepa-10; 3darc(ray,thick,len,start_angle,end_angle,precision); } translate([ray*3,0,0]) 3darc(ray,thick,len,0,90,precision); }else if (view=="half_cylinder"){ ray=10; len=50; precision=10; for (quarter=[1:4]){ translate([quarter*ray*3,0,0]){ half_cylinder(ray,len,precision,quarter); } } }else if (view=="quarter_cylinder"){ ray=10; len=50; precision=10; for (quarter=[1:4]){ translate([quarter*ray*3,0,0]){ quarter_cylinder(ray,len,precision,quarter); } } }else if (view=="quarter_concave"){ ray=10; len=50; precision=10; for (quarter=[1:4]){ translate([quarter*ray*3,0,0]){ quarter_concave(ray,len,precision,quarter); } } }else if (view=="triangle_isocel"){ width=20; len=25; thick=30; triangle_isocel(width,len,thick); }else if (view=="triangle_rectangle"){ lenx=10; leny=20; thick=30; triangle_rectangle(lenx,leny,thick); }