1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-16 11:44:50 +02:00
This commit is contained in:
Justin Lin
2019-05-25 14:56:22 +08:00
parent 6d62ac0a11
commit 944152d326

View File

@@ -1,17 +1,16 @@
module bend_extrude(size, angle, frags = 24) { module bend_extrude(size, thickness, angle, frags = 24) {
x = size[0]; x = size[0];
y = size[1]; y = size[1];
z = size[2];
frag_width = x / frags ; frag_width = x / frags ;
frag_angle = angle / frags; frag_angle = angle / frags;
half_frag_width = 0.5 * frag_width; half_frag_width = 0.5 * frag_width;
half_frag_angle = 0.5 * frag_angle; half_frag_angle = 0.5 * frag_angle;
r = half_frag_width / sin(half_frag_angle); r = half_frag_width / sin(half_frag_angle);
s = (r - z) / r; s = (r - thickness) / r;
module get_frag(i) { module get_frag(i) {
offsetX = i * frag_width; offsetX = i * frag_width;
linear_extrude(z, scale = [s, 1]) linear_extrude(thickness, scale = [s, 1])
translate([-offsetX - half_frag_width, 0, 0]) translate([-offsetX - half_frag_width, 0, 0])
intersection() { intersection() {
children(); children();