{"id":763,"date":"2024-07-09T18:17:52","date_gmt":"2024-07-09T18:17:52","guid":{"rendered":"https:\/\/blog.67bricks.com\/?p=763"},"modified":"2024-07-09T18:44:57","modified_gmt":"2024-07-09T18:44:57","slug":"ai-assisted-lampshade-design","status":"publish","type":"post","link":"https:\/\/blog.67bricks.com\/?p=763","title":{"rendered":"AI assisted 3D printing"},"content":{"rendered":"\n<p>I\u2019d like to share an anecdote which highlights why I find generative AI useful as a way of quickly being able to validate an idea or an approach.&nbsp; I\u2019ve recently been looking into replacing some small glass lampshades which I may have accidentally broken, and then broken some more whilst trying to glue them back together.&nbsp; When they are not shattered and clumsily reassembled, this is what they look like:<\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.67bricks.com\/wp-content\/uploads\/2024\/07\/image-edited.png\" alt=\"\" class=\"wp-image-765\" width=\"454\" height=\"454\" srcset=\"https:\/\/blog.67bricks.com\/wp-content\/uploads\/2024\/07\/image-edited.png 963w, https:\/\/blog.67bricks.com\/wp-content\/uploads\/2024\/07\/image-edited-300x300.png 300w, https:\/\/blog.67bricks.com\/wp-content\/uploads\/2024\/07\/image-edited-150x150.png 150w, https:\/\/blog.67bricks.com\/wp-content\/uploads\/2024\/07\/image-edited-768x769.png 768w\" sizes=\"auto, (max-width: 454px) 85vw, 454px\" \/><figcaption>Pristine lampshade, prior to impact with ground<\/figcaption><\/figure><\/div>\n\n\n\n<p>Employing my usual strategy of scouring Ebay and Etsy for suitable replacements didn\u2019t turn up anything useful.&nbsp; I was able to determine that these glass lampshades were cut from a long tube of borosilicate glass, and based on this information I was able to find a supplier, who could provide the glass and even cut it to the required length &#8211; which would avoid me injuring myself, but would cost \u00a3100.<\/p>\n\n\n\n<p>Having recently been exposed to a series of Tiktoks by <a href=\"https:\/\/www.tiktok.com\/@shanselman\">Scott Hanselman<\/a> expounding the value of owning a 3D printer, I wondered if it would be possible to 3D print some replacements.&nbsp; I don\u2019t have a 3D printer (yet), and I don\u2019t know much about 3D printing, other than Scott thinks it is cool, and it does look pretty cool.&nbsp; I thought it should be possible, but I didn\u2019t really know how well it would turn out, and there were some non-functional requirements around thermal stability (i.e. is it going to melt) that I was interested in bottoming out.<\/p>\n\n\n\n<p>I found a number of companies online who will print STL files in a range of materials, so now all I needed to do was generate the STL file.&nbsp; A brief search on <a href=\"https:\/\/www.reddit.com\/r\/3Dprinting\/wiki\/makingmodels\/\">Reddit<\/a>&nbsp; suggested that for this type of model, a parametric design tool would be most appropriate &#8211; So I downloaded <a href=\"https:\/\/openscad.org\/\">OpenScad<\/a> and set to work.&nbsp; I could have spent the next couple of hours learning the language and writing my scad file, but as I just wanted to see if it could be done as quickly as possible, I asked ChatGPT:<\/p>\n\n\n\n<p><em>&#8220;Please can you help me create an openscad file for the following object: A hollow cylinder, with 20 circular cutouts around the inner edge. The cutouts should run the entire height of the cylinder.&#8221;<\/em><\/p>\n\n\n\n<p>The response was encouraging:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">\/\/ Parameters\n$fn=100;                   \/\/ Setting high facet count for smooth curves\nouter_radius = 40;         \/\/ Outer radius of the base circle\ninner_radius = 35;         \/\/ Inner radius of the base circle\nheight = 100;              \/\/ Height of the extrusion\ncutout_radius = 2;         \/\/ Radius of the circular cutouts\nnum_cutouts = 20;          \/\/ Number of cutouts\n\nmodule cutout_pattern() {\n    difference() {\n        \/\/ Outer circle\n        circle(r = outer_radius);\n        \n        \/\/ Inner circle to create hollow space\n        circle(r = inner_radius);\n        \n        \/\/ Cutouts placed around the inner circle\n        for (i = [0:num_cutouts-1]) {\n            rotate([0, 0, i * 360 \/ num_cutouts]) {\n                translate([inner_radius, 0, 0]) {\n                    circle(r = cutout_radius);\n                }\n            }\n        }\n    }\n}\n\n\/\/ Extrude the 2D pattern to create a 3D object\nlinear_extrude(height = height, center = true) {\n    cutout_pattern();\n}\n\n<\/code><\/pre>\n\n\n\n<p>Tweaking the parameters so it was the correct size, and rendering it gave me:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.67bricks.com\/wp-content\/uploads\/2024\/07\/openscad_shade-edited.png\" alt=\"\" class=\"wp-image-767\" width=\"454\" height=\"454\" srcset=\"https:\/\/blog.67bricks.com\/wp-content\/uploads\/2024\/07\/openscad_shade-edited.png 639w, https:\/\/blog.67bricks.com\/wp-content\/uploads\/2024\/07\/openscad_shade-edited-300x300.png 300w, https:\/\/blog.67bricks.com\/wp-content\/uploads\/2024\/07\/openscad_shade-edited-150x150.png 150w\" sizes=\"auto, (max-width: 454px) 85vw, 454px\" \/><figcaption>Openscad rendering of AI designed lampshade<\/figcaption><\/figure><\/div>\n\n\n\n<p>Not bad! I uploaded this to <a href=\"http:\/\/www.surfacescan.co.uk\">www.surfacescan.co.uk<\/a>, and a couple of days later this arrived in the post: <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.67bricks.com\/wp-content\/uploads\/2024\/07\/image-1-771x1024.png\" alt=\"\" class=\"wp-image-768\" width=\"454\" height=\"624\"\/><figcaption>3D printed lampshade in situ &#8211; it is the one on the right, I will probably replace them all<\/figcaption><\/figure><\/div>\n\n\n\n<p>It cost about \u00a33 to print, shipping was extra.&nbsp; It looks pretty good in the lamp, and doesn\u2019t melt with the 1.5W LED bulbs, so that\u2019s my MVP!&nbsp; <\/p>\n\n\n\n<p>I&nbsp;did a fair amount of experimentation afterwards, trying my own designs, initially with ChatGPT, then increasingly more without it, as I became more confident in the tooling and the benefit of using Generative AI over coding it myself began to diminish.&nbsp; I learnt why I should use $fa and $fs over globally setting $fn, I watched a series of introductory <a href=\"https:\/\/www.youtube.com\/watch?v=A5bc9c3S12g\">videos<\/a> on Autodesk Fusion because I wanted to experiment interactively when modelling &#8211; all safe in the knowledge that I was spending my time on something I knew worked end to end.&nbsp;<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.67bricks.com\/wp-content\/uploads\/2024\/07\/image-2-1024x771.png\" alt=\"\" class=\"wp-image-769\" width=\"454\" height=\"342\" srcset=\"https:\/\/blog.67bricks.com\/wp-content\/uploads\/2024\/07\/image-2-1024x771.png 1024w, https:\/\/blog.67bricks.com\/wp-content\/uploads\/2024\/07\/image-2-300x226.png 300w, https:\/\/blog.67bricks.com\/wp-content\/uploads\/2024\/07\/image-2-768x578.png 768w, https:\/\/blog.67bricks.com\/wp-content\/uploads\/2024\/07\/image-2-1200x904.png 1200w, https:\/\/blog.67bricks.com\/wp-content\/uploads\/2024\/07\/image-2.png 1280w\" sizes=\"auto, (max-width: 454px) 85vw, 454px\" \/><figcaption>Honeycomb inside FTW, because <a href=\"https:\/\/www.youtube.com\/watch?v=thOifuHs6eY\">Hexagons are the Bestigons<\/a><\/figcaption><\/figure><\/div>\n\n\n\n<p>This is why Generative AI is so useful &#8211; I could definitely have written the Openscad file myself but not knowing how to was a barrier.&nbsp; Being able to get from a textual description of a model, to a visualisation in a matter of minutes, to an actual object in days allowed me to validate the approach really quickly, without having to learn much at all.  I think this is similar to product development &#8211; Generative AI may or may not be part of the solution, but it can certainly help you get there quicker.  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I\u2019d like to share an anecdote which highlights why I find generative AI useful as a way of quickly being able to validate an idea or an approach.&nbsp; I\u2019ve recently been looking into replacing some small glass lampshades which I may have accidentally broken, and then broken some more whilst trying to glue them back &hellip; <a href=\"https:\/\/blog.67bricks.com\/?p=763\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;AI assisted 3D printing&#8221;<\/span><\/a><\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[93],"tags":[90,91],"class_list":["post-763","post","type-post","status-publish","format-standard","hentry","category-generative-ai","tag-3dprinting","tag-chatgpt"],"_links":{"self":[{"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=\/wp\/v2\/posts\/763","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=763"}],"version-history":[{"count":10,"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=\/wp\/v2\/posts\/763\/revisions"}],"predecessor-version":[{"id":781,"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=\/wp\/v2\/posts\/763\/revisions\/781"}],"wp:attachment":[{"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=763"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=763"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.67bricks.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=763"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}