Sfoglia il codice sorgente

Start working on shelf.

cixo 1 anno fa
parent
commit
bb58c84b0b
3 ha cambiato i file con 108 aggiunte e 0 eliminazioni
  1. 100 0
      assets/shelf.scad
  2. 5 0
      config/shelf.scad
  3. 3 0
      renders/shelf.scad

+ 100 - 0
assets/shelf.scad

@@ -0,0 +1,100 @@
+include <../config/shelf.scad>
+
+module shelf_angle() {
+    module base_shape() {
+        move_x = shelf_angle_depth / 2 - shelf_rounding;
+        move_y = shelf_angle_height / 2 - shelf_rounding;
+
+        module base() {
+            hull() {
+                translate([-move_x, move_y]) {
+                    circle(r = shelf_rounding);
+                }
+
+                translate([-move_x, -move_y]) {
+                    circle(r = shelf_rounding);
+                }
+            }
+
+            hull() {
+                translate([-move_x, shelf_rounding]) {
+                    square(shelf_rounding * 2, center = true);
+                }
+
+                translate([move_x, shelf_rounding]) {
+                    circle(r = shelf_rounding);
+                }
+                
+                translate([-move_x, -shelf_rounding]) {
+                    square(shelf_rounding * 2, center = true);
+                }
+
+                translate([move_x, -shelf_rounding]) {
+                    circle(r = shelf_rounding);
+                }
+            }
+        }
+
+        module reverse_corner(size = 10, rotation = 0) {
+            module base() {
+                difference() {
+                    square(size * 2, center = true);
+                    circle(r = size);
+                }
+            }
+           
+            module mask() {
+                translate([0, size / 2]) {
+                    square([size * 2, size], center = true);
+                }
+            
+                translate([size / 2, -size / 2]) {
+                    square(size, center = true);
+                }
+            }
+
+            render() {
+                rotate(90 * rotation) {
+                    translate([size / 2, size / 2]) {
+                        difference() {
+                            base();
+                            mask();
+                        }
+                    }
+                }
+            }
+        }   
+
+        module indentation() {
+            width = shelf_angle_depth - shelf_angle_thickness;
+            height = shelf_thickness;
+
+            translate([shelf_angle_thickness / 2, 0]) {
+                square([width, height], center = true);
+            }
+        }
+
+        render() {
+            difference() {
+                base();
+                indentation();
+            }
+        }
+
+        base_size = min(shelf_angle_height / 2, shelf_angle_depth);
+        size = base_size - shelf_rounding * 2;
+        
+        corner_move_x = size / 2
+        - shelf_angle_depth / 2
+        + shelf_rounding * 2;
+
+        corner_move_y = size / 2
+        - shelf_angle_height / 2;
+
+        translate([corner_move_x, -corner_move_y]) {
+            reverse_corner(size, 0);
+        }
+    }
+
+    base_shape();
+}

+ 5 - 0
config/shelf.scad

@@ -0,0 +1,5 @@
+shelf_rounding = 5;
+shelf_angle_depth = 50;
+shelf_angle_height = 90;
+shelf_angle_thickness = 10;
+shelf_thickness = 3;

+ 3 - 0
renders/shelf.scad

@@ -0,0 +1,3 @@
+include <../assets/shelf.scad>
+
+shelf_angle();