{"id":486,"date":"2021-09-08T13:41:01","date_gmt":"2021-09-08T17:41:01","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/?p=486"},"modified":"2021-09-08T13:41:01","modified_gmt":"2021-09-08T17:41:01","slug":"sapeck-linewalk","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/sapeck\/09\/08\/sapeck-linewalk\/","title":{"rendered":"sapeck-LineWalk"},"content":{"rendered":"<p>SVG:<a href=\"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/09\/sapeck-LineWalk.svg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-511\" src=\"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/09\/sapeck-LineWalk.svg\" alt=\"\" width=\"1056\" height=\"816\" \/><\/a>PNG (screenshot):<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-518\" src=\"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/09\/sapeck-LineWalk.png\" alt=\"\" width=\"1056\" height=\"816\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/09\/sapeck-LineWalk.png 1056w, https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/09\/sapeck-LineWalk-621x480.png 621w, https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/09\/sapeck-LineWalk-1024x791.png 1024w, https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-content\/uploads\/2021\/09\/sapeck-LineWalk-768x593.png 768w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p>I began with a single curve and moving it in a circle around the center. I then modified the curve to go in and out of the circle to different radii. Next I flipped the in and out movement to be a back and forth movement. Lastly, I added some twist to every other point and exaggerated these twists and extensions.<\/p>\n<p>This assignment pushed my ability to completely understand my code as I was writing it. When I hit a happy accident, I made sure to really think through how my change had affected the output.<\/p>\n<pre>\/*\r\n* sapeck_LineWalk.pde\r\n* A drawing consisting of a single continuous line\r\n* Originally created by sapeck 2021-09-07\r\n* CMU 60-428 F21 Drawing With Machines\r\n*\/\r\n\r\nimport processing.svg.*;\r\n\r\nfloat[] radii = { .5, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1 };\r\nint MULTIPLIER = 30;\r\nint OUTER = 10;\r\nint OUTER_TWIST = 50;\r\nint DIVISIONS = radii.length * MULTIPLIER;\r\nint SMALLER_COORD = min(width, height);\r\n\r\nvoid setup() {\r\nsize(1056, 816); \/\/ Letter: 11\"x8.5\" at 96 DPI.\r\nnoLoop();\r\n}\r\n\r\nvoid draw() {\r\nbackground(255);\r\nbeginRecord(SVG, \"sapeck-LineWalk.svg\");\r\n\r\nstroke(0);\r\nnoFill(); \/\/ Don't create duplicate shapes!\r\n\r\nbeginShape();\r\n\r\nint current_radius = 0;\r\n\r\nfor (int i = 0; i &lt; (2*DIVISIONS)+3; i++) {\r\nfloat radius = OUTER;\r\nif (i % 2 == 0) radius = radii[current_radius];\r\nfloat offset = 0;\r\nif (radius != OUTER) offset -= ((OUTER - radii[current_radius])\/max(radii)) * MULTIPLIER*2*PI\/DIVISIONS;\r\nfloat theta = i*2*PI\/DIVISIONS + offset;\r\nfloat scale =(radii[current_radius]*SMALLER_COORD\/2);\r\nif (radii[current_radius] == max(radii)) theta -= OUTER_TWIST*2*PI\/DIVISIONS;\r\nfloat x = width\/2 - scale*cos(theta);\r\nfloat y = height\/2 - scale*sin(theta);\r\ncurveVertex(x, y);\r\ncurrent_radius++;\r\nif (current_radius == radii.length) current_radius = 0;\r\n}\r\n\r\nendShape(CLOSE);\r\nendRecord();\r\nsaveFrame(\"sapeck-LineWalk.png\");\r\n}\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SVG:PNG (screenshot): I began with a single curve and moving it in a circle around the center. I then modified the curve to go in and out of the circle to different radii. Next I flipped the in and out movement to be a back and forth movement. Lastly, I added some twist to every &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/sapeck\/09\/08\/sapeck-linewalk\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;sapeck-LineWalk&#8221;<\/span><\/a><\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-json\/wp\/v2\/posts\/486"}],"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\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-json\/wp\/v2\/comments?post=486"}],"version-history":[{"count":4,"href":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-json\/wp\/v2\/posts\/486\/revisions"}],"predecessor-version":[{"id":536,"href":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-json\/wp\/v2\/posts\/486\/revisions\/536"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-json\/wp\/v2\/media?parent=486"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-json\/wp\/v2\/categories?post=486"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-428\/f2021\/wp-json\/wp\/v2\/tags?post=486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}