def get_halfedge_mesh(self, optimization_choice, value): if self.cube_node: halfedge_mesh = HalfEdgeMesh.from_triangles(self.cube_node) optimizer = HalfEdgeMeshOptimizer(halfedge_mesh, self) if optimization_choice == 0: optimizer.optimize_by_faces(value) elif optimization_choice == 1: optimizer.optimize_by_improvement(value) return halfedge_mesh.get_node("HalfEdge Mesh", color=array([1.0, 0.5, 0.0, 1.0])) else: return None
def test_halfedge(self): halfedge_mesh = HalfEdgeMesh.from_triangles(self.cube_node) # check edge cycles for face in halfedge_mesh.faces: e1 = face.edge e2 = e1.next e3 = e2.next self.failUnless(e1.face is face) self.failUnless(e2.face is face) self.failUnless(e3.face is face) self.failUnless(e3.next is e1)
def test_halfedge_optimizer(self): halfedge_mesh = HalfEdgeMesh.from_triangles(self.cube_node) optimizer = HalfEdgeMeshOptimizer(halfedge_mesh, self.surface) optimizer.optimize_by_faces(0.9)
def test_halfedge_mesh(self): halfedge_mesh = HalfEdgeMesh.from_triangles(self.cube_node) halfedge_mesh_node = halfedge_mesh.get_node("testnode1")