more designs
This commit is contained in:
72
bus_cabinet_side_panels.scad
Normal file
72
bus_cabinet_side_panels.scad
Normal file
@@ -0,0 +1,72 @@
|
||||
thickness = 18;
|
||||
|
||||
height = 1980;
|
||||
width = 600;
|
||||
|
||||
step = 30;
|
||||
|
||||
points_panel_1_top = [120, 110, 100, 90, 75, 60, 50 ,30, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20];
|
||||
points_panel_1_side = [120, 110, 100, 90, 75, 60, 50 ,30, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20];
|
||||
|
||||
|
||||
module top_diff(width, points, step){
|
||||
max_iter = floor(width/step);
|
||||
mymax = max(points);
|
||||
echo(max_iter);
|
||||
poly = [
|
||||
for(i = [0:max_iter]) [(i)*step, points[i]-mymax],
|
||||
[width, 0.01],
|
||||
[0, 0.01]
|
||||
];
|
||||
|
||||
polygon(poly);
|
||||
}
|
||||
|
||||
module side_diff(width, points, step){
|
||||
max_iter = len(points)-1;
|
||||
height = step*max_iter;
|
||||
mymax = max(points);
|
||||
echo(max_iter);
|
||||
poly = [
|
||||
for(i = [0:max_iter]) [width-points[i],-(i)*step],
|
||||
[width + 0.01, -height],
|
||||
[width + 0.01, 0]
|
||||
];
|
||||
|
||||
polygon(poly);
|
||||
}
|
||||
|
||||
module door_top(width, height, thickness, points, step){
|
||||
difference(){
|
||||
translate([0, -height, 0])
|
||||
cube(size=[width, height, thickness], center=false);
|
||||
|
||||
translate([0,0,-0.005])
|
||||
linear_extrude(thickness+0.01)
|
||||
top_diff(width, points, step);
|
||||
}
|
||||
}
|
||||
|
||||
module door_side(width, height, thickness, points, step){
|
||||
difference(){
|
||||
translate([0, -height, 0])
|
||||
cube(size=[width, height, thickness], center=false);
|
||||
|
||||
translate([0,0,-0.005])
|
||||
linear_extrude(thickness+0.01)
|
||||
side_diff(width, points, step);
|
||||
}
|
||||
}
|
||||
|
||||
module door_complete(width, height, thickness, points_top, points_side, step){
|
||||
intersection(){
|
||||
door_top(width, height, thickness, points_top, step);
|
||||
door_side(width, height, thickness, points_side, step);
|
||||
}
|
||||
}
|
||||
|
||||
// top_diff(width, points_panel_1_top, step);
|
||||
// door_top(width, height, thickness, points_panel_1_top, step);
|
||||
// side_diff(width, points_panel_1_side, step);
|
||||
// door_side(width, height, thickness, points_panel_1_side, step);
|
||||
door_complete(width, height, thickness, points_panel_1_top, points_panel_1_side, step);
|
||||
Reference in New Issue
Block a user