Category Archives: geek

Laser cutting update: Marvel version

I cut the Marvel-licensed fabric that I picked up from Affordable Textiles on Queen Street (near Spadina) on the laser cutter. It worked out beautifully. I reused the SVG I tweaked after last week’s experiments. As it turns out, even with a 45″ one-way design, 1.5 yards is enough for a top, enough bias strips to bind the neckline and armholes, and two pairs of liner squares. There will be small scraps that I can use for other projects, too.

2015-04-14 21.52.43

This will be my 12th top, and I have the fabric for a 13th if I wanted to. I’m currently wearing the top that I laser-cut out of 100% Italian cotton. 100% cotton seems much more comfortably breathable than the polyester-cotton blend in the broadcloth that I practised with. Maybe I’ll do a few more tops as I come across colours and patterns that I like, and I’ll also gradually branch out to other patterns as well.

A checklist of things to try, fabric-wise:

  • Cotton
    • Fabric ordered online – maybe this cute Dr. Seuss fabric or something else from Jo-Ann (or maybe this one), to remind me to have fun
    • Something from Etsy
    • Fabric using someone else’s design, maybe off Spoonflower
    • Fabric I design
  • Stretch knit
  • Silk or other slippery fabrics

Mwahahaha. =)

2015-04-14d Laser-cutting fabric is awesome -- index card #laser #hacklab

2015-04-14d Laser-cutting fabric is awesome – index card #laser #hacklab

Experimenting with spending more time at Hacklab

This week I experimented with making Hacklab my default location. I biked there on Monday and Tuesday because the weather was good, and I took the subway on Friday because I wasn’t sure about the forecast for rain.

On Monday, I laser-cut pieces for the simple tops that I’ve been sewing. I’ve been skipping the pleat, since it doesn’t make any difference to the fit of the garment and skipping it makes the top easier and faster to sew. The pattern fits the laser cutter if I cut it on a fold, and I can cut registration marks on a sheet of paper to make aligning that fold easier. I cut the pieces for one top out of the peach broadcloth that I’d salvaged from my box cushion prototype. (Waste not, want not!) I cut the pieces for another top from a black gingham check that I wanted to experiment with, since it’s supposed to be one of this season’s trendy patterns. I was delighted to find that the laser-cut pieces actually matched up – not just in terms of the notches (which I can take credit for), but even in terms of the pattern. (Probably more coincidence than skill.)

I didn’t pay attention to the direction of the gingham check because I assumed the stripes were the same visual weight. It turns out one direction is a bit heavier than the other, so now my shirt has horizontal stripes when it looks like most of the commercial gingham shirts I’ve seen had dominant stripes (if any) running vertically… Ah well! I cut bias strips and wrappers for another experiment out of my excess yardage, so I don’t think I have quite enough left to make a new shirt. I’ll finish and wear what I have. If I decide it’s worth doing another gingham thing, I might be able to get half a yard and do another one.

On Tuesday, I came early so that I could get some bread dough rising while I went for a massage. (Knead and be kneaded?) That worked out well, and we had some lovely crusty bread for the open house dinner. Eric and I also checked out this community garden in the neighbourhood. Our chances of getting a plot are probably pretty low (long waiting lists), but apparently they have a small herb area that could use more volunteers, so we might give that a try. Alternatively, Alex says it’s okay for us to set out planters in the back, and he even has an automated watering system. It would be great to grow lots of basil and other herbs for cooking.

Today I went to Hacklab to talk to a friend. Since I was in the area anyway, I also took the opportunity to pick up some bamboo fabric from Designer Fabrics so that I can look into making a pair of yoga pants.

I wanted to laser-cut the bias strips for the gingham check. I thought about using the 10″ square continuous method, but I settled for making long bias strips instead so that I could fit an extra square in there for another project I’m working on. While I was sorting that out, Alex came in with a MIDI keyboard, a laptop, and a projector. He proceeded to set it up to project the keyboard training program onto the keyboard itself, which was really nifty. We had fun playing around with different pieces.

Mmm. I like this. Going to Hacklab nudges me a little more towards making stuff and talking to people, I think. Let me see what next week is like. On the flipside, it means less time at home and less time preparing meals, but if I leave Hacklab earlier and I plan what to cook, I can probably still have that in place by the time everyone’s ready for dinner.

On another note, Designer Fabrics didn’t have any polyurethane laminate (PUL – waterproof, breathable, washable in hot water; often used for diapers, but good for general waterproofing and even making food-safe lunch bags and other containers). Fabricland has some, but it’s a bit pricy at $33/m. It seems people tend to order that online, so I might give online shopping a try.

2015-04-08 Emacs Lisp Development Tips with John Wiegley

