This commit is contained in:
Laila van Reenen 2024-12-22 20:22:07 +01:00
parent 6f563d03fb
commit 5b42996ce5
42 changed files with 481550 additions and 267142 deletions

14
functions.scad Normal file
View File

@ -0,0 +1,14 @@
function to_cardinal_2d(a, d) = [
d * sin(a),
d * cos(a)
];
function move_polar_2d(p, angle, dist) = to_cardinal_2d(angle, dist) + p;
function line_len_2d(p) = sqrt(p[0]*p[0] + p[1]*p[1]);
function line_len_3d(p) = sqrt(p[0]*p[0] + p[1]*p[1] + p[2]*p[2]);
function angle_2d(p) = atan2(p[0], p[1]);
function _tangent_single_angle_2d(to, r, other_side) = angle_2d(to) + ((other_side) ? -1 : 1)*acos(r / line_len_2d(to));
function tangent_single_2d(to, r, center, other_side=false) =
move_polar_2d(center, _tangent_single_angle_2d(to - center, r, other_side), r);

295
heat_set_inserts.scad Normal file
View File

@ -0,0 +1,295 @@
heat_set_insert_lables = [ "M2", "M2.5", "M3", "M3_VORON", "M4", "M5", "M6", "M8", "M10"];
heat_set_insert_hole_d = [ 3.2, 4.0, 4.0, 4.4, 7.5, 6.5, 8.1, 9.7, 12];
heat_set_insert_wall_w = [ 1.3, 1.6, 1.6, 1.6, 3.1, 2.6, 3.3, 4.5, 6];
heat_set_insert_hole_depth = [[3.0], [4.0], [5.7,3.0], [4.4], [8.1,4.0], [9.5,5.8], [12.7], [12.7], [12.7]];
// M2:
// - L=3.0, D3=3.2, w=1.3
// M2.5:
// - L=4.0, D3=4.0, w=1.6
// M3:
// - L=5.7, D3=4.0, w=1.6
// - L=3.0, D3=4.0, w=1.6
// M3_VORON:
// - L=4.4, D3=4.4, w=1.6
// M4:
// - L=8.1, D3=5.7, w=2.1
// - L=4.0, D3=5.7, w=2.1
// M5:
// - L=9.5, D3=6.5, w=2.6
// - L=5.8, D3=6.5, w=2.6
// M6:
// - L=12.7, D3=8.1, w=3.3
// M8:
// - L=12.7, D3=9.7, w=4.5
// M10:
// - L=12.7, D3=12, w=6
function heatSetInsert_get_sizes(lable) = [
heat_set_insert_hole_d[search(lable, heat_set_insert_lables)],
heat_set_insert_wall_w[search(lable, heat_set_insert_lables)],
heat_set_insert_hole_depth[search(lable, heat_set_insert_lables)]
];
module heatSetInsert_wall(lable="", depth=0, d=-1, r=-1, w=-1)
{
depths = [];
if (lable != "")
{
id = search(lable, heat_set_inserts_lables);
if (id < 0)
error(str("heatSetInsert_wall(): could not find lable '", lable, "'"));
d = (d==-1) ? heat_set_insert_hole_d[id] : d;
w = (w==-1) ? heat_set_insert_wall_w[id] : w;
depths = heat_set_insert_hole_depth[id];
}
r = (r==-1) ? d/2 : r;
if (r < 0)
{
error("heatSetInsert_wall(): either lable, r or d has to be set");
}
else
{
if (len(depths) == 0)
{
if (depth <= 1)
{
error("heatSetInsert_wall(): either layer or depth has to be set");
}
}
else
{
depth = (depth<=0) ? depths[round(depth)] : depth;
}
difference() {
cylinder(h = L+1, r = D3/2+w);
cylinder(h = L+1, r = D3/2);
}
}
}
module heatSetInsert_2d_wall(D3, L, w)
{
difference() {
circle(r = D3/2+w);
circle(r = D3/2);
}
}
module heatSetInsert_hole(D3, L, w)
{
cylinder(h = L+1, r = D3/2);
}
module heatSetInsert_hole_2d(D3, L, w)
{
circle(r = D3/2);
}
// M2
module heatSetInsert_wall_2d_M2()
{
heatSetInsert_wall_2d(L=3.0, D3=3.2, w=1.3);
}
module heatSetInsert_hole_2d_M2()
{
heatSetInsert_hole_2d(L=3.0, D3=3.2, w=1.3);
}
module heatSetInsert_wall_M2x2()
{
heatSetInsert_wall(L=3.0, D3=3.2, w=1.3);
}
module heatSetInsert_hole_M2x2()
{
heatSetInsert_hole(L=3.0, D3=3.2, w=1.3);
}
// M2.5
module heatSetInsert_wall_2d_M2_5x4()
{
heatSetInsert_wall_2d(L=4.0, D3=4.0, w=1.6);
}
module heatSetInsert_hole_2d_M2_5x4()
{
heatSetInsert_hole_2d(L=4.0, D3=4.0, w=1.6);
}
module heatSetInsert_wall_M2_5x4()
{
heatSetInsert_wall(L=4.0, D3=4.0, w=1.6);
}
module heatSetInsert_hole_M2_5x4()
{
heatSetInsert_hole(L=4.0, D3=4.0, w=1.6);
}
// M3
module heatSetInsert_wall_2d_M3()
{
heatSetInsert_wall_2d(L=5.7, D3=4.0, w=1.6);
}
module heatSetInsert_hole_2d_M3()
{
heatSetInsert_hole_2d(L=5.7, D3=4.0, w=1.6);
}
module heatSetInsert_wall_M3x5_7()
{
heatSetInsert_wall(L=5.7, D3=4.0, w=1.6);
}
module heatSetInsert_hole_M3x5_7()
{
heatSetInsert_hole(L=5.7, D3=4.0, w=1.6);
}
module heatSetInsert_wall_M3x3()
{
heatSetInsert_wall(L=3.0, D3=4.0, w=1.6);
}
module heatSetInsert_hole_M3x3()
{
heatSetInsert_hole(L=3.0, D3=4.0, w=1.6);
}
module heatSetInsert_wall_M3x5x4_voron()
{
heatSetInsert_wall(L=4.4, D3=4.4, w=1.6);
}
module heatSetInsert_wall_2d_M3x5x4_voron()
{
heatSetInsert_wall_2d(L=4.4, D3=4.4, w=1.6);
}
module heatSetInsert_hole_M3x5x4_voron()
{
heatSetInsert_hole(L=4.4, D3=4.4, w=1.6);
}
module heatSetInsert_hole_2d_M3x5x4_voron()
{
heatSetInsert_hole_2d(L=4.4, D3=4.4, w=1.6);
}
// M4
module heatSetInsert_wall_2d_M4()
{
heatSetInsert_wall_2d(L=8.1, D3=5.7, w=2.1);
}
module heatSetInsert_hole_2d_M4()
{
heatSetInsert_hole_2d(L=8.1, D3=5.7, w=2.1);
}
module heatSetInsert_wall_M4x8_1()
{
heatSetInsert_wall(L=8.1, D3=5.7, w=2.1);
}
module heatSetInsert_hole_M4x8_1()
{
heatSetInsert_hole(L=8.1, D3=5.7, w=2.1);
}
module heatSetInsert_wall_M4x4()
{
heatSetInsert_wall(L=4.0, D3=5.7, w=2.1);
}
module heatSetInsert_hole_M4x4()
{
heatSetInsert_hole(L=4.0, D3=5.7, w=2.1);
}
// M5
module heatSetInsert_wall_2d_M5()
{
heatSetInsert_wall_2d(L=9.5, D3=6.5, w=2.6);
}
module heatSetInsert_hole_2d_M5()
{
heatSetInsert_hole_2d(L=9.5, D3=6.5, w=2.6);
}
module heatSetInsert_wall_M5x9_5()
{
heatSetInsert_wall(L=9.5, D3=6.5, w=2.6);
}
module heatSetInsert_hole_M5x9_5()
{
heatSetInsert_hole(L=9.5, D3=6.5, w=2.6);
}
module heatSetInsert_wall_M5x5_8()
{
heatSetInsert_wall(L=5.8, D3=6.5, w=2.6);
}
module heatSetInsert_hole_M5x5_8()
{
heatSetInsert_hole(L=5.8, D3=6.5, w=2.6);
}
// M6
module heatSetInsert_wall_2d_M6()
{
heatSetInsert_wall_2d(L=12.7, D3=8.1, w=3.3);
}
module heatSetInsert_hole_2d_M6()
{
heatSetInsert_hole_2d(L=12.7, D3=8.1, w=3.3);
}
module heatSetInsert_wall_M6x12_7()
{
heatSetInsert_wall(L=12.7, D3=8.1, w=3.3);
}
module heatSetInsert_hole_M6x12_7()
{
heatSetInsert_hole(L=12.7, D3=8.1, w=3.3);
}
// M8
module heatSetInsert_wall_2d_M8x12_7()
{
heatSetInsert_wall_2d(L=12.7, D3=9.7, w=4.5);
}
module heatSetInsert_hole_2d_M8x12_7()
{
heatSetInsert_hole_2d(L=12.7, D3=9.7, w=4.5);
}
module heatSetInsert_wall_M8x12_7()
{
heatSetInsert_wall(L=12.7, D3=9.7, w=4.5);
}
module heatSetInsert_hole_M8x12_7()
{
heatSetInsert_hole(L=12.7, D3=9.7, w=4.5);
}
// M10
module heatSetInsert_wall_2d_M10x12_7()
{
heatSetInsert_wall_2d(L=12.7, D3=12, w=6);
}
module heatSetInsert_hole_2d_M10x12_7()
{
heatSetInsert_hole_2d(L=12.7, D3=12, w=6);
}
module heatSetInsert_wall_M10x12_7()
{
heatSetInsert_wall(L=12.7, D3=12, w=6);
}
module heatSetInsert_hole_M10x12_7()
{
heatSetInsert_hole(L=12.7, D3=12, w=6);
}

