def add_face(self, v1, v2, v3): f = d_tri(v1,v2,v3) f.ID = self.potential_face_IDs.pop() self.faces[f.ID] = f self.n_faces += 1 e1 = self.add_half_edge(v1,v2) e2 = self.add_half_edge(v2,v3) e3 = self.add_half_edge(v3,v1) e1.next = e2 e2.next = e3 e3.next = e1 e1.face = f e2.face = f e3.face = f f.edge = e1 vec_e1 = v2.pos-v1.pos vec_e3 = v3.pos-v1.pos f.norm = util_PG.norm(vec_e1.cross(vec_e3)) if len(self.potential_face_IDs) < 1 : self.potential_face_IDs.append(self.n_faces) self.find_edge_twins() return f
def add_face(self, v1, v2, v3): f = d_tri(v1, v2, v3) f.ID = self.potential_face_IDs.pop() self.faces[f.ID] = f self.n_faces += 1 e1 = self.add_half_edge(v1, v2) e2 = self.add_half_edge(v2, v3) e3 = self.add_half_edge(v3, v1) e1.next = e2 e2.next = e3 e3.next = e1 e1.face = f e2.face = f e3.face = f f.edge = e1 vec_e1 = v2.pos - v1.pos vec_e3 = v3.pos - v1.pos f.norm = util_PG.norm(vec_e1.cross(vec_e3)) if len(self.potential_face_IDs) < 1: self.potential_face_IDs.append(self.n_faces) self.find_edge_twins() return f
def __init__(self,x,y,z): self.ID = None self.pos = Vec3(x,y,z) self.color = Vec4(0.5,0.5,0.5,1.0) self.norm = util_PG.norm(Vec3(x,y,z)) self.n_refs = 0
def __init__(self, x, y, z): self.ID = None self.pos = Vec3(x, y, z) self.color = Vec4(0.5, 0.5, 0.5, 1.0) self.norm = util_PG.norm(Vec3(x, y, z)) self.n_refs = 0