{"id":13115,"date":"2016-07-13T17:48:00","date_gmt":"2016-07-13T21:48:00","guid":{"rendered":"http:\/\/scruss.com\/blog\/?p=13115"},"modified":"2016-07-13T17:48:00","modified_gmt":"2016-07-13T21:48:00","slug":"all-your-centroids","status":"publish","type":"post","link":"https:\/\/scruss.com\/blog\/2016\/07\/13\/all-your-centroids\/","title":{"rendered":"all your centroids"},"content":{"rendered":"<p>As <a href=\"http:\/\/scruss.com\/blog\/2012\/01\/08\/archival-snarkival\/\">Side Door sign<\/a> v3 seemed to have fallen off, I needed to make a new one. With access to a laser cutter, I can make really permanent things now, so I designed this:<\/p>\n<p><a href=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/07\/side_door-cut-lc.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-13116\" src=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/07\/side_door-cut-lc.jpg\" alt=\"side_door-cut-lc\" width=\"512\" height=\"259\" srcset=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/07\/side_door-cut-lc.jpg 512w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/07\/side_door-cut-lc-160x81.jpg 160w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/07\/side_door-cut-lc-320x162.jpg 320w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/a>Yes, that&#8217;s a pointy thing filled with pointy things (all without thumbs, you&#8217;ll notice) and labelled with Cooper Black. Irony, much? <em>Fe<\/em>!<\/p>\n<p>In order to get the sign to hang correctly, I needed to work out the centroid of the pointy outline. <a href=\"https:\/\/github.com\/thedatachef\/inkscape-centroid\">thedatachef\/inkscape-centroid: Centroids for Inkscape paths and shapes<\/a> to the rescue! Well, kinda. First off, the installer had a bug that said a Ruby file was a dependency when the plugin was in Python. So I forked the repo, made the change, tested it, and issued a pull request. So yay, working centroid calculations in Inkscape!<\/p>\n<p>Secondly, the plugin only works well for simple shapes, like these:<\/p>\n<p><a href=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/07\/Screenshot-from-2016-07-13-17-15-54.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-13117\" src=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/07\/Screenshot-from-2016-07-13-17-15-54-320x116.jpg\" alt=\"Screenshot from 2016-07-13 17-15-54\" width=\"320\" height=\"116\" srcset=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/07\/Screenshot-from-2016-07-13-17-15-54-320x116.jpg 320w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/07\/Screenshot-from-2016-07-13-17-15-54-160x58.jpg 160w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/07\/Screenshot-from-2016-07-13-17-15-54.jpg 727w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a>But compound shapes? Not so well:<\/p>\n<p><a href=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/07\/Screenshot-from-2016-07-13-17-42-31.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-13118 size-medium\" src=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/07\/Screenshot-from-2016-07-13-17-42-31-201x320.jpg\" alt=\"Screenshot from 2016-07-13 17-42-31\" width=\"201\" height=\"320\" srcset=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/07\/Screenshot-from-2016-07-13-17-42-31-201x320.jpg 201w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/07\/Screenshot-from-2016-07-13-17-42-31-100x160.jpg 100w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2016\/07\/Screenshot-from-2016-07-13-17-42-31.jpg 334w\" sizes=\"auto, (max-width: 201px) 100vw, 201px\" \/><\/a>I guess it doesn&#8217;t like the negative moments generated by the holes, and does its own thing. Oh well.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As Side Door sign v3 seemed to have fallen off, I needed to make a new one. With access to a laser cutter, I can make really permanent things now, so I designed this: Yes, that&#8217;s a pointy thing filled with pointy things (all without thumbs, you&#8217;ll notice) and labelled with Cooper Black. Irony, much? [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7],"tags":[2999,2795,2294,2177,2540],"class_list":["post-13115","post","type-post","status-publish","format-standard","hentry","category-computers-suck","tag-centroid","tag-github","tag-inkscape","tag-pointy","tag-python"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pQNZZ-3px","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/13115","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/comments?post=13115"}],"version-history":[{"count":1,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/13115\/revisions"}],"predecessor-version":[{"id":13119,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/13115\/revisions\/13119"}],"wp:attachment":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/media?parent=13115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/categories?post=13115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/tags?post=13115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}