3mf reader now flips the data points without rotation quaterion

This commit is contained in:
Jaime van Kessel 2015-09-21 16:42:53 +02:00
parent bfdb908148
commit 770264e16e

View file

@ -59,7 +59,7 @@ class ThreeMFReader(MeshReader):
v1 = int(triangle.get("v1")) v1 = int(triangle.get("v1"))
v2 = int(triangle.get("v2")) v2 = int(triangle.get("v2"))
v3 = int(triangle.get("v3")) v3 = int(triangle.get("v3"))
mesh.addFace(vertex_list[v1][0],vertex_list[v1][1],vertex_list[v1][2],vertex_list[v2][0],vertex_list[v2][1],vertex_list[v2][2],vertex_list[v3][0],vertex_list[v3][1],vertex_list[v3][2]) mesh.addFace(vertex_list[v1][0],vertex_list[v1][2],vertex_list[v1][1],vertex_list[v2][0],vertex_list[v2][2],vertex_list[v2][1],vertex_list[v3][0],vertex_list[v3][2],vertex_list[v3][1])
#TODO: We currently do not check for normals and simply recalculate them. #TODO: We currently do not check for normals and simply recalculate them.
mesh.calculateNormals() mesh.calculateNormals()
node.setMeshData(mesh) node.setMeshData(mesh)
@ -109,8 +109,8 @@ class ThreeMFReader(MeshReader):
node.setScale(Vector(scale_x,scale_y,scale_z)) node.setScale(Vector(scale_x,scale_y,scale_z))
# We use a different coordinate frame, so rotate. # We use a different coordinate frame, so rotate.
rotation = Quaternion.fromAngleAxis(-0.5 * math.pi, Vector(1,0,0)) #rotation = Quaternion.fromAngleAxis(-0.5 * math.pi, Vector(1,0,0))
node.rotate(rotation) #node.rotate(rotation)
result.addChild(node) result.addChild(node)
#If there is more then one object, group them. #If there is more then one object, group them.