You can find John Wiegley on Twitter (@jwiegley) or at

0:00:00 Paredit mode. Start with it from day 1! Matching pairs of parentheses, won’t let you delete one without the other. Inserts appropriate newlines, too
0:03:56 Emacs as a Lisp environment. (Also, Helm is what’s responsible for the display.) Evaluating a function makes it available in the global scope, which has all these functions and commands you can do. This makes it easy to iteratively develop your functions, because you can just execute things directly.
0:05:08 Without (interactive), you can’t call functions with M-x. You can use M-: or put the call in your scratch buffer.
0:06:00 command-log-mode
0:06:47 pp-eval-last-sexp. Check out for other config things
0:07:14 debugging. e to evaluate within the current context. Also, stepping, quit.
0:08:09 Edebug with C-u C-M-x. Interactive debugging. SPC moves you forward, one Lisp form at a time. It shows you results in the minibuffer. You can descend into Lisp forms or go into functions. ? shows keybindings. Check out the Emacs Lisp chapter on EDebug, highly recommendeg.
0:09:25 You can also use the (debug) form to go to the debugger.
0:10:26 eldoc: Seeing arguments in the minibuffer as you type, because no one remembers all the arguments anyway. eldoc-mode, or add (turn-on-eldoc-mode) to your config.
0:11:30 What functions should you call in the first place? What concepts? Emacs predates many standard terms, so that’s why things are a little confusing. Ex: “frames” and “windows” are not what you might think they are. OS window = frame. Area within Emacs = window. Opposite of HTML. Use the Emacs tutorial C-h t.
0:13:04 Read the Emacs Lisp intro, which you can get to with C-h i (which lists the manuals that are available). Read the Emacs Lisp manual too.
0:14:03 Other weird terms: point, mark, marker. (point) vs (point-marker).
0:15:35 C-h f (describe-function) shows the help for the function. Nearly all functions you’ll probably call are documented well. Lots of options. Check out C-h f for interactive, for example.
0:17:17 C-h v (describe-variable).
0:17:46 More in-depth documentation: C-h i, go to the Emacs Lisp manual, then use i to view the index.
0:18:22 info-lookmore shows you the Info documentation for the symbol under point. Works for other Lisps too (ex: Common Lisp)
0:19:46 Sanity-checking paired parentheses with M-x check-parens. Handy for adding to your after-save-hook in Emacs Lisp mode.
0:20:40 Paredit editing capabilities. Ex: C-k kills the current sexp. paredit-raise-sexp replaces the parent sexp with the following sexp. slurping and barfing. Barfing – spitting out an element from the list form. C-{ or C-} (with suggested keybindings). C-( and C-) are slurping, which pulls forms in. Works for strings, too.
0:22:38 Maximum barfage and slurpage. Useful for slurping everything in, for example. paredit-slurp-all-the-way-forward.
0:24:13 redshank (companion to paredit) for refactoring. Ex: redshank-condify-form converts an if to a cond for when you realize you’ve got more than two conditions.
0:25:05 M-1 M-( surround the next one thing with parens
0:25:25 redshank: wrap a let, change if to a when, etc.
0:25:52 C-h k (describe-key) shows what a keyboard shortcut or menu item will do.
0:27:26 Took a while to get used to paredit, but you eventually get into the zen of paredit.
0:27:54 Linter – M-x elint-current-buffer. Loads every module that your code depends on (so the first time is slow), and then shows you style notes.
0:28:50 C-q for manually inserting parentheses
0:29:10 Helm, which shows you all the other stuff that matches your query. Lets you select by regex, multiple patterns, etc. Much nicer and more interactive.
0:30:29 Profiler M-x elp-instrument-function, then call the function, then elp-results will show you the time it took to execute. Results aggregate, and are reset when you call elp-results.
0:32:30 Measuring memory consumption. Also, internal representation of lists. reverse vs. nreverse. Like nconc, nreverse, setcar, setcdr. This can greatly speed up your code, if you can avoid using the garbage collector. EmacsWiki – memory-use-counts, but not particularly helpful? Another package that extends the Emacs Lisp profiler? Avoid premature optimization.
0:38:55 elint and flycheck? flycheck’s designed for external processes, so that might be a challenge. Possibility: use async to spawn another Emacs? Doesn’t seem to be available yet.
0:40:40 ert
0:48:11 testcover,, undercover.el
0:48:13 Read Emacs Lisp manual, etc.
0:48:20 Creating a mode. You don’t have to make it from scartch – start by copying someone else, and then strip away everything you don’t want.
0:49:58 checkdoc – checks the style of your documentation strings.
0:51:30 defining a minor mode
0:56:08 when to define a major mode – structure of your buffer

Laser cutting registration experiments and cutting long pieces of fabric

(aka Things Other People Probably Already Knew About the Hacklab Laser Cutter But That I Wanted to Figure Out =) )

