... | @@ -78,7 +78,7 @@ pi_vals = np.tile(pi_vals, n_petals) |
... | @@ -78,7 +78,7 @@ pi_vals = np.tile(pi_vals, n_petals) |
|
amps = np.cos(pi_vals) * amp
|
|
amps = np.cos(pi_vals) * amp
|
|
unit_circle = np.linspace(0, TAU, N, endpoint=False)
|
|
unit_circle = np.linspace(0, TAU, N, endpoint=False)
|
|
circle_coords = np.array([np.sin(unit_circle), np.cos(unit_circle), np.zeros(N)])
|
|
circle_coords = np.array([np.sin(unit_circle), np.cos(unit_circle), np.zeros(N)])
|
|
coords = circle_coords.T* (profile_radius + amps.reshape((-1, 1)))
|
|
coords = circle_coords.T * (profile_radius + amps.reshape((-1, 1)))
|
|
|
|
|
|
verts.append(coords.tolist())
|
|
verts.append(coords.tolist())
|
|
|
|
|
... | @@ -87,4 +87,5 @@ edge_indices_b = np.roll(edge_indices_a, -1) |
... | @@ -87,4 +87,5 @@ edge_indices_b = np.roll(edge_indices_a, -1) |
|
final_edges = np.array([edge_indices_a, edge_indices_b]).T.tolist()
|
|
final_edges = np.array([edge_indices_a, edge_indices_b]).T.tolist()
|
|
edges.append(final_edges)
|
|
edges.append(final_edges)
|
|
|
|
|
|
``` |
|
```
|
|
\ No newline at end of file |
|
i'm sure it's possible to write that even shorter using numpy, but this will give an idea. |
|
|
|
\ No newline at end of file |