Ejemplo n.º 1
0
def test_objreader():
    filename = examples.download_doorman(load=False)
    reader = pyvista.get_reader(filename)
    assert isinstance(reader, pyvista.OBJReader)
    assert reader.filename == filename

    mesh = reader.read()
    assert all([mesh.n_points, mesh.n_cells])
Ejemplo n.º 2
0
 def test_download_doorman():
     data = examples.download_doorman()
     assert data.n_cells
Ejemplo n.º 3
0
mesh.faces.reshape(-1, 4)[:, 1:]  # triangular faces

###############################################################################
# Loading other files types is just as easy! Simply pass your file path to the
# :func:`pyvista.read` function and that's it!
#
# Here are a few other examples - simply replace ``examples.download_*`` in the
# examples below with ``pyvista.read('path/to/you/file.ext')``

###############################################################################
# Example STL file:
mesh = examples.download_cad_model()
cpos = [(107.0, 68.5, 204.0), (128.0, 86.5, 223.5), (0.45, 0.36, -0.8)]
mesh.plot(cpos=cpos)

###############################################################################
# Example OBJ file
mesh = examples.download_doorman()
mesh.plot(cpos="xy")

###############################################################################
# Example BYU file
mesh = examples.download_teapot()
mesh.plot(cpos=[-1, 2, -5], show_edges=True)

###############################################################################
# Example VTK file
mesh = examples.download_bunny_coarse()
cpos = [(0.2, 0.3, 0.9), (0, 0, 0), (0, 1, 0)]
mesh.plot(cpos=cpos, show_edges=True, color=True)