MCPcopy Create free account
hub / github.com/ActiveState/code / Spaceout

Function Spaceout

recipes/Python/576871_Spline_demonstrator/recipe-576871.py:94–117  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92 t = t + step
93
94def Spaceout():
95 global points
96 newpoints = []
97 L = len(points)
98 if lOpen:
99 newpoints.append(points[0])
100 knot = StandardKnot()
101 if len(knot) == 0:
102 return
103 for t in range( 1, L - m + 2):
104 p = P(t - 0.5,knot,Nopen)
105 x = points[t][0] - p[0]
106 y = points[t][1] - p[1]
107 newpoints.append([points[t][0] + x,points[t][1] + y])
108 newpoints.append(points[-1])
109 else:
110 knot = range(L)
111 for t in range(L):
112 p = P(mod(t + 1.5,L),knot,Nclosed)
113 x = points[t][0] - p[0]
114 y = points[t][1] - p[1]
115 newpoints.append([points[t][0] + x,points[t][1] + y])
116 points = newpoints
117 plot()
118
119def do_mouse(eventname):
120 def mouse_binding(event):

Callers

nothing calls this directly

Calls 6

StandardKnotFunction · 0.85
rangeFunction · 0.85
modFunction · 0.85
plotFunction · 0.85
PFunction · 0.70
appendMethod · 0.45

Tested by

no test coverage detected