summaryrefslogtreecommitdiffstats
path: root/wheel.scad
diff options
context:
space:
mode:
authorRobert "ar" Gerus <ar@bash.org.pl>2013-06-06 19:32:56 +0200
committerRobert "ar" Gerus <ar@bash.org.pl>2013-06-06 19:32:56 +0200
commitdc8ef1eb805d941e378683c19e7022ddd8d339d0 (patch)
tree32230af0de70a57d6c9e2b7b400146f347c38577 /wheel.scad
parent9606e7364b63a782e25e66e7dd88921394137b29 (diff)
download3dparts-dc8ef1eb805d941e378683c19e7022ddd8d339d0.tar.gz
3dparts-dc8ef1eb805d941e378683c19e7022ddd8d339d0.tar.bz2
3dparts-dc8ef1eb805d941e378683c19e7022ddd8d339d0.zip
small update for the wheel, just cosmetics.
Diffstat (limited to 'wheel.scad')
-rw-r--r--wheel.scad19
1 files changed, 11 insertions, 8 deletions
diff --git a/wheel.scad b/wheel.scad
index f3b4a19..c216bc1 100644
--- a/wheel.scad
+++ b/wheel.scad
@@ -1,12 +1,13 @@
$fn=100;
module wheel(radius, width, thickness, spokes) {
+ echo("axle width:", (radius-thickness)/(spokes));
union() {
difference() {
// basis for our wheel - a sphere
sphere(radius);
// upper cut-out
- translate([0,0,width/2])
+ translate([0,0,(width/2)])
cylinder(radius-(width/2) +1, radius, radius, 0);
// lower cut-out
translate([0,0,-radius -1])
@@ -16,14 +17,16 @@ module wheel(radius, width, thickness, spokes) {
removing 1 from z on translate and making the cylinder
higher by two to generate slightly more valid objects
*/
- translate([0,0,-width/2 -1])
- cylinder(width+2, radius-thickness, radius-thickness, 0);
+ translate([0,0,-(width/2) -1])
+ cylinder(width +2, radius-thickness, radius-thickness, 0);
}
// spokes
- for (i = [0:(360/spokes):360]) {
- rotate([0,0,i])
- translate([-(radius-thickness),-(radius-thickness)/(spokes*2), -(width/2)])
- cube([(radius-thickness), (radius-thickness)/(spokes), width]);
+ union() {
+ for (i = [0:(360/spokes):360]) {
+ rotate([0,0,i])
+ translate([-(radius-thickness),-(radius-thickness)/(spokes*2), -(width/2)])
+ cube([(radius-thickness), (radius-thickness)/(spokes), width]);
+ }
}
}
-} \ No newline at end of file
+}