2020-12-22 13:05:47 +00:00
|
|
|
// dependency: https://github.com/revarbat/BOSL
|
|
|
|
use <BOSL/transforms.scad>
|
|
|
|
|
2020-12-22 19:38:48 +00:00
|
|
|
use <holodisk_spec.scad>
|
|
|
|
|
|
|
|
include <anim.scad>
|
|
|
|
|
2020-12-22 13:05:47 +00:00
|
|
|
// outside config
|
|
|
|
tape_height=5;
|
|
|
|
tape_z=4;
|
|
|
|
|
|
|
|
|
2020-12-22 19:38:48 +00:00
|
|
|
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];
|
|
|
|
|
2020-12-22 13:05:47 +00:00
|
|
|
module laser(corner=0.1) {
|
|
|
|
up(laser_size.z/2)
|
|
|
|
up(corner)
|
|
|
|
color("Red")
|
2020-12-22 19:38:48 +00:00
|
|
|
fwd(laser_cutout_size.y/3) cube(laser_size, center=true);
|
2020-12-22 13:05:47 +00:00
|
|
|
}
|
|
|
|
|
2020-12-22 19:38:48 +00:00
|
|
|
module laser_tower(corner=1) {
|
2020-12-22 13:05:47 +00:00
|
|
|
color("DarkSlateBlue")
|
|
|
|
difference() {
|
2020-12-22 19:38:48 +00:00
|
|
|
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();
|
2020-12-22 13:05:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module head_space() {
|
2020-12-22 19:38:48 +00:00
|
|
|
/*stube=[head_size.x-head_frame*2, head_size.y+head_frame*3, head_size.z-head_frame*2];
|
2020-12-22 13:05:47 +00:00
|
|
|
up(head_size.z/4 + head_frame)
|
2020-12-22 19:38:48 +00:00
|
|
|
cube(stube, center=true);*/
|
|
|
|
translate(get_holodisk_laserwindow_pos_center()) cube(get_holodisk_laserwindow_size(), center=true);
|
2020-12-22 13:05:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module head(corner=0.5) {
|
|
|
|
up(corner)
|
|
|
|
back(head_size.y/2)
|
|
|
|
color("DarkSlateBlue")
|
|
|
|
minkowski() {
|
|
|
|
s=[head_size[0], head_size[1] + frame, head_size[2]-corner*2];
|
|
|
|
|
|
|
|
difference() {
|
2020-12-22 19:38:48 +00:00
|
|
|
translate(head_pos) up(head_size.z/2) cube(s, center=true);
|
2020-12-22 13:05:47 +00:00
|
|
|
head_space();
|
|
|
|
}
|
|
|
|
sphere(corner);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-22 19:38:48 +00:00
|
|
|
head();
|
|
|
|
|
|
|
|
retraction=laser_tower_size.z;
|
|
|
|
down(retraction)
|
|
|
|
up(anim(2, 3)*retraction)
|
|
|
|
down(anim(5, 6)*retraction)
|
2020-12-22 13:05:47 +00:00
|
|
|
translate(laser_pos) {
|
|
|
|
laser();
|
|
|
|
laser_tower();
|
|
|
|
}
|
|
|
|
|
|
|
|
color("DarkSlateBlue") {
|
|
|
|
difference() {
|
|
|
|
fwd(frame) cube([width, frame, height]);
|
2020-12-22 19:38:48 +00:00
|
|
|
head_space();
|
2020-12-22 13:05:47 +00:00
|
|
|
}
|
|
|
|
fwd(frame) down(frame) cube([width, depth + frame, frame]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-22 19:38:48 +00:00
|
|
|
holodisk_size = is_undef(disk_size) ? [50, 100, 20] : disk_size;
|
|
|
|
|
|
|
|
reader(holodisk_size);
|