For sewing purposes, I want to eventually be able to accurately cut pieces that are larger than the laser bed (22×18″). The approach that other people had recommended for large cuts is to laser-cut a piece of paper, then position material on top of it. This works really well for acrylic and other clear materials, but it’s a bit trickier with fabric.

I was curious about the following questions:

  1. Do the cutting bounds coincide with the mat if the grid has been removed? If so, then placing material would be much easier.
  2. Can you use registration markers to make the process of shifting opaque material easier?
  3. Can you build pauses into laser programs to make it easier to reposition material or adjust power?
  4. Do you need to keep stroke width in mind when setting the X and Y locations for paths in Inkscape? That is, when you set the X and Y, does it use the path (which is what’s used for cutting), or does it use the stroke width?
  5. Is the lowest leftmost position stable? That is, if you rehome the laser and then use the joystick to move it to the minimum X and Y the hardware will let it reach, does that position stay the same even if you repeat the process?

To explore these questions, I created an SVG that had

  • L-shapes to define the corners
  • a couple of crosshairs for shifting, and an additional reference line that could be checked against the X=0 line
  • two half-circles that would become one circle after shifting

Since Inkscape’s Gcode tools export the path names, I used Path – Combine to group related paths and the Object Properties dialog to rename them. This allowed me to edit the resulting Gcode, move the path for the second half-circle to the end of the file, and add an M0 pause before it. I taped paper down to cover the four corners. After processing the file with the sed scripts used to tweak things for our laser, I ran it.

Here are the results:

1. The cutting area does not coincide with the rulers or the mat.

I homed the laser and then touched off at the minimum X and Y positions that the hardware would let me reach. The lines I cut for the upper corners are slightly skewed away from the built-in ruler, which means that it cannot be used for alignment.

2. Registration marks allow for reasonable precision in large cuts.

2015-04-06 12.40.222015-04-06 12.36.01

The circle above is formed from half-circles, cut in two passes separated by a reposition. I started with two sheets of paper taped to the lower left corner: one to move, and one to act as a reference. After I made the first cut, I repositioned the top layer of paper so that the crosshair on the right was on top of the crosshair on the left and the reference line I cut was aligned with the lower left corner. Folding the quarters of the crosshair back helped me verify its position. I taped the top layer of the paper down and proceeded with the second cut. This simple registration process produced a cut that’s not completely accurate, but which is manageable for the kind of work that I want to do. It could probably be refined with additional crosshairs, boxes, or other registration shapes.

(Update: Boxes work wonderfully.)

3. You can use the M65 P0 and M0 operations to add a pause to your G-code program, but the program will be reset if you raise the lid of the laser.

The M0 operation pauses the program, and you can continue it by clicking on the pause button in the controller. However, when you raise the lid of the laser to reposition material, the controller loses the connection to the laser. After you reestablish the connection, the controller is no longer in pause mode, and you need to start the program from the beginning.

Because my G-code was relatively simple, I chose to re-run the program with zero power. When I reached the pause, I set the power to level 1 and continued with the program. This may be a good way to handle larger cuts if you want to keep the design in a single G-code file. Here’s a snippet showing the pause code.

M63 P0

(End cutting path id: upperleft)

M65 P0

(Start cutting path id: secondhalfcircle)
(Change tool to Default tool)

M63 P0

M65 P0 turns off the laser immediately (instead of being synchronized with motion), and M0 pauses the program until it’s continued from the controller.

If you don’t want to pause and rerun, you can always split your cuts into separate G-code files. Dividing your SVG into layers makes it easy to select all the paths on a given layer before running the G-code export tool.

4. Inkscape takes stroke width into account when you move paths using X and Y, so be consistent about your positions.

If your stroke width is 1 px, then a line drawn on top of a 1″ grid from (0,0) to (0,2) will start at (-0.006″, -0.006″) and have a height of 2.006 inches. This can still be cut. If you move it to (0,0), the actual line itself will be offset by a tiny bit, although I’m not sure how much difference it would make when cutting. Anyway, when creating registration marks, make sure you have a consistent offset between your registration marks and the path to cut, and that you use a consistent stroke width (even if the laser cutter ignores that width). Make sure you turn off the default preference that scales stroke widths whenever you resize something (Edit – Preference – Behavior – Transforms – Scale stroke width, or use the fourth icon from the right of the top toolbar).

5. The lowest leftmost position appears to be stable.

