mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-16 11:44:50 +02:00
refactor
This commit is contained in:
@@ -1,15 +1,12 @@
|
||||
function __fast_fibonacci_sub(nth) =
|
||||
function __fast_fibonacci_2_elems(nth) =
|
||||
nth == 0 ? [0, 1] :
|
||||
let(
|
||||
_f = __fast_fibonacci_2_elems(floor(nth / 2)),
|
||||
a = _f[0],
|
||||
b = _f[1],
|
||||
c = a * (b * 2 - a),
|
||||
d = a ^ 2 + b ^ 2
|
||||
d = _f * _f
|
||||
)
|
||||
nth % 2 == 0 ? [c, d] : [d, c + d];
|
||||
|
||||
function __fast_fibonacci_2_elems(nth) =
|
||||
nth == 0 ? [0, 1] : __fast_fibonacci_sub(nth);
|
||||
|
||||
function __fast_fibonacci(nth) =
|
||||
__fast_fibonacci_2_elems(nth)[0];
|
||||
function __fast_fibonacci(nth) = __fast_fibonacci_2_elems(nth)[0];
|
@@ -5,14 +5,14 @@ function __tr__corner_t_leng_lt_zero(frags, t_sector_angle, l1, l2, h, round_r)
|
||||
let(t_height = tan(t_sector_angle) * l1 - round_r / sin(90 - t_sector_angle) - h / 2)
|
||||
[
|
||||
for(pt = __pie_for_rounding(round_r, 90 - t_sector_angle, 90, frags * t_sector_angle / 180))
|
||||
[pt[0], pt[1] + t_height]
|
||||
[pt.x, pt.y + t_height]
|
||||
];
|
||||
|
||||
function __tr_corner_t_leng_gt_or_eq_zero(frags, t_sector_angle, t_leng, h, round_r) =
|
||||
let(offset_y = h / 2 - round_r)
|
||||
[
|
||||
for(pt = __pie_for_rounding(round_r, 90 - t_sector_angle, 90, frags * t_sector_angle / 360))
|
||||
[pt[0] + t_leng, pt[1] + offset_y]
|
||||
[pt.x + t_leng, pt.y + offset_y]
|
||||
];
|
||||
|
||||
function __tr_corner(frags, b_ang, l1, l2, h, round_r) =
|
||||
@@ -29,14 +29,14 @@ function __tr__corner_b_leng_lt_zero(frags, b_sector_angle, l1, l2, h, round_r)
|
||||
[
|
||||
for(i = [0:leng - 1])
|
||||
let(pt = reversed[leng - 1 - i])
|
||||
[pt[0], -pt[1]]
|
||||
[pt.x, -pt.y]
|
||||
];
|
||||
|
||||
function __br_corner_b_leng_gt_or_eq_zero(frags, b_sector_angle, l1, l2, b_leng, h, round_r) =
|
||||
let(half_h = h / 2)
|
||||
[
|
||||
for(pt = __pie_for_rounding(round_r, -90, -90 + b_sector_angle, frags * b_sector_angle / 360))
|
||||
[pt[0] + b_leng, pt[1] + round_r - half_h]
|
||||
[pt.x + b_leng, pt.y + round_r - half_h]
|
||||
];
|
||||
|
||||
function __br_corner(frags, b_ang, l1, l2, h, round_r) =
|
||||
|
Reference in New Issue
Block a user