20110223

ZSH Colored prompt

Just a quick post because this was driving me crazy : how do you get a colored prompt on ZSH on ubuntu ?

Various suggestions online seemed to fail. It seemed like the escape sequences for getting colored varied wildly, and none worked for me.

I followed the instructions here for loading one of the default prompts. eg :
autoload -U promptinit
promptinit
prompt -l
prompt bigfade
Then, I typed
echo $PROMPT
to see what the proper escape sequences were ( they didn't look like anything provided online ). e.g.:
%B%F{blue}█▓▒░%B%F{white}%K{blue}%n@%m%b%k%f%F{blue}%K{black}░▒▓█%b%f%k%F{blue}%K{black}█▓▒░%B%F{white}%K{black} %D{%a %b %d} %D{%I:%M:%S%P}
%}%B%F{yellow}%K{black}/home/mrule>%b%f%k 
So, apparantly %B gives you bold, %F{colorname} sets the foreground color, and %b and %f return these to defaults ? Anyway, this will give a blue prompt:
%B%F{blue}%~$ %b%f

20110205

3D Printed Polyhedral Lamp

These are instructions for building a very bright lamp with 20 bulbs and a truncated icosahedral core. [Thingiverse entry].


Parts :
Materials:
  • electrical tape
  • super-glue ( I used Gorilla brand )
Tools:
  • Pliers
  • 3D printer
  • razor knife
  • wire cutters
  • wire strippers
  • Phillip's head screwdriver
Assembly:

First print out the indicated quantity of all printed parts.

More detailed assembly instructions for the lamp socket brackets can be found on the thingiverse page. Trim the bracket until the black socket rests flush inside. This is important, since we need the hexagonal cover plate to bond to both the bracket and the socket for a good fit.
The orientation of the socket within the bracket will matter later. The socket has a wide ridge. Align this ridge with a side of the bracket for 10 pieces. Align the ridge with a corner of the bracket for the other 10. Aligning randomly also works, as long as you don't align all sockets so that the wide parts face a side.

Print out 12 pentagonal pieces. All pieces have extra plastic to stabilize the hinge while printing. This can be removed easily with a razor knife.

Perform a test assembly with just the hexagonal pieces. Leave out the pentagons for now since they are hard to remove once assembled. Ensure that all light sockets fit properly and don't collide. You may have to experiment, rotating and swapping between pieces, to get everything to fit well. If all else fails you can tap apart one of the brackets and re-orient it.

Carefully unfold your test assembly into an as-linear-as-possible planar arrangement like below. The exact arrangement doesn't really matter, just so long as there isn't too much branching.

The lamp sockets clip onto 12 to 14 gauge electrical wire. The only 12 gauge wire I could find had too thick of insulation to work with these sockets. I used 16 gauge wire instead, which just barely works. Using scissors or a knife, separate one end of the lamp cord. Protect the ends with electrical tape. Starting at the far end, clamp the sockets to the cable in turn. The sockets are difficult to close, so I had to use pliers to get enough force.

Before you get excited and attach the plug to test everything, slide on the pentagonal hook piece over the cable. The top of the printed piece should be facing away from the assembly, toward the plug. I neglected to do this, and had to dis-assemble my plug to add this piece.

To assemble the plug, use needle-nose pliers to remove the orange stopper from the front of the plug. Remove the prongs. Thread the lamp cord through. Split and strip about 13mm from the end of each wire. Wrap the exposed wire around the bolts attached to the prongs, and tighten the bolts well. Replace the prongs and stopper.

Test each of your sockets. Turn everything over and plug in some lightbulbs. I did it the dangerous way by adding and removing bulbs ( I only had 2 at the time ) while the thing was plugged in. People that don't want to die should un-plug the setup while moving the bulbs. Better yet, order the bulbs with the rest of your parts and put them all in at once to test.

The next step is tricky. Unplug the setup and remove the bulbs. Turn over the setup. You are going to need to fold the pieces back into the polyhedral shape. The lamp cord is inflexible and resists folding, but bending each joint beforehand helps. Adding in the pentagons while folding provides more stability. As the polyhedron becomes more complete, it becomes more difficult to add pieces. If you're having trouble getting a hinge to mate, pry up slightly the side that is already in the polyhedron. The hinges come together more easily if pushed together from the side, rather than if pushed down from above.

When it was all done, the compressed cable overpowered the super-glue on a couple brackets, thankfully this mistake is easily fixed with more super-glue and some patience. You should end up with an object that looks more than a little bit like the detonation mechanism for an atomic bomb. The final assembly is very strong and the hinges will hold together without additional glue.

The last piece you'll insert is the one that contains the power cord and the rope or chain for hanging the lamp. I would attach rope or chain before you add this piece. Don't use polypropylene rope like I did, it doesn't hold knots. A chain would look nicer anyway.
Thats it. You're done. Hang the lamp somewhere, insert bulbs, and power up your own miniature sun.

20110104

