Skip to content

Instantly share code, notes, and snippets.

@zeffii
Forked from anonymous/nump_example_01.py
Created May 4, 2014 22:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeffii/2b80ef4ace21d2ca8218 to your computer and use it in GitHub Desktop.
Save zeffii/2b80ef4ace21d2ca8218 to your computer and use it in GitHub Desktop.
import numpy as np
def sv_main(n_items=1500):
in_sockets = [
['s', 'n_items', n_items]]
points = np.random.uniform(0.0,1.0,size = (n_items,2))
points *= (2, 10)
a = points[:,1]
b = points[:,0]
c = np.array([0.0 for i in b])
d = np.column_stack((a,b,c))
# consumables
Verts = [d.tolist()]
out_sockets = [
['v', 'Verts', Verts]
]
return in_sockets, out_sockets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment