{"id":72741,"date":"2022-09-24T16:34:21","date_gmt":"2022-09-24T20:34:21","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/?p=72741"},"modified":"2022-09-24T16:34:21","modified_gmt":"2022-09-24T20:34:21","slug":"project-04-string-art-7","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/24\/project-04-string-art-7\/","title":{"rendered":"Project 04 &#8211; 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>This project consists of abstract string art made with multiple stacking of straight lines, creating an illusion of circles that look like octagons. The most challenging part of this project is organizing the direction the lines are going. <\/p> <div><a class=\"p5_sketch_link\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/09\/sketch-348.js\" data-width=\"400\" data-height=\"300\">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=\"300\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">\/\/Jenny Wang\n\/\/Section B\n\nvar dx1;\nvar dy1;\nvar dx2;\nvar dy2;\nvar dx3;\nvar dy3;\nvar dx4;\nvar dy4;\nvar dx5;\nvar dy5;\nvar dx6;\nvar dy6;\nvar dx7;\nvar dy7;\nvar dx8;\nvar dy8;\nvar numLines = 15\n\n\nfunction setup() {\n\n    createCanvas(400, 300);\n    background(\"black\");\n\n    var cx = width\/2 \/\/center x\n    var cy = height\/2 \/\/center y\n    \/\/draw ellipse\n    noStroke();\n    fill(110);\n    ellipse(cx,cy,110,110);\n    fill(180);\n    ellipse(cx,cy,80,80);\n    fill(230);\n    ellipse(cx,cy,50,50);\n\n    stroke(\"blue\")\n    line(cx,cy,width\/2,0);\/\/line 1 \n    line(cx,cy, width, height\/2);\/\/line2\n    line(cx,cy,width\/2,height);\/\/line 3\n    line(cx,cy, 0,height\/2);\/\/line4\n\n    \/\/Q1\n    dx1 = (cx-cx)\/numLines;\n    dy1 = (cy-0)\/numLines;\n    dx2 = (width-cx)\/numLines;\n    dy2 = (cy-cy)\/numLines;\n\n    \/\/Q2\n    dx3 = (cx-cx)\/numLines;\n    dy3 = (cy-height)\/numLines;\n    dx4 = (width-cx)\/numLines;\n    dy4 = (cy-cy)\/numLines;\n\n    \/\/Q3\n    dx5 = (cx-cx)\/numLines;\n    dy5 = (cy-height)\/numLines;\n    dx6 = (0-cx)\/numLines;\n    dy6 = (cy-cy)\/numLines;\n\n    \/\/Q4\n    dx7 = (cx-cx)\/numLines;\n    dy7 = (cy-0)\/numLines;\n    dx8 = (0-cy)\/numLines;\n    dy8 = (cy-cy)\/numLines;\n}\n\nfunction draw() {\n    \/\/Q1.1\n    var x1 = width\/2;\n    var y1 = 0;\n    var x2 = width\/2;\n    var y2 = height\/2;\n    for (var i = 0; i &lt;= numLines; i += 1) {\n        stroke(\"lightblue\")\n        line(x1, y1, x2, y2);\n        x1 += dx1;\n        y1 += dy1;\n        x2 += dx2;\n        y2 += dy2;\n    }\n\n    \/\/Q2.1\n    var x3 = width\/2;\n    var y3 = height;\n    var x4 = width\/2;\n    var y4 = height\/2;\n    for (var i = 0; i &lt;= numLines; i += 1) {\n        stroke(\"pink\")\n        line(x3, y3, x4, y4);\n        x3 += dx3;\n        y3 += dy3;\n        x4 += dx4;\n        y4 += dy4;\n    }\n    \/\/Q2.2\n    var x3 = width;\n    var y3 = height\/2;\n    var x4 = width\/2;\n    var y4 = height\/2;\n    for (var i = 0; i &lt;= numLines; i += 1) {\n        stroke(\"white\")\n        line(x3, y3, x4, y4);\n        x3 += dx3;\n        y3 += dy3;\n        x4 += dx4;\n        y4 += dy4;\n    }\n    \/\/Q2.3\n    var x3 = 0;\n    var y3 = height\/2;\n    var x4 = width\/2;\n    var y4 = height\/2;\n    for (var i = 0; i &lt;= numLines; i += 1) {\n        stroke(\"grey\")\n        line(x3, y3, x4, y4);\n        x3 += dx3;\n        y3 += dy3;\n        x4 += dx4;\n        y4 += dy4;\n    }\n\n    \/\/Q3.1\n    var x5 = width\/2;\n    var y5 = height;\n    var x6 = width\/2;\n    var y6 = height\/2;\n    for (var i = 0; i &lt;= numLines; i += 1) {\n        stroke(\"lightgreen\")\n        line(x5, y5, x6, y6);\n        x5 += dx5;\n        y5 += dy5;\n        x6 += dx6;\n        y6 += dy6;\n    }\n    \/\/Q3.2\n    var x5 = 0;\n    var y5 = height\/2;\n    var x6 = width\/2;\n    var y6 = height\/2;\n    for (var i = 0; i &lt;= numLines; i += 1) {\n        stroke(\"white\")\n        line(x5, y5, x6, y6);\n        x5 += dx5;\n        y5 += dy5;\n        x6 += dx6;\n        y6 += dy6;\n    }\n    \/\/Q3.3\n    var x5 = width;\n    var y5 = height\/2;\n    var x6 = width\/2;\n    var y6 = height\/2;\n    for (var i = 0; i &lt;= numLines; i += 1) {\n        stroke(\"grey\")\n        line(x5, y5, x6, y6);\n        x5 += dx5;\n        y5 += dy5;\n        x6 += dx6;\n        y6 += dy6;\n    }\n\n    \/\/Q4.1\n    var x7 = width\/2;\n    var y7 = 0;\n    var x8 = width\/2;\n    var y8 = height\/2;\n    for (var i = 0; i &lt;= numLines; i += 1) {\n        stroke(224,199,166)\n        line(x7, y7, x8, y8);\n        x7 += dx7;\n        y7 += dy7;\n        x8 += dx8;\n        y8 += dy8;\n    }\n \n    noLoop();\n}\n<\/code><\/pre><\/div><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>This project consists of abstract string art made with multiple stacking of straight lines, creating an illusion of circles that look like octagons. The most challenging part of this project is organizing the direction the lines are going. sketch \/\/Jenny Wang \/\/Section B var dx1; var dy1; var dx2; var dy2; var dx3; var dy3; &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/09\/24\/project-04-string-art-7\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 04 &#8211; String Art&#8221;<\/span><\/a><\/p>\n","protected":false},"author":769,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[102,56],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/72741"}],"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\/769"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/comments?post=72741"}],"version-history":[{"count":1,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/72741\/revisions"}],"predecessor-version":[{"id":72744,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/72741\/revisions\/72744"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/media?parent=72741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/categories?post=72741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/tags?post=72741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}