-
Notifications
You must be signed in to change notification settings - Fork 616
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #901 from colour-science/master
PR: Support for parametric plane and box geometries.
- Loading branch information
Showing
9 changed files
with
432 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ doc/_build | |
/_gh-pages | ||
/_images | ||
/_demo-data | ||
.idea | ||
build | ||
dist | ||
MANIFEST | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (c) 2015, Vispy Development Team. | ||
# Distributed under the (new) BSD License. See LICENSE.txt for more info. | ||
|
||
""" | ||
Simple demonstration of the box geometry. | ||
""" | ||
|
||
import sys | ||
|
||
from vispy import scene | ||
from vispy import geometry | ||
|
||
canvas = scene.SceneCanvas(keys='interactive', size=(800, 600), show=True) | ||
|
||
view = canvas.central_widget.add_view() | ||
|
||
vertices, faces, outline = geometry.create_box(width=2, height=4, depth=8, | ||
width_segments=4, | ||
height_segments=8, | ||
depth_segments=16) | ||
|
||
box = scene.visuals.Box(width=4, height=4, depth=8, width_segments=4, | ||
height_segments=8, depth_segments=16, | ||
vertex_colors=vertices['color'], | ||
edge_color='k', | ||
parent=view.scene) | ||
|
||
camera = scene.cameras.TurntableCamera(fov=45, azimuth=60, parent=view.scene) | ||
view.camera = camera | ||
|
||
if __name__ == '__main__' and sys.flags.interactive == 0: | ||
canvas.app.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (c) 2015, Vispy Development Team. | ||
# Distributed under the (new) BSD License. See LICENSE.txt for more info. | ||
|
||
""" | ||
Simple demonstration of the plane geometry. | ||
""" | ||
|
||
import sys | ||
|
||
from vispy import scene | ||
from vispy import geometry | ||
|
||
canvas = scene.SceneCanvas(keys='interactive', size=(800, 600), show=True) | ||
|
||
view = canvas.central_widget.add_view() | ||
|
||
vertices, faces, outline = geometry.create_plane(width=2, height=4, | ||
width_segments=4, | ||
height_segments=8, | ||
direction='+y') | ||
|
||
plane = scene.visuals.Plane(width=2, height=4, width_segments=4, | ||
height_segments=8, direction='+y', | ||
vertex_colors=vertices['color'], | ||
edge_color='k', | ||
parent=view.scene) | ||
|
||
camera = scene.cameras.TurntableCamera(fov=45, azimuth=-45, parent=view.scene) | ||
view.camera = camera | ||
|
||
if __name__ == '__main__' and sys.flags.interactive == 0: | ||
canvas.app.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.