Thursday, June 14, 2012

assessment and no zeros

Following an Edmonton teacher's suspension for "ignoring his principal’s repeated directions to follow the school’s no-zero grading practice", there has been a lot of discussion about assessment. I just wanted to link here to a couple of blogs that I think best express opinions from educators who are using assessment properly.


Zero-Knowledge Proofs by John Scammell
for the love of learning by Joe Bower
Teaching on Purpose by Cherra-Lynn Olthof

For the most part I agree with them, so it's easier to link to them than to re-invent the wheel.


Monday, May 14, 2012

Print a 3D Key Fob from an Image or Logo

I've also published this as an Instructable and uploaded the related files to Thingiverse.

Print a 3D Key Fob from an Image or LogoLet's say, hypothetically, that you need to design a 3D printable key fob for an event this weekend. First you check Instructables and Thingiverse to see if anyone has done it already. Unfortunately no one has, so you come back and read this Instructable. Don't worry, though, it's not that difficult. This basically involves converting a black and white image to vector format and extruding it into a 3D shape.

Through the process of modelling a key fob, students will be able to explore a practical application of geometry and algebra.

Instructors can also take this opportunity to remind students about the importance of respecting intellectual propertytrademarks, and copyright.

Software and Hardware Requirements

For converting the image to a vector graphic, we'll use Inkscape (with the Better DXF plugin or R12 plugin).

To extrude the vector graphic into 3D and add the key ring attachment we'll use OpenSCAD.

Preparing the file for printing will involve ReplicatorG or similar software.

Making a physical model will require a 3D Printer (e.g. MakerBot) or a service such as Shapeways.

Setting up Inkscape and "Better DXF Output"

Download and install Inkscape from inkscape.org. If you're running Windows you can use the installable or portable (no install required) version.

