File: test_isosurface.py

package info (click to toggle)
python-vispy 0.14.3-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 8,840 kB
  • sloc: python: 59,436; javascript: 6,800; makefile: 69; sh: 6
file content (22 lines) | stat: -rw-r--r-- 469 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# -*- coding: utf-8 -*-

import numpy as np
from vispy import scene

from vispy.testing import run_tests_if_main, requires_pyopengl


@requires_pyopengl()
def test_isosurface():

    # Create data
    vol = np.arange(1000).reshape((10, 10, 10)).astype(np.float32)

    # Create visual
    iso = scene.visuals.Isosurface(vol, level=200)

    # Change color (regression test for a bug that caused this to crash)
    iso.color = (1.0, 0.8, 0.9, 1.0)


run_tests_if_main()