This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Center of Gravity Finder | |
This script will find the center of gravity (centroid) of all closed paths in the selection set. It was built for a specific purpose so does not have much error | |
handling. For example, if you get errors it may be the result of the selection set containing compound shapes or a self-intersecting polygon. | |
References for the math: | |
http://paulbourke.net/geometry/polygonmesh/ (Calculating the area and centroid of a polygon) | |
https://en.wikipedia.org/wiki/Centroid#Centroid_of_polygon | |
Save this file with a jsx extension and place in your Illustrator/Presets/en_US/Scripts folder. You can then access it from the File > Scripts menu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MY_DOMAIN = "YOUR_DOMAIN" | |
const START_PAGE = "URL_TO_NOTION_LANDING_PAGE" | |
addEventListener('fetch', event => { | |
event.respondWith(fetchAndApply(event.request)) | |
}) | |
const corsHeaders = { | |
"Access-Control-Allow-Origin": "*", | |
"Access-Control-Allow-Methods": "GET, HEAD, POST,PUT, OPTIONS", |