Skip to content

Commit

Permalink
fixed broken coordinate system"
Browse files Browse the repository at this point in the history
  • Loading branch information
mmorehea committed Jul 17, 2017
1 parent da11137 commit 710bca8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
Binary file added marching_cubes.exp
Binary file not shown.
Binary file added marching_cubes.lib
Binary file not shown.
Binary file added marching_cubes.pyd
Binary file not shown.
10 changes: 4 additions & 6 deletions vol2mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

from multiprocessing.dummy import Pool as ThreadPool
import subprocess
import queue
import threading
import os
import sys
Expand Down Expand Up @@ -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)
Expand All @@ -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")
Expand Down

0 comments on commit 710bca8

Please sign in to comment.