homework 02 - james-bern/CS345 GitHub Wiki



Fasten your seatbelts... This week, we're learning about fasteners (screws and nuts). 💖

We will also continue our exploration of the process of going from a 2D sketch to a 3D triangle mesh.


  • A-
    • 3x assembled boxes in not-black
      • 1x 20x40x40mm box using long screws and exposed nuts
        • NOTE: you'll need to hold the nuts with pliers (end of wire strippers is fine) as you tighten the screws
      • 1x 30x40x40mm box using self-tapped screws
        • NOTE: one can by special "self-tapping" screws, but we don't have any; the machine screws I gave you can work just fine 🙂👍
      • 1x 40x40x40mm box using captive nuts and counterbored screws
        • NOTE: no fasteners should extend outside of the 50x50x20mm
        • NOTE: this box will require support!--be sure to Prepare -> Support -> Support -> Enable support in Bambu Studio or it's gonna sag and make a horrid mess
      • NOTE: make sure you assemble all 4 screws into all your boxes (even if my boxes don't have all their screws)
      • NOTE: match the overall assembled dimensions (specified up) as closely as possible
      • NOTE: match other dimensions approximately (should look fairly similar)
      • NOTE: do NOT measure my boxes (you may measure the screws and nuts)
  • A
    • Choose 1
      • 1x lithophane of not-Jeannie
        • NOTE: you must create this "from scratch" in code (do NOT use a lithophane generator from Google)
        • NOTE: you may use whatever programming language you like (hints are below)
      • 1x 1:4 scale pantograph
        • NOTE: it must work, though doesn't have to work perfectly (i will use it to draw a heart)
  • A+
    • Do both of the above

✨🦄 Hints


First, make sure you understand the rules for a triangle mesh (review the hw00 writeup very carefully).

  • All triangles need to be facing the right way (out).
  • Triangle corners can only touch other corners (NOT the middles of edges.)
  • ...

Next, make sure you have a triangle mesh visualizer you really like (I recommend my new and improved viewer, formerly dxfviewer, which can now also visualize STL's, and draws the backs of triangles in red).

Next, get ready to write a bunch of for loops

The name of the game is incremental development (break the problem down into a bunch of simple steps).

  • First make just a single triangle.
  • Then a square.
  • Then a grid.
  • Then a height field.
  • Then a height field based on a picture.
  • Then add the sides (probably one side at a time).
  • Then add the back.


There are probably a lot of ways to make a revolute joint (pin joint) with the tools we have. None are amazing (a correct solution is to use rotary bearing, which we don't have yet). Nevertheless, here are some ideas:

  • Plastic cylinder rotating freely in plastic hole. In order to keep it from falling out, you can make the pin out of two pieces that you screw together so it has "caps," and looks kind of like an I from the side. Big cylinder is probably better.
  • (This approach feels sus, but I bet it sort of works.) Screw rotating freely in plastic hole (some sort of jam nut approach can serve as the "cap" but still permit free rotation about the pin (screw). (You don't want to bolt the links together, or they won't be able to spin.)

👀 Spoilers

Jim's Cheatsheet
  • M3 screws

    • tap drill: 2.5mm
    • through-hole: 3.4mm
    • clearance for head of socket head cap screw: 6mm
  • M3 hex nut captive in PLA -- exact width of nut (height maybe a little deeper)

  • PLA

    • min wall thickness: 2.0mm
    • offset for slip fit 0.1mm
Jim's Jeannie Mesh


⚠️ **GitHub.com Fallback** ⚠️