-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add gnomon, reuleaux, theodorus and triangletoy
- Loading branch information
1 parent
4d7638f
commit 9c88a3f
Showing
4 changed files
with
86 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]); | ||
} | ||
} |