{"id":14906,"date":"2018-05-09T23:13:46","date_gmt":"2018-05-09T23:13:46","guid":{"rendered":"http:\/\/scruss.com\/blog\/2018\/05\/09\/openscad-might-notve-been-the-best-choice-here\/"},"modified":"2018-05-10T08:04:43","modified_gmt":"2018-05-10T12:04:43","slug":"openscad-might-notve-been-the-best-choice-here","status":"publish","type":"post","link":"https:\/\/scruss.com\/blog\/2018\/05\/09\/openscad-might-notve-been-the-best-choice-here\/","title":{"rendered":"OpenSCAD might not&#8217;ve been the best choice here"},"content":{"rendered":"<p><a href=\"https:\/\/www.instagram.com\/p\/BilNh7mH-cS1LTORKtmlDd1g9yPaHviTH8uul00\/\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"insta-image\" src=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2018\/05\/1525922026.jpg\" alt=\"OpenSCAD might not\u00e2\u20ac\u2122ve been the best choice here\" width=\"640\" height=\"640\" \/><\/a><\/p>\n<p>Yup, lots of circles, intersections, differences and offsets went into this attempt at the logo of <a href=\"https:\/\/www.agakhanmuseum.org\/\">my favourite museum<\/a>.<\/p>\n<p>For the determined\/demented, here&#8217;s the source. It&#8217;s probably not that useful for learning <a href=\"http:\/\/www.openscad.org\/\">OpenSCAD<\/a>, as it&#8217;s written in my typical <em>\u00e2\u20ac\u0153carve away all the bits that don&#8217;t look like an elephant\u00e2\u20ac\u009d<\/em> style:<\/p>\n<pre>\/\/ akm logo - why yes this *is* a good tool to use ...\r\n\r\n\/\/ constants for octagon maths\r\nr1 = 1 - sqrt(2) \/ 2;           \/\/ ~0.292893\r\nr2 = sqrt(r1);                  \/\/ ~0.541196\r\nx1 = (sqrt(2) - 1) \/ 2;         \/\/ ~0.207107\r\n\r\nsc = 100;                       \/\/ size factor\r\nt = 4;                          \/\/ line thickness\r\nbigt = 7;                       \/\/ strapwork gap thickness\r\n$fn = 256;                      \/\/ OpenSCAD circle smoothness\r\n\r\nmodule petal() {\r\n    intersection() {\r\n        translate([ sc * x1, sc * x1])circle(r = sc * r2);\r\n        translate([-sc * x1, sc * x1])circle(r = sc * r2);\r\n    }\r\n}\r\n\r\nmodule hollow_petal() {\r\n    difference() {\r\n        offset(r =  t \/ 2)petal();\r\n        offset(r = -t \/ 2)petal();\r\n    }\r\n}\r\n\r\nmodule inner_lobe() {\r\n    difference() {\r\n        for (i = [0:3]) {\r\n            rotate(i * 90 + 45)offset(r = t \/ 2)petal();\r\n        }\r\n        for (i = [0:3]) {\r\n            rotate(i * 90 + 45)offset(r = -t \/ 2)petal();\r\n        }\r\n    }\r\n}\r\n\r\nmodule ring() {\r\n    for (i = [0:3]) {\r\n        rotate(i * 90)difference() {\r\n            intersection() {\r\n                inner_lobe();\r\n                union() {\r\n                    offset(r = -bigt \/ 2)petal();\r\n                    rotate(45)offset(r = t \/ 2)petal();\r\n                }\r\n            }\r\n            rotate(90)offset(r = bigt \/ 2)petal();\r\n        }\r\n    }\r\n}\r\n\r\nmodule logo() {\r\n    union() {\r\n        ring();\r\n        for (i = [0:3]) {\r\n            rotate(90 * i)union() {\r\n                intersection() {\r\n                    hollow_petal();\r\n                    rotate(-90)offset(r = -bigt \/ 2)petal();\r\n                }\r\n                difference() {\r\n                    intersection() {\r\n                        hollow_petal();\r\n                        rotate(45)offset(r = -bigt \/ 2)petal();\r\n                    }\r\n                    rotate(-90)offset(r = bigt \/ 2)petal();\r\n                }\r\n                \r\n                difference() {\r\n                    hollow_petal();\r\n                    offset(r = bigt \/ 2)union() {\r\n                        rotate(-90)petal();\r\n                        rotate(45)petal();\r\n                    }\r\n                }       \r\n            }\r\n        }\r\n    }\r\n}\r\n\r\nlogo();\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>OpenSCAD might not&#8217;ve been the best choice here<\/p>\n","protected":false},"author":2,"featured_media":14907,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7,11],"tags":[3136,2687,3015],"class_list":["post-14906","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-computers-suck","category-photo","tag-2d","tag-instagram","tag-openscad"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2018\/05\/1525922026.jpg","jetpack_shortlink":"https:\/\/wp.me\/pQNZZ-3Sq","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/14906","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/comments?post=14906"}],"version-history":[{"count":4,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/14906\/revisions"}],"predecessor-version":[{"id":14911,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/14906\/revisions\/14911"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/media\/14907"}],"wp:attachment":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/media?parent=14906"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/categories?post=14906"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/tags?post=14906"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}