| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- include <../config/pot.scad>
- include <../config/top.scad>
- include <bottom.scad>
- function top_size() = [
- bottom_size().x + top_wall_thickness * 2,
- bottom_size().y + top_wall_thickness * 4 + curtain_space * 2,
- bottom_size().z
- ];
- module top_object() {
- function base_size() = [
- top_size().x,
- top_size().y
- ];
- function base_size_no_rounding() = [
- base_size().x - wall_rounding * 2,
- base_size().y - wall_rounding * 2
- ];
- module cable_hole_shape() {
- circle(r = cable_hole / 2);
- }
- module cable_holes() {
- edge
- = bottom_size().x / 2
- - single_pot_size.x / 2
- - pot_wall_thickness;
-
- move = single_pot_size.x + pot_wall_thickness;
- for (count = [-edge : move : edge]) {
- translate([count, 0]) {
- cable_hole_shape();
- }
- }
- }
- module base_shape() {
- difference() {
- minkowski() {
- square(base_size_no_rounding(), center = true);
- circle(r = wall_rounding);
- }
- cable_holes();
- }
- }
- module base_object() {
- linear_extrude(height = top_wall_thickness) {
- base_shape();
- }
- }
- module diode_hole_shape() {
- square(diode_size, center = true);
- }
- module place_shape(cable = true) {
- function place_size_no_rounding() = [
- single_pot_size.x - (wall_rounding + top_placer_margin) * 2,
- single_pot_size.y - (wall_rounding + top_placer_margin) * 2
- ];
- render() {
- difference() {
- minkowski() {
- square(place_size_no_rounding(), center = true);
- circle(r = wall_rounding);
- }
-
- if (cable) {
- cable_hole_shape();
- } else {
- diode_hole_shape();
- }
- }
- }
- }
- module placer_shape(cable = true) {
- edge
- = bottom_size().x / 2
- - single_pot_size.x / 2
- - pot_wall_thickness;
-
- move = single_pot_size.x + pot_wall_thickness;
- for (count = [-edge : move : edge]) {
- translate([count, 0]) {
- place_shape(cable);
- }
- }
- }
- module placer_object(cable = true) {
- linear_extrude(height = top_placer_thickness / 2) {
- placer_shape(cable);
- }
- }
- module curtain_shape() {
- module curtain() {
- move = top_size().x / 2 - wall_rounding;
- render() {
- hull() {
- translate([move, 0]) {
- circle(r = wall_rounding);
- }
- translate([-move, 0]) {
- circle(r = wall_rounding);
- }
- }
- }
- }
- position = top_size().y / 2 - wall_rounding;
- translate([0, position]) {
- curtain();
- }
- translate([0, -position]) {
- curtain();
- }
- }
- module curtain_object() {
- linear_extrude(height = curtain_height) {
- curtain_shape();
- }
- }
- color(top_color) {
- render() {
- base_object();
-
- translate([0, 0, top_wall_thickness]) {
- placer_object(cable = true);
- curtain_object();
- }
- translate([0, 0, top_wall_thickness + top_placer_thickness / 2]) {
- placer_object(cable = false);
- }
- }
- }
- }
|