{"id":1474,"date":"2021-10-05T19:01:54","date_gmt":"2021-10-05T23:01:54","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/?p=1474"},"modified":"2021-10-05T22:58:39","modified_gmt":"2021-10-06T02:58:39","slug":"sweetcorn-tilingpattern","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/sweetcorn\/10\/05\/sweetcorn-tilingpattern\/","title":{"rendered":"sweetcorn-TilingPattern"},"content":{"rendered":"<p>For my project, I picked up an old project of mine which generated childrens&#8217;-story-esque faces. I worked on this before becoming familiar with Shapely, so I had hadn&#8217;t implemented any sort of filling. I brought this old code from JavaScript to python and converted everything into Shapely geometries. Below is some documentation from the old project.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-1475\" src=\"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/10\/head-gen-prog-3.gif\" alt=\"\" width=\"539\" height=\"539\" \/><\/p>\n<p>With my work last week figuring out how to plot on the USCutter MH871-MK2, I figured it would be lovely to generate and plot human-sized figures.<\/p>\n<p>The hair and shoes are filled with simple hatching, but the shirt has a pattern build out of Hershey fonts. Using this <a href=\"https:\/\/github.com\/apshu\/HersheyFonts\">python hershey font library<\/a>, I randomly choose symbol characters and place them between arrangements of {}, \/\\, or two opposite-facing integral symbols. I use shapely to crop all the fills to their respective polygons. Below is a gif containing a few generated .svg&#8217;s<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-1476\" src=\"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/10\/final_people.gif\" alt=\"\" width=\"325\" height=\"920\" \/><\/p>\n<p>A video of the plot in progress:<\/p>\n<p><iframe loading=\"lazy\" title=\"pattern plotting closeup\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/mDCtXsQDQ0U?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p>And some plotted results:<\/p>\n<div id='gallery-1' class='gallery galleryid-1474 gallery-columns-2 gallery-size-medium'><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon portrait'>\n\t\t\t\t<a href='https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/sweetcorn\/10\/05\/sweetcorn-tilingpattern\/img_1236\/'><img width=\"411\" height=\"480\" src=\"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/10\/IMG_1236-411x480.jpg\" class=\"attachment-medium size-medium\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/10\/IMG_1236-411x480.jpg 411w, https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/10\/IMG_1236-877x1024.jpg 877w, https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/10\/IMG_1236-768x896.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/10\/IMG_1236-1316x1536.jpg 1316w, https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/10\/IMG_1236-1755x2048.jpg 1755w, https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/10\/IMG_1236-1200x1400.jpg 1200w\" sizes=\"(max-width: 411px) 85vw, 411px\" \/><\/a>\n\t\t\t<\/div><\/figure><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon portrait'>\n\t\t\t\t<a href='https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/sweetcorn\/10\/05\/sweetcorn-tilingpattern\/img_1237\/'><img width=\"209\" height=\"480\" src=\"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/10\/IMG_1237-209x480.jpg\" class=\"attachment-medium size-medium\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/10\/IMG_1237-209x480.jpg 209w, https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/10\/IMG_1237-445x1024.jpg 445w, https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/10\/IMG_1237-768x1767.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/10\/IMG_1237-667x1536.jpg 667w, https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/10\/IMG_1237-890x2048.jpg 890w, https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/10\/IMG_1237-1200x2762.jpg 1200w, https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/10\/IMG_1237-scaled.jpg 1112w\" sizes=\"(max-width: 209px) 85vw, 209px\" \/><\/a>\n\t\t\t<\/div><\/figure>\n\t\t<\/div>\n\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For my project, I picked up an old project of mine which generated childrens&#8217;-story-esque faces. I worked on this before becoming familiar with Shapely, so I had hadn&#8217;t implemented any sort of filling. I brought this old code from JavaScript to python and converted everything into Shapely geometries. Below is some documentation from the old &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/sweetcorn\/10\/05\/sweetcorn-tilingpattern\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;sweetcorn-TilingPattern&#8221;<\/span><\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[14],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-json\/wp\/v2\/posts\/1474"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-json\/wp\/v2\/comments?post=1474"}],"version-history":[{"count":4,"href":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-json\/wp\/v2\/posts\/1474\/revisions"}],"predecessor-version":[{"id":1483,"href":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-json\/wp\/v2\/posts\/1474\/revisions\/1483"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-json\/wp\/v2\/media?parent=1474"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-json\/wp\/v2\/categories?post=1474"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-json\/wp\/v2\/tags?post=1474"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}