cleanup and rename
This commit is contained in:
parent
acb86b8013
commit
1f332614f2
1 changed files with 153 additions and 216 deletions
|
|
@ -4,6 +4,7 @@ import numpy
|
|||
from .util import find_faces
|
||||
|
||||
try:
|
||||
# Check if running with line_profiler
|
||||
profile
|
||||
except NameError:
|
||||
def profile(f):
|
||||
|
|
@ -14,6 +15,10 @@ def number_of_moments(order):
|
|||
return ((order + 1) * (order + 2) * (order + 3)) // 6
|
||||
|
||||
|
||||
def get_volume(poly):
|
||||
return get_moments(poly, 0)[0]
|
||||
|
||||
|
||||
@profile
|
||||
def get_moments(poly, poly_order):
|
||||
vertices = poly['vertices']
|
||||
|
|
@ -102,5 +107,3 @@ def get_moments(poly, poly_order):
|
|||
prevlayer, curlayer = curlayer, prevlayer
|
||||
|
||||
return moments
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue