Compare commits
2 commits
0966e4eb00
...
477cc09637
Author | SHA1 | Date | |
---|---|---|---|
![]() |
477cc09637 | ||
![]() |
acdb35acaa |
2 changed files with 91 additions and 138 deletions
143
back.scad
143
back.scad
|
@ -76,9 +76,6 @@ stick_support = true;
|
|||
// Öffnung für den I²C-Anschluss.
|
||||
i2c_port = true;
|
||||
|
||||
// Platziere Reflektionsflächen unter den LEDs.
|
||||
led_reflectors = false;
|
||||
|
||||
// Wird ein Gewindeeinsatz verwendet?
|
||||
threaded_insert = false;
|
||||
|
||||
|
@ -173,49 +170,6 @@ if (nrf_module && (space < limit_nrf)) {
|
|||
* Einzelteile *
|
||||
*************************************************************************/
|
||||
|
||||
// Reflektionsflächen für die LEDs.
|
||||
module led_reflector() {
|
||||
h = min(border_height + 2.5, space - 2.5);
|
||||
l = 12;
|
||||
w = 4;
|
||||
$fn = 24;
|
||||
|
||||
// Sockel
|
||||
translate([-w/2, -l/2, 0])
|
||||
cube([w, l, struts]);
|
||||
|
||||
hull() {
|
||||
translate([0, w/2 - l/2, 0]) {
|
||||
// Basis.
|
||||
cylinder(r=w/2, h=1);
|
||||
// Kuppelform.
|
||||
translate([0, 0, h - 3.5])
|
||||
intersection() {
|
||||
sphere(r=w/2);
|
||||
translate([-w/2, -w/2, 0])
|
||||
cube([w, w, w]);
|
||||
}
|
||||
// Spitze.
|
||||
translate([0.5 + w/4, 0.5 + w/4, h - 0.25])
|
||||
sphere(0.5);
|
||||
}
|
||||
translate([0, l/2 - w/2, 0]) {
|
||||
// Basis.
|
||||
cylinder(r=w/2, h=1);
|
||||
// Kuppelform.
|
||||
translate([0, 0, h - 3.5])
|
||||
intersection() {
|
||||
sphere(r=w/2);
|
||||
translate([-w/2, -w/2, 0])
|
||||
cube([w, w, w]);
|
||||
}
|
||||
// Spitze.
|
||||
translate([0.5 + w/4, 0.5 + w/4, h - 0.25])
|
||||
sphere(0.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Schaft für die Schrauben.
|
||||
module screw_shaft() {
|
||||
translate([0, 0, top])
|
||||
|
@ -445,47 +399,6 @@ module outer() {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* Die Hülle. *
|
||||
*************************************************************************/
|
||||
|
||||
module body_back() {
|
||||
if (rounded_edges || beveled_edges) {
|
||||
difference() {
|
||||
union () {
|
||||
outer();
|
||||
}
|
||||
|
||||
color(color_top)
|
||||
translate([0, 0, -0.1])
|
||||
minkowski() {
|
||||
linear_extrude(height=0.1) {
|
||||
import("./svg/back outline.svg");
|
||||
}
|
||||
|
||||
$fn = $preview ? 4 : 8;
|
||||
if (beveled_edges) {
|
||||
// Abgeschrägte Kanten.
|
||||
cylinder(h=4, r1=1.5, r2=0);
|
||||
} else {
|
||||
// Abgerundete Kanten.
|
||||
// Dafür generieren wir im folgenden einen konkaven Kegel.
|
||||
union() {
|
||||
curve = [1.34, 1.07, 0.84, 0.63, 0.46, 0.32, 0.2, 0.11, 0.05, 0.01, 0];
|
||||
for (i = [0:len(curve)-2]) {
|
||||
translate([0, 0, i*0.5])
|
||||
cylinder(h=0.5, r1=curve[i], r2=curve[i+1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
outer();
|
||||
}
|
||||
|
||||
// Stützen für die Analog sticks.
|
||||
if (stick_support) {
|
||||
|
@ -511,22 +424,58 @@ module body_back() {
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Maske, um angerundete oder abgeschrägte Außenkanten zu schneiden.
|
||||
module edge_cut() {
|
||||
minkowski() {
|
||||
linear_extrude(height=0.1) {
|
||||
import("./svg/back outline.svg");
|
||||
}
|
||||
|
||||
$fn = $preview ? 4 : 8;
|
||||
if (beveled_edges) {
|
||||
// Abgeschrägte Kanten.
|
||||
cylinder(h=4, r1=1.5, r2=0);
|
||||
} else {
|
||||
// Abgerundete Kanten.
|
||||
// Dafür generieren wir im folgenden einen konkaven Kegel.
|
||||
union() {
|
||||
curve = [1.34, 1.07, 0.84, 0.63, 0.46, 0.32, 0.2, 0.11, 0.05, 0.01, 0];
|
||||
for (i = [0:len(curve)-2]) {
|
||||
translate([0, 0, i*0.5])
|
||||
cylinder(h=0.5, r1=curve[i], r2=curve[i+1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* Die Hülle. *
|
||||
*************************************************************************/
|
||||
|
||||
module body_back() {
|
||||
if (rounded_edges || beveled_edges) {
|
||||
difference() {
|
||||
union () {
|
||||
outer();
|
||||
}
|
||||
|
||||
translate([0, 0, -0.1])
|
||||
edge_cut();
|
||||
}
|
||||
} else {
|
||||
outer();
|
||||
}
|
||||
|
||||
// Schäfte für die Bohrungen.
|
||||
color(color_drills)
|
||||
for (i = [0:3]) {
|
||||
translate([drill_pos[i][0], drill_pos[i][1], 0])
|
||||
screw_shaft();
|
||||
}
|
||||
|
||||
// LED-Reflektoren.
|
||||
color(color_special)
|
||||
if (led_reflectors) {
|
||||
translate([9, 84, top])
|
||||
led_reflector();
|
||||
translate([141, 84, top])
|
||||
mirror([1, 0, 0])
|
||||
led_reflector();
|
||||
}
|
||||
}
|
||||
|
||||
// Bohrungen und andere Durchbrüche.
|
||||
|
|
86
front.scad
86
front.scad
|
@ -200,6 +200,28 @@ module border_pcb_cutouts() {
|
|||
cube([4, 1, 1.5]);
|
||||
}
|
||||
|
||||
// Kleine Streben zwischen Decke und Rand.
|
||||
module border_strut(width, length, height) {
|
||||
x = width/2;
|
||||
y = length/2;
|
||||
|
||||
polyhedron(points = [
|
||||
[-x, -y, 0],
|
||||
[x, -y, 0],
|
||||
[x, y, 0],
|
||||
[-x, y, 0],
|
||||
[-x, y, height],
|
||||
[x, y, height]
|
||||
], faces = [
|
||||
[0, 1, 2, 3],
|
||||
[1, 5, 2],
|
||||
[2, 5, 4, 3],
|
||||
[3, 4, 0],
|
||||
[0, 4, 5, 1]
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
// Die äußeren Teile: Front und Ränder.
|
||||
module outer() {
|
||||
// Decke.
|
||||
|
@ -306,26 +328,29 @@ module outer() {
|
|||
|
||||
}
|
||||
|
||||
// Kleine Streben zwischen Decke und Rand.
|
||||
module border_strut(width, length, height) {
|
||||
x = width/2;
|
||||
y = length/2;
|
||||
|
||||
polyhedron(points = [
|
||||
[-x, -y, 0],
|
||||
[x, -y, 0],
|
||||
[x, y, 0],
|
||||
[-x, y, 0],
|
||||
[-x, y, height],
|
||||
[x, y, height]
|
||||
], faces = [
|
||||
[0, 1, 2, 3],
|
||||
[1, 5, 2],
|
||||
[2, 5, 4, 3],
|
||||
[3, 4, 0],
|
||||
[0, 4, 5, 1]
|
||||
]);
|
||||
// Maske, um angerundete oder abgeschrägte Außenkanten zu schneiden.
|
||||
module edge_cut() {
|
||||
minkowski() {
|
||||
linear_extrude(height=0.1) {
|
||||
import("./svg/front outline.svg");
|
||||
}
|
||||
|
||||
$fn = $preview ? 4 : 8;
|
||||
if (beveled_edges) {
|
||||
// Abgeschrägte Kanten.
|
||||
cylinder(h=4, r1=1.5, r2=0);
|
||||
} else {
|
||||
// Abgerundete Kanten.
|
||||
// Dafür generieren wir im folgenden einen konkaven Kegel.
|
||||
union() {
|
||||
curve = [1.34, 1.07, 0.84, 0.63, 0.46, 0.32, 0.2, 0.11, 0.05, 0.01, 0];
|
||||
for (i = [0:len(curve)-2]) {
|
||||
translate([0, 0, i*0.5])
|
||||
cylinder(h=0.5, r1=curve[i], r2=curve[i+1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -341,29 +366,8 @@ module casing_front() {
|
|||
outer();
|
||||
}
|
||||
|
||||
color(color_top)
|
||||
translate([0, 0, -0.1])
|
||||
minkowski() {
|
||||
linear_extrude(height=0.1) {
|
||||
import("./svg/front outline.svg");
|
||||
}
|
||||
|
||||
$fn = $preview ? 4 : 8;
|
||||
if (beveled_edges) {
|
||||
// Abgeschrägte Kanten.
|
||||
cylinder(h=4, r1=1.5, r2=0);
|
||||
} else {
|
||||
// Abgerundete Kanten.
|
||||
// Dafür generieren wir im folgenden einen konkaven Kegel.
|
||||
union() {
|
||||
curve = [1.34, 1.07, 0.84, 0.63, 0.46, 0.32, 0.2, 0.11, 0.05, 0.01, 0];
|
||||
for (i = [0:len(curve)-2]) {
|
||||
translate([0, 0, i*0.5])
|
||||
cylinder(h=0.5, r1=curve[i], r2=curve[i+1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
edge_cut();
|
||||
}
|
||||
} else {
|
||||
outer();
|
||||
|
|
Loading…
Add table
Reference in a new issue