Filled spline

26 views
Skip to first unread message

Marco

unread,
Mar 10, 2018, 12:40:42 PM3/10/18
to vispy
Hi,
is it possible to plot a 2D filled closed quadratic spline, given an array of control points?

I googled and searched in examples and demos... beziers in geometry... Path Collection in visuals...

Someone can show me how it is possible?

TNX,
Marco

David Hoese

unread,
Mar 11, 2018, 11:28:45 AM3/11/18
to vispy
Marco,

The plotting interface in vispy is pretty limited and still relatively young as far as number of design/dev hours put in to it. That said, do you have an example image from some other software so I know exactly what you are looking for?

Dave

Marco

unread,
Mar 11, 2018, 1:15:43 PM3/11/18
to vispy

Hi,
here few lines using Tkinter:
import tkinter
top
= tkinter.Tk()
C
= tkinter.Canvas(top, bg="white", height=300, width=300)

points
= [100, 100, 150, 200, 50, 250, 200, 200, 100, 100]
smooth_shape
= C.create_polygon(points, fill="blue", smooth="true")

# Only for display points:
control_polygon = C.create_polygon(points, fill="", outline='red')

C
.pack()
top
.mainloop()



Marco

David Hoese

unread,
Mar 12, 2018, 8:45:20 AM3/12/18
to vispy
Do you need plot axes or just to show the data on the screen? I'm 90% sure this functionality is not directly available in the plotting api, but there may be a Visual that does this. If that is true, then it shouldn't be too difficult to add the functionality.

Dave
Reply all
Reply to author
Forward
0 new messages