mol_view_cpk {conmolfields}R Documentation

mol_view_cpk

Description

mol_view_cpk

Usage

mol_view_cpk(mol, reset=TRUE, alpha=1, rfactor=0)

Arguments

mol
reset

TRUE

alpha

1

rfactor

0

Examples

##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
mol_view_cpk <- function(mol, reset=TRUE, alpha=1, rfactor=0) {
  natoms <- length(mol$atoms)
  x <- double(natoms)
  y <- double(natoms)
  z <- double(natoms)
  colors <- double(natoms)
  radius <- double(natoms)
  for (i in 1:natoms) {
    atom <- mol$atoms[[i]]
    x[i] <- atom$x
    y[i] <- atom$y
    z[i] <- atom$z
    colors[i] <- PT.Color[[atom$el]]
    radius[i] <- PT.AtRad[[atom$el]] * rfactor
  }
  if (reset) {
    open3d()
    bg3d("white")
  }
  spheres3d(x, y, z, color=colors, radius=radius, alpha=alpha)
}

[Package conmolfields version 0.0-19 Index]