To install the "Better DXF Output" extension, download the file better_dxf_output.zip. Extract the three files and put them in "C:\Program Files\Inkscape\share\extensions" (if you installed the Windows version) or "...\InkscapePortable\App\Inkscape\share\extensions" (if you're using the Windows portable version) or "usr/share/inkscape/extensions" (if you installed the Linux version).

Start up Inkscape and you should now be able to save drawings as "Better DXF Output" files. We need to use this extension because OpenSCAD requires R12 DXF files, and Inkscape 0.48 and newer exports R13 DXF files.

Converting the Image to a Vector Graphic

This is probably the most difficult part, but it shouldn't be too hard. We're going to import the logo into Inkscape, trace it, clean it up if necessary, and export it as a DXF file for the next step. If you already have a (R12) DXF file of your logo, you can skip this step.

1. Under the File menu chose Import... and select your logo file. Hopefully it's a single colour (e.g. black and white) bitmap.
Converting the Image to a Vector Graphic

2. Click on your logo, then under the Path menu choose Trace Bitmap...
Converting the Image to a Vector Graphic

3. On the dialogue box that comes up, click OK and then close it. If all goes well you should now have a path object above your original bitmap.
Converting the Image to a Vector Graphic

4. Move the path object out of the way, and delete the original bitmap. Move the path object back to the bottom left (0, 0).
Converting the Image to a Vector Graphic

5. If there are parts of the image that you don't want, under the Path menu choose Break Apartand delete the unwanted parts
Converting the Image to a Vector Graphic

6. Select everything that remains and under the Path menu choose Combine.
Converting the Image to a Vector Graphic

7. Resize the path object to the size you'd like your key fob to be by typing the size in the W (width) or (height) box. Make sure your click the lock button first to make sure you don't change the aspect ratio of your logo.
Converting the Image to a Vector Graphic

8. Under the File menu choose Save As... then choose Better DXF Output (*.DXF) from the dropdown menu. Name your file logo.DXF and remember when you save it so that you can use it for the next step.
Converting the Image to a Vector Graphic


Creating a 3D Model

Now that you have a DXF file of your logo, we need to make it 3D.

Go to OpenSCAD.org to download the program for LinuxOS X, or Windows and install (or unzip and run the portable version).

Run OpenSCAD and paste in the following code (or download the attached logo.scad file).

width = 50; // the x size of the logo
length = 40.572; // the y size of the logo
logodepth = 2; // how far in the z direction you want the logo extruded
backdepth = 1; // thinckness of the back of the key fob
padding = 3; // how far from the edge you want the logo
holewidth = 10; // the size of the ring attachment on the top

color("green") translate(v = [0, 0, backdepth]) linear_extrude(height = logodepth) import(file = "logo.DXF");  // importing and extruding the logo

minkowski()  // this is a transformation that adds a second shape (the cylinder) around the outside of the first shape (the cube)
{
 cube([width, length, backdepth/2]);  // a cube to go behind the logo
 cylinder(r=padding, h=backdepth/2);  // rounding the corners of the cube
}

difference()
{
 translate(v = [width/2, length+padding, 0]) cylinder(h = backdepth, r = holewidth/2);  // the outside of the key ring attachment
 translate(v = [width/2, length+padding, -1]) cylinder(h = backdepth+logodepth+2, r = holewidth/2-2);  // cut out the inside of the key ring attachement
 cube([width, length, backdepth+logodepth+2]);  // cut out so that we don't overlap with the logo
}


Rendering the 3D File

Make sure your logo.DXF file from the previous step is in the same folder as the OpenSCAD program, or specify the location in the  import(file = "logo.DXF") line.

Put in appropriate values for the variables at the top of the code (width, length, etc.).

Under the Design menu select (or press F5) and it will show you what your design looks like.
Rendering the 3D file

Under the Design menu select Compile and Render (CGAL) (or press F6) and it will create a rendering of your design. Then select Export as STL... under the Design menu to save your completed 3D model in a format that can be used for printing.
Rendering the 3D file


Printing Your 3D Model

Now that you have an STL file of your 3D model you can generate G-code and print as you normally would (likely using ReplicatorG), or you can order a printed part from an online service such as Shapeways.

The first time I made key fobs we needed 90 copies for a series of sessions I was teaching, the MakerBot Automated Build Platform was very useful for this.

Thursday, April 26, 2012

Apple TV case

Playing around with a CNC router yesterday I built this:





Sunday, March 25, 2012

a new (free) party game like "the telephone game" and "draw something"

A friend just told me about a party game that's a little bit like Chinese whispers (the Telephone Game) combined with Draw Something.
  1. Each person gets a pencil and as many pieces of paper as there are people around the circle. As a group, pick a theme, such as "song titles" or "household things".
  2. On their first piece of paper everyone writes the name of one "thing" and then passes it to their right.
  3. On a new piece of paper they draw the "thing" that they were just handed, and pass that to the right.
  4. They guess the name of the "thing" depicted in the drawing they were just handed.
  5. Play continues until you have your first "thing" back. Talk about how different it is.
As an example, let's say Allen writes the word "Apple" and passes it to Ben. At the same time, Zack writes the word "Zebra" and passes it to Allen. Ben attempts to (silently) draw an apple and pass the drawing to Chad, while Allen tries to draw a zebra. After going all the way around the circle, Allen might be handed a drawing of a watermelon and Zach might get a drawing of a dog.

accessibility switch-enabled Wii controller

Full write-up coming soon, but here are some photos. I estimate that I spent about $45 on the project.





Monday, March 12, 2012

using Inkscape and Gcodetools for CNC plasma cutting

I like SheetCam for generating G-code for a CNC plasma cutter from DXF or SVG drawings, but I prefer free and/or open source programs that students can use on their own computers. Inkscape and the Gcodetools plug-in achieve that.

Version 0.49 of Inkscape will include Gcodetools, but until then we have to extract the contents of the Gcodetools download (using a program such as 7-zip) and put them in the appropriate Inkscape directory (probably c:\Program Files\Inkscape\share\extensions\ on Windows).

Once you have this set up, start up Inkscape and check under the Extensions menu for Gcodetools.
If it's not there, close Inkscape, make sure the files are copied to the correct directory, and restart Inkscape.

The process for creating G-code from a drawing follows:

Open (or create) a drawing in Inkscape. Make sure the bottom left corner of your drawing is at the bottom left of the document. As an example, I'll be making an arcade controller top for mounting buttons and a joystick.

Convert all objects to paths. Keyboard shortcuts to do this are <Ctrl><a> (to select everything) then <Shift><Ctrl><c> to convert objects to paths.

You should now have only "objects of type Path".

Now we need to set some orientation points. Click on the Extensions menu and select Gcodetools then Orientation points....

Change the Units to inches (in) and click Apply then Close.

To specify that you're going to use a plasma cutter, click on the Extensions menu and select Gcodetools then Tools library...

Select plasma and click Apply.

This will create a green text box with your tool definition in it.

You will be able to edit the text to edit it and change things like your feed rate. For now all we want to do is remove some of the "gcode before path" lines. Double-click that text box and delete everything but the line "M03 (turn on plasma)" so that it looks like this:

Next you will need to select all of your objects again (press F1 to use the arrow tool again instead of the text tool) and choose Prepare path for plasma...

This will bring up a window allowing you to create lead-in and lead-out paths, as explained in this article on torchmate.com. You'll probably want a short in-out path to make a cleaner cut and to show you which direction the torch will be cutting. Remember that the units for the length are inches. Click Apply create the paths and click Close to close that tool once it has finished.

If you don't like how the in-out paths look, you can undo it and try again until you get something that looks like this:

You can now select and delete the objects in your original drawing so you will just see the cut paths.

Now select Path to Gcode....

Click on the Preferences tab to make sure you will be saving the file onto your flash drive (e.g. drive e:\).

Select the Path to Gcode tab and click Apply. Read through any warnings that pop up, but you should get some usable G-code.

Open the file in Notepad or a similar text editor, and it should look like this:

The one thing you'll want to change is to delete the M3 on the fourth line of the file. M3 is the Gcode for turning on the torch, and we don't want it to turn on until the torch has moved into position. You can eliminate this step by having an empty file in your output directory (e:\ or wherever you specified earlier) that is called header.txt (edit: the empty file should just be named header with no extension).Your output file will then look like this:

Open that output.ngc file in Mach3, make sure everything looks as you expect, set up the torch (talk to your Instructor about the torch settings), and click Cycle Start (or press <Alt><r>). You may need to click (or press) this again every time the torch fires if it's set to pause before cutting. 

Hopefully everything will work for you and you'll have a nicely cut metal project.


Monday, March 5, 2012

mapping box.com as a network drive

To make better use of my 50 GB of free online storage at Box.com, I've just learned that you can map it a network drive.

Windows Instructions:
Right-click on "My Computer" (or "Computer") and choose "Map Network Drive...".
In the "Folder" box type   http://www.box.net/dav/
Click on "Connect using a different user name." and input your Box.com username and password.
Click the "Finish" button and in a minute or two you should have a new network drive on your computer that is your Box.com files and folders.