$search
00001 from Numeric import * 00002 from numpy import * 00003 from numpy.linalg import * 00004 00005 class Cell: 00006 def __init__(self, octant, x, y, z): 00007 #normalize x and y 00008 00009 self.normal = array([x,y,z]) 00010 #get signs for octant 00011 self.normal = self.normal * self.getSigns(octant) 00012 self.vertices = [0,0,0] 00013 self.mappedNormals = list() 00014 00015 def getSigns(self, octant): 00016 if octant == 0: 00017 signs = [1, 1, 1] 00018 elif octant == 1: 00019 signs = [1, -1, 1] 00020 elif octant == 2: 00021 signs = [-1, -1, 1] 00022 elif octant == 3: 00023 signs = [-1, 1, 1] 00024 elif octant == 4: 00025 signs = [1, 1, -1] 00026 elif octant == 5: 00027 signs = [1, -1, -1] 00028 elif octant == 6: 00029 signs = [-1, -1, -1] 00030 elif octant == 7: 00031 signs = [-1, 1, -1] 00032 00033 return array(signs) 00034 00035 def addInfo(self, point, normal, interpolated): 00036 self.mappedNormals.append((point,normal, interpolated))