Пример #1
0
 def carvedVolume(self):
     '''
     Basic linalg, since we carve out volume from the origin.
     
     Then, let a = pos - O, b = vec1, c = vec2
     
     Then V = (a * (b x c)) / 6
     
     The first term is for the direction this volume is with respect to 
     the origin.
     '''
     return numpy.sign(numpy.dot(self.pos, self.norm())) \
          * numpy.dot(self.pos, numpy.cross(self.vec1, self.vec2)) / 6.0
Пример #2
0
 def carvedVolume(self):
     '''
     Basic linalg, since we carve out volume from the origin.
     
     Then, let a = pos - O, b = vec1, c = vec2
     
     Then V = (a * (b x c)) / 6
     
     The first term is for the direction this volume is with respect to 
     the origin.
     '''
     return numpy.sign(numpy.dot(self.pos, self.norm())) \
          * numpy.dot(self.pos, numpy.cross(self.vec1, self.vec2)) / 6.0
Пример #3
0
 def carvedVolume(self):
     # signum(N . pos) * ||pos x vec||/2
     return numpy.sign(numpy.dot(self.pos, self.norm())) \
          * numpy.linalg.norm(numpy.cross(self.pos, self.vec)) / 2
Пример #4
0
 def carvedVolume(self):
     # signum(N . pos) * ||pos x vec||/2
     return numpy.sign(numpy.dot(self.pos, self.norm())) \
          * numpy.linalg.norm(numpy.cross(self.pos, self.vec)) / 2