Ejemplo n.º 1
0
def draw_tyssue(eptm, positions, faces, **kwargs):

    mdata = MeshData(vertices=positions,
                     faces=faces)

    canvas = plot.mesh(meshdata=mdata, **kwargs)

    canvas.show()
    canvas.app.run()
Ejemplo n.º 2
0
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2014, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------------------------------------------------------------
"""
Example of simple mesh plotting and manipulation.
"""

import sys
import numpy as np

from vispy.io import load_data_file
import vispy.plot as vp

fname = load_data_file('orig/triceratops.obj.gz')

canvas = vp.mesh(fname=fname, azimuth=-0, elevation=90, distance=2)

vertex_colors = np.random.rand(canvas.mesh.mesh_data.n_vertices, 3)**2
canvas.mesh.mesh_data.set_vertex_colors(vertex_colors)

if __name__ == '__main__':
    canvas.show()
    if sys.flags.interactive == 0:
        canvas.app.run()
Ejemplo n.º 3
0
Archivo: mesh.py Proyecto: Peque/vispy
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2014, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------------------------------------------------------------
"""
Example of simple mesh plotting and manipulation.
"""

import sys
import numpy as np

from vispy.io import load_data_file
import vispy.plot as vp

fname = load_data_file('orig/triceratops.obj.gz')

canvas = vp.mesh(fname=fname, azimuth=-0, elevation=90, distance=2)

vertex_colors = np.random.rand(canvas.mesh.mesh_data.n_vertices, 3) ** 2
canvas.mesh.mesh_data.set_vertex_colors(vertex_colors)

if __name__ == '__main__':
    canvas.show()
    if sys.flags.interactive == 0:
        canvas.app.run()
Ejemplo n.º 4
0
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2014, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------------------------------------------------------------
"""
Example of simple mesh plotting and manipulation.
"""

import sys
import numpy as np

from vispy.io import load_data_file
import vispy.plot as vp

fname = load_data_file('orig/triceratops.obj.gz')

canvas = vp.mesh(fname=fname)
canvas.view.camera.fov = 0  # up==y currently only works for fov==0
canvas.view.camera.up = '+y'

vertex_colors = np.random.rand(canvas.mesh.mesh_data.n_vertices, 3) ** 2
canvas.mesh.mesh_data.set_vertex_colors(vertex_colors)

if __name__ == '__main__':
    canvas.show()
    if sys.flags.interactive == 0:
        canvas.app.run()