(self, box_geom_or_site)
Add sites corresponding to the vertices of a box geom or site.
Add sites corresponding to the vertices of a box geom or site.
Add sites corresponding to the vertices of a box geom or site .
def _add_vertex_sites(self, box_geom_or_site):
    """Add sites corresponding to the vertices of a box geom or site."""
    offsets = (
        (-half_length, half_length) for half_length in box_geom_or_site.size)
    site_positions = np.vstack(itertools.product(*offsets))
    if box_geom_or_site.pos is not None:
      site_positions += box_geom_or_site.pos
    self._vertices = []
    for i, pos in enumerate(site_positions):
      site = box_geom_or_site.parent.add(
          'site', name='vertex_' + str(i), pos=pos, type='sphere', size=[0.002],
          rgba=constants.RED, group=constants.TASK_SITE_GROUP)
      self._vertices.append(site)
def _add_vertex_sites ( self , box_geom_or_site ) : offsets = ( ( - half_length , half_length ) for half_length in box_geom_or_site . size ) site_positions = np . vstack ( itertools . product ( * offsets ) ) if box_geom_or_site . pos is not None : site_positions += box_geom_or_site . pos self . _vertices = [ ] for i , pos in enumerate ( site_positions ) : site = box_geom_or_site . parent . add ( 'site' , name = 'vertex_' + str ( i ) , pos = pos , type = 'sphere' , size = [ 0.002 ] , rgba = constants . RED , group = constants . TASK_SITE_GROUP ) self . _vertices . append ( site )