Articles by Postling

You are currently browsing Postling’s articles.

Back to Bento

Now that I'm working full-time at an awesome startup downtown I've been packing bento lunches again. In addition to being better for me, it's substantially cheaper than buying lunch in midtown. A wrap or salad at the "usual" place ends up being about $9. Even considering the fact that Chris works from home a few days a week it adds up fast, to about $300 per month. A bento lunch generally comes in under $3.

Today's lunch consists of a baby spinach salad with peppers, carrots, and mushrooms, and a chicken sandwich with pepperoni. I use fat free cream cheese instead of mayonaise. Fat free cream cheese completely fails as anything I'd want to put on a bagel, but does well in sandwiches. I used "low carb" bread. Low carb bread has a weird spongy texture I really don't recommend. Stick with the real thing.

In need of a way to organize and store my Lego obsession, I made a bunch of acrylic boxes which not only hold Legos, but also stack and interlock similarly:

Each brick box holds 64+ of the same-shape piece. So the 1×1 box will hold 64 1×1 bricks, and the 2×2 holds 64 2×2 bricks. The larger ones hold a few more due to how the sizing works out. The 1×1 box is 40mm per side (external dimensions).

I posted the patterns on Thingiverse should anyone wish to make their own. No,  I'm not going to make and sell them. They're time consuming to make, and plus I'm pretty sure Lego would sue me. If you don't have access to a laser cutter, I'd suggest using a service like Ponoko.

The patterns were generated in OpenSCAD using the following code. Change "rows" and "cols" to get the lego size you desire. By the way, I’m teaching a class on OpenSCAD in Brooklyn next weekend!

fundamental_unit = 0.8;
thickness =3;
h_pitch = 10;
v_pitch = 12;
tform = 5;
knob = fundamental_unit*h_pitch*tform;
module side(rows){
	lwidth = rows*fundamental_unit*h_pitch*tform;
	lheight = v_pitch*fundamental_unit*tform;
	difference() {
 
		square(size=[lwidth, lheight]);
		translate(v=[10,0,0]) square(size=[lwidth-20,thickness]);
		translate(v=[10,lheight-thickness,0]) square(size=[lwidth-20,thickness]);
		square(size=[thickness, 10]);
		translate(v=[0,lheight-10]) square(size=[thickness, 10]);
	translate(v=[lwidth-thickness,10]) square(size=[thickness, lheight-20]);
	}
}
module top(rows,cols,holes){
	lwidth = rows*fundamental_unit*h_pitch*tform;
	llength = cols*fundamental_unit*h_pitch*tform;
	difference(){
		square(size=[lwidth,llength]);
		square(size=[thickness,10]);
		square(size=[10,thickness]);
		translate(v=[lwidth,0,0]) square(size=[-thickness,10]);
		translate(v=[lwidth,0,0]) square(size=[-10,thickness]);
		translate(v=[lwidth,llength]) square(size=[-10,-thickness]);
		translate(v=[lwidth,llength]) square(size=[-thickness,-10]);	
		translate(v=[0,llength]) square(size=[10,-thickness]);
		translate(v=[0,llength]) square(size=[thickness,-10]);	
		if(holes==true){
			for (i = [1:cols]){
				for (j=[1:rows]){
				translate(v=[j*knob-knob/2,i*knob-(fundamental_unit*h_pitch*tform)/2,0]) circle(r=fundamental_unit*6*tform/2);
				}
			}
		}
	}
}
 
rows = 2;
cols = 4;
 
h_spacing =  rows*fundamental_unit*h_pitch*tform+10;
l_spacing =  cols*fundamental_unit*h_pitch*tform+10;
v_spacing = fundamental_unit*v_pitch*tform+10;
 
side(rows);
translate(v=[ rows*fundamental_unit*h_pitch*tform+10,0,0]) side(rows);
translate(v=[0,v_spacing]) side(cols);
translate(v=[ cols*fundamental_unit*h_pitch*tform+10,v_spacing]) side(cols);
translate(v=[0,2*v_spacing]) top(rows,cols,true);
translate(v=[ rows*fundamental_unit*h_pitch*tform+10,2*v_spacing]) top(rows,cols,false);

In the next batch I'm going to make the nubs a little smaller than the holes. They work now, but it's a bit fiddly getting everything to line up just so. A little more forgiveness would be nice. Also, OpenSCAD does strange things with circles. Rather than simply write a circle in the DXF, it represents it as a bunch of line segments. I’m not sure if there’s a way around this, but it’s marginally irritating.

You can download a .dxf for a few different box sizes on Thingiverse.
I’ve also created a Flickr Collection for my various Lego stuff.

Meta Lego

