fractaldna.structure_models.random_placements.generate_non_overlapping_prisms

fractaldna.structure_models.random_placements.generate_non_overlapping_prisms(n_prisms, size, rad, early_exit=-1, verbose=False)

Generate a collection of non-overlapping prisms

Candidate prisms are generated at random and placed in a spherical volume. Overlaps are then checked and a new candidate is chosen if there is an overlap. The algorithm will exit early if early_exit is set to a number greater than 0.

Parameters:
  • n_prisms (int) – Number of prisms to generate

  • size (Union[array, List]) – size of prism in x, y, z directions

  • rad (float) – radius of ball in which to generate prisms

  • early_exit (int) – stop attempting to place ‘early_exit’ prisms due to too many overlaps (-1 to disable)

  • verbose (bool) – Display progress of algorithm

Return type:

PrismList