Check out our educational paper on a MATLAB code for topology optimization using geometry projection, which was just published in Structural and Multidisciplinary Optimization.
The corresponding code can be downloaded from GitHub at https://github.com/jnorato/GPTO.
We will add the paper and a link to the code in the Software section of our website.