{"id":8173,"date":"2021-12-27T19:51:55","date_gmt":"2021-12-28T00:51:55","guid":{"rendered":"https:\/\/blogs.mathworks.com\/cleve\/?p=8173"},"modified":"2021-12-27T19:52:08","modified_gmt":"2021-12-28T00:52:08","slug":"the-complement-of-the-menger-sponge","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/cleve\/2021\/12\/27\/the-complement-of-the-menger-sponge\/","title":{"rendered":"The Complement of the Menger Sponge"},"content":{"rendered":"<div class=\"content\"><!--introduction--><p>The <i>complement<\/i> of an evolving Menger sponge is all of the material that has been removed so far.<\/p><!--\/introduction--><h3>Contents<\/h3><div><ul><li><a href=\"#9aa050cb-b758-4049-9a6a-52d5080d7712\">Level zero<\/a><\/li><li><a href=\"#e26cc7d5-a36d-460d-b09f-20440527208d\">Level one<\/a><\/li><li><a href=\"#9ecea73d-a97e-4b3e-b096-4acc6a5c340d\">Level one complement<\/a><\/li><li><a href=\"#089c2e3b-28c6-42d8-92fb-3ee5b330842a\">The union<\/a><\/li><li><a href=\"#cd6857b5-e880-474e-9b55-9b9d16efb925\">Until next year<\/a><\/li><\/ul><\/div><h4>Level zero<a name=\"9aa050cb-b758-4049-9a6a-52d5080d7712\"><\/a><\/h4><p>I described the Menger sponge fractal in this blog <a href=\"https:\/\/blogs.mathworks.com\/cleve\/2021\/12\/06\/the-menger-sponge-fractal\/\">three weeks ago<\/a>. At level zero, you begin with a solid cube of, say, gold.<\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"http:\/\/blogs.mathworks.com\/cleve\/files\/sponge0.png\" alt=\"\"> <\/p><h4>Level one<a name=\"e26cc7d5-a36d-460d-b09f-20440527208d\"><\/a><\/h4><p>Trisect the level zero cube into 3x3x3 = 27 smaller cubes, like a Rubik's cube without the labels.  Remove the center cube from each of the six faces, as well as the cube at the very center.  This leaves these 27 - 7 = 20 smaller cubes at level one.<\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"http:\/\/blogs.mathworks.com\/cleve\/files\/sponge1.png\" alt=\"\"> <\/p><h4>Level one complement<a name=\"9ecea73d-a97e-4b3e-b096-4acc6a5c340d\"><\/a><\/h4><p>The level one complement is all the material from level zero that was removed to obtain level one.  I have made it a brighter shade of gold to provide contrast.<\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"http:\/\/blogs.mathworks.com\/cleve\/files\/cosponge1.png\" alt=\"\"> <\/p><h4>The union<a name=\"089c2e3b-28c6-42d8-92fb-3ee5b330842a\"><\/a><\/h4><p>The level one cube and its complement fit together nicely to recreate level zero.<\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"http:\/\/blogs.mathworks.com\/cleve\/files\/union11.png\" alt=\"\"> <\/p><h4>Until next year<a name=\"cd6857b5-e880-474e-9b55-9b9d16efb925\"><\/a><\/h4><p>That's enough for now.  I wanted to get to level one so I could use it my annual graphics-only <a href=\"https:\/\/blogs.mathworks.com\/cleve\/2021\/12\/27\/seasons-greetings-2021\/\">holiday card<\/a>.<\/p><script language=\"JavaScript\"> <!-- \r\n    function grabCode_cde1cb40916a45f9ada1cedcd3d20b3f() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='cde1cb40916a45f9ada1cedcd3d20b3f ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' cde1cb40916a45f9ada1cedcd3d20b3f';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        copyright = 'Copyright 2021 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n\r\n        d.title = title + ' (MATLAB code)';\r\n        d.close();\r\n    }   \r\n     --> <\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_cde1cb40916a45f9ada1cedcd3d20b3f()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n      the MATLAB code <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; R2021a<br><\/p><\/div><!--\r\ncde1cb40916a45f9ada1cedcd3d20b3f ##### SOURCE BEGIN #####\r\n%% The Complement of the Menger Sponge\r\n% The _complement_ of an evolving Menger sponge is all of the \r\n% material that has been removed so far.\r\n\r\n%% Level zero\r\n% I described the Menger sponge fractal in this blog\r\n% <https:\/\/blogs.mathworks.com\/cleve\/2021\/12\/06\/the-menger-sponge-fractal\/\r\n% three weeks ago>.\r\n% At level zero, you begin with a solid cube of, say, gold.\r\n% \r\n% <<sponge0.png>>\r\n%\r\n\r\n%% Level one\r\n%%\r\n% Trisect the level zero cube into 3x3x3 = 27 smaller cubes, like\r\n% a Rubik's cube without the labels.  Remove\r\n% the center cube from each of the six faces, as well as the cube at the\r\n% very center.  This leaves these 27 - 7 = 20 smaller cubes at level one.\r\n%\r\n% <<sponge1.png>>\r\n%\r\n\r\n%% Level one complement\r\n% The level one complement is all the material from level zero that\r\n% was removed to obtain level one.  I have made it a brighter shade   \r\n% of gold to provide contrast.\r\n%\r\n% <<cosponge1.png>>\r\n%\r\n\r\n%% The union\r\n% The level one cube and its complement fit together nicely to recreate\r\n% level zero.\r\n%\r\n% <<union11.png>>\r\n%\r\n\r\n%% Until next year\r\n% That's enough for now.  I wanted to get to level one so I could use\r\n% it my annual graphics-only\r\n% <https:\/\/blogs.mathworks.com\/cleve\/2021\/12\/27\/seasons-greetings-2021\/\r\n% holiday card>.\r\n##### SOURCE END ##### cde1cb40916a45f9ada1cedcd3d20b3f\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img src=\"https:\/\/blogs.mathworks.com\/cleve\/files\/union11.png\" class=\"img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"\" decoding=\"async\" loading=\"lazy\" \/><\/div><!--introduction--><p>The <i>complement<\/i> of an evolving Menger sponge is all of the material that has been removed so far.... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/cleve\/2021\/12\/27\/the-complement-of-the-menger-sponge\/\">read more >><\/a><\/p>","protected":false},"author":78,"featured_media":8188,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[32,18,5,23,1],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts\/8173"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/users\/78"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/comments?post=8173"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts\/8173\/revisions"}],"predecessor-version":[{"id":8176,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts\/8173\/revisions\/8176"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/media\/8188"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/media?parent=8173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/categories?post=8173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/tags?post=8173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}