Example #1
0
 def get_planes_vertices(self):
     if len(self.pts_list) > 0:
         for i, vertex in enumerate(self.pts_list):
             normal = self.normals[i]
             binorm = self.binorms[i]
             if i != 0:
                 if self.normals[i-1].angle(normal) > 0.5*math.pi and \
                         self.binorms[i-1].angle(binorm) > 0.5*math.pi:
                     normal = normal * (-1)
                     binorm = binorm * (-1)
             plane = Plane.from_point_and_two_vectors(
                 vertex, normal, binorm)
             self.planes.append(plane)
Example #2
0
def get_planes_on_each_vertex(Skeleton):
    vTangents, vNormals, vBinormals = get_vectors_on_vertices(Skeleton)
    vIndices, eIndices = get_indices_of_vertices_and_edges(Skeleton)
    vertices = get_vertices_from_Skeleton(Skeleton)
    planes = []
    for vIndex in vIndices:
        vtangent = vTangents[vIndex]
        vnormal = vNormals[vIndex]
        vbinorm = vBinormals[vIndex]
        vertex = vertices[vIndex]

        plane_vertex = Plane.from_point_and_two_vectors(
            vertex, vbinorm, vnormal)
        planes.append(plane_vertex)
    return planes