initial lamp commit
This commit is contained in:
commit
03a5b649cf
7 changed files with 196 additions and 0 deletions
BIN
insert.3mf
Normal file
BIN
insert.3mf
Normal file
Binary file not shown.
68
insert.scad
Normal file
68
insert.scad
Normal file
|
@ -0,0 +1,68 @@
|
|||
// Insert for table lamp
|
||||
|
||||
|
||||
$fn = $preview? 12 : 128;
|
||||
|
||||
// Input Values
|
||||
led_ring_dia = 75;
|
||||
led_ring_height = 10;
|
||||
led_arc = 185;
|
||||
led_width = 11;
|
||||
led_length = 110;
|
||||
led_mount_thickness = 3;
|
||||
pedestal_insert_width = 99.5;
|
||||
pedestal_insert_height = 10;
|
||||
pedestal_base_width = 120;
|
||||
pedestal_base_height = 10;
|
||||
dimple_radius=2;
|
||||
|
||||
// Calculated Values
|
||||
led_arc_angle_rad = (led_length/led_arc);
|
||||
led_arc_angle_deg = led_arc_angle_rad * (180/PI);
|
||||
led_arc_angle = led_arc_angle_deg;
|
||||
|
||||
module led_mount() {
|
||||
rotate([90,0,0])
|
||||
translate([led_ring_dia/2-led_arc, led_ring_height, -led_width/2])
|
||||
linear_extrude(height=led_width)
|
||||
intersection() {
|
||||
difference() {
|
||||
circle(r=led_arc);
|
||||
circle(r=led_arc-led_mount_thickness);
|
||||
}
|
||||
polygon([
|
||||
[0,0],
|
||||
[2*led_arc,0],
|
||||
[2*led_arc*cos(led_arc_angle), 2*led_arc*sin(led_arc_angle)],
|
||||
]);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/* for (i = [1:4]) { */
|
||||
/* rotate([0,0,i*90+45]) */
|
||||
/* led_mount(); */
|
||||
/* } */
|
||||
difference() {
|
||||
union() {
|
||||
cylinder(h=pedestal_insert_height,d=pedestal_insert_width);
|
||||
translate([0,0,-10])
|
||||
cylinder(h=pedestal_base_height,d=pedestal_base_width);
|
||||
}
|
||||
rotate([0,5,0])
|
||||
translate([20,-6.25,0])
|
||||
cube([100,12.5,20]);
|
||||
}
|
||||
|
||||
module mirror_copy(vector) {
|
||||
children();
|
||||
mirror(vector)
|
||||
children();
|
||||
};
|
||||
|
||||
mirror_copy([0,1,0])
|
||||
translate([0, (pedestal_insert_width/2)-dimple_radius/2, pedestal_insert_height-dimple_radius])
|
||||
#sphere(r=dimple_radius);
|
||||
rotate([0,0,90])
|
||||
translate([0, (pedestal_insert_width/2)-dimple_radius/2, pedestal_insert_height-dimple_radius])
|
||||
#sphere(r=dimple_radius);
|
BIN
insert.stl
Normal file
BIN
insert.stl
Normal file
Binary file not shown.
BIN
swirl.3mf
Normal file
BIN
swirl.3mf
Normal file
Binary file not shown.
64
swirl.scad
Normal file
64
swirl.scad
Normal file
|
@ -0,0 +1,64 @@
|
|||
|
||||
// Lampshade
|
||||
|
||||
|
||||
$fn=128;
|
||||
|
||||
function f(z) = 0.25 + .1 * sin(1.5 * z) + .05 * cos(1.9 * z);
|
||||
|
||||
vase_height = 170;
|
||||
vase_radius = 200;
|
||||
step = 1;
|
||||
twist = 1.4;
|
||||
|
||||
sh3_nodes = 4;
|
||||
|
||||
|
||||
|
||||
//sh3 = [0,30,60,90,120,180,210,240,270,300,330,360]; // polygon being extruded
|
||||
sh3 = [ for (i = [1:sh3_nodes]) i*(360/sh3_nodes) ];
|
||||
|
||||
|
||||
p = [
|
||||
for (z = [0:step:vase_height], angle = sh3) [
|
||||
vase_radius*cos(angle+twist*z)*f(z),
|
||||
vase_radius*sin(angle+twist*z)*f(z),
|
||||
z
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
module shape(p,m,n) {
|
||||
fcs = [for (j = [1:m], i = [0:n-2])[(n*j)+i,(n*j)+1+i,(n*(j-1))+i+1,(n*(j-1))+i]];
|
||||
|
||||
top = [for (i = [n*m:(n*m)+n-1]) i]; //connect points to create the top face
|
||||
|
||||
bottom = [for (i = [0:n-1]) i]; //connect points to create the bottom
|
||||
|
||||
stitches = [for (j = [0:m-1]) [j*n,((j+1)*n)-1,(((j+2)*n)-1),(j+1)*n]]; //connect points between the first and the last face per row
|
||||
|
||||
//now connect all
|
||||
//reverse is used to reverse normal of top face
|
||||
fcsc = concat([bottom],fcs,stitches,[reverse(top)]); //concatenate the bottom, body and top
|
||||
|
||||
color("blue") polyhedron(points=p, faces=fcsc);
|
||||
}
|
||||
|
||||
function reverse(lt) = [for(i = len(lt) - 1; i > -1; i = i - 1) lt[i]];
|
||||
|
||||
m = floor(vase_height/step); //numbers of rows of the matrix
|
||||
n = len(sh3); //number of columns in the matrix
|
||||
|
||||
|
||||
for ( i = [0 : 23] ) {
|
||||
rotate([0,0,15*i])
|
||||
shape(p,m,n);
|
||||
};
|
||||
|
||||
|
||||
mirror([1,0,0])
|
||||
for ( i = [0 : 23] ) {
|
||||
rotate([0,0,15*i])
|
||||
shape(p,m,n);
|
||||
};
|
||||
|
BIN
swirl.stl
Normal file
BIN
swirl.stl
Normal file
Binary file not shown.
64
teardrop.scad
Normal file
64
teardrop.scad
Normal file
|
@ -0,0 +1,64 @@
|
|||
|
||||
// Lampshade
|
||||
|
||||
|
||||
$fn=128;
|
||||
|
||||
function f(z) = 0.15 + .1 * sin(1.5 * z) + .06 * cos(1 * z);
|
||||
|
||||
vase_height = 160;
|
||||
vase_radius = 200;
|
||||
step = 1;
|
||||
twist = 1.4;
|
||||
|
||||
sh3_nodes = 4;
|
||||
|
||||
|
||||
|
||||
//sh3 = [0,30,60,90,120,180,210,240,270,300,330,360]; // polygon being extruded
|
||||
sh3 = [ for (i = [1:sh3_nodes]) i*(360/sh3_nodes) ];
|
||||
|
||||
|
||||
p = [
|
||||
for (z = [0:step:vase_height], angle = sh3) [
|
||||
vase_radius*cos(angle+twist*z)*f(z),
|
||||
vase_radius*sin(angle+twist*z)*f(z),
|
||||
z
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
module shape(p,m,n) {
|
||||
fcs = [for (j = [1:m], i = [0:n-2])[(n*j)+i,(n*j)+1+i,(n*(j-1))+i+1,(n*(j-1))+i]];
|
||||
|
||||
top = [for (i = [n*m:(n*m)+n-1]) i]; //connect points to create the top face
|
||||
|
||||
bottom = [for (i = [0:n-1]) i]; //connect points to create the bottom
|
||||
|
||||
stitches = [for (j = [0:m-1]) [j*n,((j+1)*n)-1,(((j+2)*n)-1),(j+1)*n]]; //connect points between the first and the last face per row
|
||||
|
||||
//now connect all
|
||||
//reverse is used to reverse normal of top face
|
||||
fcsc = concat([bottom],fcs,stitches,[reverse(top)]); //concatenate the bottom, body and top
|
||||
|
||||
color("blue") polyhedron(points=p, faces=fcsc);
|
||||
}
|
||||
|
||||
function reverse(lt) = [for(i = len(lt) - 1; i > -1; i = i - 1) lt[i]];
|
||||
|
||||
m = floor(vase_height/step); //numbers of rows of the matrix
|
||||
n = len(sh3); //number of columns in the matrix
|
||||
|
||||
|
||||
for ( i = [0 : 23] ) {
|
||||
rotate([0,0,15*i])
|
||||
shape(p,m,n);
|
||||
};
|
||||
|
||||
|
||||
mirror([1,0,0])
|
||||
for ( i = [0 : 23] ) {
|
||||
rotate([0,0,15*i])
|
||||
shape(p,m,n);
|
||||
};
|
||||
|
Loading…
Reference in a new issue