WithinSelectionSpec

Source: specs.ts

Within selection object. Used to find the subset of an atom selection that is within
some distance from another atom selection. When added as a field of an AtomSelectionSpec,
intersects the set of atoms in that selection with the set of atoms within a given
distance from the given AtomSelectionSpec. The distance comparison is
strictly greater than zero and strictly less than distance, so coincident atoms
and atoms exactly on the boundary are excluded. Both selections are evaluated
within each model; this does not measure distances between separate models.

Example

CODE
$3Dmol.download("pdb:2EJ0",viewer,{},function(){
 viewer.setStyle({chain: 'A', within:{distance: 10, sel:{chain: 'B'}}}, {sphere:{}});
 viewer.render();
});// stylizes atoms in chain A that are within 10 angstroms of an atom in chain B

Instance Fields

distance: number

the distance in angstroms away from the atom selection to include atoms in the parent selection

invert: boolean

if set, selects atoms not within distance range for intersection

sel: AtomSelectionSpec

the selection of atoms against which to measure the distance from the parent atom selection