psychopy.org | Reference | Downloads | Github

ElementArrayStim - multiple regular polygons, rather than circles?

About the ElementArrayStim function:
Is there a way to make the circles hexagons, triangles, pentagons, etc.?
Thanks!

The help page (http://www.psychopy.org/api/visual/elementarraystim.html) doesn’t seem to be comprehensive for this stimulus, but check below for documentation on the elementTex parameter:

Hi Michael,
thanks for the quick reply. For a hexagon, I was thinking that I might define an 256 by 256 zero array, with 1s in the array where my edges should be. Then, I’d use that for my texture, but I’m not sure if that’s what you’re also suggesting (conceptually at least). Can you confirm?
Thanks.

You’re exposing me a bit here as I’ve never used this myself, so the best I can say is “I think so”.

Yes, you could do this by creating an array if you need to do it programmatically (I wouldn’t know how to draw a pentagon programmatically in an array).
Or just create png images of the shapes in some image editor? Seems way easier to me
Jon

Hi Michael, thanks!, Hi Jon, yes, it definitely is easier. I have found a good solution using .png images instead. For the fun of it, I may still figure out how to programmatically do polygons in arrays :slight_smile: I will share if I finish!