Port Menger sponge algorithm to C++

This commit is contained in:
wmayer
2012-03-03 18:24:49 +01:00
parent d6ea5f782f
commit 9aebd52d57
3 changed files with 167 additions and 4 deletions

View File

@@ -8,11 +8,16 @@ import threading
import Mesh, MeshGui
from FreeCAD import Base
# Create a global mesh and make copies of them
# This makes the algorithm faster by ~60%.
box = Mesh.createBox(1,1,1)
# Create a Box and Place it a coords (x,y,z)
def PlaceBox(x,y,z):
box = Mesh.createBox(1,1,1)
box.translate(x,y,z)
return box
global box
mbox=box.copy()
mbox.translate(x,y,z)
return mbox
def Sierpinski(level,x0,y0,z0):
#print threading.current_thread().name