Saturday, January 22, 2011

A Designer's Guide to Understanding Polygon Point Order when Using InDesign's Corner Effects Script

This experiment came about out of a need to have a rounded rectangle text frame where only the two bottom corners were rounded. Before InDesign CS5, when we wanted rounded corners, we had to either:
  • Round them ourselves using the convert anchor point tool
  • Round them in Illustrator using the corner effects or one of Mordy's nifty rounded rectangle tricks (and then paste into InDesign as a path) or
  • Use InDesign's built-in Corner Effects Script (available in several scripting languages to suit any platform)
This script doesn't use live corner effects (like CS5 does), but actually edits the corner anchor points.

The script is less than intuitive. You have to know which points (first, second, third, and fourth) correspond to which point on the rectangle. You can find this information in a book on InDesign scripting (a couple of which I have read), but those books are a little dry for average designer. So here is a designer's simple guide to understanding polygon point order. Hopefully it will help reduce your trial and error when using this script.

It turns out that the numbering starts somewhere in the top (depending on the number of sides in your polygon) and goes counterclockwise. So here are the patterns I found when working with this script:
  • Polygons with odd number of sides (Triangles, pentagons, and whatever a seven-sided polygon is called): first point is at the TOP
  • 4-sided polygons: (Squares and rectangles): first point is at the TOP LEFT
  • Polygons with even sides starting with at least 6 sides: the first point is at the TOP RIGHT.

I know for those people using CS5 (and thus have Live Corner Effects), this information maybe isn't that important, but for anyone using CS4 or below, perhaps this information will be useful. Happy rounding!