Extracted anim. Added holodisk spec.

This commit is contained in:
Dejvino
2020-12-31 14:15:57 +01:00
parent c64fee4e52
commit 814f47b1a8
5 changed files with 220 additions and 85 deletions
+40 -32
View File
@@ -1,52 +1,53 @@
// dependency: https://github.com/revarbat/BOSL
use <BOSL/transforms.scad>
use <holodisk_spec.scad>
include <anim.scad>
// outside config
width=60;
height=15;
depth=100;
tape_height=5;
tape_z=4;
// local config
frame=5;
head_frame=2;
head_size=[14, 10, tape_height+head_frame*2];
head_pos=[width/2, -frame+2, tape_z-head_frame];
laser_size=[10, 2, tape_height];
laser_pos=[head_pos.x, head_pos.y + 10 + head_size.y, tape_z];
laser_tower_size=[laser_size.x+2, laser_size.y+1, 15];
module reader() {
module reader(disk_size) {
width=disk_size.x;
depth=disk_size.y;
height=disk_size.z;
laser_cutout_size = get_holodisk_laser_cutout_size();
laser_cutout_pos = get_holodisk_laser_cutout_pos_center();
frame=5;
head_frame=2;
head_size=[14, 10, tape_height+head_frame*2];
head_pos=[laser_cutout_pos.x, -frame+2, tape_z-head_frame];
laser_size=[10, 2, tape_height];
laser_offset=3;
laser_pos=[laser_cutout_pos.x, laser_cutout_pos.y + laser_offset, tape_z];
laser_tower_size=[laser_cutout_size.x - 1, laser_cutout_size.y - 1 - laser_offset, 15];
module laser(corner=0.1) {
up(laser_size.z/2)
up(corner)
color("Red")
minkowski() {
s=[laser_size.x, laser_size.y, laser_size.z-corner*2];
cube(s, center=true);
sphere(corner);
}
fwd(laser_cutout_size.y/3) cube(laser_size, center=true);
}
module laser_tower(corner=2) {
module laser_tower(corner=1) {
color("DarkSlateBlue")
back(laser_tower_size.y-laser_size.y)
difference() {
minkowski() {
s=[laser_tower_size.x, laser_tower_size.y, laser_tower_size.z-corner*2];
up(laser_size.z/2)
cube(s, center=true);
sphere(corner);
}
fwd(laser_tower_size.y) scale(1.05) laser();
up(laser_size.z/2)
fwd(laser_offset/2) scale(0.99) cube(laser_tower_size, center=true);
fwd(laser_size.y/3) scale(1.1) laser();
}
}
module head_space() {
stube=[head_size.x-head_frame*2, head_size.y+head_frame*3, head_size.z-head_frame*2];
/*stube=[head_size.x-head_frame*2, head_size.y+head_frame*3, head_size.z-head_frame*2];
up(head_size.z/4 + head_frame)
cube(stube, center=true);
cube(stube, center=true);*/
translate(get_holodisk_laserwindow_pos_center()) cube(get_holodisk_laserwindow_size(), center=true);
}
module head(corner=0.5) {
@@ -57,14 +58,19 @@ module reader() {
s=[head_size[0], head_size[1] + frame, head_size[2]-corner*2];
difference() {
up(head_size.z/2) cube(s, center=true);
translate(head_pos) up(head_size.z/2) cube(s, center=true);
head_space();
}
sphere(corner);
}
}
translate(head_pos) head();
head();
retraction=laser_tower_size.z;
down(retraction)
up(anim(2, 3)*retraction)
down(anim(5, 6)*retraction)
translate(laser_pos) {
laser();
laser_tower();
@@ -73,10 +79,12 @@ module reader() {
color("DarkSlateBlue") {
difference() {
fwd(frame) cube([width, frame, height]);
translate(head_pos) head_space();
head_space();
}
fwd(frame) down(frame) cube([width, depth + frame, frame]);
}
}
reader();
holodisk_size = is_undef(disk_size) ? [50, 100, 20] : disk_size;
reader(holodisk_size);