Want to learn to create 3D models, but find the user interface for most 3D modeling programs too infuriating? OpenSCAD may be for you! And we're teaching a class on how to use it on Sunday, June 27!

OpenSCAD is "The Programmers Solid 3D CAD Modeler." Rather than learn tricky user interfaces and navigate seemingly endless obscure menus, OpenSCAD uses a simple scripting language to generate 3D models from either existing or new 2D drawings. We'll start in 2D (great for creating designs for the laser cutter) and move into 3D modeling (perfect for MakerBot!).

A basic understanding of computer programming is helpful but not required. Sign up at EventBrite today!

Mushroom Thingy

I've been doing more Lego building from models. This time I made sort of an abstract mushroom tree forest thing. More photos are available on Flickr.

Here's the original model (left) and the resulting cubeified model after running it through AddCells (right):

I realized of course that with everything grey, it was very difficult to determine which bricks of which color were needed where. So I un-joined the primitives in the original model and ran AddCells on each one individually. I used different colored "cell" blocks for each one, and the resulting models kept the color:

Each peice needed to be moved a little bit so that all the blocks lined up, but other than that it worked pretty well.

Because each piece is separate, I couldn't use the hide tool to "slice" each layer. But I did find out something interesting: each "cube" in the new models is actually a vertex. I honestly don't understand a ton about how that's pulled off, but basically instead of being a point on a line, each vertex represents another object, the source cube.

In order to slice up the model, I wrote a script to delete all but a given layer, with layer 1 being the bottom layer, up to however many layers of cubes are in the model.

 

import Blender, BPyMessages, BPyMesh
from Blender import Scene, Mesh, NMesh, Window, sys, Group, Object, Draw
from Blender.Mathutils import \
	Matrix, Vector, ProjectVecs, AngleBetweenVecs, TranslationMatrix
 
 
def trimToLayer(selected,layerNumber, blockHeight,offset):
        toDelete= []
 
        mesh = selected.getData(mesh=1)
        tmesh = NMesh.GetRawFromObject(selected.name)
        tmesh.transform(selected.matrix)
        #Delete verticies above the current layer
        for v in tmesh.verts:
            if v.co[2] > blockHeight*layer:
                toDelete.append(v.index)
        if layerNumber > 1:
                #Delete verticies below the current layer
                for v in tmesh.verts:
                    if v.co[2] < blockHeight*layer-1:
                        toDelete.append(v.index)        
        toDelete = list(set(toDelete))
 
        mesh.verts.delete(toDelete)
        Window.Redraw()
 
 
##################3
if __name__ == "__main__":
    selection = Object.GetSelected();
 
    layer = Draw.PupIntInput("Layer",1,0,100)
    Blender.SaveUndoState('Kill Everything')  
    print "\nTrimming First Layer"
    for s in selection:
	bbox = s.getBoundBox(1)
	print bbox[0][2]
	trimToLayer(s,layer,1.2,bbox[0][2])

 

There are a couple problems with the script: primarily, I couldn't find a way to get the software to save a screenshot (ctrl+F3 normally). Because of this, I couldn't loop through the whole thing at once, I had to go through one layer at a time, running the script, hitting ctrl+f3, saving the image, lather rinse repeat. It was tedious, though not as tedious as manually cutting up each layer. But almost.

The resulting MRI-like were used to build the model. The exact placement of which bricks and where is left as an excercise to the reader. A few layers (from the bottom, middle, and towards the top) are shown below.

This is my first attempt at a Blender script, and admittedly one of my first times using blender, so any feedback on how to streamline this process would be appreciated.

My friend Adam said something which is too long for twitter or Facebook, but realy to excellent to be confined to my inbox. We were discussing the topics of the upcoming Ignite NYC, and how it's become (always was?) a bit… buzz-wordy.

Ignite is leveraged to provide out-of-the-box solutions for thinking
outside of the box!  By inner left joining your assets to the
blogosphere's most whuffie-laden creatives, you can provide a rich
canvas for your stakeholders to express their content-driven buy-in.
Generate partnerships, leads, and "branded civil unions" while
managing your passionate identity and getting hella sticky eyeball
clickthru!  You'll can't best these practices, folks.

Synergy. Pure synergy.

It was only after hours of searching that I finally came up with what I was looking for: a way to take a polygon mesh (OBJ or similar) and convert it into a blueprint for building LEGO sculptures.

Don't get me wrong, there are tons of tools out there for LEGO CAD. But strangely none of them mention being able to go from a mesh to a LEGO layout. It's surprising, since it seems like such a natural fit. The rise of 3D printers has rejuvinated interest in voxels, voulmetric pixels, and as evidenced by all the LEGO sculpture artists we seem to be in a golden age of LEGO. 

