sierpinski_foam

sierpinski_foam(dmin: int = 1, n: int = 5, ndim: int = 2, max_size: int = 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

Examples

Click here to view online example.