Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. import numpy as np
  2.  
  3. triangles = np.loadtxt('MODEL.CSV', delimiter=',', dtype='float')
  4. volumes = []
  5.  
  6. for triangle in triangles:
  7.     v1, v2, v3 = np.array_split(triangle, 3)
  8.     volumes.append(v1.dot(np.cross(v2, v3)) / 6.0)
  9.  
  10.  
  11. print(round(sum(volumes) / 1000, 3))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement