{"id":291,"date":"2011-09-01T12:13:40","date_gmt":"2011-09-01T12:13:40","guid":{"rendered":"http:\/\/www.geoplanit.co.uk\/?page_id=291"},"modified":"2011-09-01T12:18:33","modified_gmt":"2011-09-01T12:18:33","slug":"cga-mosque","status":"publish","type":"page","link":"https:\/\/www.geoplanit.co.uk\/?page_id=291","title":{"rendered":"CGA : Mosque"},"content":{"rendered":"<h2><span class=\"Apple-style-span\" style=\"font-size: 13px; font-weight: normal;\"><a href=\"https:\/\/i0.wp.com\/www.geoplanit.co.uk\/wp-content\/uploads\/2011\/09\/ce_mosque.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-thumbnail wp-image-297 alignright\" title=\"End result of CGA rule for a mosque\" src=\"https:\/\/i0.wp.com\/www.geoplanit.co.uk\/wp-content\/uploads\/2011\/09\/ce_mosque.jpg?resize=105%2C105\" alt=\"CGA Mosque\" width=\"105\" height=\"105\" srcset=\"https:\/\/i0.wp.com\/www.geoplanit.co.uk\/wp-content\/uploads\/2011\/09\/ce_mosque.jpg?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/www.geoplanit.co.uk\/wp-content\/uploads\/2011\/09\/ce_mosque.jpg?resize=1%2C1&amp;ssl=1 1w, https:\/\/i0.wp.com\/www.geoplanit.co.uk\/wp-content\/uploads\/2011\/09\/ce_mosque.jpg?zoom=2&amp;resize=105%2C105 210w, https:\/\/i0.wp.com\/www.geoplanit.co.uk\/wp-content\/uploads\/2011\/09\/ce_mosque.jpg?zoom=3&amp;resize=105%2C105 315w\" sizes=\"auto, (max-width: 105px) 100vw, 105px\" \/><\/a>Okay it&#8217;s a bit rough round the edges and if you can help me improve it please leave a comment!<\/span><\/h2>\n<p>&nbsp;<\/p>\n<p>Please feel free to copy and paste into a CityEngine rule file!<\/p>\n<pre>attr cylinder \t= \"assets\/Mosque\/cyclinder.obj\" \/\/create it using SketchUp\r\nattr locateMecca = 220\t\/\/degrees depends on where you are in the world!\r\nattr mosqueheight = 6 \/\/Mosque Height\r\n\r\nLot--&gt;\r\n\t10% : testarea \/\/you don't want to create a whole residential block of Mosques\r\n\t90% : openspace \/\/ change this to whatever you want\r\n\telse : openspace \/\/just in case the percentages don't add up!\r\n\r\nLotInner--&gt;\r\n\topenspace \/\/ you can do similar to above I just wanted mosques with street access\r\n\r\ntestarea--&gt;\r\n\tcase  geometry.area &gt; 500 : MosquePlot \/\/makes sure the plot size is big enough\r\n\telse: openspace\r\n\r\nMosquePlot--&gt;\r\n\tsetback(2){ streetSide : frontage | remainder : plot } \/\/splits the lot up and allows a setback for parking maybe?\r\n\r\nfrontage --&gt; color(\"#80FF00\")\r\n\r\nopenspace --&gt; color(\"#BBBB00\")\r\n\r\nplot --&gt;\r\n\tcolor(\"#FFFFFF\")\r\n\toffset(-0.25) mosqueoffset \/\/compound wall thickness\r\n\r\nmosqueoffset--&gt;\r\n\tcomp(f) { inside: mosque | border: mosquewall} \/\/preparing the inside of the wall for a building\r\n\r\nmosquewall--&gt;\r\n\textrude(1) \/\/height of the wall set to 1 metre\r\nmosque--&gt;\r\n\treport(\"Mosque\",1) \/\/ use reporting to make sure it's doing it correctly\r\n\treport(\"Mosque.Plot.Area\",geometry.area()) \/\/ and so we can get stats on the area\r\n\textrude(100) \/\/I think this is wrong but the building is too thin without a number here\r\n\ts('0.45, mosqueheight, '0.45) \/\/scale the building ' denotes percentage rather than number\r\n\trotate(abs, world, 0, locateMecca, 0) \/\/make the building face the right direction\r\n\tcenter(xz)\r\n\tsplit(x) {'0.95 : mosquebuilding | '0.05 : mineret} \/\/split again so we can build a mineret\r\n\r\nmosquebuilding--&gt;\r\n\tcolor(\"#FFFFFF\")\r\n\r\nmineret --&gt;\r\n\treport(\"Mineret\",1)\r\n\tcolor(\"#FFFFFF\")\r\n\tt(0,0,0) \/\/ for future use\r\n\ts(2,12,2) \/\/ scale your cylinder to the right size\r\n\ti(cylinder) \/\/ insert the cylinder<\/pre>\n<p>Now I know this isn&#8217;t very elegant or perfect, let me know if it can be done better!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Okay it&#8217;s a bit rough round the edges and if you can help me improve it please leave a comment! &nbsp; Please feel free to copy and paste into a CityEngine rule file! attr cylinder = &#8220;assets\/Mosque\/cyclinder.obj&#8221; \/\/create it using SketchUp attr locateMecca = 220 \/\/degrees depends on where you are in the world! attr [&hellip;]<\/p>\n","protected":false},"author":161,"featured_media":0,"parent":265,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-291","page","type-page","status-publish"],"_links":{"self":[{"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/291","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=\/wp\/v2\/users\/161"}],"replies":[{"embeddable":true,"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=291"}],"version-history":[{"count":8,"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/291\/revisions"}],"predecessor-version":[{"id":302,"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/291\/revisions\/302"}],"up":[{"embeddable":true,"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/265"}],"wp:attachment":[{"href":"https:\/\/www.geoplanit.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=291"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}