Daily Archives: 2/2/2013

Tinkering with OpenSCAD…

It seems like I might have access to a 3D printer, so I thought it might be fun to see what I could design. I thought using OpenSCAD, a scripting based 3D modelling software that can generate models in STL, a fairly simple but flexible format that can be printed by lots of printers. I had never used it before, but I am fairly comfortable with the ideas, so I thought I’d try a simple project: designing a 6″ (150mm diameter) wheel for a robotics project that I’m working on. It’s not really meant to be serious for construction (it is solid and uses way too much material) but it was a modest first attempt. Here’s the program I came up with in 20-30 minutes.

module dumbwheel() {
	difference() {
		union() {
			difference () {
				cylinder(h=25, r=75, center=true, $fn=200) ;
				cylinder(h=35, r=50, center=true, $fn=96) ;
			}
			rotate(a=90, v=[1, 0, 0]) {
				for (r = [0, 60, 120, 180, 240, 300]) {
					rotate (a=r, v=[0, 1, 0]) { cylinder(h=60, r=4, $fn=16) ; }
				}
			}
			cylinder(h=25, r=12, center=true, $fn=100) ;
		}
		cylinder(h=35, r=3, center=true, $fn=100) ;
	}
}

dumbwheel() ;

And it generated the following wheel.

simplewheel

I’ll have to think about this a bit more to generate a pragmatic wheel, but it’s not a bad start.