Subject 3, Trial 4, "Walk on uneven terrain"

CMU motion capture dataset
Subject 3, Trial 4, "Walk on uneven terrain"
100 overlaid walkers
scale : Uniform(0.4,1.0), offset : Gaussian(μ=0,σ = [1 2 3 4 6 8])




20101230

Simulated video feedback test run

This video is a test run of software-simulated video feedback fractals. The feedback transformation is a linear shift+scaling, and there is added reflection for symmetry. Colors are inverted, with contrast enhancement, within the feedback loop, to promote pattern formation.



20101007

MakerBot Notes:

In no particular order
  • When affixing the MK4 idler pulley to its bearing, try to center it. The washer-spacing method in the default instructions did not centre my pulley. It seems to grip filament more reliably if properly centered, and then mounted with a single washer spacer on each side.
  • Always add a copper sleeve or hose clamp around your heater insulator barrel. This will save you if you accidentally run to hot and start to deform the insulator.
  • If your filament has a "skirt" around it (or multiple threads) when you back it out of the heater, it means that the seal between the insulator and barrel is failing and you need to shore up the strength of your insulator barrel and probably reduce your temperature, and check for nozzle obstructions.
  • The MK5 extruder idler pulley wheel does not work with the MK4 extruder gear
  • Put a 'flag' of masking tape on your extruder feed 2mm calibration rod. If you are debugging feed problems and need to repeatedly remove your motor for cleaning, you will probably and up trying to calibrate the feed mechanism with the heater element attached. And, if you are clumsy like me, you will probably end up dropping the calibration rod into the heating element.
  • Let the machine warm up for 10 minutes before turning on the feed. The thermistor only reports the temperature at the tip of the extruder. Give the machine a while for this heat to diffuse along the barrel
  • If you haven't specially calibrated your thermistor settings, you might have to tweak the temperature settings in skeinforge to get the plastic soft enough. In my machine, the extruder jams for all temperatures lower than 230C. So, I had to go deep into the skeinforge-raft settings and make sure _all_ extrusion temperatures are above 230C. warning: 230C may be more than enough to melt your insulator barrel if you are using the white PTFE part that ships with the kit. I bought a PEEK barrel from MakerGear and am currently praying to various gods that it does not suffer the same sort of failure at my PTFE barrel.
  • Counter-sink the build platform and use tapered bolts in order to prevent accidental collisions between the print head and the platform mounting bolts.
  • I noticed that setting infill to 0.0 causes skeinforge to do a divide by zero... but 0.001 seems to work for "make it hollow" 
  • Level your build platform with masking tape or painter's tape. I am putting the tape on the Y stage platform; Move the stage using the control panel from corner to corner until all corners are the same distance from the nozzle.
  • Do this calibration tutorial: http://rapmanv3.blogspot.com/2009_09_01_archive.html
  • The Z rods that MakerBot ships with are inferior and possibly should be replaced to get a fully functioning makerbot. On my kit, version 11, I have rebuilt the Z stage assembly several times and keep it excessively well oiled to prevent slipping. Essentially, the problem is that the rods are slightly bent and also corrode which adds friction. Replacing them with stainless steel equivalents seems to solve these problems. For now I am running a software patch that slows down the Z axis to reduce the odds of lost steps during a build.
    http://groups.google.com/group/makerbot/browse_thread/thread/dd42b58921ff32a7
  • The heated build platform kit as it ships is incomplete. The way they suggest  hooking it up to the extruder board will not work. To complete the kit, you either need to procure a heat-sink setup for the power mosfets on the extruder board, or a relay to take the load off the extruder mosfet. I used a relay. They recommend insulating a part of the wire with heat shrink tubing, but I didn't see any heat shrink tubing in my kit. I could just have missed it though.. unclear. Other surprises may include : you need to do some surface mount soldering. The instructions recommend solder paste, but it is possible to do this with a normal soldering iron if you are careful.
  • The M6 pre-assembled heater-core from MakerGear simplifies building the hot part of the plastic extruder. 
     
     


20100627

Preparing .PDB Files for 3D Printing

I would like to print some files from the swiss protein databank into nice 3D surface models. This can be done on linux with standard open software packages.
  • assume platform is Ubutntu
  • assume that you have Replicatorg set up with Skeinforge and some sort of RepRap style 3D printer.
  • install meshlab
  • install blender
  • download .pdb
  • open .pdb in meshlab. Use the metaballs setting with resolution = 0.5 and blobbiness = 0.5
  • optionally clean up mesh
  • center and scale in blender
  • orient model in a way that looks mostly printable
  • export model as .STL
  • open model in replicatorg-skeinforge

Follow-up : Although this will create manifold meshes that skeinforge can process, it doesn't create support structures and other niceties requires for Makerbot / RepRap printing. Ideas ?
  • try out the skeinforge support settings
  • manually add support columns in Blender
  • write a script to automatically create supports (hard, don't know what algorithm to use)