Armed with Blender and a giant LEGO collection, I set out to get the computer to do the hard work for me. I used Blender, graph paper, a pencil, and of course lots of LEGOs.

Step 1: Voxelizing a Utah teapot

Let me preface this by saying that the Blender UI is not for the faint of heart. I took classes on Rhino and 3DSMax in college, and thought to myself "how different could it be?" The answer: very. If you're new to blender, don't fear the manual. You're going to need it, particularly the parts on installing/using python scripts.

To voxelize the teapot I used a script called Add Cells which covers the surface of any object with any other object. First I imported the teapot, and scaled it up a bit. Then I created my "fundamental unit" of LEGO. LEGOs have an aspect ratio of 6:5, so I created a 1×1 LEGO, a 0.6×0.5×0.5 rectangular prism in Blender.

Selecting both the teapot and my 1×1 lego I ran the Add Cells script (go to the Scripts menu –> Add -> Cells). I chose the Teapot for my object to be voxelized and the 1×1 LEGO as my voxel model.

Tada! A blocky teapot!

Step 2: Graphing each layer on paper

In order to make the build process easier, I went through layer by layer and drew a map of each layer on graph paper. This way when building with LEGOs I could shade in with a pencil each voxel I'd built. It sounds redundant, but when things all start looking the same after a few minutes and something isn't lining up, it's very helpful.

To see one layer at a time in Blender I went into Sculpture Mode, side view, and used ctrl+shift+right mouse to select and hide all but the layer I wanted to see. Then I switched to Top view and copied the layer onto my graph paper. By the end I had a sheet of paper full of wobbly circular outlines.

Step 3: Building it with LEGOs!

The completed model uses 244 LEGOs, many of which are tiny 1×1 and 1×2 bricks. The model is hollow, but the walls need to be fairly thick to be able to support the top. As it is I probably should have made things a little thicker; putting the last two layers on was a delicate operation.

I built each layer sequentially. There were a few overhang pieces near the bottom which I had to append to the layer above them, since they couldn't anchor to anything below.

Overall the project took about 4 hours, with a break in the middle for breakfast, church, etc.

Total LEGO count for the project was 244 individual bricks, distributed thusly:

  • 44 2×3 Bricks
  • 46 2×2 Bricks
  • 58 2×4 Bricks
  • 27 1×2 Bricks
  • 17 1×3 Bricks
  • 8 1×4 Bricks
  • 8 2×2 L shaped Bricks
  • 33 1×1 Bricks
  • 1 2×8 Brick
  • 1 2×6 Brick
  • 1 1×8 Brick
     

My first lego ovoids

After ordering a few hundred bricks from bricklink, I started working on what is for now a top secret project.

Step one was to practice making spherical and organic LEGO shapes, and I'm pretty happy with the two sphereoids I came up with while catching up on House. PS, Dr House is a huge jerk.

I've had the miCoach for 2 days now, and I have to say I'm pretty happy with it. If you remember, I got the miCoach because I wanted an exercise logger to hack around with and wasn't in the mood to give Apple any of my money. I haven't had much time to tinker with the device or website itself; the website uses Flash / AMF and the device itself uses a proprietary binary format.

Here's my impression so far:

Accuracy

I ran on a treadmill and the miCoach was true to the treamill's distance calculation within two hundredths of a mile. The miCoach measures how for my foot travels, and the treadmill measures how far the belt travels. I'm not sure which I'm inclined to believe, but in truth two hundredths of a mile is fine for my running.

For some reason gym equipment never registers my heart rate, so I don't have a good way of comparing the miCoach heart rate monitor to anything else. But checking my pulse the old school way (two fingers on my neck) after my run came out to about what the miCoach said.

Sync / Online Interface

The syncing process is pretty smooth, you plug the pacer into your computer and the miCoach application sends your data to their servers. The graphs are nice looking. I like showing my pace alongside the heart rate data, it's interesting to see how small changes in the speed of my running affect my heart rate. Running at 5.5 mph is fine, but pushing it up to 6 mph over a few minutes sends my heart into the red.

There's not much in the way of social interaction, but since no one else I know has one of these that's not a big drawback for me.

Coaching / Music

If you like, the pacer will coach you through various predefined workouts or your own custom plans based on either runnin speed or heart rate. I still prefer my workout-specific running mixes to the random British dude talking over a generic playlist, but it's a well implemented feature.

The miCoach daisy chains itself between your MP3 player and headphones. It uses a standard 3.5mm jack so it will work with pretty much any audio source. My gym has TVs and headphone jacks on each treadmill (yes, I go to a fancy gym) and it has been pretty exciting to listen to the audio from the TV instead of just reading the closed captions, while still getting audio cues from the pacer for when to slow down and speed up.