View File

@ -1,4 +1,4 @@
PLOT = "ALL"; // [ALL,FLAP_A,FLAP_B,FLAP_C,SPIKE_A,SPIKE_B,SPIKE_C,SPIKE_D,SKULL]
PLOT = "ALL"; // [ALL,FLAPS,FLAP_A,FLAP_B,FLAP_C,SPIKES,SPIKE_A,SPIKE_B,SPIKE_C,SPIKE_D,SKULL]
MODE = "PREVIW"; // [PREVIW,PLOT]
// $fs = (MODE == "PLOT") ? 0.01 : 1;
@ -21,6 +21,7 @@ SKIRT_FLAP_SPIKE_SEPERATION = SKIRT_FLAP_LENTH/(SKIRT_FLAP_SPIKE_NUM+1);
SPIKE_STEP_COUNT = (MODE == "PLOT") ? 25 : 5;
include <perlin_noise.scad>
include <heat_set_inserts.scad>
// =================================================
// === flap ========================================
@ -42,9 +43,9 @@ module skirt_flap_part(endpart, count = 1) {
translate([SKIRT_FLAP_SPIKE_SEPERATION, 0])
cylinder(h = 1, r1 = 15, r2 = 7);
}
cylinder(h = 100, d = 3.1);
cylinder(h = 100, d = 3.2);
translate([SKIRT_FLAP_SPIKE_SEPERATION, 0])
cylinder(h = 100, d = 3.1);
cylinder(h = 100, d = 3.2);
}
}
@ -80,27 +81,42 @@ function addl(list, l, c = 0) = c < l ? list[c] + addl(list, l, c + 1) : list[c]
module spike(size, f_d, f_sx, f_sy, step)
{
multmatrix(m = [
[size[0], 0, 0, 0],
[ 0, size[1], 0, 0],
[ 0, 0, size[2], 0],
[ 0, 0, 0, 1]
])
rotate([0, 0, -90])
union() {
for (pos = [0:step:1.5]) {
i = round(pos/step);
move_x = (i == 0) ? 0 : addl(f_sx, i-1) * step;
move_y = (i == 0) ? 0 : addl(f_sy, i-1) * step;
if (f_d[i] >= 0)
translate([move_x, move_y, pos])
multmatrix(m = [
[1, 0, f_sx[i], 0],
[0, 1, f_sy[i], 0],
[0, 0, 1, 0],
[0, 0, 0, 1],
])
cylinder(h = step, r1 = f_d[i], r2 = f_d[i+1]);
rotate([0, 0, -90])
difference() {
union() {
scale(size)
for (pos = [0:step:1.5]) {
i = round(pos/step);
move_x = (i == 0) ? 0 : addl(f_sx, i-1) * step;
move_y = (i == 0) ? 0 : addl(f_sy, i-1) * step;
if (f_d[i] >= 0)
translate([move_x, move_y, pos])
multmatrix(m = [
[1, 0, f_sx[i], 0],
[0, 1, f_sy[i], 0],
[0, 0, 1, 0],
[0, 0, 0, 1],
])
cylinder(h = step, r1 = f_d[i], r2 = f_d[i+1]);
}
}
// cavaty for fabric
translate([0, 0, -0.01]) // remove z bending
difference() {
scale(size)
cylinder(h = 0.1, r = .85);
cylinder(h = 0.5*size[2], r1 = 7, r2 = 7+0.4*size[2]);
}
// screw hole
translate([0, 0, -0.01]) { // remove z bending
// heatSetInsert_hole_M3x5_7();
cylinder(h = 6.7, d = 4.0);
translate([0, 0, 6.699])
cylinder(h = 0.8, r1 = 2.0, r2 = 1.6);
cylinder(h = 13, d = 3.2);
}
}
}
}
@ -119,15 +135,15 @@ module spike_noisy(size) {
// [1, 1, 1],
[ for (i = [0:STEP:1.5]) point_r_fn(i) + noise[0][round(i*STEP)]*0.2 ],
[ for (i = [0:STEP:1.5]) point_sheer_x_fn(i) + noise[1][round(i*STEP)]*0.2 ],
[ for (i = [0:STEP:1.5]) point_sheer_y_fn(i) + noise[2][round(i*STEP)]*0.2 ],
[ for (i = [0:STEP:1.5]) point_sheer_y_fn(i) * (noise[2][round(i*STEP)]*4-2) ],
STEP
);
}
module spike_a() { spike_noisy([20, 20, 50]); }
module spike_b() { spike_noisy([15, 15, 50]*0.85); }
module spike_c() { spike_noisy([20, 20, 50]*0.7); }
module spike_d() { spike_noisy([20, 20, 50]*0.55); }
module spike_b() { spike_noisy([17.5, 17.5, 43]); }
module spike_c() { spike_noisy([16, 16, 38]); }
module spike_d() { spike_noisy([14, 14, 35]); }
module spike_full() {
spike_a();
@ -219,11 +235,16 @@ module skull_a()
// === plot ========================================
// =================================================
if (PLOT == "ALL") {
if (PLOT == "ALL")
{
rotate([180, 0, 0])
flap_full();
spike_full();
}
else if (PLOT == "FLAPS")
{
flap_full();
}
else if (PLOT == "FLAP_A")
{
flap_a();
@ -236,6 +257,10 @@ else if (PLOT == "FLAP_C")
{
flap_c();
}
else if (PLOT == "SPIKES")
{
spike_full();
}
else if (PLOT == "SPIKE_A")
{
spike_a();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff