diff --git a/marching_cubes.exp b/marching_cubes.exp new file mode 100644 index 0000000..cbcc66d Binary files /dev/null and b/marching_cubes.exp differ diff --git a/marching_cubes.lib b/marching_cubes.lib new file mode 100644 index 0000000..db288cc Binary files /dev/null and b/marching_cubes.lib differ diff --git a/marching_cubes.pyd b/marching_cubes.pyd new file mode 100644 index 0000000..d78237f Binary files /dev/null and b/marching_cubes.pyd differ diff --git a/vol2mesh.py b/vol2mesh.py index c9c7493..fb92657 100644 --- a/vol2mesh.py +++ b/vol2mesh.py @@ -7,7 +7,6 @@ from multiprocessing.dummy import Pool as ThreadPool import subprocess -import queue import threading import os import sys @@ -59,11 +58,11 @@ def calcMesh(stackname, labelStack, location, simplify): f.write("# OBJ file\n") for v in vertices: - f.write("v %.2f %.2f %.2f \n" % ((box[0] * SCALEX) + (v[2] * SCALEX), (box[2] * SCALEY) + (v[1] * SCALEY), (box[4] * SCALEZ) + v[0])) - for n in normals: - f.write("vn %.2f %.2f %.2f \n" % (n[2], n[1], n[0])) + f.write("v %.2f %.2f %.2f \n" % ((box[0] * SCALEX) + (v[0] * SCALEX), (box[2] * SCALEY) + (v[1] * SCALEY), (box[4] * SCALEZ) + v[2])) + #for n in normals: + # f.write("vn %.2f %.2f %.2f \n" % (n[2], n[1], n[0])) for face in faces: - f.write("f %d %d %d \n" % (face[0]+1, face[1]+1, face[2]+1)) + f.write("f %d %d %d \n" % (face[2]+1, face[1]+1, face[0]+1)) print("Decimating Mesh...") if os.name == 'nt': s = './binWindows/simplify ./' + location + os.path.basename(stackname) +".obj ./" + location + os.path.basename(stackname) +".smooth.obj " + str(simplify) @@ -76,7 +75,6 @@ def calcMesh(stackname, labelStack, location, simplify): subprocess.call(s, shell=True) def main(): - q = queue.Queue() meshes = sys.argv[2] simplify = sys.argv[3] alreadyDone = glob.glob(meshes + "*.obj")