This commit is contained in:
Laila van Reenen 2024-12-21 21:35:09 +01:00
parent 1a1187392e
commit 719cf449ba
43 changed files with 485824 additions and 43 deletions

View File

@ -1,4 +1,4 @@
$fn=3;
// $fn=3;
// randomize = true;
// setseed = 123456;

22
render.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
mkdir -p stl
rm stl/*.stl
echo "=== render flap a"
openscad -o "stl/flap_a.stl" -D PLOT=\"FLAP_A\" -D MODE=\"PLOT\" skirt.scad
echo "=== render flap b"
openscad -o "stl/flap_b.stl" -D PLOT=\"FLAP_B\" -D MODE=\"PLOT\" skirt.scad
echo "=== render flap c"
openscad -o "stl/flap_c.stl" -D PLOT=\"FLAP_C\" -D MODE=\"PLOT\" skirt.scad
for i in $(seq 1 9)
do
echo "=== render spike ${i}a"
openscad -o "stl/spike_${i}a.stl" -D PLOT=\"SPIKE_A\" -D MODE=\"PLOT\" skirt.scad
echo "=== render spike ${i}b"
openscad -o "stl/spike_${i}b.stl" -D PLOT=\"SPIKE_B\" -D MODE=\"PLOT\" skirt.scad
echo "=== render spike ${i}c"
openscad -o "stl/spike_${i}c.stl" -D PLOT=\"SPIKE_C\" -D MODE=\"PLOT\" skirt.scad
echo "=== render spike ${i}d"
openscad -o "stl/spike_${i}d.stl" -D PLOT=\"SPIKE_D\" -D MODE=\"PLOT\" skirt.scad
done

View File

@ -1,7 +1,14 @@
PLOT = "ALL"; // [ALL,FLAP_A,FLAP_B,FLAP_C,SPIKE_A,SPIKE_B,SPIKE_C,SPIKE_D]
MODE = "PREVIW"; // [PREVIW,PLOT]
// $fs = (MODE == "PLOT") ? 0.01 : 1;
$fn = (MODE == "PLOT") ? 35 : 10;
// $fn = 0;
SKIRT_D_BIG = 1100;
SKIRT_FLAP_NUM = 12;
SKIRT_FLAP_THIKNES = 0.2;
SKIRT_FLAP_SLANT_NUMBER = 1; // 1 is strait; higer is wider below; lower slimmer below
SKIRT_FLAP_SLANT_NUMBER = 0.0; // 0 is strait; higer is wider below; lower slimmer below
SKIRT_FLAP_LENTH = 400;
SKIRT_FLAP_SPIKE_NUM = 4;
SKIRT_FLAP_SPIKE_BASE_D_UPPER = 20;
@ -11,16 +18,23 @@ SKIRT_FLAP_SPIKE_LENGTH_LOWER = 37;
SKIRT_FLAP_SPIKE_SEPERATION = SKIRT_FLAP_LENTH/(SKIRT_FLAP_SPIKE_NUM+1);
SPIKE_STEP_COUNT = (MODE == "PLOT") ? 25 : 5;
include <perlin_noise.scad>
module skirt_flap_part(endpart) {
// =================================================
// === flap ========================================
// =================================================
module skirt_flap_part(endpart, count = 1) {
difference() {
union() {
linear_extrude(height = SKIRT_FLAP_THIKNES)
hull() {
circle(d=SKIRT_D_BIG/SKIRT_FLAP_NUM);
skirt_base_d = SKIRT_D_BIG/SKIRT_FLAP_NUM;
circle(d=skirt_base_d+(skirt_base_d*SKIRT_FLAP_SLANT_NUMBER*count));
translate([SKIRT_FLAP_SPIKE_SEPERATION, 0])
circle(d=SKIRT_D_BIG/SKIRT_FLAP_NUM*SKIRT_FLAP_SLANT_NUMBER);
circle(d=skirt_base_d+(skirt_base_d*SKIRT_FLAP_SLANT_NUMBER*(count+1)));
}
cylinder(h = 1, r1 = 15, r2 = 7);
@ -34,18 +48,29 @@ module skirt_flap_part(endpart) {
}
}
// rotate([180, 0, 90]) {
// skirt_flap_part(endpart = false);
// translate([SKIRT_FLAP_SPIKE_SEPERATION, 0, SKIRT_FLAP_THIKNES+0.1])
// skirt_flap_part(endpart = false);
// translate([SKIRT_FLAP_SPIKE_SEPERATION, 0, SKIRT_FLAP_THIKNES+0.1]*2)
// skirt_flap_part(endpart = false);
// translate([SKIRT_FLAP_SPIKE_SEPERATION, 0, SKIRT_FLAP_THIKNES+0.1]*3)
// skirt_flap_part(endpart = true);
// }
module flap_a() {
skirt_flap_part(endpart = false, count = 1);
}
module flap_b() {
skirt_flap_part(endpart = false, count = 2);
}
STEP = 0.01;
module flap_c() {
skirt_flap_part(endpart = true, count = 3);
}
module flap_full() {
flap_a();
translate([SKIRT_FLAP_SPIKE_SEPERATION, 0, SKIRT_FLAP_THIKNES+0.1])
flap_b();
translate([SKIRT_FLAP_SPIKE_SEPERATION, 0, SKIRT_FLAP_THIKNES+0.1]*2)
flap_c();
}
// =================================================
// === point =======================================
// =================================================
function point_r_fn(x) = 1-(0.8*x+0.2)^3;
function point_sheer_x_fn(x) = 0.3-(1.6*x)^3;
@ -53,10 +78,6 @@ function point_sheer_y_fn(x) = max(0, x-0.3);
function add(list, c = 0) = c < len(list) - 1 ? list[c] + addl(list, c + 1) : list[c];
function addl(list, l, c = 0) = c < l ? list[c] + addl(list, l, c + 1) : list[c];
point_sheer_move = 0;
$fn = 30;
module spike(size, f_d, f_sx, f_sy, step)
{
multmatrix(m = [
@ -67,10 +88,11 @@ module spike(size, f_d, f_sx, f_sy, step)
])
rotate([0, 0, -90])
union() {
for (pos = [0:step:1-step]) {
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],
@ -83,29 +105,83 @@ module spike(size, f_d, f_sx, f_sy, step)
}
}
noise = [
perlin_noise(no=4, seed=rands(0, 100000, 1)[0]),
perlin_noise(no=4, seed=rands(0, 100000, 1)[0]),
perlin_noise(no=4, seed=rands(0, 100000, 1)[0])
];
module spike_noisy(size) {
noise = [
perlin_noise(no=4, seed=rands(0, 100000, 1)[0]),
perlin_noise(no=4, seed=rands(0, 100000, 1)[0]),
perlin_noise(no=4, seed=rands(0, 100000, 1)[0])
];
echo(noise);
STEP = 1 / SPIKE_STEP_COUNT;
rotate([0, 0, -90])
spike(
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 ],
STEP
);
}
spike(
[20, 20, 50],
// [1, 1, 1],
[ for (i = [0:STEP:1]) point_r_fn(i) + noise[0][round(i*STEP)]*0.2 ],
[ for (i = [0:STEP:1]) point_sheer_x_fn(i) + noise[1][round(i*STEP)]*0.2 ],
[ for (i = [0:STEP:1]) point_sheer_y_fn(i) + noise[2][round(i*STEP)]*0.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);
}
// test_list = [0.3, 0.295904, 0.267232, 0.189408, 0.037856, -0.212, -0.584736, -1.10493, -1.79715, -2.68598, -3.796];
// for (i = [0:1:6])
// {
// echo(i);
// number = (i == 0) ? 0 : addl(test_list, i);
// translate([number, 0, 0])
// cube([1, 1, 1]);
// echo(number);
// }
module spike_full() {
spike_a();
translate([SKIRT_FLAP_SPIKE_SEPERATION, 0, SKIRT_FLAP_THIKNES+0.1])
spike_b();
translate([SKIRT_FLAP_SPIKE_SEPERATION, 0, SKIRT_FLAP_THIKNES+0.1]*2)
spike_c();
translate([SKIRT_FLAP_SPIKE_SEPERATION, 0, SKIRT_FLAP_THIKNES+0.1]*3)
spike_d();
}
// =================================================
// === plot ========================================
// =================================================
if (PLOT == "ALL") {
rotate([180, 0, 0])
flap_full();
spike_full();
}
else if (PLOT == "FLAP_A")
{
flap_a();
}
else if (PLOT == "FLAP_B")
{
flap_b();
}
else if (PLOT == "FLAP_C")
{
flap_c();
}
else if (PLOT == "SPIKE_A")
{
spike_a();
}
else if (PLOT == "SPIKE_B")
{
spike_b();
}
else if (PLOT == "SPIKE_C")
{
spike_c();
}
else if (PLOT == "SPIKE_D")
{
spike_d();
}

4482
stl/flap_a.stl Normal file

File diff suppressed because it is too large Load Diff

4482
stl/flap_b.stl Normal file

File diff suppressed because it is too large Load Diff

5938
stl/flap_c.stl Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

12714
stl/spike_1a.stl Normal file

File diff suppressed because it is too large Load Diff

13204
stl/spike_1b.stl Normal file

File diff suppressed because it is too large Load Diff

12714
stl/spike_1c.stl Normal file

File diff suppressed because it is too large Load Diff

12714
stl/spike_1d.stl Normal file

File diff suppressed because it is too large Load Diff

12714
stl/spike_2a.stl Normal file

File diff suppressed because it is too large Load Diff

13204
stl/spike_2b.stl Normal file

File diff suppressed because it is too large Load Diff

12714
stl/spike_2c.stl Normal file

File diff suppressed because it is too large Load Diff

12714
stl/spike_2d.stl Normal file

File diff suppressed because it is too large Load Diff

13204
stl/spike_3a.stl Normal file

File diff suppressed because it is too large Load Diff

13204
stl/spike_3b.stl Normal file

File diff suppressed because it is too large Load Diff

12714
stl/spike_3c.stl Normal file

File diff suppressed because it is too large Load Diff

12714
stl/spike_3d.stl Normal file

File diff suppressed because it is too large Load Diff

12714
stl/spike_4a.stl Normal file

File diff suppressed because it is too large Load Diff

13204
stl/spike_4b.stl Normal file

File diff suppressed because it is too large Load Diff

13204
stl/spike_4c.stl Normal file

File diff suppressed because it is too large Load Diff

13204
stl/spike_4d.stl Normal file

File diff suppressed because it is too large Load Diff

12714
stl/spike_5a.stl Normal file

File diff suppressed because it is too large Load Diff

13204
stl/spike_5b.stl Normal file

File diff suppressed because it is too large Load Diff

13204
stl/spike_5c.stl Normal file

File diff suppressed because it is too large Load Diff

12714
stl/spike_5d.stl Normal file

File diff suppressed because it is too large Load Diff

13204
stl/spike_6a.stl Normal file

File diff suppressed because it is too large Load Diff

12714
stl/spike_6b.stl Normal file

File diff suppressed because it is too large Load Diff

12714
stl/spike_6c.stl Normal file

File diff suppressed because it is too large Load Diff

12714
stl/spike_6d.stl Normal file

File diff suppressed because it is too large Load Diff

12714
stl/spike_7a.stl Normal file

File diff suppressed because it is too large Load Diff

13204
stl/spike_7b.stl Normal file

File diff suppressed because it is too large Load Diff

13204
stl/spike_7c.stl Normal file

File diff suppressed because it is too large Load Diff

13204
stl/spike_7d.stl Normal file

File diff suppressed because it is too large Load Diff

12714
stl/spike_8a.stl Normal file

File diff suppressed because it is too large Load Diff

13204
stl/spike_8b.stl Normal file

File diff suppressed because it is too large Load Diff

12714
stl/spike_8c.stl Normal file

File diff suppressed because it is too large Load Diff

12714
stl/spike_8d.stl Normal file

File diff suppressed because it is too large Load Diff

12714
stl/spike_9a.stl Normal file

File diff suppressed because it is too large Load Diff

12714
stl/spike_9b.stl Normal file

File diff suppressed because it is too large Load Diff

12714
stl/spike_9c.stl Normal file

File diff suppressed because it is too large Load Diff

12714
stl/spike_9d.stl Normal file

File diff suppressed because it is too large Load Diff