mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-01-17 14:18:13 +01:00
refactor
This commit is contained in:
parent
7bb8acaed0
commit
ba7f7422a9
@ -1,6 +1,5 @@
|
|||||||
include <line2d.scad>;
|
use <polyline2d.scad>
|
||||||
include <polyline2d.scad>
|
use <util/fibseq.scad>;
|
||||||
include <util/fibseq.scad>;
|
|
||||||
|
|
||||||
smallest_length = 30;
|
smallest_length = 30;
|
||||||
height1 = 60;
|
height1 = 60;
|
||||||
@ -8,10 +7,10 @@ height2 = 120;
|
|||||||
thickness = 1;
|
thickness = 1;
|
||||||
|
|
||||||
module tableware_organizer(smallest_length, height1, height2, thickness) {
|
module tableware_organizer(smallest_length, height1, height2, thickness) {
|
||||||
module golden_rectangle(fibseq, i = 0) {
|
module golden_rectangle(fseq, i = 0) {
|
||||||
if(i < len(fibseq) - 1) {
|
if(i < len(fseq) - 1) {
|
||||||
f1 = fibseq[i] * smallest_length;
|
f1 = fseq[i] * smallest_length;
|
||||||
f2 = fibseq[i + 1] * smallest_length;
|
f2 = fseq[i + 1] * smallest_length;
|
||||||
|
|
||||||
linear_extrude(f1 < 3 * smallest_length ? height1 : height2)
|
linear_extrude(f1 < 3 * smallest_length ? height1 : height2)
|
||||||
polyline2d([[0, 0], [f1, 0], [f1, f1], [0, f1], [0, 0]], thickness);
|
polyline2d([[0, 0], [f1, 0], [f1, f1], [0, f1], [0, 0]], thickness);
|
||||||
@ -22,7 +21,7 @@ module tableware_organizer(smallest_length, height1, height2, thickness) {
|
|||||||
|
|
||||||
translate([0, f1 - f2, 0])
|
translate([0, f1 - f2, 0])
|
||||||
rotate(90)
|
rotate(90)
|
||||||
golden_rectangle(fibseq, i + 1);
|
golden_rectangle(fseq, i + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user