예제 #1
0
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
예제 #2
0
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()
예제 #3
0
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()
예제 #4
0
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()
예제 #5
0
def mesh_generator():
    yield o3d.geometry.TriangleMesh.create_sphere()
    yield meshes.knot()
    yield meshes.bunny()
    yield meshes.armadillo()
예제 #6
0
def mesh_generator():
    yield o3d.geometry.create_mesh_box()
    yield o3d.geometry.create_mesh_sphere()
    yield meshes.knot()
    yield meshes.bunny()
    yield meshes.armadillo()