Skip to content

Commit 9c88a3f

Browse files
committed
Add gnomon, reuleaux, theodorus and triangletoy
1 parent 4d7638f commit 9c88a3f

File tree

4 files changed

+86
-4
lines changed

4 files changed

+86
-4
lines changed

Reuleaux/reuleaux-n-gon.scad

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// File reuleaux-n-gon.scad
2+
// Prints out a Reuleaux n-gon and an enclosure for it to roll in
3+
// (c) 2020 Rich Cameron
4+
// Released under a CC-BY 4.0 International License
5+
6+
width = 50; // width of the object, in mm
7+
sides = 3; // must be an odd number (>=3)
8+
height = 10; // height in z direction
9+
wall = 1; // thickness of vertical walls
10+
base = .6; // thickness of solid base
11+
clearance = .2; // clearance between n-gon and enclosure
12+
13+
$fs = .2;
14+
$fa = 2;
15+
16+
if((sides % 2) != 1 || sides < 3) {
17+
echo("Reuleaux polygons must have an odd number of sides.");
18+
} else {
19+
difference() {
20+
linear_extrude(height - base) intersection_for(a = [0:360 / sides:359]) rotate(a) translate([width / (sin(180 / sides) / sin(90 / sides)), 0, 0]) circle(width);
21+
translate([0, 0, base]) linear_extrude(height) offset(-wall) intersection_for(a = [0:360 / sides:359]) rotate(a) translate([width / (sin(180 / sides) / sin(90 / sides)), 0, 0]) circle(width);
22+
}
23+
24+
translate([-width - wall * 2 - clearance, 0, 0]) difference() {
25+
linear_extrude(height) rotate(180 / (sides + 1)) circle((width / 2 + wall + clearance) / cos(180 / (sides + 1)), $fn = sides + 1);
26+
translate([0, 0, base]) linear_extrude(height) offset(-wall) rotate(180 / (sides + 1)) circle((width / 2 + wall + clearance) / cos(180 / (sides + 1)), $fn = sides + 1);
27+
}
28+
29+
30+
%circle(r = width / (sin(180 / sides) / sin(90 / sides)), $fn = sides);
31+
}

Triangles/theodorus.scad

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// theodorus.scad
2+
// makes a spiral of theodorus
3+
// (c) 2020, Rich Cameron, licensed Creative Commons CC-BY4.0
4+
5+
max = 53; // number of triangles to be made
6+
// the last triangle's sides will be sqrt(max), 1 and sqrt(max + 1)
7+
8+
xyscale = 10;
9+
wall = 1;
10+
base = 1;
11+
12+
zstep = .2; //should be a multiple of layer height
13+
14+
$fs = .2;
15+
$fa = 2;
16+
17+
18+
function angle(n) = (n > 1) ? asin(1 / sqrt(n)) + angle(n - 1) : 0;
19+
20+
for(i = [1:max]) rotate(angle(i)) linear_extrude(base + (max + 1 - i) * zstep) difference() {
21+
offset(wall / 2) polygon(xyscale * [[0, 0], [sqrt(i), 0], [sqrt(i), 1]]);
22+
offset(-wall / 2) polygon(xyscale * [[0, 0], [sqrt(i), 0], [sqrt(i), 1]]);
23+
}
24+
25+
for(i = [1:max]) rotate(angle(i)) linear_extrude(base) difference() {
26+
polygon(xyscale * [[0, 0], [sqrt(i), 0], [sqrt(i), 1]]);
27+
}
28+
29+
echo(angle(max + 1) % 360);
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
length = [50, 170];
1+
// File TriangleToy.scad
2+
// Prints out a triangle with swingable sides
3+
// (c) 2020 Rich Cameron
4+
// Released under a CC-BY 4.0 International License
5+
6+
length = [50, 170]; // [short side, long sides]
27
hole = 12;
38
width = 8;
49
thick = 2;
5-
fit = .1;
6-
710

811
$fs = .2;
912
$fa = 2;
@@ -18,7 +21,6 @@ translate([width * 2 + 1, 0, 0]) rotate(180) linear_extrude(thick) difference()
1821
for(i = [1, -1]) translate([0, i * length[0] / 2, 0]) circle(hole / 2);
1922
}
2023

21-
//for(i = [0, 1]) rotate([90, 0, i * 180]) translate([length[0] / 2, width, -thick]) rotate(90 - angles[i]) {
2224
for(i = [0, 1]) rotate(i * 180) translate([i * (width + 1), -length[1] / 2 + width / 2, 0]) linear_extrude(thick) difference() {
2325
union() {
2426
circle(width);

gnomon.scad

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// File gnomon.scad
2+
// Prints out a gnomon with sun angle marked
3+
// Long side goes on the ground, short side is the gnomon
4+
// (c) 20019-2020 Rich Cameron
5+
// Released under a CC-BY 4.0 International License
6+
7+
size = 80; //hieght of the gnomon
8+
max_angle = 65; //maximum sun angle that can be measured
9+
10+
rotate([0, -90, 0]) {
11+
linear_extrude(size) square(10);
12+
mirror([0, 1, 0]) translate([0, -10, -10]) cube([10, size * tan(max_angle) + 10 + 1, 10 - .2]);
13+
mirror([0, 0, 1]) linear_extrude(10) difference() {
14+
mirror([0, 1, 0]) translate([0, -10, 0]) square([10, size * tan(max_angle) + 10 + 1]);
15+
for(i = [10:10:max_angle]) translate([10, -size * tan(i) + 1, 0]) text(str(90 - i), size = 4.5, halign = "right");
16+
for(i = [0:10:max_angle]) translate([0, -size * tan(i), 0]) square([10, .2]);
17+
for(i = [0:5:max_angle]) translate([0, -size * tan(i), 0]) square([8, .2]);
18+
for(i = [0:1:max_angle]) translate([0, -size * tan(i), 0]) square([2, .2]);
19+
}
20+
}

0 commit comments

Comments
 (0)