Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- triangles = np.loadtxt('MODEL.CSV', delimiter=',', dtype='float')
- volumes = []
- for triangle in triangles:
- v1, v2, v3 = np.array_split(triangle, 3)
- volumes.append(v1.dot(np.cross(v2, v3)) / 6.0)
- print(round(sum(volumes) / 1000, 3))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement