Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 1.15 KB

README.md

File metadata and controls

34 lines (22 loc) · 1.15 KB

MagicaMenger

A Python/numpy implementation of the Menger Sponge/Cube designed to work with MagicaVoxel.

Modules

Functionality

  • Set object.lut = [] to indicate which voxels in a 3x3x3 cube to delete. (0 ... 26)
  • Call output(depth, filename) to return a numpy array of the traditional Menger sponge as well as write it to filename.vox.
  • Use inverseOutput(depth, filename) to output the model of all deleted cubes in the regular sponge.

Usage

# Create an object 
menger = MengerMagica()

# Call either output() or inverseOutput()
invop = menger.inverseOutput(3, "output.vox")

Notes

  • Calling inverseOutput results in an internal call to output()
  • Calculations for a call to output() for a certain depth occur once. Changing the depth results in recomputation.

Based on

The method of using a look up table for voxel deletion was borrowed from Malcolm Kesson.