sierpinski_foam

sierpinski_foam(dmin, n, ndim=2, max_size=1000000000.0)[source]

Generates an image of a Sierpinski carpet or foam

Parameters
  • dmin (int) – The size of the smallest square in the final image

  • n (int) – The number of times to iteratively tile the image

  • ndim (int) – The number of dimensions of the desired image, can be 2 or 3. The default value is 2.

Returns

foam – A boolean image of a Sierpinski gasket or foam

Return type

ndarray