Crafting

Mechanical Embroidery Machine

Also at the Berlin Tech Museum was a punch tape driven embroidery machine. The Tech Museum has a ton of industrial textile equipment as part of their permanent collection. The machines are completely mechincal, as far as I can tell no electricity is required.

Punchtape embroidery machinePunchtape embroidery machine

Sadly I couln’t read the German placquard explaining more about it, and couldn’t find much info online. I got a snapshot of the name plate so I’d at least know what it was called.

Wurker Automat

If anyone knows more about these machines I’d love to hear it.

Crafting

Jacquard Mechanism Simplified

Spent the better part of the day at the Stiftung Deutsches Technikmuseum in Berlin. They have an awesome Jacquard loom for ribbon weaving, and a great model which shows very clearly how the Jacquard head works.

Next week, Adam and I plan on building one.
I shot a few seconds of the actual loom, and then took some detail photos. The loom itself is HUGE:

Jacquard ThreadingJacquard head Tensioning Heddles from behind

I have a bunch of other weaving related stuff I’ll post over the next few days, as well as the video from my talk at 25c3 as soon as I get my hands on it.

lased, SDXF Documentation

Tinysaur Display

Tinysaur Kit Display

I’m helping my friend Sara at the Squidfire Holiday Market in Baltimore, Maryland on Sunday. She suggested I bring some Tinysaurs, and so I made a display to neatly hold the Tinysaur kits.

I generated the pattern with a python script I wrote, using the sdxf library.

If you’d like to make your own, the DXF files are up on Thingiverse, or you can grab the python scripts and make one to your own dimensions. I cut it on the laser, but there’s no reason it couldn’t be cut on a scroll saw.

first, second, success

Here you can see my first attempt, second attempt, and final. The first two were in cardboard, fantastic for prototyping.

Once all this craft show stuff is over I will probably make a few available in my Etsy shop in case folks who do craft shows are interested in one.

Programming

Adam Mayer explains pointers to art students

I don’t have a background in CS. In fact I got my degree in Crafts. Yes, you can get a degree in Crafts. And I have one.

Most of my programming skills are self-taught, which is fine most of the time but occasionally gets me into trouble. Recently I learned about pointers the hard way, and to help clarify things my friend Adam broke it down into art school terms for me. It was so hilarious (and helpful) that I’m reposting it here.

You’re telling me you went through art school without once discussing referers and referents? WHAT KIND OF PUNK-ASS ART SCHOOL DID YOU GO TO? Let me break it down to you in art-school terms, then:

In python, you can think of all variables as pointers. All they do is point to objects. When you say:
>> constructivism = 6
You can think of this as creating an “integer object” with a value of 6. Constructivism is not itself 6 (which is to say, constructivism is not “6” in the way that brutalist materialism might be “6”). Instead, constructivism is a variable which points to this newly created
integer object with a value of 6. If you were to say:
>> constructivism = []
or
>> constructivism = Socket()
then you’ll be creating an new empty list object, or a new socket object, and then constructivism will point to that instead.

That’s all pretty simple. Then there’s this:
>> futurism = constructivism
Now, constructivism is already a pointer to something else. Futurism, however, will not point to constructivism itself: instead it will point to whatever constructivism points too, much like in 1991 Saatchi did not point at Damien Hirst, but whatever Damien Hirst was pointing at at the time; in this instance a dead shark. Note that while Damien Hirst went on to point at other things, Saatchi is still pointing at the dead shark. So:
>> hirst = Shark( dead=True )
Hirst is now pointing at a dead shark.
>> saatchi = hirst
Saatchi is now pointing at the same dead shark. Now,
>> hirst = Skull( bling=True )
Hirst is now pointing at a blinged-out skull, but Saatchi is still stuck on the shark.

When two variables are pointing at the same thing, they both see any changes made to that thing over time. So, for example, look at the following code:

>> # note that hirst does not make the shark himself, but calls a constructor
>> hirst = Shark( dead=True )
>> saatchi = hirst
>> print hirst.living
False

Both Hirst and Saatchi are referring to the same dead shark. But, later:

>> # Saatchi uses his money to bring the shark back to life
>> saatchi.ressurect()
>> print saatchi.living
True
>> print hirst.living
True

However, let’s move on:
>> hirst = Skull() # Hirst has moved on to other dumb shit
>> # What doth life?
>> print hirst.living
AttributeError: Skull has no attribute 'living'

… because hirst now points to a skull, and not the shark.

I could go on, but I’m impatient to see what google ads start popping up for this thread.

-a
(Actually, you probably really need to hear about scoping, but I’ll do that in terms of objectification and the male gaze.)

Programming, SDXF Documentation

Python library for generating DXF files

I’ve gotten a little frustrated with the limitations of using Processing to generate PDFs for laser cutting. Primarily, there’s no support for “hairline” thickness lines, which add an extra step to getting things ready to lase, and there’s no way to separate lines into different layers so it can be hard to work with the file later if you want to raster etch some lines and vector cut others.

Adam suggested looking into a DXF library someone had written for Python. Indeed, there is a very nice library. Unfortunately the original documentation for it seems to have gone missing.

I’ve started documenting the library, it’s called SDXF and is pretty thorough. I don’t know Python, or DXF, but so I’m picking up both as I go along.

lased

Woolly Tiny



Not wanting to get Tinysaur to get all the spotlight, I bring you… WOOLLY TINY. Like a Woolly Mammoth. But Tiny.

The pattern comes from the epilog website and the assembly was done with a pair of tweezers and a baby syringe full of Elmer’s glue.

If you’ve always wanted your own mini mammoth, or just want to show off you have the steadiest hands of anyone ever, you can pick up the pre-lased parts on Etsy.

Programming

Mysql_Awesome_Query

Hm it’s been a while since I’ve posted, been busy with a lot of boring, non-hacking stuff. Travesty! But here’s something vaguely interesting:

Often when I’m writing a bunch of PHP I want to be able to see the MySQL queries its generating. Usually I just comment out the mysql_query() and replace it with an echo. But sometimes that’s annoying, or I want to check multiple queries at once and don’t feel like switching them back and forth all the time.

I wrote a quick function called mysql_awesome_query(), which will either execute or echo a query depending on whether it’s a SELECT, INSERT, UPDATE, or DELETE/DROP.

//1 is run, 0 is echo sql
$flags = array(
'S'=>1,
'I'=>1,
'U'=>1,
'D'=>1
);


function mysql_awesome_query($sql){
$flags = $GLOBALS['flags'];

if($flags[$sql[0]]==1){
$result = mysql_query($sql);
if(mysql_error()){
return mysql_error();
} else {
return $result;
}
} else {
echo $sql;
return false;
}
}

The $flags global variable is an array of settings for which types of queries to execute, based on the first letter of the query string. MySQL conveniently doesn't have a lot of overlap there.
When mysql_awesome_query() is executed it checks the first letter of the query and if the corresponding array value is 1, it executes it and returns either a result or a mysql error. If it's 0, it simply echos the query so you can review it.

I'm sure there are more elegant ways to do this, but this was quick and dirty and works for my purposes.

lased

Folded paper boxes

I’ve been working on learning Processing, a language which is a bastardization of Java used for drawing pretty pictures (among other things). Most of its functions are based around drawing/graphics.

Processing project #1 was to generate templates to be cut on the laser cutter. Specifically paper boxes, because I needed something to package my Tinysaurs in. They end up looking like this:

Laser-cut boxes

You enter the depth, width, and height of the box, and Processing draws the pattern

Processing has a PDF library which I use to generate the template in PDF format, which Corel Draw is able to read. I’m looking into using Python instead of Processing, because it apparently has a nice DXF library. Although the fact that Adam scoffs at Processing makes me want to keep using it just to annoy him.

The Processing program is available in the NYC Resistor SVN repository. Which is public, hooray! The code is only vaguely commented, but it should be pretty clear what it’s doing. Maybe.

Of course you dont’ need a laser to cut these out, and xacto knife would work just fine. But… I have a laser so I use it.

If you don’t want to mess with Processing and just want to print box patterns, you can do that too. I’ve generated a bunch of sizes:

You may need to right-click and save the pdf to your hard drive to get it to load.