def recache_visible_atoms(makeBonds = false)

      plane_count = (@clip_planes ? @clip_planes.length : 0)
      return if plane_count == 0

      if @visibleAtoms
        @visibleAtoms.clear
      else
        @visibleAtoms = []
      end
      @atoms.each{|a|
        i = plane_count
        @clip_planes.each{|p|
          i = i-1 if 0 >= p.distance_to_point(a.x, a.y, a.z) 
        }
        @visibleAtoms << a if i == 0
      }
      
      if @visibleBonds
        @visibleBonds.clear
      else
        @visibleBonds = []
      end
      
      make_bonds if (makeBonds or @bonds.nil?)

      @bonds.each{|b|
        a0 = b[0]
        a1 = b[1]
        i0 = plane_count
        i1 = plane_count
        @clip_planes.each{|p|
          i0 = i0-1 if 0 >= p.distance_to_point(a0.x, a0.y, a0.z)
          i1 = i1-1 if 0 >= p.distance_to_point(a1.x, a1.y, a1.z)
        }
        @visibleBonds << b if (i0 + i1) < 2
      }
      
    end
def recache_visible_atoms(makeBonds = false)

      plane_count = (@clip_planes ? @clip_planes.length : 0)
      return if plane_count == 0

      if @visibleAtoms
        @visibleAtoms.clear
      else
        @visibleAtoms = []
      end
      @atoms.each{|a|
        i = plane_count
        @clip_planes.each{|p|
          i = i-1 if 0 >= p.distance_to_point(a.x, a.y, a.z) 
        }
        @visibleAtoms << a if i == 0
      }
      
      if @visibleBonds
        @visibleBonds.clear
      else
        @visibleBonds = []
      end
      
      make_bonds if (makeBonds or @bonds.nil?)

      @bonds.each{|b|
        a0 = b[0]
        a1 = b[1]
        i0 = plane_count
        i1 = plane_count
        @clip_planes.each{|p|
          i0 = i0-1 if 0 >= p.distance_to_point(a0.x, a0.y, a0.z)
          i1 = i1-1 if 0 >= p.distance_to_point(a1.x, a1.y, a1.z)
        }
        @visibleBonds << b if (i0 + i1) < 2
      }
      
    end
Recompute the atoms that are behind all the clip planes
 Atoms that are in front of any clip-plane are considered invisible.