Skip to content

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

Notifications You must be signed in to change notification settings

mathewa6/MagicaMenger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages