{"id":31,"date":"2010-08-29T16:55:43","date_gmt":"2010-08-29T08:55:43","guid":{"rendered":"http:\/\/www.magicandlove.com\/blog\/?p=31"},"modified":"2010-08-29T17:20:11","modified_gmt":"2010-08-29T09:20:11","slug":"context-free-art","status":"publish","type":"post","link":"http:\/\/www.magicandlove.com\/blog\/2010\/08\/29\/context-free-art\/","title":{"rendered":"Context Free Art"},"content":{"rendered":"<p>To prepare for a new course <a href=\"http:\/\/va2650.wordpress.com\/\">Evolutionary Graphics<\/a> in <a href=\"http:\/\/ava.hkbu.edu.hk\/joomla\/\">AVA<\/a>, I am testing the use of various graphical tools. One of them is the <a href=\"http:\/\/www.contextfreeart.org\/\">Context Free Art<\/a>. It is a ruled based language to generate complex imagery. It cannot be described as a programming language as it lacks a lot of procedural elements. Its recursive capability makes it a good choice for generative type of graphics.<\/p>\n<p>The <a href=\"http:\/\/www.contextfreeart.org\/mediawiki\/index.php\/Community_of_Variation\">Community of Variation<\/a> book contains the sample of drawings in the gallery.<\/p>\n<figure style=\"width: 392px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" title=\"Community of Variation\" src=\"http:\/\/www.contextfreeart.org\/mediawiki\/images\/b\/b2\/Cover-shot.png\" alt=\"\" width=\"392\" height=\"334\" \/><figcaption class=\"wp-caption-text\">Community of Variation<\/figcaption><\/figure>\n<p>The drawing is done by typing a sequence of rules on the left hand panel. Press the &#8216;Render&#8217; button to generate the graphics.<\/p>\n<figure id=\"attachment_32\" aria-describedby=\"caption-attachment-32\" style=\"width: 480px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-32\" title=\"Main window\" src=\"http:\/\/www.magicandlove.com\/blog\/wp-content\/uploads\/2010\/08\/image01.jpg\" alt=\"\" width=\"480\" height=\"377\" srcset=\"http:\/\/www.magicandlove.com\/blog\/wp-content\/uploads\/2010\/08\/image01.jpg 480w, http:\/\/www.magicandlove.com\/blog\/wp-content\/uploads\/2010\/08\/image01-300x235.jpg 300w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><figcaption id=\"caption-attachment-32\" class=\"wp-caption-text\">Main window<\/figcaption><\/figure>\n<p>Every &#8216;program&#8217; starts with a <em>startshape<\/em> keyword. For example, to draw a circle, we can type in the following:<\/p>\n<pre>startshape MyShape\r\n\r\nrule MyShape {\r\n     CIRCLE {}\r\n}<\/pre>\n<pre><\/pre>\n<pre>\r\n\r\n<figure id=\"attachment_38\" aria-describedby=\"caption-attachment-38\" style=\"width: 480px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-38\" title=\"Circle\" src=\"http:\/\/www.magicandlove.com\/blog\/wp-content\/uploads\/2010\/08\/image02.jpg\" alt=\"\" width=\"480\" height=\"378\" srcset=\"http:\/\/www.magicandlove.com\/blog\/wp-content\/uploads\/2010\/08\/image02.jpg 480w, http:\/\/www.magicandlove.com\/blog\/wp-content\/uploads\/2010\/08\/image02-300x236.jpg 300w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><figcaption id=\"caption-attachment-38\" class=\"wp-caption-text\">Circle<\/figcaption><\/figure><\/pre>\n<p>To draw a square, type:<\/p>\n<pre>startshape MyShape\r\n\r\nrule MyShape {\r\n     SQUARE {}\r\n}<\/pre>\n<pre><\/pre>\n<pre>\r\n\r\n<figure id=\"attachment_39\" aria-describedby=\"caption-attachment-39\" style=\"width: 480px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-39\" title=\"Square\" src=\"http:\/\/www.magicandlove.com\/blog\/wp-content\/uploads\/2010\/08\/image03.jpg\" alt=\"\" width=\"480\" height=\"375\" srcset=\"http:\/\/www.magicandlove.com\/blog\/wp-content\/uploads\/2010\/08\/image03.jpg 480w, http:\/\/www.magicandlove.com\/blog\/wp-content\/uploads\/2010\/08\/image03-300x234.jpg 300w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><figcaption id=\"caption-attachment-39\" class=\"wp-caption-text\">Square<\/figcaption><\/figure><\/pre>\n<pre><\/pre>\n<p>To draw a triangle, type:<\/p>\n<pre>startshape MyShape\r\n\r\nrule MyShape {\r\n     TRIANGLE {}\r\n}<\/pre>\n<pre><\/pre>\n<pre>\r\n\r\n<figure id=\"attachment_40\" aria-describedby=\"caption-attachment-40\" style=\"width: 480px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-40\" title=\"Triangle\" src=\"http:\/\/www.magicandlove.com\/blog\/wp-content\/uploads\/2010\/08\/image04.jpg\" alt=\"\" width=\"480\" height=\"377\" srcset=\"http:\/\/www.magicandlove.com\/blog\/wp-content\/uploads\/2010\/08\/image04.jpg 480w, http:\/\/www.magicandlove.com\/blog\/wp-content\/uploads\/2010\/08\/image04-300x235.jpg 300w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><figcaption id=\"caption-attachment-40\" class=\"wp-caption-text\">Triangle<\/figcaption><\/figure><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>To prepare for a new course Evolutionary Graphics in AVA, I am testing the use of various graphical tools. One of them is the Context Free Art. It is a ruled based language to generate complex imagery. It cannot be described as a programming language as it lacks a lot of procedural elements. Its recursive [&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-31","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\/31","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=31"}],"version-history":[{"count":6,"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/posts\/31\/revisions"}],"predecessor-version":[{"id":41,"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/posts\/31\/revisions\/41"}],"wp:attachment":[{"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/media?parent=31"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/categories?post=31"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.magicandlove.com\/blog\/wp-json\/wp\/v2\/tags?post=31"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}