@@ -0,0 +1,2528 @@
+# -*- coding: utf-8 -*-%0A# -----------------------------------------------------------------------------%0A# Copyright (c) 2015, Vispy Development Team. All Rights Reserved.%0A# Distributed under the (new) BSD License. See LICENSE.txt for more info.%0A# -----------------------------------------------------------------------------%0A%22%22%22%0AThis example demonstrates how to draw curved lines (bezier).%0A%22%22%22%0A%0Aimport sys%0A%0Afrom vispy import app, gloo, visuals%0Afrom vispy.geometry import curves%0Afrom vispy.visuals.transforms import STTransform, NullTransform%0A%0A%0Aclass Canvas(app.Canvas):%0A    def __init__(self):%0A        app.Canvas.__init__(self, title='Bezier lines example',%0A                            keys='interactive', size=(400, 750))%0A%0A        self.lines = %5B%0A            visuals.LineVisual(curves.curve4_bezier(%0A                (10, 0),%0A                (50, -190),%0A                (350, 190),%0A                (390, 0)%0A            ), color='w', width=2, method='agg'),%0A            visuals.LineVisual(curves.curve4_bezier(%0A                (10, 0),%0A                (190, -190),%0A                (210, 190),%0A                (390, 0)%0A            ), color='w', width=2, method='agg'),%0A            visuals.LineVisual(curves.curve3_bezier(%0A                (10, 0),%0A                (30, 200),%0A                (390, 0)%0A            ), color='w', width=2, method='agg')%0A        %5D%0A%0A        # Translate each line visual downwards%0A        for i, line in enumerate(self.lines):%0A            x = 0%0A            y = 200 * (i + 1)%0A%0A            line.transform = STTransform(translate=%5Bx, y%5D)%0A%0A        self.texts = %5B%0A            visuals.TextVisual('4 point Bezier curve', bold=True, color='w',%0A                               font_size=24, pos=(200, 75)),%0A            visuals.TextVisual('3 point Bezier curve', bold=True, color='w',%0A                               font_size=24, pos=(200, 525)),%0A        %5D%0A%0A        for text in self.texts:%0A            text.transform = NullTransform()%0A%0A        # Initialize transform systems for each visual%0A        self.visuals = self.lines + self.texts%0A        for visual in self.visuals:%0A            visual.tr_sys = visuals.transforms.TransformSystem(self)%0A            visual.tr_sys.visual_to_document = visual.transform%0A%0A        self.show()%0A%0A    def on_draw(self, event):%0A        gloo.clear('black')%0A        gloo.set_viewport(0, 0, *self.physical_size)%0A%0A        for visual in self.visuals:%0A            visual.draw(visual.tr_sys)%0A%0Aif __name__ == '__main__':%0A    win = Canvas()%0A%0A    if sys.flags.interactive != 1:%0A        app.run()%0A

Add an example how to draw Bezier curves.