File Exchange

image thumbnail

Sierpinski-Menger sponge

version 2.6 (59.5 KB) by Nicolas Douillet
Function to compute, display, and save the 3D printable ready Sierpinski-Menger sponge, at any iteration / depth level.


Updated 10 Sep 2020

View Version History

View License

Please first check the examples tab (doc) here on the right for a complete description.

Once downloaded, typewrite 'doc Menger_sponge' or 'help Menger_sponge' in Matlab console for support.

Cite As

Nicolas Douillet (2020). Sierpinski-Menger sponge (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (5)

Nicolas Douillet

Write and save the vertex V and the face sets T (in a .ply or .stl file for instance) before sending it to your favorite 3D printing manufacturer. Such file format writer is not included here, but may easily be found on this file exchange.

Nicolas Douillet

Display function based on fill3 is still very greedy in cpu time as well as the number of faces very quickly grows. From nb_iterations >= 3 it becomes very slow to get a display. My advice is to save V and T, to write a file and then to use another 'way' to display it (with a more efficient 3D display engine).

Nicolas Douillet

New version is now available.

Nicolas Douillet


Nicolas Douillet

New version is coming for 3D printing. Waiting for it, to prevent from creating non manifold edges, just comment lines relative to remove duplicated vertices and triangles (l121-123).

MATLAB Release Compatibility
Created with R2019b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!