{"id":488,"date":"2022-02-01T04:35:53","date_gmt":"2022-02-01T04:35:53","guid":{"rendered":"https:\/\/handandmachine.org\/classes\/computational_fabrication\/?p=488"},"modified":"2022-02-01T04:35:54","modified_gmt":"2022-02-01T04:35:54","slug":"small-assignment-2-ben-liu","status":"publish","type":"post","link":"https:\/\/handandmachine.org\/classes\/computational_fabrication\/2022\/02\/01\/small-assignment-2-ben-liu\/","title":{"rendered":"Small Assignment 2 &#8211; Ben Liu"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\" id=\"part-1-p0lar-plot\">Part 1: P0lar Plot<\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"800\" src=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Polar.jpg\" alt=\"\" class=\"wp-image-491\" srcset=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Polar.jpg 800w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Polar-300x300.jpg 300w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Polar-150x150.jpg 150w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Polar-768x768.jpg 768w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Polar-575x575.jpg 575w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Polar-380x380.jpg 380w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">For this plot, I used lines placed in a circular pattern, with a line connecting each to the previously drawn line. Each line is a random length and grey color. I originally intended to make the pattern more uniform, but I forgot about the fact that Processing&#8217;s trig functions use radians instead of degrees so I ended up with this pattern, which I think looks much more interesting and chaotic. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"part-2-centered-circle\">Part 2: Centered Circle<\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"800\" src=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Circle-1.jpg\" alt=\"\" class=\"wp-image-493\" srcset=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Circle-1.jpg 800w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Circle-1-300x300.jpg 300w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Circle-1-150x150.jpg 150w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Circle-1-768x768.jpg 768w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Circle-1-575x575.jpg 575w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Circle-1-380x380.jpg 380w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This plot is just a simple circle around a turtle, using its drawTurtle() method to show the turtle. To do this, my program finds the circumference of the circle, then moves the turtle around it 1 degree at a time. Technically, it&#8217;s actually a 360-sided polygon with circumference\/360 length sides. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"part-3-flower\">Part 3: Flower<\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"800\" src=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Flower_11.jpg\" alt=\"\" class=\"wp-image-497\" srcset=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Flower_11.jpg 800w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Flower_11-300x300.jpg 300w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Flower_11-150x150.jpg 150w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Flower_11-768x768.jpg 768w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Flower_11-575x575.jpg 575w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Flower_11-380x380.jpg 380w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Flower with 11 petals<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"800\" src=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Flower.jpg\" alt=\"\" class=\"wp-image-498\" srcset=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Flower.jpg 800w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Flower-300x300.jpg 300w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Flower-150x150.jpg 150w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Flower-768x768.jpg 768w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Flower-575x575.jpg 575w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Flower-380x380.jpg 380w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Flower with 20 petals<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">As you can probably tell, these flowers are a little bit off. I ran into some issues with calculating the petals&#8217; locations, which I think is caused by rounding errors. I started with using a &#8220;reference circle&#8221; for the petals, using a fixed radius and dividing it up by the requested number of petals. Then each petal is made of one length of r (radius), a semicircle (using the same technique as in part 2), then another length of r. I tried debugging this for a long time, and it seems like my math should be correct, but unfortunately my program always generates slightly offset petals.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"part-4-turtle-drawings\">Part 4: Turtle Drawings<\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"800\" src=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Turtle_1.jpg\" alt=\"\" class=\"wp-image-501\" srcset=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Turtle_1.jpg 800w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Turtle_1-300x300.jpg 300w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Turtle_1-150x150.jpg 150w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Turtle_1-768x768.jpg 768w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Turtle_1-575x575.jpg 575w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Turtle_1-380x380.jpg 380w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Image 1<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This first turtle-generated drawing is based on some of the images we went over in class. This is a simple loop of one move forward and one turn right, but this has very small increments to the length of each run and moderate increases to the angle of each turn. What&#8217;s interesting about this pattern, though, is that after run lengths go over ~150, the pattern &#8220;destabilizes&#8221; and starts to go all over the place. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"800\" src=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Turtle_2.jpg\" alt=\"\" class=\"wp-image-502\" srcset=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Turtle_2.jpg 800w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Turtle_2-300x300.jpg 300w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Turtle_2-150x150.jpg 150w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Turtle_2-768x768.jpg 768w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Turtle_2-575x575.jpg 575w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Turtle_2-380x380.jpg 380w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Image 2<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This drawing comes from experimenting with L-Systems. I was playing around with generating hexagonal shapes, and one of the iterations came out looking like this. I think it&#8217;s neat because it shows a clear spiral pattern, but with rough geometric shapes instead of a smooth curve. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"800\" src=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Turtle_3.jpg\" alt=\"\" class=\"wp-image-503\" srcset=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Turtle_3.jpg 800w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Turtle_3-300x300.jpg 300w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Turtle_3-150x150.jpg 150w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Turtle_3-768x768.jpg 768w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Turtle_3-575x575.jpg 575w, https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/Turtle_3-380x380.jpg 380w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Image 3<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This last image comes from experimenting with the polygonHalt() method defined in class. It consists of 100 polygons that progressively decrease in size via angle, ie. the first polygon has 360 sides, then 180 sides, 120, 90, etc.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Link to my code: <a href=\"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/BenLiuSA2.zip\">https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-content\/uploads\/2022\/02\/BenLiuSA2.zip<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Part 1: P0lar Plot For this plot, I used lines placed in a circular pattern, with a line connecting each to the previously drawn line. Each line is a random length and grey color. I originally intended to make the pattern more uniform, but I forgot about the fact that Processing&#8217;s trig functions use radians instead of degrees so I [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-488","post","type-post","status-publish","format-standard","hentry","category-small-assignment-2"],"_links":{"self":[{"href":"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-json\/wp\/v2\/posts\/488","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-json\/wp\/v2\/comments?post=488"}],"version-history":[{"count":7,"href":"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-json\/wp\/v2\/posts\/488\/revisions"}],"predecessor-version":[{"id":505,"href":"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-json\/wp\/v2\/posts\/488\/revisions\/505"}],"wp:attachment":[{"href":"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-json\/wp\/v2\/media?parent=488"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-json\/wp\/v2\/categories?post=488"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/handandmachine.org\/classes\/computational_fabrication\/wp-json\/wp\/v2\/tags?post=488"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}