diff options
author | Robert "ar" Gerus <ar@bash.org.pl> | 2013-06-06 02:45:50 +0200 |
---|---|---|
committer | Robert "ar" Gerus <ar@bash.org.pl> | 2013-06-06 02:45:50 +0200 |
commit | 9606e7364b63a782e25e66e7dd88921394137b29 (patch) | |
tree | e30cb7dd6f014d71017ae2f4f01d9230b2774706 | |
download | 3dparts-9606e7364b63a782e25e66e7dd88921394137b29.tar.gz 3dparts-9606e7364b63a782e25e66e7dd88921394137b29.tar.bz2 3dparts-9606e7364b63a782e25e66e7dd88921394137b29.tar.xz 3dparts-9606e7364b63a782e25e66e7dd88921394137b29.zip |
My first object - a wheel with spokes
-rw-r--r-- | wheel.png | bin | 0 -> 16110 bytes | |||
-rw-r--r-- | wheel.scad | 29 |
2 files changed, 29 insertions, 0 deletions
diff --git a/wheel.png b/wheel.png Binary files differnew file mode 100644 index 0000000..1b60f16 --- /dev/null +++ b/wheel.png diff --git a/wheel.scad b/wheel.scad new file mode 100644 index 0000000..f3b4a19 --- /dev/null +++ b/wheel.scad @@ -0,0 +1,29 @@ +$fn=100; + +module wheel(radius, width, thickness, spokes) { + union() { + difference() { + // basis for our wheel - a sphere + sphere(radius); + // upper cut-out + translate([0,0,width/2]) + cylinder(radius-(width/2) +1, radius, radius, 0); + // lower cut-out + translate([0,0,-radius -1]) + cylinder(radius-(width/2) +1, radius, radius, 0); + /* + inner cut-out + 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); + } + // 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]); + } + } +}
\ No newline at end of file |