1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-04-19 21:51:57 +02:00
This commit is contained in:
Justin Lin 2021-09-03 11:38:21 +08:00
parent 346cea1db8
commit 853da1f9e2
2 changed files with 19 additions and 19 deletions

View File

@ -7,19 +7,19 @@ module r_union2(radius = 1) {
rx = is_list(r) ? r[1] : r;
ry = is_list(r) ? r[0] : r;
for(i = [0:fn - 1]) {
x = rx - sin(i * step) * rx;
y = ry - cos(i * step) * ry;
xi = rx - sin(i * step + step) * rx;
yi = ry - cos(i * step + step) * ry;
for(a = [0:step:step * (fn - 1)]) {
hull() {
intersection() {
offset(x) children(0);
offset(y) children(1);
offset(rx - sin(a) * rx)
children(0);
offset(ry - cos(a) * ry)
children(1);
}
intersection() {
offset(xi) children(0);
offset(yi) children(1);
offset(rx - sin(a + step) * rx)
children(0);
offset(ry - cos(a + step) * ry)
children(1);
}
}
}

View File

@ -13,20 +13,20 @@ module r_union3(radius = 1) {
step = 90 / fn;
rx = is_list(r) ? r[1] : r;
ry = is_list(r) ? r[0] : r;
for(i = [0:fn - 1]) {
x = rx - sin(i * step) * rx;
y = ry - cos(i * step) * ry;
xi = rx - sin(i * step + step) * rx;
yi = ry - cos(i * step + step) * ry;
for(a = [0:step:step * (fn - 1)]) {
hull() {
intersection() {
dilate(x) children(0);
dilate(y) children(1);
dilate(rx - sin(a) * rx)
children(0);
dilate(ry - cos(a) * ry)
children(1);
}
intersection() {
dilate(xi) children(0);
dilate(yi) children(1);
dilate(rx - sin(a + step) * rx)
children(0);
dilate(ry - cos(a + step) * ry)
children(1);
}
}
}