Hey #Python #numpy friends, which is better/faster? Are they the same?

triangles_conc = np.concatenate((a, b, c), axis=1).reshape(-1, 2)

triangles_stack = np.hstack((a, b, c)).reshape(-1, 2)

Context: Drawing “boids” as triangles.

triangles = np.hstack(
        (left_points, right_points, head_points)).reshape(-1, 2)
with py5.begin_shape(py5.TRIANGLES):
    py5.vertices(triangles)

#py5 #boids

Image

⤋ Read More