1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-29 11:58:39 +01:00

clean code

This commit is contained in:
Justin Lin 2021-09-03 07:40:17 +08:00
parent 43d614ba7c
commit 5863a5c3f6
2 changed files with 1 additions and 8 deletions

View File

@ -15,16 +15,12 @@ module fidget_polygon(model, beginning_radius, fn, n, height, thickness, spacing
y = beginning_radius - beginning_radius * cos(theta);
dr = y / cos(theta) + thickness + spacing;
pw = pow((beginning_radius + dr) * sin(theta), 2);
// function a(ri, ro, i) = acos((pow(ro, 2) + pow(ri, 2) - pw * pow(0.985, i)) / (2 * ro * ri));
module drawPolygon(r) {
circle(r, $fn = fn);
}
rs = [for(i = [0: n + 1]) beginning_radius + i * dr];
//as = [for(i = [1: n]) a(rs[i - 1], rs[i], i) / 2];
half_height = height / 2;

View File

@ -29,7 +29,6 @@ module fidget_star(model, r1, r2, n, number_of_stars, height, thickness, spacing
y = r2 - r2 * cos(theta);
dr = y / cos(theta) + thickness + spacing;
pw = pow((r2 + dr) * sin(theta), 2);
r_ratio = r1 / r2;
@ -80,12 +79,10 @@ module fidget_star(model, r1, r2, n, number_of_stars, height, thickness, spacing
offset(ring_thickness / 3, $fn = n)
offset(delta = -thickness)
star(rs2[number_of_stars] * s[number_of_stars] * r_ratio, rs2[number_of_stars] * s[number_of_stars]);
//star(rs[n] * s[n] - thickness);
linear_extrude(thickness * 4, center = true)
offset(delta = -ring_thickness)
star(rs2[number_of_stars] * s[number_of_stars] * r_ratio, rs2[number_of_stars] * s[number_of_stars]);
//star(rs[n] * s[n] - ring_thickness);
}
}