To do this I thought something like in Matplotlib.
Vispy can do this polygon:
Note: external path is clockwise, internal path counterclockwise.
If the first and the last point of exterior collapsed, and the same for the interior, I expected a similar triangulation:
Here a snippet:
import sys
import numpy as np
from vispy import app
from vispy.scene import SceneCanvas
from vispy.scene.visuals import Polygon
canvas = SceneCanvas(keys='interactive', show=True)
v = canvas.central_widget.add_view()
v.bgcolor = "gray"
v.camera = 'panzoom'
poly_coords = np.array([[0.0, 0.0], [0.0, 1.0], [1.0, 0.0], [0.0, 0.0],
[0.1, 0.1], [0.3, 0.1], [0.1, 0.3], [0.1, 0.1]])
poly = Polygon(poly_coords, color="red", parent=v.scene)
if __name__ == '__main__':
if sys.flags.interactive != 1:
app.run()
Marco
--
You received this message because you are subscribed to the Google Groups "vispy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vispy+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.