{"id":73069,"date":"2022-09-25T18:00:55","date_gmt":"2022-09-25T22:00:55","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/?p=73069"},"modified":"2022-09-25T18:00:55","modified_gmt":"2022-09-25T22:00:55","slug":"project-04-string-art-14","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/25\/project-04-string-art-14\/","title":{"rendered":"Project-04: String Art"},"content":{"rendered":"<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<html><body><p><em>Graham Murtha<\/em><\/p>\n\n\n\n<p><em>Section A<\/em><\/p>\n\n\n\n<p>This is the &ldquo;complimentary eye of the storm&rdquo;.  I used 4 different variations of a base string code, each with different stroke weights and stroke colors for more variation.  The numlines is set to 25.  <\/p>\n\n\n\n<div><a class=\"p5_sketch_link\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/sketch-389.js\" data-width=\"400\" data-height=\"600\">sketch<\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"400\" height=\"600\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">\/\/ gmurtha Graham Murtha\n\/\/ Section A\n\nvar dx1 = 0;\nvar dy1 = 0;\nvar dx2 = 0;\nvar dy2 = 0;\nvar numLines =25;\n\nfunction setup() {\n    createCanvas(300, 400);\n    background(80,0,80); \/\/ dark purple\n\n    for(var a = 0; a &lt;= 360; a += 80){ \/\/a = angle\n        translate(width\/2,height\/2);\n        line(0,125,25,-75); \/\/ base line 1\n        line(25,25,125,0); \/\/base line 2\n        dx1 = (25-0)\/numLines; \/\/calculates difference between each string\n        dy1 = (-75-125)\/numLines; \/\/calculates difference between each string\n        dx2 = (125-25)\/numLines; \/\/calculates difference between each string \n        dy2 = (0-25)\/numLines; \/\/calculates difference between each string\n        rotate(radians(a));\n    }\n\n}\n\nfunction draw() {\n    fill(255,255,200) \/\/ bright yellow\n        circle(width\/2,height\/2,25);\n    fill(80,0,80); \/\/background color\n    circle(width\/2,height\/2,10);\n\n    translate(width\/2,height\/2);\n    stroke(255,255,255); \/\/white\n    strokeWeight(1);\n    for(var a = 0; a &lt;= 360; a += 30){ \/\/ 12 shape variations fit\n        var x1 = 125;\n        var y1 = 75;\n        var x2 = 75;\n        var y2 = 125;\n        for (var i = 0; i &lt;= numLines; i ++) { \/\/loops 25 times\n            line(x1, y1, x2, y2);\n            x1 += dx1;\n            y1 += dy1;\n            x2 += dx2;\n            y2 += dy2;\n        }\n    rotate(radians(a));\n    }\n\n    stroke(255,255,100); \/\/yellow\n    strokeWeight(3);\n    for(var a = 0; a &lt;= 360; a += 45){ \/\/ 8 shape variations fit\n        var x1 = 125;\n        var y1 = 175;\n        var x2 = 175;\n        var y2 = 125;\n        for (var i = 0; i &lt;= numLines; i ++) {  \/\/loops 25 times\n            line(x1, y1, x2, y2);\n            x1 += dx1;\n            y1 += dy1;\n            x2 += dx2;\n            y2 += dy2;\n        }\n    rotate(radians(a));\n    }\n\n    stroke(200,0,200); \/\/purple\n    strokeWeight(2);\n    for(var a = 0; a &lt;= 360; a += 60){ \/\/six shape variations fit\n        var x1 = 125;\n        var y1 = -125;\n        var x2 = 75;\n        var y2 = 75;\n        for (var i = 0; i &lt;= numLines; i ++) {  \/\/loops 25 times\n            line(x1, y1, x2, y2);\n            x1 += dx1;\n            y1 += dy1;\n            x2 += dx2;\n            y2 += dy2;\n        }\n    rotate(radians(a));\n    }\n\n    \n    stroke(255,150,255); \/\/bright purple\n    strokeWeight(1);\n    for(var a = 0; a &lt;= 360; a += 90){ \/\/four shape variations fit\n        var x1 = 0;\n        var y1 = 125;\n        var x2 = 125;\n        var y2 = 0;\n        for (var i = 0; i &lt;= numLines; i ++) {  \/\/loops 25 times\n            line(x1, y1, x2, y2);\n            x1 += dx1;\n            y1 += dy1;\n            x2 += dx2;\n            y2 += dy2;\n        }\n    rotate(radians(a));\n    }\n\n}<\/code><\/pre><\/div><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>Graham Murtha Section A This is the &ldquo;complimentary eye of the storm&rdquo;. I used 4 different variations of a base string code, each with different stroke weights and stroke colors for more variation. The numlines is set to 25. sketch \/\/ gmurtha Graham Murtha \/\/ Section A var dx1 = 0; var dy1 = 0; &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/25\/project-04-string-art-14\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project-04: String Art&#8221;<\/span><\/a><\/p>\n","protected":false},"author":748,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[102,1],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/73069"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/users\/748"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/comments?post=73069"}],"version-history":[{"count":2,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/73069\/revisions"}],"predecessor-version":[{"id":73077,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/73069\/revisions\/73077"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/media?parent=73069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/categories?post=73069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/tags?post=73069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}