浏览代码

Add wall mounting spacer.

cixo 1 年之前
父节点
当前提交
d37e5843f0
共有 6 个文件被更改,包括 71 次插入1 次删除
  1. 46 0
      assets/wall_spacer.scad
  2. 6 0
      config/wall_spacer.scad
  3. 4 0
      manufacture/wall.scad
  4. 10 0
      manufacture/wall_spacer.scad
  5. 1 1
      renders/hole.scad
  6. 4 0
      renders/wall_spacer.scad

+ 46 - 0
assets/wall_spacer.scad

@@ -0,0 +1,46 @@
+include <../config/wall_spacer.scad>
+include <../config/wall.scad>
+
+module wall_spacer_contact_shape() {
+    outside = wall_mounting_screws + wall_spacer_contact_margin;
+    inside = wall_mounting_screws;
+
+    difference() {
+        circle(r = outside / 2);
+        circle(r = inside / 2);
+    }
+}
+
+module wall_spacer_contact_object() {
+    linear_extrude(height = wall_spacer_contact_height) {
+        wall_spacer_contact_shape();
+    }
+}
+
+module wall_spacer_top_shape() {
+    outside = wall_mounting_screws + wall_spacer_margin;
+    inside = wall_mounting_screws;
+
+    difference() {
+        circle(r = outside / 2);
+        circle(r = inside / 2);
+    }
+}
+
+module wall_spacer_top_object() {
+    top_height = wall_spacer_full_height - wall_spacer_contact_height;
+
+    linear_extrude(height = top_height) {
+        wall_spacer_top_shape();
+    }
+}
+
+module wall_spacer_object() {
+    color(wall_spacer_color) {
+        wall_spacer_contact_object();
+
+        translate([0, 0, wall_spacer_contact_height]) {
+            wall_spacer_top_object();
+        }
+    }
+}

+ 6 - 0
config/wall_spacer.scad

@@ -0,0 +1,6 @@
+wall_spacer_full_height = 20;
+wall_spacer_contact_height = 3;
+wall_spacer_contact_margin = 20;
+wall_spacer_margin = 10;
+wall_spacer_color = "lightgreen";
+wall_spacer_manufacture_count = 4;

+ 4 - 0
manufacture/wall.scad

@@ -0,0 +1,4 @@
+include <../assets/wall.scad>
+
+$fn = 100;
+wall_object();

+ 10 - 0
manufacture/wall_spacer.scad

@@ -0,0 +1,10 @@
+include <../assets/wall_spacer.scad>
+
+size = wall_spacer_contact_margin * 1.2 + wall_mounting_screws;
+move_x = size * (wall_spacer_manufacture_count - 1) / 2;
+
+for (count = [-move_x : size : move_x]) {
+    translate([count, 0, 0]) {
+        wall_spacer_object();
+    }
+}

+ 1 - 1
renders/hole.scad

@@ -1,4 +1,4 @@
 include <../assets/hole.scad>
 
 $fn = 100;
-hole();
+hole_shape();

+ 4 - 0
renders/wall_spacer.scad

@@ -0,0 +1,4 @@
+include <../assets/wall_spacer.scad>
+
+$fn = 100;
+wall_spacer_object();