If you home the laser, then use the joystick to move to the minimum X and Y position you can reach in the lower left, and you use the GUI controller to touch off at that point so that all coordinates are relative to that position, then your cuts will be in the same place each time. This appears to be true even after you rehome the laser and re-touch-off, and even after you turn off the laser and restart Linux EMC2. This means we could probably mark off the outside limits of the cutting area on the mat using something that’s laser-safe, and then people could use those as reference lines. On the temporary side, there’s taping down paper and using that as a guideline, which people are used to already.

Whee! So with the results above, I should now be able to make decently-precise long cuts in fabric…

2015-04-06 15.10.27 2015-04-06 15.09.58

MWAHAHA. Behold the power of the laser cutter. The pattern pieces are about 23″. This is the picture of a cut after the piece has been shifted so that the registration squares on the right of the fabric is over the registration squares on the left on my reference piece of paper. There’s a barely-perceptible jog in the line, and since that’s in the seam allowance instead of in a design, it’s totally okay.

All right! See files at if you want to explore.

Accurately tracing and cutting patterns makes the rest of sewing so much easier because you can go by the seam allowances. Since long cuts on fabric turn out to be Not That Scary, I can use this for cutting the pieces to sew together. For fabric that is harder to handle or laser-cut, I can use the laser to cut pieces that I can then pin to the real fabric for hand-cutting (since fabric patterns can be easier to handle than paper). Mwahaha!

Quantified Self: How can you measure freedom?

At a recent Quantified Self Toronto meetup, one of the participants shared his key values (freedom, health, happiness, purpose) and asked for ideas on how to measure freedom. I gave him some quick tips on how I measured:

  • Money:
    • Long-term freedom through a theoretical withdrawal rate: expenses vs net worth and investment returns
    • Short-term freedom for discretionary expenses: opportunity fund for tools and ideas, connection fund for treating people
  • Time, particularly discretionary time (my own interests and projects)

In addition to those two easy metrics, there are a few other things that contribute to a feeling of freedom for me.

2015-03-06b What makes me feel free - What can I measure -- index card #quantified #freedom #independence #feeling

2015-03-06b What makes me feel free – What can I measure – index card #quantified #freedom #independence #feeling

  • How often do I have to wake up to an alarm clock, or can I sleep until I feel well-rested?
  • Am I starting to be stressed because of commitments? Do I have to juggle or cut back?
  • Can I follow the butterflies of my interest/energy, or have I promised to do a specific thing at a specific time?
  • Can I share what I’m learning for free, or am I restricted by agreements or by need?
  • Am I getting influenced by ads to want or buy things that I don’t really need? Do I experience buyer’s remorse, or do things contribute to clutter? Is it easy to remember my decisions or my values in the din?
  • Do I have the space to enjoy a great relationship with W-?
  • Can I make the things I want? Do I have the skills to create or modify things?
  • Am I reacting or responding? How reflexive is my ability to see things in the light that I would like to see them in, and to respond the way I would like to respond?
  • Can I learn about what I’m curious about? Do I use it in real life?
  • Can I make small bets and learn from them?

I think it’s because I tend to think of freedom as freedom from stress and freedom to do things – maybe more precisely, to live according to my choices without having to choose between deeply flawed options. I’m in a safe, rather privileged situation, so I’m not as worried about freedom to live or move or speak or learn; those are more important freedoms, for sure! So with the definition of freedom I have, I feel pretty free. Based on my impressions from conversations with other people, I think I’m probably in the top 10% of freedom in terms of people I know. Or at least a different sort of freedom; I’m more risk-averse than some of my friends are, for example, so they’re freer in that sense.

2015-03-06a How can you measure freedom -- index card #freedom #independence #quantified

2015-03-06a How can you measure freedom – index card #freedom #independence #quantified

If you break down the abstract concept of freedom into different types of freedom, you can figure out which types resonate with you and which ones don’t. You might then be able to think of ways to measure the specific types of freedom you’re curious about, and that will help you get a sense of areas in your life that you may want to tweak.

Philosophy has a lot to say about freedom, so that’s another way to pick up ideas. The biggest freedom, for me – the one I most want to cultivate and keep – is the freedom that comes from choosing how I perceive the world and what I do in response. I like the freedom described in Epictetus’ Discourses. How could I measure this or remind myself about this? Since it’s entirely self-willed, I can keep track of whether I remember to take responsibility for my perceptions and responses and how easy it is to do so. I imagine that as I get better at it, I’ll be more consistent at taking responsibility (even if I realize uncomfortable things about myself) and that I’ll do it with more habit. I can also track the magnitude of things I respond to. I know that I can maintain my tranquility with small events, and I’ll just have to wait and observe my behaviour with larger ones.

What does freedom mean to you? How do you observe or reflect on it?