{"id":333,"date":"2021-09-08T11:54:28","date_gmt":"2021-09-08T15:54:28","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/?p=333"},"modified":"2021-09-08T11:54:28","modified_gmt":"2021-09-08T15:54:28","slug":"lemonbear-molnarrecode","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/lemonbear\/09\/08\/lemonbear-molnarrecode\/","title":{"rendered":"lemonbear-MolnarRecode"},"content":{"rendered":"<p>Molnar &#8220;Searching for Paul Klee&#8221; Observations:<\/p>\n<ol>\n<li>The piece is a grid of many squares<\/li>\n<li>The squares have different things happening inside of them<\/li>\n<li>Sometimes there are sub-rectangles, sub-squares, or sub-triangles within these squares, but never any other subdivisions<\/li>\n<li>There are only diagonal lines drawn with differing densities<\/li>\n<li>These diagonal lines are oriented in different directions<\/li>\n<li>There are also implied curves due to the fact that some of these diagonal lines will vary angles within a subspace<\/li>\n<li>Nearly all of the time there are 2 sub rectangles at differing orientations within a cell<\/li>\n<li>However, there are also (not&#8230; infrequently) triangles composing half a rectangle (these also often come in pairs).<\/li>\n<li>There are sometimes other triangles, like those which occupy half a square and those which are a fourth of the square, but in a different orientation<\/li>\n<li>Often, these half-rectangle triangles meet in the middle. I didn&#8217;t code this super well<\/li>\n<\/ol>\n<p>I made the actual SVG way too big (~20 MB) to upload to WordPress, so here is the <a href=\"https:\/\/drive.google.com\/file\/d\/1Gc4QIqK2Fd2PfCM_cielUlv-6e2CnzOx\/view?usp=sharing\">link<\/a> to download it from Drive.<\/p>\n<p>Here is an (almost) full pixel screenshot:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-449\" src=\"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-08-at-11.35.01-AM-504x480.png\" alt=\"\" width=\"504\" height=\"480\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-08-at-11.35.01-AM-504x480.png 504w, https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-08-at-11.35.01-AM-1024x975.png 1024w, https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-08-at-11.35.01-AM-768x731.png 768w, https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-08-at-11.35.01-AM-1536x1463.png 1536w, https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-08-at-11.35.01-AM-1200x1143.png 1200w, https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-08-at-11.35.01-AM.png 1634w\" sizes=\"(max-width: 504px) 85vw, 504px\" \/><\/p>\n<p>Here is a close up pixel screenshot:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-447\" src=\"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-07-at-8.46.51-PM-640x398.png\" alt=\"\" width=\"640\" height=\"398\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-07-at-8.46.51-PM-640x398.png 640w, https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-07-at-8.46.51-PM-1024x637.png 1024w, https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-07-at-8.46.51-PM-768x478.png 768w, https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-07-at-8.46.51-PM-1200x746.png 1200w, https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/09\/Screen-Shot-2021-09-07-at-8.46.51-PM.png 1396w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p>I actually probably spent more time on this than my line walk (oops). I found it to be a really engaging exercise! I only wrote about 6 observations before getting bored and starting the code, and during the programming process I made way more minute observations than I did while just looking at it (my ten listed observations don&#8217;t encapsulate the full extent of everything I observed and implemented). Here is my code:<\/p>\n<pre>\r\n\/\/ Uses https:\/\/github.com\/zenozeng\/p5.js-svg to export SVG.\r\n\/\/ noprotect\r\nfunction setup() {\r\n  createCanvas(816*4, 1056*4, SVG); \r\n  noLoop(); \r\n}\r\n\r\nfunction makeSubsection(x1, y1, pixelDim, rot, type) {\r\n  var x2 = 0;\r\n  var y2 = 0;\r\n  if (rot == 0) {\r\n    \/\/top\r\n    x2 = x1 + pixelDim;\r\n    y2 = y1 + pixelDim\/2;\r\n  }\r\n  else if (rot == 1) {\r\n    \/\/bottom\r\n    x2 = x1 + pixelDim;\r\n    y1 += pixelDim\/2;\r\n    y2 = y1 + pixelDim\/2;\r\n\r\n  }\r\n  else if (rot == 2) {\r\n    \/\/left\r\n    x2 = x1 + pixelDim\/2;\r\n    y2 = y1 + pixelDim;\r\n  }\r\n  else if (rot == 3) {\r\n    \/\/right\r\n    x1 += pixelDim\/2;\r\n    x2 = x1 + pixelDim\/2;\r\n    y2 = y1 + pixelDim;\r\n  }\r\n  var density = Math.floor(Math.pow(Math.random(), 1) * 12);\r\n  var xMargin = (x2-x1+1)\/density;\r\n  var yMargin = (y2-y1+1)\/density;\r\n  if (type &lt; .75) { \/\/half rectangle\r\n    var direction = Math.floor(Math.random()*2);\r\n    \/\/ console.log(rot);\r\n    \/\/ console.log(x1, y1, x2, y2);\r\n    if (direction == 0) {\r\n      for (var i = x1; i &lt; x2; i+=xMargin) {\r\n        for (var j = y1; j &lt; y2; j+=yMargin) { line(i, j, i+xMargin, j+yMargin); } } } else { for (var i = x2; i &gt; x1; i-=xMargin) {\r\n        for (var j = y1; j &lt; y2; j+=yMargin) {\r\n          line(i, j, i-xMargin, j+yMargin);\r\n        }\r\n      }\r\n    }\r\n    if (rot == 3 &amp;&amp; Math.random() &lt; 0.1) {\r\n      x1 -= pixelDim\/2;\r\n      y2 -= pixelDim\/2;\r\n      xMargin = (x2-x1+1)\/density;\r\n      yMargin = (y2-y1+1)\/density;\r\n      for (var n = 0; n &lt; density; n++) {\r\n        line(x1+n*xMargin, y1, x2-pixelDim\/2, y1+(n+1)*yMargin)\r\n      }\r\n      x1 += pixelDim\/2;\r\n      x2 += pixelDim\/2;\r\n      for (var n = 0; n &lt; density; n++) {\r\n        line(x1+n*xMargin, y2, x2-pixelDim\/2, y1+(n-1)*yMargin)\r\n      }\r\n    }\r\n  }\r\n  else if (type &lt; .9) { \/\/half triangle in half rectangle \r\n    var direction = Math.floor(Math.random()*4);\r\n    if (direction == 0) {\r\n      for (var n = 0; n &lt; density; n++) {\r\n        \/\/upper-right\r\n        line(x1+n*xMargin, y1, x2, y2-n*yMargin);\r\n      }\r\n    }\r\n    else if (direction == 1) {\r\n      for (var n = 0; n &lt; density; n++) {\r\n        \/\/lower-right\r\n        line(x1+n*xMargin, y2, x2, y1+n*yMargin);\r\n      }\r\n    }\r\n    else if (direction == 2) {\r\n      for (var n = 0; n &lt; density; n++) {\r\n        \/\/lower-left\r\n        line(x1, y1+n*yMargin, x2-n*xMargin, y2);\r\n      }\r\n    }\r\n    else if (direction == 3) {\r\n      for (var n = 0; n &lt; density; n++) {\r\n        \/\/upper-left\r\n        line(x2-n*xMargin, y1, x1, y2-n*yMargin);\r\n      }\r\n    }\r\n  }\r\n  else if (type &lt; 1) {\r\n    if (rot == 0) {\r\n      for (var n = 0; n &lt; density; n++) {\r\n        \/\/top\r\n        line(x1+n*xMargin, y1, x2-pixelDim\/2+n*xMargin\/2, y2-n*yMargin);\r\n      }\r\n    }\r\n    else if (rot == 1) {\r\n      for (var n = 0; n &lt; density; n++) {\r\n        \/\/bottom\r\n        line(x1+n*xMargin, y2, x2-pixelDim\/2+n*xMargin\/2, y1+n*yMargin);\r\n      }\r\n    }\r\n    else if (rot == 2) {\r\n      for (var n = 0; n &lt; density; n++) {\r\n        \/\/left\r\n        line(x1, y1+n*yMargin, x2-n*xMargin, y2-pixelDim\/2+n*yMargin\/2);\r\n      }\r\n    }\r\n    else if (rot == 3) {\r\n      for (var n = 0; n &lt; density; n++) {\r\n        \/\/right\r\n        line(x2, y1+n*yMargin, x1+n*xMargin, y2-pixelDim\/2+n*yMargin\/2);\r\n      }\r\n    }  \r\n  }\r\n}\r\n\r\nfunction draw() {\r\n\r\n  var squaresWide = 8.5*4;\r\n  var squaresHigh = 11*4;\r\n  \r\n  var pixelDim = width\/squaresWide;\r\n\r\n  for (var x = 0; x &lt; squaresHigh; x++) {\r\n    for (var y = 0; y &lt; squaresWide; y++) {\r\n      var rot1 = Math.floor(Math.random() * 4);\r\n      var rot2 = (rot1 + Math.floor(Math.random() * 3) + 1)%4;\r\n      console.log(rot1, rot2);\r\n      var type = (Math.random());\r\n      makeSubsection(x*pixelDim, y*pixelDim, pixelDim, rot1, type);\r\n      makeSubsection(x*pixelDim, y*pixelDim, pixelDim, rot2, type);\r\n      \r\n    }\r\n  } \r\n  \/\/ saveSVG(\"molnar_redraw_v3.svg\");\r\n}\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Molnar &#8220;Searching for Paul Klee&#8221; Observations: The piece is a grid of many squares The squares have different things happening inside of them Sometimes there are sub-rectangles, sub-squares, or sub-triangles within these squares, but never any other subdivisions There are only diagonal lines drawn with differing densities These diagonal lines are oriented in different directions &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/lemonbear\/09\/08\/lemonbear-molnarrecode\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;lemonbear-MolnarRecode&#8221;<\/span><\/a><\/p>\n","protected":false},"author":18,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,1],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-json\/wp\/v2\/posts\/333"}],"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\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-json\/wp\/v2\/comments?post=333"}],"version-history":[{"count":2,"href":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-json\/wp\/v2\/posts\/333\/revisions"}],"predecessor-version":[{"id":463,"href":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-json\/wp\/v2\/posts\/333\/revisions\/463"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-json\/wp\/v2\/media?parent=333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-json\/wp\/v2\/categories?post=333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-json\/wp\/v2\/tags?post=333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}