Value

The miCoach is not cheap. I got mine from RoadRunner Sports for $125 shipped. As a running tracker, it's probably only worth it if you're serious about running. Otherwise the $30 Nike+ is much more affordable (assuming you have a compatible iPod; I didn't).

However, comparing the miCoach to the Nike+ is a bit unfair. Nike+ is a pedometer, whereas miCoach is a heart rate monitor with online tracking and a pedometer. This is significant because the miCoach is useful for pretty much any type of exercise, not just running. Since it measures your heart rate and not just your footfalls it's still useful for rowing, cycling, etc. You won't get the same type of distance/pace data, obviously.

I really wish there was a standard for exercise data. The ergometer we got back in 2000 has the ability to interface with a PC, so there's no technical reason all the equipment couldn't feed into the same tracking systems. But since everyone has their own proprietary thing we end up with a separate tracker for each type of workout data. Bleh.

Hacking

Using FireBug I watched a few of the AMF calls, but since I have no experience with AMF it will be a while before I can see if that's something I can use in my own code. In theory if the Flash client can do it I should be able to (since Flash is run locally), but it's been a very long time since I looked at anything Flash related. I wish they'd just open an API. It could only help adoption of the device if third-party sites were able to support it.

Upon mounting the device in Windows it shows up as a removable drive with two files on it, adidas.bin and adidas.dat. There doesn't appear to be anything in adidas.bin, and adidas.dat looks to be encrypted/compressed/otherwise a pain.

However! Once you run the Adidas MiCoach Manager software, a ton of files show up on the device (I'm assuming decompressed from adidas.dat). From my 28 minute workout there are 40 files named EXRCS###.bin, 16 WKDEF###.bin, and a handful of other binaries. A quick stab with IDA Pro didn't turn up anything super exciting, but my guess is that the EXRCS files are completed workout data and the WKDEF are pre-programmed workouts.

I have a ton of dev work to do over the next month, and a wedding to start planning, so it will probably be a while before I can really look at these. But it's a start!

The main reason I chose the B&N nook over the Kindle when I bought an ebook reader was the fact that the nook supports PDF and Epub. While the nook's PDF support is really only suited for text, it doesn't do a very good job with graphs and images, I find that I can convert most anything a nook-friendly format using Calibre.

One thing the nook handles surprisingly well is manga, Japanese comic books. The nook doesn't do so well with full sized American comics due to resizing (thus rendering text illegible), but the smaller form factor of manga is perfect for the nook's screen size:

A lot of manga is only commercially available in Japanese, and the English translation are largely done by fans. The translated files are available in .CBR or .CBZ format, which is really just a renamed zip file full of images. Calibre does a great job of converting the CBR files in to an Epub suitable for the nook. The pages are very readable, and the artwork looks good.

There was also some new nook firmware released today. While most of the attention is going to the new browser (in beta) and games, the page turns are noticibly faster in 1.3. They're now fast enough that I don't really notice them, and consider it on par with the amount of time it takes to physically turn a page:

The nook got off to a shaky start, but it's turning out to be a really nice ebook reader. The games are cute, but not something I see myself using much. Hopefully when the browser is out of beta it will allow for downloading books through it (right now you have to cable sync or use B&Ns app). Or better yet, I hope they let folks develop their own apps for them. A Calibre client for the nook would be great.

I spent a decent portion of yesterday on the laser, prototyping a tiny embroidery hoop for (duh) tiny embroidery. I'm pretty happy with the results. So much in fact that I've decided to start offering tiny embroidery kits along side my tiny dinosaur kits.

The embroidery hoop is made from laser cut acrylic, and the rubber band provides tension to keep everything in place. The whole thing measures 1.5" across, a standard sewing machine bobbin is show for scale in the picture above. I actually neglected to save the cut file (oops) but it's pretty simple: two concentric rings (0.2" wide), with the outside diameter of the smaller ring being 0.05" smaller than the inside diameter of the larger ring. The large ring has a "nub" on the side for the rubber band, and is split down the middle on that side.

There's about a 1" diameter working area. I used 28 count aida fabric, which gave me approximately 28 "pixels" across to work with. Chris helped me design a cupcake chart for counted cross stitch. It uses 7 colors: white, red, light pink, dark pink, pink, grey, and light grey. It's a nice portable project because it fits in your pocket. I've listed a kit for sale on Etsy and may bring a few down to Spring BadaBing in Richmond, VA this weekend.

Here's the chart for your cross-stitch pleasure:

« Older entries