Articles Tagged: 2d

Most recent displayed first:

  • Polygon Clipping (Part 2)

    My previous polygon clipping tutorial dove into the Greiner-Hormann clipping algorithm. Unfortunately, this algorithm fails at common cases… so let’s revist the problem and try again.

    The F. Martinez 2008 algorithm handles coincident edges (unlike Greiner-Hormann), but it still has some minor goofiness. Let’s solve this problem once and for all.

    ...read more

  • Polygon Clipping (Part 1)

    Polygon clipping is an interesting problem: how do you intersect, union, or diff two polygons?

    The Greiner-Hormann clipping algorithm is quite beautiful and intuitive. Let’s dissect it and take a look.

    ...read more

  • Two-Dimensional Bin Packing

    Two-dimensional bin packing turns out to be quite a pickle.

    I was introduced to the problem as a 13 year old. My Dad’s friend, Keith, noticed I was taking a knack to programming, and wanted to see if I could help him. Keith was (and still is) a carpenter.

    Keith wanted me to write a program where he could input a list of shapes, and the program would figure out the best way to cut a board of wood into those shapes, while minimizing scrap wood. Seems reasonable.

    My 13 year old mind quickly exploded… I couldn’t figure out one simple, obvious way to do it. Eventually I gave up, to my ego’s dismay (and Keith’s disappointment!).

    ...read more