| Reference | Downloads | Github

Dot stimulus: how to make dots not overlap

PsychoPy version: 3.7
Standard Standalone?: Yes

My goal: to create a dot stimulus in which the dots are not overlapping, and ideally you can set the minimum distance between dots.

I have this dot stimulus:

    dots_blue = visual.DotStim(
        win=win, name='dots_blue',units='pix', 
        nDots=200, dotSize=4,
        speed=0.3, dir=1.0, coherence=1.0,
        fieldPos=(0.0, 0.0), fieldSize=214,fieldShape='circle',
        signalDots='same', noiseDots='direction',dotLife=-1,
        color=[240,1,1], colorSpace='hsv', opacity=1,

I know that infinite dot life is not recommended, but my dot stimulus has a uniform dot distribution throughout the trial by pasting a smaller aperture over it (so the dot stimulus is defined larger and with more dots than I want it to appear). I also use this code in the beginning of the trial:

dots_blue._verticesBase = dots_blue._newDotsXY(200)

What I tried:
I tried the suggestions posted by @angjw.aaron and @djmannion back in 2017 here: Fixing of overlapping dots with visual.dotStim
But this gives me the defined error: ValueError: Iteration limit reached

Any suggestions how I can solve this?

Many thanks!!!