def test_mesh(noise=0): mesh = meshes.knot() if noise > 0: vertices = np.asarray(mesh.vertices) vertices += np.random.uniform(0, noise, size=vertices.shape) mesh.vertices = o3d.utility.Vector3dVector(vertices) mesh.compute_vertex_normals() return mesh
def mesh_generator(): yield meshes.triangle() yield meshes.plane() yield o3d.geometry.TriangleMesh.create_tetrahedron() yield o3d.geometry.TriangleMesh.create_box() yield o3d.geometry.TriangleMesh.create_octahedron() yield o3d.geometry.TriangleMesh.create_icosahedron() yield o3d.geometry.TriangleMesh.create_sphere() yield o3d.geometry.TriangleMesh.create_cone() yield o3d.geometry.TriangleMesh.create_cylinder() yield meshes.knot() yield meshes.bathtub()
def mesh_generator(edge_cases=True): yield 'box', o3d.geometry.create_mesh_box() yield 'sphere', o3d.geometry.create_mesh_sphere() yield 'cone', o3d.geometry.create_mesh_cone() yield 'torus', o3d.geometry.create_mesh_torus(radial_resolution=30, tubular_resolution=20) yield 'moebius (twists=1)', o3d.geometry.create_mesh_moebius(twists=1) yield 'moebius (twists=2)', o3d.geometry.create_mesh_moebius(twists=2) yield 'moebius (twists=3)', o3d.geometry.create_mesh_moebius(twists=3) yield 'knot', meshes.knot() if edge_cases: yield 'non-manifold edge', meshes.non_manifold_edge() yield 'non-manifold vertex', meshes.non_manifold_vertex() yield 'open box', meshes.open_box() yield 'boxes', meshes.intersecting_boxes()
def mesh_generator(edge_cases=True): yield "box", o3d.geometry.TriangleMesh.create_box() yield "sphere", o3d.geometry.TriangleMesh.create_sphere() yield "cone", o3d.geometry.TriangleMesh.create_cone() yield "torus", o3d.geometry.TriangleMesh.create_torus(radial_resolution=30, tubular_resolution=20) yield "moebius (twists=1)", o3d.geometry.TriangleMesh.create_moebius( twists=1) yield "moebius (twists=2)", o3d.geometry.TriangleMesh.create_moebius( twists=2) yield "moebius (twists=3)", o3d.geometry.TriangleMesh.create_moebius( twists=3) yield "knot", meshes.knot() if edge_cases: yield "non-manifold edge", meshes.non_manifold_edge() yield "non-manifold vertex", meshes.non_manifold_vertex() yield "open box", meshes.open_box() yield "boxes", meshes.intersecting_boxes()
def mesh_generator(): yield o3d.geometry.TriangleMesh.create_sphere() yield meshes.knot() yield meshes.bunny() yield meshes.armadillo()
def mesh_generator(): yield o3d.geometry.create_mesh_box() yield o3d.geometry.create_mesh_sphere() yield meshes.knot() yield meshes.bunny() yield meshes.armadillo()