Where skillset meets mindset.

  • Home
  • Projects
    • Project Summaries
    • Planning
  • Students
    • A High Tech High Student
    • Featurettes
  • Sponsorship & Donations
  • General Resources
    • Shop Tools
      • Hand Tools
      • Power Tools
      • Tool Safety
    • Radio Control Hobbies
    • Laser Cutting
    • Automata
    • Gears & Mechanisms
    • Machining
    • Physics Resources
    • Stained Glass
    • Tips & Guides
    • Electronics
      • Paper Circuits
      • General Electronics
      • Arduino Hardware
    • Coding
      • Processing
      • Arduino
      • Google Apps Script
      • Troubleshooting
  • Educator Resources
    • Project Design Guide
    • Musings
    • Project Ideas
  • GRITLab
    • General
    • Adversity by Design
    • GRITLab Media
    • GRIT Case Study
    • GRITLab Expansion Plan
  • MAKESafe
  • About
    • Scott Swaaley
    • HTH Cover Letter
    • Professional Resume
    • Professional Projects

Apr 02 2017

Finding the Center of Gravity (Centroid) of a Polygon in Adobe Illustrator

I’m working on a project where I want to make an image of a greyhound with a mosaic of sheet metal pieces. To give it some liveliness, I wanted the sheet metal pieces to be loosely suspended and able to move with the breeze. As I prepared files for the CNC machine, I quickly realized that I would need to find the center of gravity for each of the 63 individual parts … which is not something I wanted to do by hand. I searched for ways to do it in Illustrator and while Illustrator did have two distinct “centers” for different kinds of shapes, neither was the actual centroid. The only “easy” way was to export individual shapes from illustrator, import each shape into CAD software, then back to Illustrator. No way – that process would be too laborious and any design changes would require me to repeat the whole process. I then found an equation that generally described the center of gravity of an irregular polygon, taught myself how to script in Adobe Illustrator, and voila!

Print Friendly, PDF & Email

Written by scottswaaley · Categorized: Musings, Professional Development

Comments

  1. Andrew Glinwood says

    July 28, 2017 at 11:37 am

    shame this doesn’t work for compound paths, I have a large object with a hole in the middle (a wreath) and need to find the centre.

    Reply
    • scottswaaley says

      August 6, 2017 at 10:24 pm

      Could you just release the compound path to do it?

      Reply

Leave a Reply Cancel reply

  • About GRITLab
  • Contact

Copyright © 2021 · Altitude Pro Theme on Genesis Framework · WordPress · Log in