Skip to content

Commit

Permalink
Add gnomon, reuleaux, theodorus and triangletoy
Browse files Browse the repository at this point in the history
  • Loading branch information
whosawhatsis committed Oct 30, 2020
1 parent 4d7638f commit 9c88a3f
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 4 deletions.
31 changes: 31 additions & 0 deletions Reuleaux/reuleaux-n-gon.scad
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// File reuleaux-n-gon.scad
// Prints out a Reuleaux n-gon and an enclosure for it to roll in
// (c) 2020 Rich Cameron
// Released under a CC-BY 4.0 International License

width = 50; // width of the object, in mm
sides = 3; // must be an odd number (>=3)
height = 10; // height in z direction
wall = 1; // thickness of vertical walls
base = .6; // thickness of solid base
clearance = .2; // clearance between n-gon and enclosure

$fs = .2;
$fa = 2;

if((sides % 2) != 1 || sides < 3) {
echo("Reuleaux polygons must have an odd number of sides.");
} else {
difference() {
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);
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);
}

translate([-width - wall * 2 - clearance, 0, 0]) difference() {
linear_extrude(height) rotate(180 / (sides + 1)) circle((width / 2 + wall + clearance) / cos(180 / (sides + 1)), $fn = sides + 1);
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);
}


%circle(r = width / (sin(180 / sides) / sin(90 / sides)), $fn = sides);
}
29 changes: 29 additions & 0 deletions Triangles/theodorus.scad
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// theodorus.scad
// makes a spiral of theodorus
// (c) 2020, Rich Cameron, licensed Creative Commons CC-BY4.0

max = 53; // number of triangles to be made
// the last triangle's sides will be sqrt(max), 1 and sqrt(max + 1)

xyscale = 10;
wall = 1;
base = 1;

zstep = .2; //should be a multiple of layer height

$fs = .2;
$fa = 2;


function angle(n) = (n > 1) ? asin(1 / sqrt(n)) + angle(n - 1) : 0;

for(i = [1:max]) rotate(angle(i)) linear_extrude(base + (max + 1 - i) * zstep) difference() {
offset(wall / 2) polygon(xyscale * [[0, 0], [sqrt(i), 0], [sqrt(i), 1]]);
offset(-wall / 2) polygon(xyscale * [[0, 0], [sqrt(i), 0], [sqrt(i), 1]]);
}

for(i = [1:max]) rotate(angle(i)) linear_extrude(base) difference() {
polygon(xyscale * [[0, 0], [sqrt(i), 0], [sqrt(i), 1]]);
}

echo(angle(max + 1) % 360);
10 changes: 6 additions & 4 deletions triangle toy.scad → Triangles/triangleToy.scad
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
length = [50, 170];
// File TriangleToy.scad
// Prints out a triangle with swingable sides
// (c) 2020 Rich Cameron
// Released under a CC-BY 4.0 International License

length = [50, 170]; // [short side, long sides]
hole = 12;
width = 8;
thick = 2;
fit = .1;


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

//for(i = [0, 1]) rotate([90, 0, i * 180]) translate([length[0] / 2, width, -thick]) rotate(90 - angles[i]) {
for(i = [0, 1]) rotate(i * 180) translate([i * (width + 1), -length[1] / 2 + width / 2, 0]) linear_extrude(thick) difference() {
union() {
circle(width);
Expand Down
20 changes: 20 additions & 0 deletions gnomon.scad
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// File gnomon.scad
// Prints out a gnomon with sun angle marked
// Long side goes on the ground, short side is the gnomon
// (c) 20019-2020 Rich Cameron
// Released under a CC-BY 4.0 International License

size = 80; //hieght of the gnomon
max_angle = 65; //maximum sun angle that can be measured

rotate([0, -90, 0]) {
linear_extrude(size) square(10);
mirror([0, 1, 0]) translate([0, -10, -10]) cube([10, size * tan(max_angle) + 10 + 1, 10 - .2]);
mirror([0, 0, 1]) linear_extrude(10) difference() {
mirror([0, 1, 0]) translate([0, -10, 0]) square([10, size * tan(max_angle) + 10 + 1]);
for(i = [10:10:max_angle]) translate([10, -size * tan(i) + 1, 0]) text(str(90 - i), size = 4.5, halign = "right");
for(i = [0:10:max_angle]) translate([0, -size * tan(i), 0]) square([10, .2]);
for(i = [0:5:max_angle]) translate([0, -size * tan(i), 0]) square([8, .2]);
for(i = [0:1:max_angle]) translate([0, -size * tan(i), 0]) square([2, .2]);
}
}

0 comments on commit 9c88a3f

Please sign in to comment.