{"id":85,"date":"2010-09-06T14:57:48","date_gmt":"2010-09-06T06:57:48","guid":{"rendered":"http:\/\/www.magicandlove.com\/blog\/?p=85"},"modified":"2010-09-06T15:07:42","modified_gmt":"2010-09-06T07:07:42","slug":"context-free-art-tutorial-7","status":"publish","type":"post","link":"http:\/\/www.magicandlove.com\/blog\/2010\/09\/06\/context-free-art-tutorial-7\/","title":{"rendered":"Context Free Art &#8211; Tutorial 7"},"content":{"rendered":"<p>We continue the study of <em>path<\/em> command. Take a look of the closed shape, a square.<\/p>\n<pre>startshape MyShape\r\n\r\npath Line {\r\n\tMOVETO {x -0.5 y -0.5}\r\n\tLINETO {x 0.5 y -0.5}\r\n\tLINETO {x 0.5 y 0.5}\r\n\tLINETO {x -0.5 y 0.5}\r\n\tLINETO {x -0.5 y -0.5}\r\n\tCLOSEPOLY {}\r\n\tSTROKE {}\r\n}\r\n\r\nrule MyShape {\r\n\tLine {}\r\n}<\/pre>\n<figure id=\"attachment_87\" aria-describedby=\"caption-attachment-87\" style=\"width: 480px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-87\" title=\"close polygon\" src=\"http:\/\/www.magicandlove.com\/blog\/wp-content\/uploads\/2010\/09\/class02a.png\" alt=\"\" width=\"480\" height=\"480\" srcset=\"http:\/\/www.magicandlove.com\/blog\/wp-content\/uploads\/2010\/09\/class02a.png 480w, http:\/\/www.magicandlove.com\/blog\/wp-content\/uploads\/2010\/09\/class02a-150x150.png 150w, http:\/\/www.magicandlove.com\/blog\/wp-content\/uploads\/2010\/09\/class02a-300x300.png 300w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><figcaption id=\"caption-attachment-87\" class=\"wp-caption-text\">CLOSEPOLY<\/figcaption><\/figure>\n<p>If by any chances, you type the wrong position for the last end point or there is rounding error after a sequence of calculation, you may end of with:<\/p>\n<pre>startshape MyShape\r\n\r\npath Line {\r\n\tMOVETO {x -0.5 y -0.5}\r\n\tLINETO {x 0.5 y -0.5}\r\n\tLINETO {x 0.5 y 0.5}\r\n\tLINETO {x -0.5 y 0.5}\r\n\tLINETO {x -0.45 y -0.45}\r\n\tCLOSEPOLY {}\r\n\tSTROKE {}\r\n}\r\n\r\nrule MyShape {\r\n\tLine {}\r\n}<\/pre>\n<figure id=\"attachment_90\" aria-describedby=\"caption-attachment-90\" style=\"width: 480px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-90\" title=\"closed shape 2\" src=\"http:\/\/www.magicandlove.com\/blog\/wp-content\/uploads\/2010\/09\/class02a1.png\" alt=\"\" width=\"480\" height=\"452\" srcset=\"http:\/\/www.magicandlove.com\/blog\/wp-content\/uploads\/2010\/09\/class02a1.png 480w, http:\/\/www.magicandlove.com\/blog\/wp-content\/uploads\/2010\/09\/class02a1-300x282.png 300w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><figcaption id=\"caption-attachment-90\" class=\"wp-caption-text\">CLOSEPOLY error<\/figcaption><\/figure>\n<p>Note the <em>CLOSEPOLY<\/em> command will connect an extra line segment to close the shape if there is a gap between the beginning and the end points. In case we want to get rid of the error, we can use the <em>CLOSEPOLY<\/em> command with an extra parameter <em>align<\/em>.<\/p>\n<pre>startshape MyShape\r\n\r\npath Line {\r\n\tMOVETO {x -0.5 y -0.5}\r\n\tLINETO {x 0.5 y -0.5}\r\n\tLINETO {x 0.5 y 0.5}\r\n\tLINETO {x -0.5 y 0.5}\r\n\tLINETO {x -0.45 y -0.45}\r\n\tCLOSEPOLY {p align}\r\n\tSTROKE {}\r\n}\r\n\r\nrule MyShape {\r\n\tLine {}\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>We continue the study of path command. Take a look of the closed shape, a square. startshape MyShape path Line { MOVETO {x -0.5 y -0.5} LINETO {x 0.5 y -0.5} LINETO {x 0.5 y 0.5} LINETO {x -0.5 y 0.5} LINETO {x -0.5 y -0.5} CLOSEPOLY {} STROKE {} } rule MyShape { Line [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[13,12],"class_list":["post-85","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-context-free-art","tag-tutorial"],"_links":{"self":[{"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/posts\/85","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/comments?post=85"}],"version-history":[{"count":5,"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/posts\/85\/revisions"}],"predecessor-version":[{"id":88,"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/posts\/85\/revisions\/88"}],"wp:attachment":[{"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/media?parent=85"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/categories?post=85"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/tags?post=85"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}