Miles Mathis' Charge Field
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Miles Periodic Table with Standard Periodic Table reference

5 posters

Page 2 of 12 Previous  1, 2, 3, ... 10, 11, 12  Next

Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Mon Aug 30, 2021 8:34 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Argon11
A view of Argon.

Code:

In[1]:
from pythreejs import *
from IPython.display import display
#from ipywidgets import VBox, HBox, Checkbox, jslink
#import ipywidgets as widgets
import ipywidgets
from math import sqrt
phi = (1+sqrt(5))/2  # calculating phi-based-pi, piG.
piG = 4/sqrt(phi)    # piG is used instead of pi.

In[2]:
view_width = 600
view_height = 400
factor = 40 # orthographic "scaler"
camera = PerspectiveCamera(position=[10, 0, 0], up=[0, 0, 1], aspect=view_width/view_height)
#camera = PerspectiveCamera(position=[10, 0, 0], up=[1, 0, 0], aspect=view_width/view_height)
camera = PerspectiveCamera(position=[10, 0, 0], up=[0, 1, 0], aspect=view_width/view_height)
#camera = OrthographicCamera(view_width/-factor,view_width/factor,view_height / factor,
#    view_height / - factor,0.1,1000)
key_light = DirectionalLight(position=[0, 10, 10])
ambient_light = AmbientLight()

In[3]:
number = input( "Please enter the Atomic Number: " )
number = int( number )
print( "The number selected is ", number )

In[4]:
grpAn = Group()   # An - Atomic Number
#atomicNumber = 20 # Easier place to change An when coding
atomicNumber = number  # Enter the desired number of protons

# Dimensions
p1p2 = 5.0  # Alpha, up-down (z) proton-proton separation
pRadius = 0.75
nRadius = 0.9
eRadius = 0.15
emRadius = 8*p1p2/10
p2p3 = p1p2/2  # small gap
p1p3 = 8*p1p2/10  # large gap
n1n2 = 3.0  # Alpha, left-right (y) neutron-neutron separation
p1n1 = p1p2/2 # Alpha, up-down (z) neutron-neutron separation
e1e2 = 0.5*p1p2/10 # 0.5  # electron-electron separation
p1e1 = pRadius + 0.5*p1p2/10  # Alpha, top-bottom (z) proton-electron separation
flipPN = p1p3/4 + p1p2/4 # Dist. between adjacent vertical and horiz protons
maxZNeg = 0.0 # maxZNeg and maxZPos are Used to center(z) the atom on the screen
maxZPos = 0.0 # chain  

# Proton set Geometries and Materials
protonGeometry =  SphereBufferGeometry(pRadius, 32, 16)
neutronGeometry =  SphereBufferGeometry(nRadius, 32, 16)
electronGeometry =  SphereBufferGeometry(eRadius, 8, 16)
emissionGeometry = CircleGeometry(emRadius, 32)
protonMaterial = MeshStandardMaterial(color='blue')
neutronMaterial = MeshStandardMaterial(color='red')
electronMaterial = MeshStandardMaterial(color='cyan')
emissionmaterial = MeshStandardMaterial(color='gray',
    transparent = True,opacity = 0.6)

# Assemble the atomic models.
for i in range( atomicNumber ):
    emissionA2i = Mesh( emissionGeometry, emissionmaterial)
    emissionA2i.rotateX(piG)
    protonAi = Group()
    protonAi.add(Mesh(protonGeometry, protonMaterial))
    protonAi.add(Mesh(emissionGeometry, emissionmaterial))
    protonAi.add(emissionA2i)
    neutronAi = Group()
    neutronAi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronAi.position = [0,-n1n2/2,-p1n1]
    protonAi.add(neutronAi)
    electronAi = Group()
    electronAi.add(Mesh(electronGeometry, electronMaterial))
    electronAi.position = [0,-e1e2/2,-p1e1]
    protonAi.add(electronAi)
    
    if i == 0:
        protonAi.position = [0,0,0]
        if 1 <= atomicNumber:
            protonAi.position = [0,0,p1p2/2]
            maxZNeg = 0
            maxZPos = p1p2/2
        #print('proton[',i+1,'] position =', protonAi.position)

    if i == 1:
        protonAi.position = [0,0,0]
        if 2<=atomicNumber:
            protonAi.rotateX(-piG)
            protonAi.position = [0,0, -p1p2/2]
            maxZNeg = -p1p2/2
            maxZPos = p1p2/2
        #print('proton[',i+1,'].position =', protonAi.position)
      
    if i == 2:
        protonAi.position = [0,0,0]
        if 3 <= atomicNumber < 7:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0, -p1p2/2-2*flipPN]
            maxZNeg = -p1p2/2-2*flipPN
            maxZPos = p1p2/2
        elif 7 <= atomicNumber < 11:
            protonAi.position = [0,0,-p1p2/2-p2p3]            
        elif 11 <= atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,p1p2/2,-p1p2/2-2*flipPN]
         #print('proton[',i+1,'].position =', protonAi.position)
        
    if i == 3:
        protonAi.position = [0,0,0]
        if 4 == atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [0, 0, 2*flipPN + p1p2/2 ]
            maxZPos = p1p2/2+2*flipPN
            maxZNeg = -p1p2/2-2*flipPN
        if 5 <= atomicNumber < 11:
            protonAi.rotateX(piG)
            protonAi.position = [0, 0, p2p3 + p1p2/2 ]
        elif 11 <= atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,p1p2/2,p1p2/2+2*flipPN]
        #print('proton[',i+1,'].position =', protonAi.position)
        
    if i == 4:
        protonAi.position = [0,0,0]
        if 5 <= atomicNumber < 11:
            protonAi.position = [0, 0, 3*p1p2/2 + p2p3]
            maxZNeg = -p1p2/2-2*flipPN
            maxZPos = 3*p1p2/2 + p2p3
            
        elif 11 <= atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-p1p2/2,p1p2/2+2*flipPN]
        #print('proton[',i+1,'].position =', protonAi.position)
                  
    if i == 5:
        protonAi.position = [0,0,0]  
        if 6 <= atomicNumber < 7:
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0,3*p1p2/2+p2p3+2*flipPN]
            maxZPos = p2p3+3*p1p2/2+2*flipPN
            maxZNeg = -p1p2/2-2*flipPN
        elif 7 <= atomicNumber < 11:
            protonAi.rotateX(piG)
            protonAi.position = [0,0,-3*p1p2/2 - p2p3]
        elif 11 <= atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-p1p2/2,-p1p2/2-2*flipPN]
        #print('proton[',i+1,'].position =', protonAi.position)

    if i == 6:
        protonAi.position = [0,0,0]
        if 7 <= atomicNumber < 9:        
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0,-3*p1p2/2 - p2p3 - 2*flipPN]
            maxZPos = 3*p1p2/2 + p2p3
            maxZNeg = -3*p1p2/2 - p2p3 - 2*flipPN
        elif 9 <= atomicNumber < 10:
            protonAi.rotateX(piG/2)
            protonAi.position = [0,p1p2/2,-3*p1p2/2 - p2p3 - 2*flipPN]
        elif 10 ==atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,p1p2/2,-3*p1p2/2 - p2p3 - 2*flipPN]
        elif 11 <= atomicNumber < 14:
            protonAi.position = [0, 0, -p1p2/2 - 4*flipPN ]
        elif 14 <= atomicNumber:
            protonAi.rotateY(piG/2)
            protonAi.rotateZ(piG)            
            protonAi.position = [-2*flipPN, 0, 0]
        #print('proton[',i+1,'].position =', protonAi.position)
          
    if i == 7:
        protonAi.position = [0,0,0]
        if 8 == atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,0,3*p1p2/2 + p2p3 + 2*flipPN]
            maxZPos = 3*p1p2/2 + p2p3 + 2*flipPN
            maxZNeg = -3*p1p2/2 - p2p3 - 2*flipPN
        elif 9 <= atomicNumber < 11:
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-p1p2/2,-3*p1p2/2-p2p3-2*flipPN]
        elif 11 <=atomicNumber < 14:
            protonAi.rotateX(-piG)
            protonAi.position = [0,0,-3*p1p2/2-4*flipPN]
        elif 14 == atomicNumber:
            protonAi.rotateY(-piG/2)
            protonAi.position = [-2*flipPN - p1p2, 0, 0]
        elif 15 ==atomicNumber:
            protonAi.rotateX(-piG)
            protonAi.position = [0,0,-3*p1p2/2-4*flipPN]
        elif 16 <= atomicNumber:
            protonAi.rotateY(-piG/2)
            protonAi.position = [-2*flipPN - p1p2, 0, 0]
        #print('proton[',i+1,'].position =', protonAi.position)

    if i == 8:
        protonAi.position = [0,0,0]
        if 9 <= atomicNumber < 10:
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0, 3*p1p2/2 + p2p3 + 2*flipPN]
            maxZNeg = -3*p1p2/2 - p2p3 - 2*flipPN
            maxZPos = 3*p1p2/2 + p2p3 + 2*flipPN
        elif 10 <= atomicNumber < 11:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,p1p2/2, 3*p1p2/2 + p2p3 + 2*flipPN]
        elif 11 <= atomicNumber < 14:
            protonAi.rotateX(piG)
            protonAi.position = [0, 0, p1p2/2 + 4*flipPN]
        elif 14 <= atomicNumber:            
            protonAi.rotateY(-piG/2)
            protonAi.rotateZ(piG)            
            protonAi.position = [2*flipPN, 0,0]            
        #print('proton[',i+1,'].position =', protonAi.position)

    if i == 9:
        protonAi.position = [0,0,0]
        if 10 == atomicNumber:  # Neon
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-p1p2/2, 3*p1p2/2 + p2p3 + 2*flipPN]
            maxZNeg = -3*p1p2/2 - 4*flipPN
            maxZPos = 3*p1p2/2 + 4*flipPN
        elif 11 <= atomicNumber < 14:
            protonAi.position = [0, 0, 3*p1p2/2 + 4*flipPN]
        elif 14 == atomicNumber:
            protonAi.rotateY(piG/2)
            protonAi.position = [p1p2 + 2*flipPN, 0,0]
        elif 15 == atomicNumber:
            protonAi.position = [0, 0, 3*p1p2/2 + 4*flipPN]            
        elif 16 <= atomicNumber:
            protonAi.rotateY(piG/2)
            protonAi.position = [p1p2 + 2*flipPN, 0,0]            
        #print('proton[',i+1,'].position =', protonAi.position)
      
    if i == 10:
        protonAi.position = [0,0,0]
        if 11 <= atomicNumber < 13:
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,0, -3*p1p2/2-6*flipPN]
            maxZPos = 3*p1p2/2+4*flipPN
            maxZNeg = -3*p1p2/2-6*flipPN
        elif 13 == atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, -p1p2/2, -3*p1p2/2-6*flipPN]
        elif 14 <= atomicNumber < 17:
            protonAi.rotateX(piG/2)
            protonAi.position = [ 0, 2*flipPN, 0]
        elif 17 == atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, p1p2/2, 3*p1p2/2+6*flipPN]
        elif 18 <= atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [ 0, 2*flipPN, 0]
        #print('proton[',i+1,'].position =', protonAi.position)
 
    if i == 11:
        protonAi.position = [0,0,0]
        if 12 <= atomicNumber < 14 :
            protonAi.rotateX(piG/2)
            protonAi.position = [0, 0, 3*p1p2/2 + 6*flipPN]
            maxZNeg = -3*p1p2/2 - 6*flipPN
            maxZPos =  3*p1p2/2 + 6*flipPN
        elif 14 == atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [ 0,-p1p2-2*flipPN,0]
        elif 15 == atomicNumber:            
            protonAi.rotateX(piG)
            protonAi.position = [0, 0, p1p2/2 + 4*flipPN]
        elif 16 == atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [ 0,-p1p2-2*flipPN,0]
        elif 17 == atomicNumber:            
            protonAi.rotateX(piG/2)
            protonAi.position = [0, -p1p2/2, 3*p1p2/2 + 6*flipPN]
        elif 18 <= atomicNumber:            
            protonAi.rotateX(piG/2)
            protonAi.position = [ 0,-p1p2-2*flipPN,0]
        #print('proton[',i+1,'].position =', protonAi.position)
      
    if i == 12:
        protonAi.position = [0,0,0]
        if 13 == atomicNumber:              
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,p1p2/2, -3*p1p2/2-6*flipPN]            
            maxZNeg = -3*p1p2/2-6*flipPN
            maxZPos =  3*p1p2/2 + 6*flipPN
        elif 14 == atomicNumber < 15:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 2*flipPN + p1p2, 0]
        elif 15 == atomicNumber:
            protonAi.position = [ 0,0, -p1p2/2-4*flipPN]
        elif 16 == atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 2*flipPN + p1p2, 0]
        elif 17 == atomicNumber:
            protonAi.rotateY(piG)
            protonAi.rotateZ(piG)
            protonAi.position = [ 0,0, -3*p1p2/2-4*flipPN]
        elif 18 <= atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 2*flipPN + p1p2, 0]
        #print('proton[',i+1,'].position =', protonAi.position)
        
    if i == 13:     # Silicon, the carousal level
        protonAi.position = [0,0,0]
        if 14 <= atomicNumber < 17:
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,-2*flipPN,0]
            maxZNeg = -p1p2-4*flipPN
            maxZPos = p1p2+4*flipPN
        elif 17 == atomicNumber:
            protonAi.position = [0, 0, 3*p1p2/2+4*flipPN]            
        if 18 <= atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,-2*flipPN,0]
        #print('proton[',i+1,'].position =', protonAi.position)

    if i == 14:
        protonAi.position = [0,0,0]
        if 15 <= atomicNumber:
            protonAi.rotateX(piG)
            protonAi.position = [0, 0, p1p2/2 + 4*flipPN]
            maxZNeg = -p1p2/2 - 4*flipPN
            maxZPos =  p1p2/2 + 4*flipPN
        #print('proton[',i+1,'].position =', protonAi.position)
      
    if i == 15:
        protonAi.position = [0,0,0]
        if 16 <= atomicNumber:
            protonAi.position = [0, 0, -p1p2/2 - 4*flipPN]
            maxZNeg = -p1p2/2 - 4*flipPN
            maxZPos = p1p2/2 + 4*flipPN
        #print('proton[',i+1,'].position =', protonAi.position)

    if i == 16:
        protonAi.position = [0,0,0]
        if 17 <=atomicNumber:
            protonAi.rotateX(piG)          
            protonAi.position = [0,0,-3*p1p2/2-4*flipPN]          
            maxZNeg = -3*p1p2/2-4*flipPN
            maxZPos = 3*p1p2/2+4*flipPN
        #print('proton[',i+1,'].position =', protonAi.position)
        
    if i == 17:
        protonAi.position = [0,0,20]
        if 18 <=atomicNumber:
            #protonAi.rotateY(-piG/2)
            #protonAi.rotateZ(-piG/2)
            protonAi.position = [0,0,3*p1p2/2+4*flipPN]
            maxZNeg = -3*p1p2/2-4*flipPN
            maxZPos = 3*p1p2/2+4*flipPN
        #print('proton[',i+1,'].position =', protonAi.position)
        
    if i == 18:
        protonAi.position = [0,0,20]
        if 19 <=atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0, -3*p1p2/2-6*flipPN]
            maxZNeg = -3*p1p2/2-6*flipPN
            maxZPos =  3*p1p2/2+4*flipPN
        #print('proton[',i+1,'].position =', protonAi.position)
      
    if i == 19:
        protonAi.position = [0,0,20]
        if 20 <=atomicNumber:
            protonAi.rotateX(piG/2)            
            protonAi.position = [0,0,3*p1p2/2+6*flipPN]          
            maxZNeg = -3*p1p2/2-6*flipPN
            maxZPos =  3*p1p2/2+6*flipPN
        #print('proton[',i+1,'].position =', protonAi.position)

    grpAn.add( protonAi )

grpAn.position = [0,0,(-maxZNeg + maxZPos)/2 - maxZPos]


In[5]
scene = Scene(children=[grpAn, camera, key_light, ambient_light])
controller = OrbitControls(controlling=camera, screenSpacePanning=True)

In[6]
renderer = Renderer(camera=camera, scene=scene, controls=[controller],
                    width=view_width, height=view_height)
 
In[7]:
renderer

In[8]:
spin_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 2], values=[0, 2*piG])
spin_clip = AnimationClip(tracks=[spin_track])
spin_action = AnimationAction(AnimationMixer(grpAn), spin_clip, grpAn) # best
spin_action
Positive progress. The code is still good to Calcium, and In[4] went from about 540 to 340 code lines. Building outward from the center made for clearer positions and less proton position changes. The dimensions are also improved. I saved most of the lines by moving the proton.add(electron) and proton.add(neutron) lines to the top of each i-loop, and so not execute those commands for each and every proton within each loop, twice, how embarrassing, live and learn.

Still in review mode. Feel free to comment. 
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Thu Sep 02, 2021 1:50 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Two0th10
Atomic elements 20 through 25. The actual top and bottom directions, aligned to the earth’s vertical emissions, are shown sideways.

Code:

In[1]:
from pythreejs import *
from IPython.display import display
import ipywidgets
from math import sqrt
phi = (1+sqrt(5))/2  # calculating phi-based-pi, piG.
piG = 4/sqrt(phi)    # piG is used instead of pi.

In[2]:
view_width = 600
view_height = 400
factor = 40 # orthographic "scaler"
camera = PerspectiveCamera(position=[10, 0, 0], up=[0, 0, 1], aspect=view_width/view_height)
#camera = PerspectiveCamera(position=[10, 0, 0], up=[1, 0, 0], aspect=view_width/view_height)
camera = PerspectiveCamera(position=[10, 0, 0], up=[0, 1, 0], aspect=view_width/view_height)
#camera = OrthographicCamera(view_width/-factor,view_width/factor,view_height / factor,
#    view_height / - factor,0.1,1000)  # The orbital controls doesn't work with ortho(?)
key_light = DirectionalLight(position=[0, 10, 10])
ambient_light = AmbientLight()

In[3]
elements = ["1.Hydrogen", "2.Helium", "3.Lithium", "4.Beryllium", "5.Boron",
           "6.Carbon", "7.Nitrogen", "8.Oxygen", "9.Fluorine", "10.Neon", "11.Sodium",
           "12.Magnesium", "13.Aluminum", "14.Silicon", "15.Phosphorus", "16.Sulfur",
           "17.Chlorine", "18.Argon", "19.Potassium", "20.Calcium", "21.Scandium",
           "22.Titanium", "23.Vanadium", "24.Chromium", "25.Manganese"]
print( elements )

In[4]
number = input( "Please enter an Atomic number: " )
number = int( number )
print( "The Atomic number selected is", elements[number-1])

In[5]
grpAn = Group()   # An - Atomic Number
#atomicNumber = 1 # Easier place to change An when coding
atomicNumber = number  # Enter the desired number of protons

# Dimensions
pP1pP2 = 4.0 # Proton 1 to proton 2, Pole-to-pole separation.
pRadius = 0.5
nRadius = 0.6
eRadius = 0.15
emRadius = 8*pP1pP2/10
p2p3 = pP1pP2/2  # small gap
p1p3 = 8*pP1pP2/10  # large gap
n1n2 = 3.0  # Alpha, left-right (y) neutron-neutron orbital separation
p1n1 = pP1pP2/2 # Alpha, up-down (z) proton-orbital neutron separation
p1n2 = 4*pP1pP2/10  # In line proton and neutron
e1e2 = 0.5*pP1pP2/10 # 0.5  # electron-electron separation
p1e1 = pRadius + 0.5*pP1pP2/10  # Alpha, top-bottom (z) proton-electron separation
flipPN = p1p3/4 + pP1pP2/4 # Dist. between adjacent vertical and horiz protons
maxZNeg = 0.0 # maxZNeg and maxZPos are Used to center(z) the atom on the screen
maxZPos = 0.0 # chain  

# Proton set Geometries and Materials
protonGeometry =  SphereBufferGeometry(pRadius, 32, 16)
neutronGeometry =  SphereBufferGeometry(nRadius, 32, 16)
electronGeometry =  SphereBufferGeometry(eRadius, 8, 16)
emissionGeometry = CircleGeometry(emRadius, 32)
protonMaterial = MeshStandardMaterial(color='blue')
neutronMaterial = MeshStandardMaterial(color='red')
electronMaterial = MeshStandardMaterial(color='cyan')
emissionmaterial = MeshStandardMaterial(color='gray',
    transparent = True,opacity = 0.4)

# Assemble the atomic models.
for i in range( atomicNumber ):
    emissionA2i = Mesh( emissionGeometry, emissionmaterial)
    emissionA2i.rotateX(piG)
    protonAi = Group()
    protonAi.add(Mesh(protonGeometry, protonMaterial))
    protonAi.add(Mesh(emissionGeometry, emissionmaterial))
    protonAi.add(emissionA2i)
    neutronAi = Group()
    neutronAi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronAi.position = [0,-n1n2/2,-p1n1]
    neutronBi = Group()
    neutronBi.add(Mesh(neutronGeometry, neutronMaterial))
    protonAi.add(neutronAi)
    electronAi = Group()
    electronAi.add(Mesh(electronGeometry, electronMaterial))
    electronAi.position = [0,-e1e2/2,-p1e1]
    protonAi.add(electronAi)
    protonAi.position = [0,0,0]
    
    if i == 0:
        if 1 == atomicNumber: # Hydrogen. Remove the orbitable neutron and  
            protonAi.remove(neutronAi) # replace it with an ortho neutron
            neutronBi.position = [0,0,-p1n2]
            protonAi.add(neutronBi)        
            maxZNeg = 0  
            maxZPos = 0
        elif 1 < atomicNumber: # or the first proton of a larger atom.
            protonAi.position = [0,0,pP1pP2/2]
        print('proton[',i+1,'] position =', protonAi.position)

    if i == 1:
        if 2<=atomicNumber: # Helium
            protonAi.rotateX(-piG)
            protonAi.position = [0,0, -pP1pP2/2]
            maxZNeg = -pP1pP2/2
            maxZPos = pP1pP2/2
        print('proton[',i+1,'].position =', protonAi.position)
      
    if i == 2:
        if 3 == atomicNumber: # Lithium
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0, -pP1pP2/2-2*flipPN]
            maxZNeg = -pP1pP2/2-2*flipPN
            maxZPos = pP1pP2/2
        if 3 < atomicNumber < 7:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0, -pP1pP2/2-2*flipPN]
        if 7 <= atomicNumber < 11:
            protonAi.position = [0,0,-pP1pP2/2-p2p3]
        elif 11 <= atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,pP1pP2/2,-pP1pP2/2-2*flipPN]
        print('proton[',i+1,'].position =', protonAi.position)
        
    if i == 3:
        if 4 == atomicNumber: # Beryllium 
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0, 0, 2*flipPN + pP1pP2/2 ]
            maxZPos = pP1pP2/2+2*flipPN
            maxZNeg = -pP1pP2/2-2*flipPN
        elif 5 <= atomicNumber < 11:
            protonAi.rotateX(piG)
            protonAi.position = [0, 0, p2p3 + pP1pP2/2 ]
        elif 11 <= atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,pP1pP2/2,pP1pP2/2+2*flipPN]
        print('proton[',i+1,'].position =', protonAi.position)
        
    if i == 4:
        if 5 <= atomicNumber < 11: # Boron
            protonAi.position = [0, 0, 3*pP1pP2/2 + p2p3]
            maxZNeg = -pP1pP2/2-2*flipPN
            maxZPos = 3*pP1pP2/2 + p2p3
        elif 11 <= atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2,pP1pP2/2+2*flipPN]
        print('proton[',i+1,'].position =', protonAi.position)
                  
    if i == 5:
        if 6 == atomicNumber: # Carbon
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0,3*pP1pP2/2+p2p3+2*flipPN]
            maxZPos = p2p3+3*pP1pP2/2+2*flipPN
            maxZNeg = -pP1pP2/2-2*flipPN
        if 6 < atomicNumber < 11:
            protonAi.rotateX(piG)
            protonAi.position = [0,0,-3*pP1pP2/2 - p2p3]
        elif 11 <= atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2,-pP1pP2/2-2*flipPN]
        print('proton[',i+1,'].position =', protonAi.position)

    if i == 6:
        if 7 == atomicNumber: # Nitrogen
            protonAi.remove(neutronAi)    
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0,-3*pP1pP2/2 - p2p3 - 2*flipPN]
            maxZPos = 3*pP1pP2/2 + p2p3
            maxZNeg = -3*pP1pP2/2 - p2p3 - 2*flipPN
        if 7 < atomicNumber < 9: # Nitrogen
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0,-3*pP1pP2/2 - p2p3 - 2*flipPN]
        elif 9 <= atomicNumber < 10:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,pP1pP2/2,-3*pP1pP2/2 - p2p3 - 2*flipPN]
        elif 10 ==atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,pP1pP2/2,-3*pP1pP2/2 - p2p3 - 2*flipPN]
        elif 11 <= atomicNumber < 14:
            protonAi.position = [0, 0, -pP1pP2/2 - 4*flipPN ]
        elif 14 == atomicNumber:
            protonAi.rotateY(piG/2)
            protonAi.rotateZ(piG)            
            protonAi.position = [-2*flipPN, 0, 0]
        elif 15 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateY(piG/2)
            protonAi.rotateZ(piG)            
            protonAi.position = [-2*flipPN, 0, 0]
        elif 16 <= atomicNumber:
            protonAi.rotateY(piG/2)
            protonAi.rotateZ(piG)            
            protonAi.position = [-2*flipPN, 0, 0]
        print('proton[',i+1,'].position =', protonAi.position)
          
    if i == 7:
        if 8 == atomicNumber: # Oxygen
            protonAi.remove(neutronAi)  
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,0,3*pP1pP2/2 + p2p3 + 2*flipPN]
            maxZPos = 3*pP1pP2/2 + p2p3 + 2*flipPN
            maxZNeg = -3*pP1pP2/2 - p2p3 - 2*flipPN
        if 9 == atomicNumber < 11:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2,-3*pP1pP2/2-p2p3-2*flipPN]
        if 10 == atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2,-3*pP1pP2/2-p2p3-2*flipPN]
        elif 11 <=atomicNumber < 14:
            protonAi.rotateX(-piG)
            protonAi.position = [0,0,-3*pP1pP2/2-4*flipPN]
        elif 14 == atomicNumber:
            protonAi.rotateY(-piG/2)
            protonAi.position = [-2*flipPN - pP1pP2, 0, 0]
        elif 15 ==atomicNumber:
            protonAi.rotateX(-piG)
            protonAi.position = [0,0,-3*pP1pP2/2-4*flipPN]
        elif 16 <= atomicNumber:
            protonAi.rotateY(-piG/2)
            protonAi.position = [-2*flipPN - pP1pP2, 0, 0]
        print('proton[',i+1,'].position =', protonAi.position)

    if i == 8:
        if 9 <= atomicNumber < 10: # Fluorine
            protonAi.remove(neutronAi)  
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0, 3*pP1pP2/2 + p2p3 + 2*flipPN]
            maxZNeg = -3*pP1pP2/2 - p2p3 - 2*flipPN
            maxZPos = 3*pP1pP2/2 + p2p3 + 2*flipPN
        elif 10 <= atomicNumber < 11:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,pP1pP2/2, 3*pP1pP2/2 + p2p3 + 2*flipPN]
        elif 11 <= atomicNumber < 14:
            protonAi.rotateX(piG)
            protonAi.position = [0, 0, pP1pP2/2 + 4*flipPN]
        elif 14 == atomicNumber:            
            protonAi.rotateY(-piG/2)
            protonAi.rotateZ(piG)            
            protonAi.position = [2*flipPN, 0,0]  
        elif 15 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateY(-piG/2)
            protonAi.rotateZ(piG)            
            protonAi.position = [2*flipPN, 0,0]
        elif 16 <= atomicNumber:            
            protonAi.rotateY(-piG/2)
            protonAi.rotateZ(piG)            
            protonAi.position = [2*flipPN, 0,0]  
        print('proton[',i+1,'].position =', protonAi.position)

    if i == 9:
        if 10 == atomicNumber:  # Neon
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2, 3*pP1pP2/2 + p2p3 + 2*flipPN]
            maxZNeg = -3*pP1pP2/2 - 4*flipPN
            maxZPos = 3*pP1pP2/2 + 4*flipPN
        elif 11 <= atomicNumber < 14:
            protonAi.position = [0, 0, 3*pP1pP2/2 + 4*flipPN]
        elif 14 == atomicNumber:
            protonAi.rotateY(piG/2)
            protonAi.position = [pP1pP2 + 2*flipPN, 0,0]
        elif 15 == atomicNumber:
            protonAi.position = [0, 0, 3*pP1pP2/2 + 4*flipPN]            
        elif 16 <= atomicNumber:
            protonAi.rotateY(piG/2)
            protonAi.position = [pP1pP2 + 2*flipPN, 0,0]            
        print('proton[',i+1,'].position =', protonAi.position)
      
    if i == 10:
        if 11 <= atomicNumber < 13: # Sodium
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,0, -3*pP1pP2/2-6*flipPN]
            maxZPos = 3*pP1pP2/2+4*flipPN
            maxZNeg = -3*pP1pP2/2-6*flipPN
        elif 13 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, -pP1pP2/2, -3*pP1pP2/2-6*flipPN]
        elif 14 == atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [ 0, 2*flipPN, 0]
        elif 15 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [ 0, 2*flipPN, 0]
        elif 16 == atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [ 0, 2*flipPN, 0]
        elif 17 == atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, pP1pP2/2, 3*pP1pP2/2+6*flipPN]
        elif 18 <= atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [ 0, 2*flipPN, 0]
        print('proton[',i+1,'].position =', protonAi.position)
 
    if i == 11:
        if 12 <= atomicNumber < 14 : # Magnesium
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0, 0, 3*pP1pP2/2 + 6*flipPN]
            maxZNeg = -3*pP1pP2/2 - 6*flipPN
            maxZPos =  3*pP1pP2/2 + 6*flipPN
        elif 14 == atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [ 0,-pP1pP2-2*flipPN,0]
        elif 15 == atomicNumber:            
            protonAi.rotateX(piG)
            protonAi.position = [0, 0, pP1pP2/2 + 4*flipPN]
        elif 16 == atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [ 0,-pP1pP2-2*flipPN,0]
        elif 17 == atomicNumber:            
            protonAi.rotateX(piG/2)
            protonAi.position = [0, -pP1pP2/2, 3*pP1pP2/2 + 6*flipPN]
        elif 18 <= atomicNumber:            
            protonAi.rotateX(piG/2)
            protonAi.position = [ 0,-pP1pP2-2*flipPN,0]
        print('proton[',i+1,'].position =', protonAi.position)
      
    if i == 12:
        if 13 == atomicNumber: # Aluminum
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,pP1pP2/2, -3*pP1pP2/2-6*flipPN]            
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2 + 6*flipPN
        elif 14 == atomicNumber < 15:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 2*flipPN + pP1pP2, 0]
        elif 15 == atomicNumber:
            protonAi.position = [ 0,0, -pP1pP2/2-4*flipPN]
        elif 16 == atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 2*flipPN + pP1pP2, 0]
        elif 17 == atomicNumber:
            protonAi.rotateY(piG)
            protonAi.rotateZ(piG)
            protonAi.position = [ 0,0, -3*pP1pP2/2-4*flipPN]
        elif 18 <= atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 2*flipPN + pP1pP2, 0]
        print('proton[',i+1,'].position =', protonAi.position)
        
    if i == 13:
        if 14 == atomicNumber: # Silicon, the carousal level
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,-2*flipPN,0]
            maxZNeg = -pP1pP2-4*flipPN
            maxZPos = pP1pP2+4*flipPN
        if 15 == atomicNumber: # Silicon, the carousal level
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,-2*flipPN,0]
        if 16 == atomicNumber: # Silicon, the carousal level
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,-2*flipPN,0]
        if 17 == atomicNumber:
            protonAi.position = [0, 0, 3*pP1pP2/2+4*flipPN]            
        if 18 <= atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,-2*flipPN,0]
        print('proton[',i+1,'].position =', protonAi.position)

    if i == 14:
        if 15 == atomicNumber: # Phosphorus 
            protonAi.rotateX(piG)
            protonAi.position = [0, 0, pP1pP2/2 + 4*flipPN]
            maxZNeg = -pP1pP2/2 - 4*flipPN
            maxZPos =  pP1pP2/2 + 4*flipPN
        if 16 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG)
            protonAi.position = [0, 0, pP1pP2/2 + 4*flipPN]
        if 17 <= atomicNumber:
            protonAi.rotateX(piG)
            protonAi.position = [0, 0, pP1pP2/2 + 4*flipPN]
        print('proton[',i+1,'].position =', protonAi.position)
      
    if i == 15:
        if 16 == atomicNumber: # Sulfur
            protonAi.remove(neutronAi)
            protonAi.position = [0, 0, -pP1pP2/2 - 4*flipPN]
            maxZNeg = -pP1pP2/2 - 4*flipPN
            maxZPos = pP1pP2/2 + 4*flipPN
        if 17 <= atomicNumber:
            protonAi.position = [0, 0, -pP1pP2/2 - 4*flipPN]
        print('proton[',i+1,'].position =', protonAi.position)

    if i == 16:
        if 17 ==atomicNumber: # Chlorine
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)          
            protonAi.position = [0,0,-3*pP1pP2/2-6*flipPN]          
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
        if 18 <=atomicNumber < 21:
            protonAi.rotateY(piG)
            protonAi.rotateZ(piG)
            protonAi.position = [0,0,-3*pP1pP2/2-4*flipPN]
        if 21 <=atomicNumber:
            protonAi.rotateY(piG)
            protonAi.rotateZ(piG)
            protonAi.position = [0,0,-3*pP1pP2/2-4*flipPN]            
        print('proton[',i+1,'].position =', protonAi.position)

    if i == 17:
        if 18 <=atomicNumber: # Argon
            protonAi.position = [0,0,3*pP1pP2/2+4*flipPN]
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos = 3*pP1pP2/2+4*flipPN
        print('proton[',i+1,'].position =', protonAi.position)
        
    if i == 18:
        if 19 <= atomicNumber < 21: # Potassium
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0, -3*pP1pP2/2-6*flipPN]
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+4*flipPN
        if 21 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateZ(piG/2)
            protonAi.position = [pP1pP2+4*flipPN, 0, 0]
            neutronBi.position = [-pP1pP2-2*flipPN-p1n2,pP1pP2+4*flipPN,0]  
            protonAi.add(neutronBi)
        if 22 <= atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateZ(-piG/2)
            protonAi.position = [pP1pP2+4*flipPN, 0, 0]  
        print('proton[',i+1,'].position =', protonAi.position)
      
    if i == 19:
        if 20 ==atomicNumber: # Calcium
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)            
            protonAi.position = [0,0,3*pP1pP2/2+6*flipPN]          
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
        if 21 ==atomicNumber: # Calcium
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)            
            protonAi.position = [0,0,3*pP1pP2/2+6*flipPN]          
            neutronBi.position = [0,-3*pP1pP2/2-6*flipPN,-pP1pP2-2*flipPN - p1n2]
            protonAi.add(neutronBi)
        if 22 <=atomicNumber: # Calcium
            protonAi.remove(neutronAi)
            protonAi.position = [0,pP1pP2+4*flipPN,0]          
        print('proton[',i+1,'].position =', protonAi.position)
        
    if i == 20:
        if 21 <=atomicNumber < 24: # Scandium 
            protonAi.remove(neutronAi)
            protonAi.rotateZ(piG/2)            
            protonAi.position = [-pP1pP2-4*flipPN,0,0]
            neutronBi.position = [0,-pP1pP2-4*flipPN,-3*pP1pP2/2-4*flipPN-p1n2]
            protonAi.add(neutronBi)            
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
        if 24 <= atomicNumber: # Scandium 
            protonAi.remove(neutronAi)
            protonAi.rotateZ(piG/2)            
            protonAi.position = [-pP1pP2-4*flipPN,0,0]
        print('proton[',i+1,'].position =', protonAi.position)
        
    if i == 21:
        if 22 <=atomicNumber: # Titanium
            protonAi.remove(neutronAi)
            protonAi.position = [0,-pP1pP2-4*flipPN,0]
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
        print('proton[',i+1,'].position =', protonAi.position)
        
    if i == 22:
        if 23 <=atomicNumber: # Vanadium
            protonAi.rotateX(piG/2)
            protonAi.remove(neutronAi)
            protonAi.position = [0,0, 3*pP1pP2/2+6*flipPN]
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
        print('proton[',i+1,'].position =', protonAi.position)
        
    if i == 23:
        if 24 <=atomicNumber: # Chromium
            protonAi.rotateX(piG/2)
            protonAi.remove(neutronAi)
            protonAi.position = [0,0, -3*pP1pP2/2-6*flipPN]
            maxZNeg = -3*pP1pP2/2-8*flipPN
            maxZPos =  3*pP1pP2/2+8*flipPN
        print('proton[',i+1,'].position =', protonAi.position)
        
    if i == 24:
        if 25 == atomicNumber: # Manganese
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0, -3*pP1pP2/2-6*flipPN]
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
        print('proton[',i+1,'].position =', protonAi.position)
        
    if i > 24:
        break
        
    grpAn.add( protonAi )

grpAn.position = [0,0,(-maxZNeg + maxZPos)/2 - maxZPos]

In[6]
scene = Scene(children=[grpAn, camera, key_light, ambient_light])
controller = OrbitControls(controlling=camera, screenSpacePanning=True)

In[7]
renderer = Renderer(camera=camera, scene=scene, controls=[controller],
                    width=view_width, height=view_height)
scene = Scene()  # initialising the scene

In[8]
renderer

Cr6, your excel doc MathisAllElementsv30 has been my sole atomic model reference, thank you very much.
 
After a little more code organizing I was ready to start properly positioning neutrons.

The main neutron rule appears to be to omit any “exposed” neutrons, do not include any neutrons not within an alpha. In the image above, calcium’s left and right side (actually top and bottom) protons do not have neutrons. Code wise, now that the top of the loop includes all the protonAi.add(neutronAi) commands, I needed to add new protonAi.remove(neutronAi) commands inside the loops. I should mention that neutronAi is not an addressable object outside the i-loop. I may need to change that before this project is complete.

The next neutron rule is to include exposed neutrons only when they are held close and directly outward from the proton, as we see outside scandium’s top, left and bottom alpha protons. For that, I added a new group, and new protonAi.add(neutronBi) commands where needed. For example, I include the new alternate neutron with Hydrogen’s proton. Of course we know Hydrogen isotopes with two (deuterium) and three (tritium) neutrons also exist.

Making those changes, and adding these five latest elements, the main In[] cell code went from 340 to about 460 lines (ignoring the proton position print commands which I’ll remove after the atoms are built).

Another code change is a new cell In[3], which prints a list called elements that the user can review when asked to enter an Atomic number.

More Later.
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Sun Sep 05, 2021 2:41 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Two6th10
Iron through Zinc.

The protons have been brought closer together, as I believe they should be, in preparation for Krypton(36); where argon’s 9 alpha configuration doubles to 18. I’ll post images of gallium (31) through bromine(35) before getting to krypton.

Once again, up/down is mainly left/right in these images. Please notice that in addition to protons becoming alphas, neutrons and protons have been switching in and out of the main up/down channel's hook positions. The code lines now total 775.

Posting half the code lines 1 - 379 here, the rest in the next post.
Code:

In[1]:
from pythreejs import *
from IPython.display import display
#from ipywidgets import VBox, HBox, Checkbox, jslink
#import ipywidgets as widgets
import ipywidgets
from math import sqrt
phi = (1+sqrt(5))/2  # calculating phi-based-pi, piG.
piG = 4/sqrt(phi)    # piG is used instead of pi.

In[2]:
view_width = 600
view_height = 400
factor = 40 # orthographic "scaler"
camera = PerspectiveCamera(position=[10, 0, 0], up=[0, 0, 1], aspect=view_width/view_height)
#camera = PerspectiveCamera(position=[10, 0, 0], up=[1, 0, 0], aspect=view_width/view_height)
camera = PerspectiveCamera(position=[10, 0, 0], up=[0, 1, 0], aspect=view_width/view_height)
#camera = OrthographicCamera(view_width/-factor,view_width/factor,view_height / factor,
#    view_height / - factor,0.1,1000)  # The orbital controls doesn't work with ortho(?)
key_light = DirectionalLight(position=[0, 10, 10])
ambient_light = AmbientLight()

In[3]
elements = ["1.Hydrogen", "2.Helium", "3.Lithium", "4.Beryllium", "5.Boron",
           "6.Carbon", "7.Nitrogen", "8.Oxygen", "9.Fluorine", "10.Neon", "11.Sodium",
           "12.Magnesium", "13.Aluminum", "14.Silicon", "15.Phosphorus", "16.Sulfur",
           "17.Chlorine", "18.Argon", "19.Potassium", "20.Calcium", "21.Scandium",
           "22.Titanium", "23.Vanadium", "24.Chromium", "25.Manganese", "26 Iron Fe",
           "27 Cobalt Co","28 Nickel Ni","29 Copper Cu","30 Zinc Zn","31 Gallium Ga",
           "32 Germanium Ge","33 Arsenic As","34 Selenium Se","35 Bromine Br","36 Krypton Kr"]
print( elements )

In[4]
number = input( "Please enter an Atomic number: " )
number = int( number )
print( "The Atomic number selected is", elements[number-1])

In[5]
grpAn = Group()   # An - Atomic Number
#atomicNumber = 30 # Easier place to change An when coding
atomicNumber = number  # Enter the desired number of protons

# Dimensions
pP1pP2 = 1.5 # Proton 1 to proton 2, Pole-to-pole separation.
pRadius = 0.5
nRadius = 0.6
eRadius = 0.15
emRadius = 6
p2p3 = pRadius*2.5  # small gap
n1n2 = 4.0  # Alpha, left-right (y) neutron-neutron orbital separation
p1n1 = pP1pP2/2 # Alpha, up-down (z) proton-orbital neutron separation
p1n2 = pRadius + nRadius + 0.5  # In line proton and neutron
e1e2 = 2.0  # 0.5  # electron-electron separation
flipPN = 3 # Dist. between adjacent vertical and horiz protons
maxZNeg = 0.0 # maxZNeg and maxZPos are Used to center(z) the atom on the screen
maxZPos = 0.0 # chain  

# Proton set Geometries and Materials
protonGeometry =  SphereBufferGeometry(pRadius, 24, 16)
neutronGeometry =  SphereBufferGeometry(nRadius, 24, 16)
electronGeometry =  SphereBufferGeometry(eRadius, 8, 16)
emissionGeometry = CircleGeometry(emRadius, 24)
protonMaterial = MeshStandardMaterial(color='blue')
neutronMaterial = MeshStandardMaterial(color='red')
electronMaterial = MeshStandardMaterial(color='cyan')
emissionmaterial = MeshStandardMaterial(color='gray',
    transparent = True,opacity = 0.4)

# Assemble the atomic models.
for i in range( atomicNumber ):
    emissionA2i = Mesh( emissionGeometry, emissionmaterial)
    emissionA2i.rotateX(piG)
    protonAi = Group()
    protonAi.add(Mesh(protonGeometry, protonMaterial))
    protonAi.add(Mesh(emissionGeometry, emissionmaterial))
    protonAi.add(emissionA2i)
    neutronAi = Group()
    neutronAi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronAi.position = [0,-n1n2/2,-p1n1]
    neutronBi = Group()
    neutronBi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronCi = Group()
    neutronCi.add(Mesh(neutronGeometry, neutronMaterial))
    protonAi.add(neutronAi)
    electronAi = Group()
    electronAi.add(Mesh(electronGeometry, electronMaterial))
    electronAi.position = [0,-e1e2/2,-p1e1]
    protonAi.add(electronAi)
    protonAi.position = [0,0,0]
    
    if i == 0:
        if 1 == atomicNumber: # Hydrogen. Remove the orbitable neutron and  
            neutronAi.position = [0,0,-p1n2]
            maxZNeg = 0  
            maxZPos = 0
        elif 1 < atomicNumber: # or the first proton of a larger atom.
            protonAi.position = [0,0,pP1pP2/2]
        print('[',i+1,']', protonAi.position)

    if i == 1:
        if 2<=atomicNumber: # Helium
            protonAi.rotateX(-piG)
            protonAi.position = [0,0, -pP1pP2/2]
            maxZNeg = -pP1pP2/2
            maxZPos = pP1pP2/2
        print('[',i+1,']', protonAi.position)
      
    if i == 2:
        if 3 == atomicNumber: # Lithium
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0, -pP1pP2/2-2*flipPN]
            maxZNeg = -pP1pP2/2-2*flipPN
            maxZPos = pP1pP2/2
        if 3 < atomicNumber < 7:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0, -pP1pP2/2-2*flipPN]
        if 7 <= atomicNumber < 11:
            protonAi.position = [0,0,-pP1pP2/2-p2p3]
        elif 11 <= atomicNumber < 26:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,pP1pP2/2,-pP1pP2/2-2*flipPN]
        elif 26 <= atomicNumber < 29:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,pP1pP2/2,-pP1pP2/2-2*flipPN]            
            neutronBi.position = [0,0,p1n2]
            protonAi.add(neutronBi)
        elif 29 == atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,pP1pP2/2,-pP1pP2/2-2*flipPN]            
            neutronBi.position = [0,p1n2/2,p1n2]
            neutronCi.position = [0,-p1n2/2,p1n2]            
            protonAi.add(neutronBi)            
            protonAi.add(neutronCi)
        elif 30 == atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,pP1pP2/2,-pP1pP2/2-2*flipPN]
        elif 31 == atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,pP1pP2/2,-pP1pP2/2-2*flipPN]
            neutronBi.position = [0,0,p1n2]
            protonAi.add(neutronBi)      
            
        elif 32 <= atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,pP1pP2/2,-pP1pP2/2-2*flipPN]
            
            #neutronBi.position = [0,0,p1n2]
            #protonAi.add(neutronBi)
            
        print('[',i+1,']', protonAi.position)

        
    if i == 3:
        if 4 == atomicNumber: # Beryllium 
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0, 0, 2*flipPN + pP1pP2/2 ]
            maxZPos = pP1pP2/2+2*flipPN
            maxZNeg = -pP1pP2/2-2*flipPN
        elif 5 <= atomicNumber < 11:
            protonAi.rotateX(piG)
            protonAi.position = [0, 0, p2p3 + pP1pP2/2 ]
        elif 11 <= atomicNumber < 27:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,pP1pP2/2,pP1pP2/2+2*flipPN]
        elif 27 <= atomicNumber < 31:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,pP1pP2/2,pP1pP2/2+2*flipPN]
            neutronBi.position = [0,0,p1n2]
            protonAi.add(neutronBi)    
        elif 31 == atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,pP1pP2/2,pP1pP2/2+2*flipPN]
        elif 32 == atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,pP1pP2/2,pP1pP2/2+2*flipPN]
            neutronBi.position = [0,0,p1n2]
            protonAi.add(neutronBi)              
        elif 33 <= atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,pP1pP2/2,pP1pP2/2+2*flipPN]
        print('[',i+1,']', protonAi.position)
        
    if i == 4:
        if 5 <= atomicNumber < 11: # Boron
            protonAi.position = [0, 0, 3*pP1pP2/2 + p2p3]
            maxZNeg = -pP1pP2/2-2*flipPN
            maxZPos = 3*pP1pP2/2 + p2p3
        elif 11 <= atomicNumber < 26:
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2,pP1pP2/2+2*flipPN]
        elif 26 <= atomicNumber < 29:
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2,pP1pP2/2+2*flipPN]
            neutronBi.position = [0,0,p1n2]
            protonAi.add(neutronBi)
        elif 29 == atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2,pP1pP2/2+2*flipPN]
            neutronBi.position = [0,-p1n2/2,p1n2]
            neutronCi.position = [0,p1n2/2,p1n2]            
            protonAi.add(neutronBi)            
            protonAi.add(neutronCi)
        elif 30 <= atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2,pP1pP2/2+2*flipPN]
        print('[',i+1,']', protonAi.position)
                  
    if i == 5:
        if 6 == atomicNumber: # Carbon
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0,3*pP1pP2/2+p2p3+2*flipPN]
            maxZPos = p2p3+3*pP1pP2/2+2*flipPN
            maxZNeg = -pP1pP2/2-2*flipPN
        if 6 < atomicNumber < 11:
            protonAi.rotateX(piG)
            protonAi.position = [0,0,-3*pP1pP2/2 - p2p3]
        elif 11 <= atomicNumber < 26:
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2,-pP1pP2/2-2*flipPN]
        elif 26 <= atomicNumber < 31:
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2,-pP1pP2/2-2*flipPN]
            neutronBi.position = [0,0,p1n2]
            protonAi.add(neutronBi)
        elif 31 == atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2,-pP1pP2/2-2*flipPN]
        elif 32 <= atomicNumber < 34:
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2,-pP1pP2/2-2*flipPN]
            neutronBi.position = [0,0,p1n2]
            protonAi.add(neutronBi)      
        elif 34 <= atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2,-pP1pP2/2-2*flipPN]
        print('[',i+1,']', protonAi.position)

    if i == 6:
        if 7 == atomicNumber: # Nitrogen
            protonAi.remove(neutronAi)    
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0,-3*pP1pP2/2 - p2p3 - 2*flipPN]
            maxZPos = 3*pP1pP2/2 + p2p3
            maxZNeg = -3*pP1pP2/2 - p2p3 - 2*flipPN
        if 7 < atomicNumber < 9:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0,-3*pP1pP2/2 - p2p3 - 2*flipPN]
        elif 9 <= atomicNumber < 10:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,pP1pP2/2,-3*pP1pP2/2 - p2p3 - 2*flipPN]
        elif 10 ==atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,pP1pP2/2,-3*pP1pP2/2 - p2p3 - 2*flipPN]
        elif 11 <= atomicNumber < 14:
            protonAi.position = [0, 0, -pP1pP2/2 - 4*flipPN ]
        elif 14 == atomicNumber:
            protonAi.rotateY(piG/2)
            protonAi.rotateZ(piG)            
            protonAi.position = [-2*flipPN, 0, 0]
        elif 15 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateY(piG/2)
            protonAi.rotateZ(piG)            
            protonAi.position = [-2*flipPN, 0, 0]
        elif 16 <= atomicNumber:
            protonAi.rotateY(piG/2)
            protonAi.rotateZ(piG)            
            protonAi.position = [-2*flipPN, 0, 0]
        print('[',i+1,']', protonAi.position)
          
    if i == 7:
        if 8 == atomicNumber: # Oxygen
            protonAi.remove(neutronAi)  
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,0,3*pP1pP2/2 + p2p3 + 2*flipPN]
            maxZPos = 3*pP1pP2/2 + p2p3 + 2*flipPN
            maxZNeg = -3*pP1pP2/2 - p2p3 - 2*flipPN
        if 9 == atomicNumber < 11:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2,-3*pP1pP2/2-p2p3-2*flipPN]
        if 10 == atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2,-3*pP1pP2/2-p2p3-2*flipPN]
        elif 11 <=atomicNumber < 14:
            protonAi.rotateX(-piG)
            protonAi.position = [0,0,-3*pP1pP2/2-4*flipPN]
        elif 14 == atomicNumber:
            protonAi.rotateY(-piG/2)
            protonAi.position = [-2*flipPN - pP1pP2, 0, 0]
        elif 15 ==atomicNumber:
            protonAi.rotateX(-piG)
            protonAi.position = [0,0,-3*pP1pP2/2-4*flipPN]
        elif 16 <= atomicNumber:
            protonAi.rotateY(-piG/2)
            protonAi.position = [-2*flipPN - pP1pP2, 0, 0]
        print('[',i+1,']', protonAi.position)

    if i == 8:
        if 9 <= atomicNumber < 10: # Fluorine
            protonAi.remove(neutronAi)  
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0, 3*pP1pP2/2 + p2p3 + 2*flipPN]
            maxZNeg = -3*pP1pP2/2 - p2p3 - 2*flipPN
            maxZPos = 3*pP1pP2/2 + p2p3 + 2*flipPN
        elif 10 <= atomicNumber < 11:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,pP1pP2/2, 3*pP1pP2/2 + p2p3 + 2*flipPN]
        elif 11 <= atomicNumber < 14:
            protonAi.rotateX(piG)
            protonAi.position = [0, 0, pP1pP2/2 + 4*flipPN]
        elif 14 == atomicNumber:            
            protonAi.rotateY(-piG/2)
            protonAi.rotateZ(piG)            
            protonAi.position = [2*flipPN, 0,0]  
        elif 15 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateY(-piG/2)
            protonAi.rotateZ(piG)            
            protonAi.position = [2*flipPN, 0,0]
        elif 16 <= atomicNumber:            
            protonAi.rotateY(-piG/2)
            protonAi.rotateZ(piG)            
            protonAi.position = [2*flipPN, 0,0]  
        print('[',i+1,']', protonAi.position)

    if i == 9:
        if 10 == atomicNumber:  # Neon
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2, 3*pP1pP2/2 + p2p3 + 2*flipPN]
            maxZNeg = -3*pP1pP2/2 - 4*flipPN
            maxZPos = 3*pP1pP2/2 + 4*flipPN
        elif 11 <= atomicNumber < 14:
            protonAi.position = [0, 0, 3*pP1pP2/2 + 4*flipPN]
        elif 14 == atomicNumber:
            protonAi.rotateY(piG/2)
            protonAi.position = [pP1pP2 + 2*flipPN, 0,0]
        elif 15 == atomicNumber:
            protonAi.position = [0, 0, 3*pP1pP2/2 + 4*flipPN]            
        elif 16 <= atomicNumber:
            protonAi.rotateY(piG/2)
            protonAi.position = [pP1pP2 + 2*flipPN, 0,0]            
        print('[',i+1,']', protonAi.position)
      
    if i == 10:
        if 11 <= atomicNumber < 13: # Sodium
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,0, -3*pP1pP2/2-6*flipPN]
            maxZPos = 3*pP1pP2/2+4*flipPN
            maxZNeg = -3*pP1pP2/2-6*flipPN
        elif 13 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, -pP1pP2/2, -3*pP1pP2/2-6*flipPN]
        elif 14 == atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [ 0, 2*flipPN, 0]
        elif 15 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [ 0, 2*flipPN, 0]
        elif 16 == atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [ 0, 2*flipPN, 0]
        elif 17 == atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, pP1pP2/2, 3*pP1pP2/2+6*flipPN]
        elif 18 <= atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [ 0, 2*flipPN, 0]
        print('[',i+1,']', protonAi.position)

Before adding a single new proton, along with moving each and every prior proton slightly sideways to accommodate all the alpha doublings, I think I need to go back to start and create new alpha, argon and krypton groups and see what that does to the code.

This post is in two parts.
.


Last edited by LongtimeAirman on Sun Sep 05, 2021 2:49 pm; edited 1 time in total

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Sun Sep 05, 2021 2:45 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Three110
Gallium through Bromine.

The remaining code, lines 380 - 775
Code:

 
    if i == 11:
        if 12 <= atomicNumber < 14 : # Magnesium
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0, 0, 3*pP1pP2/2 + 6*flipPN]
            maxZNeg = -3*pP1pP2/2 - 6*flipPN
            maxZPos =  3*pP1pP2/2 + 6*flipPN
        elif 14 == atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [ 0,-pP1pP2-2*flipPN,0]
        elif 15 == atomicNumber:            
            protonAi.rotateX(piG)
            protonAi.position = [0, 0, pP1pP2/2 + 4*flipPN]
        elif 16 == atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [ 0,-pP1pP2-2*flipPN,0]
        elif 17 == atomicNumber:            
            protonAi.rotateX(piG/2)
            protonAi.position = [0, -pP1pP2/2, 3*pP1pP2/2 + 6*flipPN]
        elif 18 <= atomicNumber:            
            protonAi.rotateX(piG/2)
            protonAi.position = [ 0,-pP1pP2-2*flipPN,0]
        elif 26 <= atomicNumber:            
            protonAi.rotateX(piG/2)
            protonAi.position = [ 0,-pP1pP2-2*flipPN,0]
        print('[',i+1,']', protonAi.position)
      
    if i == 12:
        if 13 == atomicNumber: # Aluminum
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,pP1pP2/2, -3*pP1pP2/2-6*flipPN]            
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2 + 6*flipPN
        elif 14 == atomicNumber < 15:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 2*flipPN + pP1pP2, 0]
        elif 15 == atomicNumber:
            protonAi.position = [ 0,0, -pP1pP2/2-4*flipPN]
        elif 16 == atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 2*flipPN + pP1pP2, 0]
        elif 17 == atomicNumber:
            protonAi.rotateY(piG)
            protonAi.rotateZ(piG)
            protonAi.position = [ 0,0, -3*pP1pP2/2-4*flipPN]
        elif 18 <= atomicNumber < 27:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 2*flipPN + pP1pP2, 0]
        elif 27 == atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 2*flipPN + pP1pP2, 0]
            neutronBi.position = [0,0,p1n2]
            protonAi.add(neutronBi)
        elif 28 <= atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 2*flipPN + pP1pP2, 0]
        print('[',i+1,']', protonAi.position)
        
    if i == 13:
        if 14 == atomicNumber: # Silicon, the carousal level
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,-2*flipPN,0]
            maxZNeg = -pP1pP2-4*flipPN
            maxZPos = pP1pP2+4*flipPN
        if 15 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,-2*flipPN,0]
        if 16 == atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,-2*flipPN,0]
        if 17 == atomicNumber:
            protonAi.position = [0, 0, 3*pP1pP2/2+4*flipPN]            
        if 18 <= atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,-2*flipPN,0]
        print('[',i+1,']', protonAi.position)

    if i == 14:
        if 15 == atomicNumber: # Phosphorus 
            protonAi.rotateX(piG)
            protonAi.position = [0, 0, pP1pP2/2 + 4*flipPN]
            maxZNeg = -pP1pP2/2 - 4*flipPN
            maxZPos =  pP1pP2/2 + 4*flipPN
        if 16 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG)
            protonAi.position = [0, 0, pP1pP2/2 + 4*flipPN]
        if 17 <= atomicNumber:
            protonAi.rotateX(piG)
            protonAi.position = [0, 0, pP1pP2/2 + 4*flipPN]
        print('[',i+1,']', protonAi.position)
      
    if i == 15:
        if 16 == atomicNumber: # Sulfur
            protonAi.remove(neutronAi)
            protonAi.position = [0, 0, -pP1pP2/2 - 4*flipPN]
            maxZNeg = -pP1pP2/2 - 4*flipPN
            maxZPos = pP1pP2/2 + 4*flipPN
        if 17 <= atomicNumber:
            protonAi.position = [0, 0, -pP1pP2/2 - 4*flipPN]
        print('[',i+1,']', protonAi.position)

    if i == 16:
        if 17 ==atomicNumber: # Chlorine
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)          
            protonAi.position = [0,0,-3*pP1pP2/2-6*flipPN]          
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
        if 18 <=atomicNumber < 21:
            protonAi.rotateY(piG)
            protonAi.rotateZ(piG)
            protonAi.position = [0,0,-3*pP1pP2/2-4*flipPN]
        if 21 <=atomicNumber:
            protonAi.rotateY(piG)
            protonAi.rotateZ(piG)
            protonAi.position = [0,0,-3*pP1pP2/2-4*flipPN]            
        print('[',i+1,']', protonAi.position)

    if i == 17:
        if 18 <=atomicNumber: # Argon
            protonAi.position = [0,0,3*pP1pP2/2+4*flipPN]
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos = 3*pP1pP2/2+4*flipPN
        print('[',i+1,']', protonAi.position)
        
    if i == 18:
        if 19 <= atomicNumber < 21: # Potassium
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0, -3*pP1pP2/2-6*flipPN]
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+4*flipPN
        if 21 == atomicNumber: #Moving the neutron to proton 12
            neutronAi.position = [-pP1pP2-2*flipPN-p1n2,pP1pP2+4*flipPN,0]
            protonAi.rotateZ(piG/2)
            protonAi.position = [pP1pP2+4*flipPN, 0, 0]
        if 22 <= atomicNumber < 26:
            protonAi.remove(neutronAi)
            protonAi.rotateZ(-piG/2)
            protonAi.position = [pP1pP2+4*flipPN, 0, 0]  
        if 26 == atomicNumber:
            protonAi.rotateZ(-piG/2)
            protonAi.position = [pP1pP2+4*flipPN, 0, 0]
            neutronAi.position = [0,0,p1n2]
            electronAi.position = [0,0,p1e1]
        if 27 <= atomicNumber:
            protonAi.rotateZ(-piG/2)
            protonAi.position = [pP1pP2+4*flipPN, 0, pP1pP2/2]
        print('[',i+1,']', protonAi.position)
      
    if i == 19:
        if 20 ==atomicNumber: # Calcium
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)            
            protonAi.position = [0,0,3*pP1pP2/2+6*flipPN]          
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
        if 21 ==atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)            
            protonAi.position = [0,0,3*pP1pP2/2+6*flipPN]          
            neutronBi.position = [0,-3*pP1pP2/2-6*flipPN,-pP1pP2-2*flipPN - p1n2]
            protonAi.add(neutronBi)
        if 22 <= atomicNumber < 26:
            protonAi.remove(neutronAi)
            protonAi.position = [0,pP1pP2+4*flipPN,0]      
        if 26 ==atomicNumber:
            neutronAi.position = [0,0,-p1n2]
            protonAi.position = [0,pP1pP2+4*flipPN,0]
        if 27 <=atomicNumber:
            protonAi.rotateY(piG)            
            protonAi.rotateZ(-piG/2)
            protonAi.position = [pP1pP2+4*flipPN,0,-pP1pP2/2]
        print('[',i+1,']', protonAi.position)

    if i == 20:
        if 21 <=atomicNumber < 24: # Scandium 
            protonAi.remove(neutronAi)
            protonAi.rotateZ(piG/2)            
            protonAi.position = [-pP1pP2-4*flipPN,0,0]
            neutronBi.position = [0,-pP1pP2-4*flipPN,-3*pP1pP2/2-4*flipPN-p1n2]
            protonAi.add(neutronBi)            
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
        if 24 <= atomicNumber < 26:
            protonAi.remove(neutronAi)
            protonAi.rotateZ(piG/2)            
            protonAi.position = [-pP1pP2-4*flipPN,0,0]
        if 26 == atomicNumber:
            protonAi.rotateZ(piG/2)            
            protonAi.position = [-pP1pP2-4*flipPN,0,0]
            neutronAi.position = [0,0,p1n2]
        if 27 <= atomicNumber:
            protonAi.rotateZ(piG/2)            
            protonAi.position = [-pP1pP2-4*flipPN,0,pP1pP2/2]
        print('[',i+1,']', protonAi.position)
        
    if i == 21:
        if 22 <=atomicNumber: # Titanium
            protonAi.remove(neutronAi)
            protonAi.position = [0,-pP1pP2-4*flipPN,0]
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
        if 26 ==atomicNumber:
            protonAi.position = [0,-pP1pP2-4*flipPN,0]
            neutronBi.position = [0,0,-p1n2]
            protonAi.add(neutronBi)  
        if 27 <=atomicNumber < 29:
            protonAi.position = [0,-pP1pP2-4*flipPN,0]
        if 29 <=atomicNumber:
            protonAi.add(neutronAi)
            protonAi.position = [0,-pP1pP2-4*flipPN,pP1pP2/2]
        print('[',i+1,']', protonAi.position)
        
    if i == 22:
        if 23 <= atomicNumber < 26: # Vanadium
            protonAi.rotateX(piG/2)
            protonAi.remove(neutronAi)
            protonAi.position = [0,0, 3*pP1pP2/2+6*flipPN]
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
        if 26 <= atomicNumber < 29:
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2, 3*pP1pP2/2+6*flipPN]
        if 29 <= atomicNumber < 31:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0, 3*pP1pP2/2+6*flipPN]
        if 31 <= atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2, 3*pP1pP2/2+6*flipPN]
        print('[',i+1,']', protonAi.position)
        
    if i == 23:
        if 24 <= atomicNumber < 30: # Chromium
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2, -3*pP1pP2/2-6*flipPN]
            maxZNeg = -3*pP1pP2/2-8*flipPN
            maxZPos =  3*pP1pP2/2+8*flipPN
        if 30 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0, -3*pP1pP2/2-6*flipPN]
        if 31 <= atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2, -3*pP1pP2/2-6*flipPN]
        print('[',i+1,']', protonAi.position)
        
    if i == 24:
        if 25 == atomicNumber: # Manganese
            protonAi.remove(neutronAi)
            protonAi.position = [0,-pP1pP2/2-2*flipPN, pP1pP2/2+2*flipPN]
            maxZNeg = -3*pP1pP2/2-8*flipPN
            maxZPos =  3*pP1pP2/2+8*flipPN
        if 26 <= atomicNumber < 30:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,pP1pP2/2, -3*pP1pP2/2-6*flipPN]
        if 30 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.position = [0,pP1pP2/2 + 2*flipPN, -pP1pP2/2-2*flipPN]
        if 31 <= atomicNumber:
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,pP1pP2/2, -3*pP1pP2/2-6*flipPN]
        print('[',i+1,']', protonAi.position)
        
    if i == 25:
        if 26 <= atomicNumber < 29: # Iron
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,pP1pP2/2, 3*pP1pP2/2+6*flipPN]
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
        if 29 <= atomicNumber:
            protonAi.rotateZ(piG)
            protonAi.rotateY(piG)
            protonAi.position = [0,pP1pP2+4*flipPN, -pP1pP2/2]
        print('[',i+1,']', protonAi.position)
                
    if i == 26:
        if 27 <= atomicNumber: # Cobalt
            protonAi.rotateY(piG)
            protonAi.rotateZ(piG/2)
            protonAi.position = [-pP1pP2-4*flipPN, 0, -pP1pP2/2]
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
        print('[',i+1,']', protonAi.position)                

    if i == 27:
        if 28 == atomicNumber: # Nickel
            protonAi.remove(neutronAi)
            protonAi.position = [0,pP1pP2+4*flipPN, 0]
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
        if 29 <= atomicNumber:
            protonAi.position = [0,pP1pP2+4*flipPN, pP1pP2/2]
        print('[',i+1,']', protonAi.position)
            
    if i == 28:
        if 29 <= atomicNumber: # Copper
            protonAi.rotateX(piG)
            protonAi.position = [0,-pP1pP2-4*flipPN,-pP1pP2/2]
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
        print('[',i+1,']', protonAi.position)
                    
    if i == 29:
        if 30 <= atomicNumber: # Zinc
            protonAi.remove(neutronAi)
            protonAi.rotateY(piG)
            protonAi.position = [0,-pP1pP2/2-2*flipPN,pP1pP2/2+2*flipPN]
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
        print('[',i+1,']', protonAi.position)
        
    if i == 30:
        if 31 <= atomicNumber: # Gallium  neutrons equal protons
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,pP1pP2/2, 3*pP1pP2/2+6*flipPN]
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
        print('[',i+1,']', protonAi.position)
        
    if i == 31:
        if 32 <= atomicNumber < 35: # Germanium
            protonAi.remove(neutronAi)
            protonAi.position = [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
        if 35 <= atomicNumber: #
            #protonAi.remove(neutronAi)
            protonAi.position = [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN + pP1pP2/2]
        print('[',i+1,']', protonAi.position)
        
    if i == 32:
        if 33 <= atomicNumber: # Arsenic
            protonAi.remove(neutronAi)
            protonAi.position = [0,pP1pP2/2+2*flipPN,pP1pP2/2+2*flipPN]            
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
        print('[',i+1,']', protonAi.position)
        
    if i == 33:
        if 34 <= atomicNumber: # Selenium
            protonAi.rotateY(piG)
            protonAi.remove(neutronAi)
            protonAi.position = [0,-pP1pP2/2-2*flipPN,-pP1pP2/2-2*flipPN]            
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
        print('[',i+1,']', protonAi.position)
        
    if i == 34:
        if 35 <= atomicNumber: # Bromine
            protonAi.rotateZ(piG)
            protonAi.rotateY(piG)
            protonAi.position = [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN-pP1pP2/2]            
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
        print('[',i+1,']', protonAi.position)

    if i == 35:
        if 36 <= atomicNumber: # Krypton
            #protonAi.rotateZ(piG)
            #protonAi.rotateY(piG)
            #protonAi.position = [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN-pP1pP2/2]  
            protonAi.position = [0,0,0]            
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
        print('[',i+1,']', protonAi.position)
        
    if i > 35:
        break
        
    grpAn.add( protonAi )

grpAn.position = [0,0,(-maxZNeg + maxZPos)/2 - maxZPos]

In[6]
scene = Scene(children=[grpAn, camera, key_light, ambient_light])
controller = OrbitControls(controlling=camera, screenSpacePanning=True)

In[7]
renderer = Renderer(camera=camera, scene=scene, controls=[controller],
                    width=view_width, height=view_height)
scene = Scene()  # initialising the scene

In[8]
renderer

In[9]
spin_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 2], values=[0, 2*piG])
spin_clip = AnimationClip(tracks=[spin_track])
spin_action = AnimationAction(AnimationMixer(grpAn), spin_clip, grpAn) # best
spin_action


Part 2 of 2
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Sun Sep 05, 2021 6:33 pm

Shocked  Wow Airman you've dropped my Jaw!!!!

Awesome work!  With @jmeyer PiG to boot. Just glad I got that Excel file put together. Intended to just show differences and similarities with classic "electron bonding" and Miles' new atomic structures-layouts. 

I love you

Chromium6

Posts : 727
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Mon Sep 06, 2021 7:02 pm

By the way I was able to get your script running successfully. 

Miles Periodic Table with Standard Periodic Table reference - Page 2 Mathis10

Chromium6

Posts : 727
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Wed Sep 08, 2021 7:12 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Bromin10
Bromine. Superimposed with the console output – the occupied positions for that element.

Code:

In[1]:
from pythreejs import *
from IPython.display import display
#from ipywidgets import VBox, HBox, Checkbox, jslink
#import ipywidgets as widgets
import ipywidgets
from math import sqrt
phi = (1+sqrt(5))/2  # calculating phi-based-pi, piG.
piG = 4/sqrt(phi)    # piG is used instead of pi.

In[2]:
view_width = 600
view_height = 400
factor = 40 # orthographic "scaler"
camera = PerspectiveCamera(position=[10, 0, 0], up=[0, 0, 1], aspect=view_width/view_height)
#camera = PerspectiveCamera(position=[10, 0, 0], up=[1, 0, 0], aspect=view_width/view_height)
camera = PerspectiveCamera(position=[10, 0, 0], up=[0, 1, 0], aspect=view_width/view_height)
#camera = OrthographicCamera(view_width/-factor,view_width/factor,view_height / factor,
#    view_height / - factor,0.1,1000)  # The orbital controls doesn't work with ortho(?)
key_light = DirectionalLight(position=[0, 10, 10])
ambient_light = AmbientLight()

In[3]
elements = ["1 Hydrogen H","2 Helium He","3 Lithium Li","4 Beryllium Be","5 Boron B",
           "6 Carbon C","7 Nitrogen N","8 Oxygen O","9 Fluorine F","10 Neon Ne","11 Sodium Na",
           "12 Magnesium Mg","13 Aluminum Al","14 Silicon Si","15 Phosphorus P","16 Sulfur S",
           "17 Chlorine Cl","18 Argon Ar","19 Potassium P","20 Calcium Ca","21 Scandium Sc",
           "22 Titanium Ti","23 Vanadium V","24 Chromium Cr","25 Manganese Mn","26 Iron Fe",
           "27 Cobalt Co","28 Nickel Ni","29 Copper Cu","30 Zinc Zn","31 Gallium Ga",
           "32 Germanium Ge","33 Arsenic As","34 Selenium Se","35 Bromine Br","36 Krypton Kr"]
print( elements )

In[4]
number = input( "Please enter the Atomic number: " )
number = int( number )
print( "The Atomic number selected is ", number,",", elements[number-1])

In[5]
grpAn = Group()   # An - Atomic Number
#atomicNumber = 20 # Easier place to change An when coding
atomicNumber = number  # Enter the desired number of protons

# Dimensions
pP1pP2 = 1.5 # Proton 1 to proton 2, Pole-to-pole separation.
pRadius = 0.5
nRadius = 0.6
eRadius = 2*pRadius/10
emRadius = 6
p2p3 = pRadius*2.5  # small gap
n1n2 = 4.0  # Alpha, left-right (y) neutron-neutron orbital separation
p1n1 = pP1pP2/2 # Alpha, up-down (z) proton-orbital neutron separation
p1n2 = pRadius + nRadius + 0.5  # In line proton and neutron
p1e1 = pRadius + 1.5*pP1pP2/10  # Alpha, top-bottom (z) proton-electron separation
e1e2 = 0.75  # 0.5  # electron-electron separation
flipPN = 3 # Dist. between adjacent vertical and horiz protons
maxZNeg = 0.0 # maxZNeg and maxZPos are Used to center(z) the atom on the screen
maxZPos = 0.0 # chain  

# Proton set Geometries and Materials
protonGeometry =  SphereBufferGeometry(pRadius, 24, 16)
neutronGeometry =  SphereBufferGeometry(nRadius, 24, 16)
electronGeometry =  SphereBufferGeometry(eRadius, 8, 16)
emissionGeometry = CircleGeometry(emRadius, 24)
protonMaterial = MeshStandardMaterial(color='blue')
#protonMaterialB = MeshStandardMaterial(color='green')
neutronMaterial = MeshStandardMaterial(color='red')
electronMaterial = MeshStandardMaterial(color='cyan')
emissionmaterial = MeshStandardMaterial(color='gray',
    transparent = True,opacity = 0.4)

# Assemble the atomic models.
for i in range( atomicNumber ):
    emissionA2i = Mesh( emissionGeometry, emissionmaterial)
    emissionA2i.rotateX(piG)
    #protonAi = Group()
    protonAi = Object3D()
    protonAi.add(Mesh(protonGeometry, protonMaterial))
    protonAi.add(Mesh(emissionGeometry, emissionmaterial))
    protonAi.add(emissionA2i)
    neutronAi = Object3D()
    neutronAi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronAi.position = [0,-n1n2/2,-p1n1]
    protonAi.add(neutronAi)
    electronAi = Object3D()
    electronAi.add(Mesh(electronGeometry, electronMaterial))
    electronAi.position = [0,-e1e2/2,-p1e1]
    protonAi.add(electronAi)
    
    emissionB2i = Mesh( emissionGeometry, emissionmaterial)
    emissionB2i.rotateX(piG)
    protonBi = Object3D()
    protonBi.add(Mesh(protonGeometry, protonMaterial))
    protonBi.add(Mesh(emissionGeometry, emissionmaterial))
    protonBi.add(emissionB2i)
    neutronBi = Object3D()
    neutronBi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronBi.position = [0,-n1n2/2,-p1n1]
    protonBi.add(neutronBi)
    electronBi = Object3D()  
    electronBi.add(Mesh(electronGeometry, electronMaterial))
    electronBi.position = [0,-e1e2/2,-p1e1]
    protonBi.add(electronBi)
    protonBi.rotateY(piG)
    protonBi.rotateZ(piG)

    neutronCi = Object3D()
    neutronCi.add(Mesh(neutronGeometry, neutronMaterial))
    
    protonEi = Object3D() # alpha
    protonEi.add(protonAi)
    protonEi.position = [0,0,pP1pP2/2]
    protonDi = Object3D()
    protonDi.add(protonBi)
    protonDi.position = [0,0,-pP1pP2/2]
    alphaAi = Object3D()
    alphaAi.add(protonEi)
    alphaAi.add(protonDi)
    
    if i == 0:
        if 1 == atomicNumber: # Hydrogen. Remove the orbitable neutron and
            neutronAi.position = [0,0,-p1n2]
            grpAn.add( protonAi )
            maxZNeg = 0  
            maxZPos = 0
            print('protonAi[',i+1,']', protonAi.position)

    if i == 1:
        if 2 <= atomicNumber < 10: # Helium
            alphaAi.position = [0,0,pP1pP2 + p2p3]
            grpAn.add( alphaAi )
            maxZNeg = p2p3
            maxZPos = pP1pP2 + p2p3
            print('alphaAi[',i+1,']', alphaAi.position)

    if i == 2:
        if 3 <= atomicNumber < 10: # Lithium
            protonAi.remove(neutronCi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0, 3*pP1pP2/2+p2p3+2*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -pP1pP2/2
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 10 <= atomicNumber < 14:
            alphaAi.position = [0, 0, pP1pP2+4*flipPN]            
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 17 <= atomicNumber < 18:
            protonAi.remove(neutronCi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
            
    if i == 3:
        if 4 == atomicNumber < 5: # Beryllium
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0, 0, pP1pP2/2+p2p3 -2*flipPN]
            grpAn.add(protonAi)
            maxZNeg = pP1pP2/2+p2p3 -2*flipPN
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('protonAi[',i+1,']', protonAi.position)  

    if i == 4:
        if 5 <= atomicNumber: # Boron
            alphaAi.position = [0, 0, 0]
            grpAn.add(alphaAi)
            maxZNeg = -pP1pP2/2
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)

    if i == 5:
        if 6 == atomicNumber < 7: # Carbon
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0,-pP1pP2/2-2*flipPN]
            grpAn.add(protonAi)
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            maxZNeg = -pP1pP2/2-2*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 15 <= atomicNumber < 16: # Carbon
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0,-3*pP1pP2/2-6*flipPN]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)

    if i == 6:
        if 7 <= atomicNumber < 10: # Nitrogen
            alphaAi.position = [0,0,-pP1pP2-p2p3]
            grpAn.add(alphaAi)
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            maxZNeg = -pP1pP2-p2p3
            print('alphaAi[',i+1,']', alphaAi.position)
        if 10 <= atomicNumber < 14:
            alphaAi.position = [0,0,-pP1pP2-4*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 15 == atomicNumber:
            alphaAi.position = [0,0,-pP1pP2-4*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)            
        if 16 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.position = [0,0,-pP1pP2/2-4*flipPN]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 17 <= atomicNumber:
            alphaAi.position = [0,0,-pP1pP2-4*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)  
            
    if i == 7:
        if 8 == atomicNumber: # Oxygen
            protonAi.remove(neutronAi)  
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0,-3*pP1pP2/2-p2p3-2*flipPN]
            grpAn.add(protonAi)
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            maxZNeg = -3*pP1pP2/2-p2p3-2*flipPN            
            print('protonAi[',i+1,']', protonAi.position)
        if 9 == atomicNumber:
            protonAi.remove(neutronAi)  
            protonAi.rotateX(piG/2)
            protonAi.position = [0,pP1pP2/2,-3*pP1pP2/2-p2p3-2*flipPN]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 10 <= atomicNumber:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0,-pP1pP2/2-2*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)

    if i == 8:
        if 9 == atomicNumber < 10: # Fluorine
            protonAi.remove(neutronAi)  
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2,-3*pP1pP2/2-p2p3-2*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -3*pP1pP2/2-p2p3-2*flipPN
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('protonAi[',i+1,']', protonAi.position)

    if i == 9:
        if 10 <= atomicNumber:  # Neon
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, pP1pP2/2 + 2*flipPN]
            grpAn.add(alphaAi)
            maxZNeg = -3*pP1pP2/2-p2p3-2*flipPN
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        
    if i == 10:
        if 11 <= atomicNumber < 14: # Sodium
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,0, pP1pP2+6*flipPN]
            grpAn.add(protonAi)
            maxZPos =  pP1pP2+6*flipPN
            maxZNeg = -pP1pP2-4*flipPN        
            print('protonAi[',i+1,']', protonAi.position)
        if 14 == atomicNumber:
            alphaAi.rotateX(-piG/2)
            #alphaAi.rotateZ(-piG/2)
            alphaAi.rotateY(-piG/2)
            alphaAi.position = [ -pP1pP2/2-2*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 15 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.rotateY(piG/2)
            protonAi.position = [-2*flipPN,0, 0]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 16 <= atomicNumber:
            alphaAi.rotateX(-piG/2)
            alphaAi.rotateY(-piG/2)
            alphaAi.position = [ -pP1pP2/2-2*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
            
    if i == 11:
        if 12 == atomicNumber: # Magnesium
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0, 0, -pP1pP2 - 6*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -pP1pP2 - 6*flipPN
            maxZPos =  pP1pP2 + 6*flipPN                
            print('protonAi[',i+1,']', protonAi.position)
        if 13 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0, pP1pP2/2+2*flipPN, 0]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 14 <= atomicNumber < 15:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,pP1pP2/2+2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 15 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,2*flipPN, 0]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 16 == atomicNumber:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,pP1pP2/2+2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 18 <= atomicNumber:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,pP1pP2/2+2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
            
    if i == 12:
        if 13 == atomicNumber: # Aluminum
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,-pP1pP2/2-2*flipPN,0]
            grpAn.add(protonAi)
            maxZNeg = -pP1pP2-4*flipPN
            maxZPos =  3*pP1pP2/2 + 6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 14 == atomicNumber:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,-pP1pP2/2-2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 15 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,-2*flipPN,0]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)            
        if 16 == atomicNumber:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,-pP1pP2/2-2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 18 <= atomicNumber:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,-pP1pP2/2-2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
            
    if i == 13:
        if 14 == atomicNumber: # Silicon, the carousal level
            alphaAi.rotateX(-piG/2)
            alphaAi.rotateY(piG/2)
            alphaAi.position = [ pP1pP2/2+2*flipPN,0,0]
            grpAn.add( alphaAi )
            maxZNeg = -pP1pP2-4*flipPN
            maxZPos = pP1pP2+4*flipPN            
            print('alphaAi[',i+1,']', alphaAi.position)
        if 15 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.rotateY(piG/2)
            protonAi.position = [2*flipPN,0,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 16 <= atomicNumber:
            alphaAi.rotateX(-piG/2)
            alphaAi.rotateY(piG/2)
            alphaAi.position = [ pP1pP2/2+2*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
            
    if i == 14:
        if 15 == atomicNumber: # Phosphorus 
            alphaAi.rotateX(piG)
            alphaAi.position = [0, 0, pP1pP2 + 4*flipPN]
            grpAn.add( alphaAi )
            maxZNeg = -pP1pP2/2 - 4*flipPN
            maxZPos =  pP1pP2/2 + 4*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 16 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG)
            protonAi.position = [0, 0, pP1pP2/2 + 4*flipPN]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 17 <= atomicNumber < 18:
            alphaAi.rotateX(piG)
            alphaAi.position = [0, 0, pP1pP2 + 4*flipPN]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
            
    if i == 15:
        if 16 == atomicNumber: # Sulfur
            protonAi.remove(neutronAi)
            protonAi.position = [0, 0, -pP1pP2/2 - 4*flipPN]
            grpAn.add( protonAi )
            maxZNeg = -pP1pP2/2 - 4*flipPN
            maxZPos = pP1pP2/2 + 4*flipPN
            print('protonAi[',i+1,']', protonAi.position)
            
    if i == 16:
        if 17 == atomicNumber: # Chlorine
            alphaAi.rotateX(piG/2)          
            alphaAi.position = [0,0,-3*pP1pP2/2-6*flipPN]
            grpAn.add( alphaAi )
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN        
            print('alphaAi[',i+1,']', alphaAi.position)
            
    if i == 17:
        if 18 <=atomicNumber: # Argon
            alphaAi.position = [0, 0, pP1pP2 + 4*flipPN]            
            grpAn.add( alphaAi )
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos = 3*pP1pP2/2+4*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)        

    if i == 18:
        if 19 <= atomicNumber < 21: # Potassium
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN            
            print('protonAi[',i+1,']', protonAi.position)
        if 21 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            neutronBi.position = [0,3*pP1pP2/2+6*flipPN,-pP1pP2 - 2*flipPN - p1n2]
            protonAi.add(neutronBi)
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 22 <= atomicNumber < 27:
            neutronAi.position = [0,0, p1n2]            
            protonAi.rotateZ(piG/2)    
            protonAi.position = [0, pP1pP2+4*flipPN,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 27 == atomicNumber:
            neutronAi.position = [0,p1n2+pP1pP2+2*flipPN,0]
            grpAn.add( neutronAi )
            print('neutronAi[',i+1,']', neutronAi.position)
        if 29 <= atomicNumber < 30:          
            neutronAi.position = [0,pP1pP2/2+p1n2,p2p3-pP1pP2/2-2*flipPN]
            grpAn.add( neutronAi )
            neutronBi.position = [0,pP1pP2/2+p1n2,-p2p3-pP1pP2/2-2*flipPN]
            grpAn.add( neutronBi )
            print('2 hook neutrons[',i+1,']', neutronAi.position)            
        if 30 == atomicNumber :
            protonAi.remove(neutronAi)
            protonAi.position = [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 32 <= atomicNumber < 35 :
            protonAi.remove(neutronAi)
            protonAi.position = [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 35 <= atomicNumber :
            alphaAi.position = [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]
            grpAn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
            
    if i == 19:
        if 20 == atomicNumber: # Calcium
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)            
            protonAi.position = [0,0,-3*pP1pP2/2-6*flipPN]          
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 21 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateZ(piG/2)
            protonAi.position = [4*flipPN+pP1pP2,0,0]
            neutronBi.position = [2*flipPN+pP1pP2 +p1n2,pP1pP2+4*flipPN,0]
            protonAi.add(neutronBi)
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 22 <= atomicNumber < 27:
            neutronAi.position = [0,0,-p1n2]
            protonAi.rotateZ(-piG/2)
            protonAi.position = [4*flipPN+pP1pP2,0,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 27 <= atomicNumber:
            alphaAi.position = [0,0,-p1n2]
            alphaAi.rotateZ(-piG/2)
            alphaAi.position = [4*flipPN+pP1pP2,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
            
    if i == 20:
        if 21 == atomicNumber: # Scandium 
            protonAi.remove(neutronAi)
            protonAi.rotateZ(piG/2)            
            protonAi.position = [-pP1pP2-4*flipPN,0,0]
            neutronBi.position = [0,-pP1pP2-4*flipPN,-3*pP1pP2/2-4*flipPN-p1n2]
            protonAi.add(neutronBi)            
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 22 <= atomicNumber < 27 :
            neutronAi.position = [0,0,p1n2]
            protonAi.rotateZ(-piG/2)            
            protonAi.position = [-pP1pP2-4*flipPN,0,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 27 <= atomicNumber:
            alphaAi.position = [0,0,p1n2]
            alphaAi.rotateZ(-piG/2)            
            alphaAi.position = [-pP1pP2-4*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)

    if i == 21:
        if 22 <=atomicNumber < 29: # Titanium
            neutronAi.position = [0,0,-p1n2]
            protonAi.rotateZ(piG/2)    
            protonAi.position = [0,-pP1pP2-4*flipPN,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 29 <=atomicNumber:
            alphaAi.rotateZ(piG/2)    
            alphaAi.position = [0,-pP1pP2-4*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
      
    if i == 22:
        if 23 <= atomicNumber < 26: # Vanadium
            protonAi.rotateX(piG/2)
            protonAi.remove(neutronAi)
            protonAi.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN        
            print('protonAi[',i+1,']', protonAi.position)
        if 26 <= atomicNumber < 29:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpAn.add(alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 29 <= atomicNumber < 31:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpAn.add(protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 31 <= atomicNumber:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpAn.add(alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
            
    if i == 23:
        if 24 <= atomicNumber < 26: # Chromium
            protonAi.rotateX(piG/2)
            protonAi.remove(neutronAi)
            protonAi.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-8*flipPN
            maxZPos =  3*pP1pP2/2+8*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 26 <= atomicNumber < 30:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpAn.add( alphaAi )
            maxZNeg = -3*pP1pP2/2-8*flipPN
            maxZPos =  3*pP1pP2/2+8*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 30 == atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.remove(neutronAi)
            protonAi.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-8*flipPN
            maxZPos =  3*pP1pP2/2+8*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 31 <= atomicNumber:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpAn.add( alphaAi )
            maxZNeg = -3*pP1pP2/2-8*flipPN
            maxZPos =  3*pP1pP2/2+8*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)        
            
    if i == 24:
        if 25 == atomicNumber: # Manganese
            protonAi.remove(neutronAi)
            protonAi.position = [0,-pP1pP2/2-2*flipPN, pP1pP2/2+2*flipPN]
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-8*flipPN
            maxZPos =  3*pP1pP2/2+8*flipPN
            print('hook protonAi[',i+1,']', protonAi.position)
        if 26 <= atomicNumber < 29: # Three hook position neutrons
            neutronAi.position = [0,-pP1pP2/2-p1n2,pP1pP2/2 + 2*flipPN]
            grpAn.add( neutronAi )
            neutronBi.position = [0,-pP1pP2/2-p1n2,-pP1pP2/2 - 2*flipPN]
            grpAn.add( neutronBi )
            neutronCi.position = [0,pP1pP2/2+p1n2,-pP1pP2/2 - 2*flipPN]
            grpAn.add( neutronCi )
            print('3 ea hook neutrons[',i+1,']', neutronAi.position)
        if 29 <= atomicNumber < 34:
            neutronAi.position = [0,-pP1pP2/2-p1n2,-pP1pP2/2 - 2*flipPN]
            grpAn.add( neutronAi )
            print('hook neutronAi[',i+1,']', neutronAi.position)
        if 34 <= atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.position = [0,-pP1pP2/2- 2*flipPN,-pP1pP2/2 - 2*flipPN]
            grpAn.add( protonAi )
            print('hook protonAi[',i+1,']', protonAi.position)

    if i == 25:
        if 26 <= atomicNumber < 29: # Iron
            print('[',i+1,'] Iron. New objects added elsewhere')
        if 29 == atomicNumber:
            neutronAi.position = [0,-pP1pP2/2-p1n2,p2p3+pP1pP2/2+2*flipPN]
            grpAn.add( neutronAi )
            neutronBi.position = [0,-pP1pP2/2-p1n2,-p2p3+pP1pP2/2+2*flipPN]
            grpAn.add( neutronBi )
            print('2 ea hook neutrons[',i+1,']', neutronAi.position)
        if 30 <= atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.position = [0,-pP1pP2/2-2*flipPN,pP1pP2/2+2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
            
    if i == 26:
        if 27 <= atomicNumber < 33: # Cobalt
            neutronAi.position = [0, pP1pP2/2+p1n2, pP1pP2/2+2*flipPN]
            grpAn.add(neutronAi)
        if 33 <= atomicNumber: # Cobalt
            protonAi.remove(neutronAi)
            protonAi.position = [0, pP1pP2/2+2*flipPN, pP1pP2/2+2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)            

    if i == 27:
        if 28 == atomicNumber: # Nickel
            protonAi.remove(neutronAi)
            protonAi.position = [0, pP1pP2+4*flipPN, 0]
            grpAn.add(protonAi)
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
            
    if i == 28:
        if 29 <= atomicNumber: # Copper
            alphaAi.position = [0, pP1pP2+4*flipPN, 0]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)

    if i > 28:
        break

grpAn.position = [0,0,(-maxZNeg + maxZPos)/2 - maxZPos]


In[6]
scene = Scene(children=[grpAn, camera, key_light, ambient_light])
controller = OrbitControls(controlling=camera, screenSpacePanning=True)

In[7]
renderer = Renderer(camera=camera, scene=scene, controls=[controller],
                    width=view_width, height=view_height)
scene = Scene()  # initialising the scene

In[8]
renderer

In[9]
spin_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 2], values=[0, 2*piG])
spin_clip = AnimationClip(tracks=[spin_track])
spin_action = AnimationAction(AnimationMixer(grpAn), spin_clip, grpAn) # best
spin_action

Please pardon my usual errors Cr6, I prefer learning by repetition and never get anything right the first (or second, …) time. Great to hear you’ve got this thing running on jupyter notebook. Play with it and soon you may be dangerous.

This latest code is an improvement over the one you’ve got. All elements up to and including Bromine are now described with 680 code lines, eighty of which are print statements for building/accounting/clarity that can be removed from a final version.
Based on alphas instead of protons, i.e. its easier to swap a proton out and put an alpha in its place than carefully add a second proton in order to create that alpha “in-place”.  At the top of the i-loop I make available: two different types of protons, three types of neutrons and an alpha from which one selects, reorients and positions as needed. I might be able to reduce that overhead if I knew how to copy 3DObjects or Groups. I made several efforts at instancing and cloning meshes - no joy.

The next atom is Krypton; instead of moving each and every prior proton (35 or so) in order to accommodate krypton’s alpha doublings, we need only reposition each and every alpha, 18 repositionings. Or start with a new krypton group – only 18 builds and no repositionings. That’s still a lot of code lines but I’m reassured this particular approach may be expanded to larger atoms.

We might improve the code by following your excel document’s example more closely, using only your numbered and oriented positions, we would have an indexed list of component pieces for each and every atom. Such a list would allow only atom building without repositioning through each and every previous atom.
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Sat Sep 11, 2021 6:43 pm

Hi LTAM,

Was looking at this site for anything that could be leveraged from the Atom2Vec project from page 1 of this thread. UC Berkley's Ceder group is trying to build DL algos for future materials discovery such as Crystals for ion batteries. 

https://ceder.berkeley.edu/

The Computational and Experimental Design of Emerging materials Research group (CEDER) is a part of the Department of Materials Science and Engineering at UC Berkeley and the Materials Sciences Division at Lawrence Berkeley National Laboratory. Our goal is to better design high quality functional materials by mapping the relationship between materials structures and their physical and chemical properties through a combined theoretical and experimental approach. Our group integrates all the aspects of materials research from developing the fundamental understanding to the design, synthesis and testing of new bulk and nano materials. We combine computational approaches in quantum mechanics, solid state physics and statistical mechanics, with selected experiments into a complimentary research strategy to investigate materials in the energy field. We are one of the premier groups in high-throughput computing and the Materials Genome and contribute extensively to the Materials Project.


Applied areas of interest are in energy storage based on Li, Na, and multi-valent ion intercalation, thermoelectrics, and other functional materials. On the fundamental side, the group develops expertise in electronic structure, ab-initio thermodynamics of bulk and nano systems, diffusion, electron transport, structure prediction, and data mining. Over the last decade, we have successfully performed many research projects supported by various companies and governments. The CEDER group offers research opportunities for students interested in theoretical, computational, or experimental work or a combination of these.

Chromium6

Posts : 727
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Sun Sep 12, 2021 3:04 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Kthruz10
Cr6, I checked out the Berkeley Ceder Group but suffered no inspirations.

With respect to this project, an ideal solution may be to present the jupyter notebook user with the Periodic Table. Select the desired atom by clicking on it. There are no doubt many examples of varying sophistication out there, here’s one. https://ptable.com/?lang=en#Properties

/\\///\\\\/////\\\\\\/////\\\\///\\/

Miles Periodic Table with Standard Periodic Table reference - Page 2 Slotla10
Slot Layout for Fluorine.

I mentioned my only atomic model reference has been your excel doc Cr6. I should explain why. The Slot Layout, a tiny grid which can describe any atomic element using no more than 19 slots (or positions). The simple example shown is Fluorine, with three occupied slots. The center position is 1. The up direction slots from 1 are 2, 4, and 14. The down slots are 3, 5, and 15. Left is 6 and 10. Right is 7 and 12. Front is 8 and 11. Back is 9 and 13. The main up/down channel has four hook positions, 16, 17, 18, and 19. Before each number we see either a vertical (|) or horizontal (–) orientation indicator. The gray indicates protons and the blue color indicates alphas. Miles and the slot layout rely on different colors to convey each multiple alpha group, 1-6. The E in slot 1 indicates 3 horizontally oriented alphas. Slot two holds a single vertical proton. The || in slot 3 indicates 2 vertically oriented protons. Any slot can contain either: 1. One neutron. 2. Two neutrons. 3. One proton w/o a neutron. 4. One proton with a neutron. 5. Two protons. 6. One alpha. 7. Two alphas. 8. Three alphas. 9 Four alphas. 10. Five alphas. 11. Six alphas. An excellent solution.
 
As currently writ, the code includes the first 7 of those 11 slot layout pre-built items: 1. One neutron, … , and 7. Two alphas. As well as the other necessary 3DObjects - electrons and proton emissions. Since last time, trying to follow Cr6’s slot layout more closely, I’ve added a double alpha object and most of the double alpha atoms up to 53 Iodine. All those elements can be built with 19 (or less) “registered” additions. Each register is the addition of that component object to the desired atom shown. 54 Xenon is built with 9 triple-alphas objects which the code does not currently include. Each triple alpha would require no less than two i-loop dummy register additions.

Here’s Silver’s (Ag 47) console output
hook protonAi[ 1 ] (0.0, 8.125, 8.125)
hook protonAi[ 2 ] (0.0, -8.125, -8.125)
dblAlphai[ 5 ] (0.0, 0.0, 0.0)
dblAlphai[ 7 ] (-8.125, 0.0, 0.0)
dblAlphai[ 8 ] (0.0, 0.0, -8.125)
protonAi[ 9 ] (16.25, 0.0, 0.0)
dblAlphai[ 10 ] (8.125, 0.0, 0.0)
dblAlphai[ 12 ] (0.0, 0.0, 8.125)
alphaAi[ 15 ] (0.0, 16.25, 0.0)
alphaAi[ 16 ] (0.0, -16.25, 0.0)
protonAi[ 17 ] (-16.25, 0.0, 0.0)
dblAlphai[ 18 ] (0.0, -8.125, 0.0)
dblAlphai[ 19 ] (0.0, 0.0, -16.25)
dblAlphai[ 21 ] (0.0, 8.125, 0.0)
dblAlphai[ 26 ] (0.0, 0.0, 16.25)
protonAi[ 37 ] (0.0, -0.75, 24.375)
alphaAi[ 38 ] (0.0, 0.0, -24.375)
17 object additions totaling 47 protons.

Adding the double alpha alternative added significantly to the i-loop overhead and time it takes for jupyter notebook to process the code – you may need to wait most of a minute to see the output. The remaining pre-built slot possibilities 8-11 would add increasingly larger blocks of code to the loop overhead and is a practical limit preventing this method from building the largest elements.

The code.
Code:


In[1]:
from pythreejs import *
from IPython.display import display
import ipywidgets
from math import sqrt
phi = (1+sqrt(5))/2  # calculating phi-based-pi, piG.
piG = 4/sqrt(phi)    # piG is used instead of pi.

In[2]:
view_width = 600
view_height = 400
factor = 40 # orthographic "scaler"
camera = PerspectiveCamera(position=[10, 0, 0], up=[0, 0, 1], aspect=view_width/view_height)
#camera = PerspectiveCamera(position=[10, 0, 0], up=[1, 0, 0], aspect=view_width/view_height)
camera = PerspectiveCamera(position=[10, 0, 0], up=[0, 1, 0], aspect=view_width/view_height)
#camera = OrthographicCamera(view_width/-factor,view_width/factor,view_height / factor,
#    view_height / - factor,0.1,1000)  # The orbital controls doesn't work with ortho(?)
key_light = DirectionalLight(position=[0, 10, 10])
ambient_light = AmbientLight()

In[3]
elements = ["1 Hydrogen H","2 Helium He","3 Lithium Li","4 Beryllium Be",
           "5 Boron B","6 Carbon C","7 Nitrogen N","8 Oxygen O",
           "9 Fluorine F","10 Neon Ne","11 Sodium Na","12 Magnesium Mg",
           "13 Aluminum Al","14 Silicon Si","15 Phosphorus P","16 Sulfur S",
           "17 Chlorine Cl","18 Argon Ar","19 Potassium P","20 Calcium Ca",
           "21 Scandium Sc","22 Titanium Ti","23 Vanadium V","24 Chromium Cr",
           "25 Manganese Mn","26 Iron Fe","27 Cobalt Co","28 Nickel Ni",
           "29 Copper Cu","30 Zinc Zn","31 Gallium Ga","32 Germanium Ge",
           "33 Arsenic As","34 Selenium Se","35 Bromine Br","36 Krypton Kr",
           "37 Rubidium Rb","38 Strontium Sr","39 Yttrium Y","40 Zirconium Zr",
           "41 Niobium Nb","42 Molybdenum Mo","43 Technetium Tc","44 Ruthenium Ru",
           "45 Rhodium Rh","46 Palladium Pd","47 Silver Ag","48 Cadmium Cd"]
print( elements )

In[4]
number = input( "Please enter the Atomic number: " )
number = int( number )
print( "The Atomic number selected is", elements[number-1])

In[5]
grpAn = Group()   # An - Atomic Number
#atomicNumber = 15 # Easier place to change An when coding
atomicNumber = number  # Enter the desired number of protons

# Dimensions
pP1pP2 = 1.5 # Proton 1 to proton 2, Pole-to-pole separation.
pRadius = 0.5
nRadius = 0.6
eRadius = 2*pRadius/10
emRadius = 6
p1p2 = pRadius*2.5  # small gap
p2p3 = pRadius*3  # small gap
n1n2 = 4.0  # Alpha, left-right (y) neutron-neutron orbital separation
p1n1 = pP1pP2/2 # Alpha, up-down (z) proton-orbital neutron separation
p1n2 = pRadius + nRadius + 0.5  # In line proton and neutron
p1e1 = pRadius + 1.5*pP1pP2/10  # Alpha, top-bottom (z) proton-electron separation
e1e2 = 0.75  # 0.5  # electron-electron separation
flipPN = 3 # Dist. between adjacent vertical and horiz protons
maxZNeg = 0.0 # maxZNeg and maxZPos are Used to center(z) the atom on the screen
maxZPos = 0.0 # chain  

# Proton set Geometries and Materials
protonGeometry =  SphereBufferGeometry(pRadius, 24, 16)
neutronGeometry =  SphereBufferGeometry(nRadius, 24, 16)
electronGeometry =  SphereBufferGeometry(eRadius, 8, 16)
emissionGeometry = CircleGeometry(emRadius, 24)
protonMaterial = MeshStandardMaterial(color='blue')
#protonMaterialB = MeshStandardMaterial(color='green')
neutronMaterial = MeshStandardMaterial(color='red')
electronMaterial = MeshStandardMaterial(color='cyan')
emissionmaterial = MeshStandardMaterial(color='gray',
    transparent = True,opacity = 0.3)

# Assemble the atomic models.
for i in range( atomicNumber ):
    emissionA2i = Mesh( emissionGeometry, emissionmaterial)
    emissionA2i.rotateX(piG)
    protonAi = Group()
    protonAi.add(Mesh(protonGeometry, protonMaterial))
    protonAi.add(Mesh(emissionGeometry, emissionmaterial))
    protonAi.add(emissionA2i)
    neutronAi = Object3D()
    neutronAi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronAi.position = [0,-n1n2/2,-p1n1]
    protonAi.add(neutronAi)
    electronAi = Object3D()
    electronAi.add(Mesh(electronGeometry, electronMaterial))
    electronAi.position = [0,-e1e2/2,-p1e1]
    protonAi.add(electronAi)
    emissionB2i = Mesh( emissionGeometry, emissionmaterial)
    emissionB2i.rotateX(piG)
    protonBi = Group()
    protonBi.add(Mesh(protonGeometry, protonMaterial))
    protonBi.add(Mesh(emissionGeometry, emissionmaterial))
    protonBi.add(emissionB2i)
    neutronBi = Object3D()
    neutronBi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronBi.position = [0,-n1n2/2,-p1n1]
    protonBi.add(neutronBi)
    electronBi = Object3D()  
    electronBi.add(Mesh(electronGeometry, electronMaterial))
    electronBi.position = [0,-e1e2/2,-p1e1]
    protonBi.add(electronBi)
    protonBi.rotateY(piG)
    protonBi.rotateZ(piG)

    emissionC2i = Mesh( emissionGeometry, emissionmaterial)
    emissionC2i.rotateX(piG)
    protonCi = Group()
    protonCi.add(Mesh(protonGeometry, protonMaterial))
    protonCi.add(Mesh(emissionGeometry, emissionmaterial))
    protonCi.add(emissionC2i)
    neutronCi = Object3D()
    neutronCi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronCi.position = [0,-n1n2/2,-p1n1]
    protonCi.add(neutronCi)
    electronCi = Object3D()
    electronCi.add(Mesh(electronGeometry, electronMaterial))
    electronCi.position = [0,-e1e2/2,-p1e1]
    protonCi.add(electronCi)    
    emissionD2i = Mesh( emissionGeometry, emissionmaterial)
    emissionD2i.rotateX(piG)
    protonDi = Group()
    protonDi.add(Mesh(protonGeometry, protonMaterial))
    protonDi.add(Mesh(emissionGeometry, emissionmaterial))
    protonDi.add(emissionD2i)
    neutronDi = Object3D()
    neutronDi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronDi.position = [0,-n1n2/2,-p1n1]
    protonDi.add(neutronDi)
    electronDi = Object3D()  
    electronDi.add(Mesh(electronGeometry, electronMaterial))
    electronDi.position = [0,-e1e2/2,-p1e1]
    protonDi.add(electronDi)
    protonDi.rotateY(piG)
    protonDi.rotateZ(piG)
    
    neutronGi = Object3D()
    neutronGi.add(Mesh(neutronGeometry, neutronMaterial))
    
    protonEi = Group() # alpha
    protonEi.add(protonAi)
    protonEi.position = [0,0,pP1pP2/2]
    protonHi = Group()
    protonHi.add(protonBi)
    protonHi.position = [0,0,-pP1pP2/2]
    alphaAi = Group()
    alphaAi.add(protonEi)
    alphaAi.add(protonHi)
    
    protonFi = Group() # 2nd alpha
    protonFi.add(protonCi)
    protonFi.position = [0,0,pP1pP2/2]
    protonJi = Group()
    protonJi.add(protonDi)
    protonJi.position = [0,0,-pP1pP2/2]
    alphaCi = Group()
    alphaCi.add(protonFi)
    alphaCi.add(protonJi)

    alpha1i = Group()
    alpha1i.add(alphaAi)
    alpha1i.position = [0,0,-p1p2/2-pP1pP2/2]
    alpha2i = Group()
    alpha2i.add(alphaCi)
    alpha2i.position = [0,0,p1p2/2+pP1pP2/2]
    dblAlphai = Group()
    dblAlphai.add(alpha1i)
    dblAlphai.add(alpha2i)
  
    if i == 0:
        if 1 == atomicNumber: # Hydrogen.
            neutronAi.position = [0,0,-p1n2]
            grpAn.add( protonAi )
            maxZNeg = 0  
            maxZPos = 0
            print('protonAi[',i+1,']', protonAi.position)
        if 46 <= atomicNumber < 48: # hook position            
            protonAi.remove(neutronAi)
            protonAi.position = [0,p1p2/2+pP1pP2+2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)

    if i == 1:
        if 2 <= atomicNumber < 10: # Helium
            alphaAi.position = [0,0,pP1pP2 + p2p3]
            grpAn.add( alphaAi )
            maxZNeg = p2p3
            maxZPos = pP1pP2 + p2p3
            print('alphaAi[',i+1,']', alphaAi.position)
        if 45 <= atomicNumber < 48: # hook position            
            protonAi.remove(neutronAi)
            protonAi.position = [0,-p1p2/2-pP1pP2-2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)

    if i == 2:
        if 3 <= atomicNumber < 10: # Lithium
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0, 3*pP1pP2/2+p2p3+2*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -pP1pP2/2
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 10 <= atomicNumber < 14:
            alphaAi.position = [0, 0, pP1pP2+4*flipPN]            
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 17 <= atomicNumber < 18:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 44 <= atomicNumber < 47: # hook position            
            protonAi.remove(neutronAi)
            protonAi.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
            
    if i == 3:
        if 4 == atomicNumber < 5: # Beryllium
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0, 0, pP1pP2/2+p2p3 -2*flipPN]
            grpAn.add(protonAi)
            maxZNeg = pP1pP2/2+p2p3 -2*flipPN
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 43 <= atomicNumber < 47: # Tc hook position            
            protonAi.remove(neutronAi)
            protonAi.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
            
    if i == 4:
        if 5 <= atomicNumber < 36: # Boron
            alphaAi.position = [0, 0, 0]
            grpAn.add(alphaAi)
            maxZNeg = -pP1pP2/2
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber :
            dblAlphai.position = [0,0,0]
            grpAn.add(dblAlphai)
            print('dblAlphai[',i+1,']', dblAlphai.position)

    if i == 5:
        if 6 == atomicNumber < 7: # Carbon
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0,-pP1pP2/2-2*flipPN]
            grpAn.add(protonAi)
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            maxZNeg = -pP1pP2/2-2*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 15 <= atomicNumber < 16: # Carbon
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0,-3*pP1pP2/2-6*flipPN]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)

    if i == 6:
        if 7 <= atomicNumber < 10: # Nitrogen
            alphaAi.position = [0,0,-pP1pP2-p2p3]
            grpAn.add(alphaAi)
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            maxZNeg = -pP1pP2-p2p3
            print('alphaAi[',i+1,']', alphaAi.position)
        if 10 <= atomicNumber < 14:
            alphaAi.position = [0,0,-pP1pP2-4*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 15 == atomicNumber:
            alphaAi.position = [0,0,-pP1pP2-4*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)            
        if 16 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.position = [0,0,-pP1pP2/2-4*flipPN]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 17 <= atomicNumber < 36:
            alphaAi.position = [0,0,-pP1pP2-4*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 36 <= atomicNumber:
            dblAlphai.rotateY(piG/2)
            dblAlphai.position = [-2*flipPN-p1p2/2-pP1pP2,0,0]
            grpAn.add(dblAlphai)
            print('dblAlphai[',i+1,']',dblAlphai.position)  
            
    if i == 7:
        if 8 == atomicNumber: # Oxygen
            protonAi.remove(neutronAi)  
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0,-3*pP1pP2/2-p2p3-2*flipPN]
            grpAn.add(protonAi)
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            maxZNeg = -3*pP1pP2/2-p2p3-2*flipPN            
            print('protonAi[',i+1,']', protonAi.position)
        if 9 == atomicNumber:
            protonAi.remove(neutronAi)  
            protonAi.rotateX(piG/2)
            protonAi.position = [0,pP1pP2/2,-3*pP1pP2/2-p2p3-2*flipPN]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 10 <= atomicNumber < 36:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0,-pP1pP2/2-2*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber:
            dblAlphai.rotateX(piG/2)
            dblAlphai.position = [0,0,-p1p2/2-pP1pP2-2*flipPN]
            grpAn.add(dblAlphai)
            print('dblAlphai[',i+1,']', dblAlphai.position)

            
    if i == 8:
        if 9 == atomicNumber < 10: # Fluorine
            protonAi.remove(neutronAi)  
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2,-3*pP1pP2/2-p2p3-2*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -3*pP1pP2/2-p2p3-2*flipPN
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 39 <= atomicNumber < 48:        
            protonAi.remove(neutronAi)
            #protonAi.rotateX(piG/2)          
            protonAi.position = [4*pP1pP2/2+p1p2+4*flipPN,0,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 48 <= atomicNumber:        
            alphaAi.position = [4*pP1pP2/2+p1p2+4*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)

    if i == 9:
        if 10 <= atomicNumber < 36:  # Neon
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, pP1pP2/2 + 2*flipPN]
            grpAn.add(alphaAi)
            maxZNeg = -3*pP1pP2/2-p2p3-2*flipPN
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber:  # Neon
            dblAlphai.rotateY(piG/2)
            dblAlphai.position = [2*flipPN+p1p2/2+pP1pP2,0,0]
            grpAn.add(dblAlphai)
            print('dblAlphai[',i+1,']', dblAlphai.position)
            
    if i == 10:
        if 11 <= atomicNumber < 14: # Sodium
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,0, pP1pP2+6*flipPN]
            grpAn.add(protonAi)
            maxZPos =  pP1pP2+6*flipPN
            maxZNeg = -pP1pP2-4*flipPN        
            print('protonAi[',i+1,']', protonAi.position)
        if 14 == atomicNumber:
            alphaAi.rotateX(-piG/2)
            #alphaAi.rotateZ(-piG/2)
            alphaAi.rotateY(-piG/2)
            alphaAi.position = [ -pP1pP2/2-2*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 15 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.rotateY(piG/2)
            protonAi.position = [-2*flipPN,0, 0]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 16 <= atomicNumber < 36:
            alphaAi.rotateX(-piG/2)
            alphaAi.rotateY(-piG/2)
            alphaAi.position = [ -pP1pP2/2-2*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        
    if i == 11:
        if 12 == atomicNumber: # Magnesium
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0, 0, -pP1pP2 - 6*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -pP1pP2 - 6*flipPN
            maxZPos =  pP1pP2 + 6*flipPN                
            print('protonAi[',i+1,']', protonAi.position)
        if 13 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0, pP1pP2/2+2*flipPN, 0]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 14 <= atomicNumber < 15:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,pP1pP2/2+2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 15 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,2*flipPN, 0]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 16 == atomicNumber:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,pP1pP2/2+2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 18 <= atomicNumber < 36:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,pP1pP2/2+2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber:
            dblAlphai.rotateX(piG/2)
            dblAlphai.position = [0,0,p1p2/2+pP1pP2+2*flipPN]
            grpAn.add(dblAlphai)
            print('dblAlphai[',i+1,']', dblAlphai.position)  
        
    if i == 12:
        if 13 == atomicNumber: # Aluminum
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,-pP1pP2/2-2*flipPN,0]
            grpAn.add(protonAi)
            maxZNeg = -pP1pP2-4*flipPN
            maxZPos =  3*pP1pP2/2 + 6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 14 == atomicNumber:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,-pP1pP2/2-2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 15 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,-2*flipPN,0]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)            
        if 16 == atomicNumber:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,-pP1pP2/2-2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 18 <= atomicNumber < 36:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,-pP1pP2/2-2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
Code lines 1-459. Continued in the next message.
.


Last edited by LongtimeAirman on Sun Sep 12, 2021 3:19 pm; edited 1 time in total (Reason for editing : Fixed Aan typo)

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Sun Sep 12, 2021 3:09 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Nbthru10

Code lines 460-877
Code:

            
    if i == 13:
        if 14 == atomicNumber: # Silicon, the carousal level
            alphaAi.rotateX(-piG/2)
            alphaAi.rotateY(piG/2)
            alphaAi.position = [ pP1pP2/2+2*flipPN,0,0]
            grpAn.add( alphaAi )
            maxZNeg = -pP1pP2-4*flipPN
            maxZPos = pP1pP2+4*flipPN            
            print('alphaAi[',i+1,']', alphaAi.position)
        if 15 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.rotateY(piG/2)
            protonAi.position = [2*flipPN,0,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 16 <= atomicNumber < 36:
            alphaAi.rotateX(-piG/2)
            alphaAi.rotateY(piG/2)
            alphaAi.position = [ pP1pP2/2+2*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
  
    if i == 14:
        if 15 == atomicNumber: # Phosphorus 
            alphaAi.rotateX(piG)
            alphaAi.position = [0, 0, pP1pP2 + 4*flipPN]
            grpAn.add( alphaAi )
            maxZNeg = -pP1pP2/2 - 4*flipPN
            maxZPos =  pP1pP2/2 + 4*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 16 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG)
            protonAi.position = [0, 0, pP1pP2/2 + 4*flipPN]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 17 <= atomicNumber < 18:
            alphaAi.rotateX(piG)
            alphaAi.position = [0, 0, pP1pP2 + 4*flipPN]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 42 <= atomicNumber < 47:
            protonAi.remove(neutronAi)
            protonAi.position = [0,4*pP1pP2/2+p1p2+4*flipPN,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 47 <= atomicNumber :
            alphaAi.position = [0,4*pP1pP2/2+p1p2+4*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)          

    if i == 15:
        if 16 == atomicNumber: # Sulfur
            protonAi.remove(neutronAi)
            protonAi.position = [0, 0, -pP1pP2/2 - 4*flipPN]
            grpAn.add( protonAi )
            maxZNeg = -pP1pP2/2 - 4*flipPN
            maxZPos = pP1pP2/2 + 4*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 41 <= atomicNumber < 47:
            protonAi.remove(neutronAi)
            protonAi.position = [0,-4*pP1pP2/2-p1p2-4*flipPN,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)  
        if 47 <= atomicNumber:
            alphaAi.position = [0,-4*pP1pP2/2-p1p2-4*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)            

    if i == 16:
        if 17 == atomicNumber: # Chlorine
            alphaAi.rotateX(piG/2)          
            alphaAi.position = [0,0,-3*pP1pP2/2-6*flipPN]
            grpAn.add( alphaAi )
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN        
            print('alphaAi[',i+1,']', alphaAi.position)
        if 39 <= atomicNumber < 48:
            protonAi.remove(neutronAi)
            protonAi.position = [-4*pP1pP2/2-p1p2-4*flipPN,0,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 48 <= atomicNumber:
            #alphaAi.remove(neutronAi)
            alphaAi.position = [-4*pP1pP2/2-p1p2-4*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)

    if i == 17:
        if 18 <=atomicNumber < 36: # Argon
            alphaAi.position = [0, 0, pP1pP2 + 4*flipPN]            
            grpAn.add( alphaAi )
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos = 3*pP1pP2/2+4*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber :
            dblAlphai.rotateX(piG/2)
            dblAlphai.position = [0,-2*flipPN-p1p2/2-pP1pP2,0]
            grpAn.add(dblAlphai)
            print('dblAlphai[',i+1,']', dblAlphai.position)

    if i == 18:
        if 19 <= atomicNumber < 21: # Potassium
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN            
            print('protonAi[',i+1,']', protonAi.position)
        if 21 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            neutronBi.position = [0,3*pP1pP2/2+6*flipPN,-pP1pP2 - 2*flipPN - p1n2]
            protonAi.add(neutronBi)
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 22 <= atomicNumber < 27:
            neutronAi.position = [0,0, p1n2]            
            protonAi.rotateZ(piG/2)    
            protonAi.position = [0, pP1pP2+4*flipPN,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 27 == atomicNumber:
            neutronAi.position = [0,p1n2+pP1pP2+2*flipPN,0]
            grpAn.add( neutronAi )
            print('neutronAi[',i+1,']', neutronAi.position)
        if 29 <= atomicNumber < 30:          
            neutronAi.position = [0,pP1pP2/2+p1n2,p2p3-pP1pP2/2-2*flipPN]
            grpAn.add( neutronAi )
            neutronBi.position = [0,pP1pP2/2+p1n2,-p2p3-pP1pP2/2-2*flipPN]
            grpAn.add( neutronBi )
            print('2 hook neutrons[',i+1,']', neutronAi.position)            
        if 30 == atomicNumber :
            protonAi.remove(neutronAi)
            protonAi.position = [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 32 <= atomicNumber < 35 :
            protonAi.remove(neutronAi)
            protonAi.position = [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 35 == atomicNumber :
            alphaAi.position = [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]
            grpAn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber :
            #dblAlphai.rotateX(piG/2)
            dblAlphai.position = [0,0,-p1p2/2-pP1pP2-p1p2/2-pP1pP2-4*flipPN]
            grpAn.add( dblAlphai )            
            print('dblAlphai[',i+1,']', dblAlphai.position)            
            
    if i == 19:
        if 20 == atomicNumber: # Calcium
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)            
            protonAi.position = [0,0,-3*pP1pP2/2-6*flipPN]          
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 21 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateZ(piG/2)
            protonAi.position = [4*flipPN+pP1pP2,0,0]
            neutronBi.position = [2*flipPN+pP1pP2 +p1n2,pP1pP2+4*flipPN,0]
            protonAi.add(neutronBi)
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 22 <= atomicNumber < 27:
            neutronAi.position = [0,0,-p1n2]
            protonAi.rotateZ(-piG/2)
            protonAi.position = [4*flipPN+pP1pP2,0,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 27 <= atomicNumber < 36:
            alphaAi.position = [0,0,-p1n2]
            alphaAi.rotateZ(-piG/2)
            alphaAi.position = [4*flipPN+pP1pP2,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)

    if i == 20:
        if 21 == atomicNumber: # Scandium 
            protonAi.remove(neutronAi)
            protonAi.rotateZ(piG/2)            
            protonAi.position = [-pP1pP2-4*flipPN,0,0]
            neutronBi.position = [0,-pP1pP2-4*flipPN,-3*pP1pP2/2-4*flipPN-p1n2]
            protonAi.add(neutronBi)            
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 22 <= atomicNumber < 27 :
            neutronAi.position = [0,0,p1n2]
            protonAi.rotateZ(-piG/2)            
            protonAi.position = [-pP1pP2-4*flipPN,0,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 27 <= atomicNumber < 36:
            alphaAi.position = [0,0,p1n2]
            alphaAi.rotateZ(-piG/2)            
            alphaAi.position = [-pP1pP2-4*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber :
            dblAlphai.rotateX(piG/2)
            dblAlphai.position = [0,p1p2/2+pP1pP2+2*flipPN,0]
            grpAn.add( dblAlphai )            
            print('dblAlphai[',i+1,']', dblAlphai.position)
            
    if i == 21:
        if 22 <= atomicNumber < 29: # Titanium
            neutronAi.position = [0,0,-p1n2]
            protonAi.rotateZ(piG/2)    
            protonAi.position = [0,-pP1pP2-4*flipPN,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 29 <= atomicNumber < 36:
            alphaAi.rotateZ(piG/2)    
            alphaAi.position = [0,-pP1pP2-4*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)

    if i == 22:
        if 23 <= atomicNumber < 26: # Vanadium
            protonAi.rotateX(piG/2)
            protonAi.remove(neutronAi)
            protonAi.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN        
            print('protonAi[',i+1,']', protonAi.position)
        if 26 <= atomicNumber < 29:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpAn.add(alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 29 <= atomicNumber < 31:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpAn.add(protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 31 <= atomicNumber < 36:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpAn.add(alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
          
    if i == 23:
        if 24 <= atomicNumber < 26: # Chromium
            protonAi.rotateX(piG/2)
            protonAi.remove(neutronAi)
            protonAi.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-8*flipPN
            maxZPos =  3*pP1pP2/2+8*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 26 <= atomicNumber < 30:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 30 == atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.remove(neutronAi)
            protonAi.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 31 <= atomicNumber < 36:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
          
    if i == 24:
        if 25 == atomicNumber: # Manganese
            protonAi.remove(neutronAi)
            protonAi.position = [0,-pP1pP2/2-2*flipPN, pP1pP2/2+2*flipPN]
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-8*flipPN
            maxZPos =  3*pP1pP2/2+8*flipPN
            print('hook protonAi[',i+1,']', protonAi.position)
        if 26 <= atomicNumber < 29: # Three hook position neutrons
            neutronAi.position = [0,-pP1pP2/2-p1n2,pP1pP2/2 + 2*flipPN]
            grpAn.add( neutronAi )
            neutronBi.position = [0,-pP1pP2/2-p1n2,-pP1pP2/2 - 2*flipPN]
            grpAn.add( neutronBi )
            neutronGi.position = [0,pP1pP2/2+p1n2,-pP1pP2/2 - 2*flipPN]
            grpAn.add( neutronGi )
            print('3 ea hook neutrons[',i+1,']', neutronAi.position)
        if 29 <= atomicNumber < 34:
            neutronAi.position = [0,-pP1pP2/2-p1n2,-pP1pP2/2 - 2*flipPN]
            grpAn.add( neutronAi )
            print('hook neutronAi[',i+1,']', neutronAi.position)
        if 34 <= atomicNumber < 36:
            protonAi.remove(neutronAi)
            protonAi.position = [0,-pP1pP2/2- 2*flipPN,-pP1pP2/2 - 2*flipPN]
            grpAn.add( protonAi )
            print('hook protonAi[',i+1,']', protonAi.position)
        """            
        if 37 <= atomicNumber:
            neutronGi.position = [0,0,p2p3]
            alphaAi.position = [0,0,-3*p1p2/2-5*pP1pP2/2-4*flipPN]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        """
            
    if i == 25:
        if 26 <= atomicNumber < 29: # Iron
            print('[',i+1,'] Iron. New objects added elsewhere')
        if 29 == atomicNumber:
            neutronAi.position = [0,-pP1pP2/2-p1n2,p2p3+pP1pP2/2+2*flipPN]
            grpAn.add( neutronAi )
            neutronBi.position = [0,-pP1pP2/2-p1n2,-p2p3+pP1pP2/2+2*flipPN]
            grpAn.add( neutronBi )
            print('2 ea hook neutrons[',i+1,']', neutronAi.position)
        if 30 <= atomicNumber < 36:
            protonAi.remove(neutronAi)
            protonAi.position = [0,-pP1pP2/2-2*flipPN,pP1pP2/2+2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 36 <= atomicNumber :
            dblAlphai.position = [0,0,p1p2/2+pP1pP2+p1p2/2+pP1pP2+4*flipPN]
            grpAn.add(dblAlphai)
            print('dblAlphai[',i+1,']', dblAlphai.position)
            
    if i == 26:
        if 27 <= atomicNumber < 33: # Cobalt
            neutronAi.position = [0, pP1pP2/2+p1n2, pP1pP2/2+2*flipPN]
            grpAn.add(neutronAi)
        if 33 <= atomicNumber < 36:
            protonAi.remove(neutronAi)
            protonAi.position = [0, pP1pP2/2+2*flipPN, pP1pP2/2+2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)

    if i == 27:
        if 28 == atomicNumber: # Nickel
            protonAi.remove(neutronAi)
            protonAi.position = [0, pP1pP2+4*flipPN, 0]
            grpAn.add(protonAi)
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
            
    if i == 28:
        if 29 <= atomicNumber < 36: # Copper
            alphaAi.position = [0, pP1pP2+4*flipPN, 0]
            grpAn.add(alphaAi)
            
            print('alphaAi[',i+1,']', alphaAi.position)

    if i == 36:
        if 37 <= atomicNumber < 48: # Rubidium
            neutronAi.position = [0,2*flipPN-p2p3,p2p3]
            protonAi.rotateX(-piG/2)  
            protonAi.position = [0,-p2p3/2,3*p1p2/2+6*pP1pP2/2+6*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -3*p1p2/2-5*pP1pP2/2-4*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 48 <= atomicNumber : # Copper
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0, 0, 3*p1p2/2+6*pP1pP2/2+6*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
            
    if i == 37:
        if 38 == atomicNumber: # Strontium
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 40 <= atomicNumber < 47:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 47 <= atomicNumber:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpAn.add(alphaAi)
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
  
grpAn.position = [0,0,(-maxZNeg + maxZPos)/2 - maxZPos]


In[6]
scene = Scene(children=[grpAn, camera, key_light, ambient_light])
controller = OrbitControls(controlling=camera, screenSpacePanning=True)

In[7]
renderer = Renderer(camera=camera, scene=scene, controls=[controller],
                    width=view_width, height=view_height)
scene = Scene()  # initialising the scene

In[8]
renderer

In[9]
spin_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 2], values=[0, 2*piG])
spin_clip = AnimationClip(tracks=[spin_track])
spin_action = AnimationAction(AnimationMixer(grpAn), spin_clip, grpAn) # best
spin_action

Adding those additional object options will not reduce the code length or allow the code to run faster, but it would be cleaner and more logical. Anyway, as is, the code is fat and slow. I’ll be concentrating on trying to improve the code rather than adding any elements past Iodine. I’ll hold off further posting unless I make improvements.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Rhthru10
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Thu Sep 16, 2021 5:44 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Inthru10

Code:


In[1]:
from pythreejs import *
from IPython.display import display
import ipywidgets
from math import sqrt
phi = (1+sqrt(5))/2  # calculating phi-based-pi, piG.
piG = 4/sqrt(phi)    # piG is used instead of pi.

In[2]:
view_width = 600
view_height = 400
factor = 40 # orthographic "scaler"
camera = PerspectiveCamera(position=[10, 0, 0], up=[0, 0, 1], aspect=view_width/view_height)
#camera = PerspectiveCamera(position=[10, 0, 0], up=[1, 0, 0], aspect=view_width/view_height)
camera = PerspectiveCamera(position=[10, 0, 0], up=[0, 1, 0], aspect=view_width/view_height)
#camera = OrthographicCamera(view_width/-factor,view_width/factor,view_height / factor,
#    view_height / - factor,0.1,1000)  # The orbital controls doesn't work with ortho(?)
key_light = DirectionalLight(position=[0, 10, 10])
ambient_light = AmbientLight()

In[3]
elements = ["1 Hydrogen H","2 Helium He","3 Lithium Li","4 Beryllium Be",
           "5 Boron B","6 Carbon C","7 Nitrogen N","8 Oxygen O",
           "9 Fluorine F","10 Neon Ne","11 Sodium Na","12 Magnesium Mg",
           "13 Aluminum Al","14 Silicon Si","15 Phosphorus P","16 Sulfur S",
           "17 Chlorine Cl","18 Argon Ar","19 Potassium P","20 Calcium Ca",
           "21 Scandium Sc","22 Titanium Ti","23 Vanadium V","24 Chromium Cr",
           "25 Manganese Mn","26 Iron Fe","27 Cobalt Co","28 Nickel Ni",
           "29 Copper Cu","30 Zinc Zn","31 Gallium Ga","32 Germanium Ge",
           "33 Arsenic As","34 Selenium Se","35 Bromine Br","36 Krypton Kr",
           "37 Rubidium Rb","38 Strontium Sr","39 Yttrium Y","40 Zirconium Zr",
           "41 Niobium Nb","42 Molybdenum Mo","43 Technetium Tc","44 Ruthenium Ru",
           "45 Rhodium Rh","46 Palladium Pd","47 Silver Ag","48 Cadmium Cd",
           "49 Indium In", "50 Tin Sn","51 Antimony Sb","52 Tellurium Te",
           "53 Iodine I","54 Xenon Xe","55 Caesium Cs","56 Barium Ba"]
print( elements )

In[4]
number = input( "Please enter the Atomic number: " )
number = int( number )
print( "The Atomic number selected is", elements[number-1])

In[5]
grpAn = Group()   # An - Atomic Number
#atomicNumber = 2 # Easier place to change An when coding
atomicNumber = number  # Enter the desired number of protons

# Dimensions
pP1pP2 = 1.5 # Proton 1 to proton 2, Pole-to-pole separation.
pRadius = 0.5
nRadius = 0.6
eRadius = 2*pRadius/10
emRadius = 6
p1p2 = pRadius*2.5  # small gap
p2p3 = pRadius*3  # small gap
n1n2 = 4.0  # Alpha, left-right (y) neutron-neutron orbital separation
p1n1 = pP1pP2/2 # Alpha, up-down (z) proton-orbital neutron separation
p1n2 = pRadius + nRadius + 0.5  # In line proton and neutron
p1e1 = pRadius + 1.5*pP1pP2/10  # Alpha, top-bottom (z) proton-electron separation
e1e2 = 0.75  # 0.5  # electron-electron separation
flipPN = 3 # Dist. between adjacent vertical and horiz protons
maxZNeg = 0.0 # maxZNeg and maxZPos are Used to center(z) the atom on the screen
maxZPos = 0.0 # chain  

# Proton set Geometries and Materials
protonGeometry =  SphereBufferGeometry(pRadius, 24, 16)
neutronGeometry =  SphereBufferGeometry(nRadius, 24, 16)
electronGeometry =  SphereBufferGeometry(eRadius, 8, 16)
emissionGeometry = CircleGeometry(emRadius, 24)
emissionTopGeometry = CircleGeometry(emRadius, 24)
emissionBotGeometry = CircleGeometry(emRadius, 24)

protonMaterial = MeshStandardMaterial(color='blue')
#protonMaterialB = MeshStandardMaterial(color='green')
neutronMaterial = MeshStandardMaterial(color='red')
electronMaterial = MeshStandardMaterial(color='cyan')
emissionmaterial = MeshStandardMaterial(color='gray',
    transparent = True,opacity = 0.25)

def buildTripleAlpha():
    num = 0          
    while num < 6: # create a triple Alpha group
        protonMi = Group()
        protonMi.add(Mesh(protonGeometry, protonMaterial))    
        emissionM2i = Mesh( emissionGeometry, emissionmaterial)
        emissionM2i.rotateX(piG)
        protonMi.add(Mesh(emissionGeometry, emissionmaterial))
        protonMi.add(emissionM2i)
        neutronMi = Object3D()
        neutronMi.add(Mesh(neutronGeometry, neutronMaterial))
        neutronMi.position = [0,-n1n2/2,-p1n1]
        protonMi.add(neutronMi)                
        electronMi = Object3D()
        electronMi.add(Mesh(electronGeometry, electronMaterial))
        electronMi.position = [0,-e1e2/2,-p1e1]
        protonMi.add(electronMi)
        if num%2 == 0:
            protonMi.position = [0,0, 3*pP1pP2/2 + p2p3 - (p2p3/2 + pP1pP2/2)*num]
        else:
            protonMi.rotateX(piG)
            protonMi.position = [0,0, 3*p2p3/2 + pP1pP2 - (p2p3/2 + pP1pP2/2)*num]
        trplAlpha.add(protonMi)                
        num += 1
    return
        
# Assemble the atomic models.
for i in range( atomicNumber ):
    emissionA2i = Mesh( emissionGeometry, emissionmaterial)
    emissionA2i.rotateX(piG)
    protonAi = Group()
    protonAi.add(Mesh(protonGeometry, protonMaterial))
    protonAi.add(Mesh(emissionGeometry, emissionmaterial))
    protonAi.add(emissionA2i)
    neutronAi = Object3D()
    neutronAi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronAi.position = [0,-n1n2/2,-p1n1]
    protonAi.add(neutronAi)
    electronAi = Object3D()
    electronAi.add(Mesh(electronGeometry, electronMaterial))
    electronAi.position = [0,-e1e2/2,-p1e1]
    protonAi.add(electronAi)
    emissionB2i = Mesh( emissionGeometry, emissionmaterial)
    emissionB2i.rotateX(piG)
    protonBi = Group()
    protonBi.add(Mesh(protonGeometry, protonMaterial))
    protonBi.add(Mesh(emissionGeometry, emissionmaterial))
    protonBi.add(emissionB2i)
    neutronBi = Object3D()
    neutronBi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronBi.position = [0,-n1n2/2,-p1n1]
    protonBi.add(neutronBi)
    electronBi = Object3D()  
    electronBi.add(Mesh(electronGeometry, electronMaterial))
    electronBi.position = [0,-e1e2/2,-p1e1]
    protonBi.add(electronBi)
    protonBi.rotateY(piG)
    protonBi.rotateZ(piG)

    emissionC2i = Mesh( emissionGeometry, emissionmaterial)
    emissionC2i.rotateX(piG)
    protonCi = Group()
    protonCi.add(Mesh(protonGeometry, protonMaterial))
    protonCi.add(Mesh(emissionGeometry, emissionmaterial))
    protonCi.add(emissionC2i)
    neutronCi = Object3D()
    neutronCi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronCi.position = [0,-n1n2/2,-p1n1]
    protonCi.add(neutronCi)
    electronCi = Object3D()
    electronCi.add(Mesh(electronGeometry, electronMaterial))
    electronCi.position = [0,-e1e2/2,-p1e1]
    protonCi.add(electronCi)    
    emissionD2i = Mesh( emissionGeometry, emissionmaterial)
    emissionD2i.rotateX(piG)
    protonDi = Group()
    protonDi.add(Mesh(protonGeometry, protonMaterial))
    protonDi.add(Mesh(emissionGeometry, emissionmaterial))
    protonDi.add(emissionD2i)
    neutronDi = Object3D()
    neutronDi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronDi.position = [0,-n1n2/2,-p1n1]
    protonDi.add(neutronDi)
    electronDi = Object3D()  
    electronDi.add(Mesh(electronGeometry, electronMaterial))
    electronDi.position = [0,-e1e2/2,-p1e1]
    protonDi.add(electronDi)
    protonDi.rotateY(piG)
    protonDi.rotateZ(piG)
    
    neutronGi = Object3D()
    neutronGi.add(Mesh(neutronGeometry, neutronMaterial))
    
    protonEi = Group() # alpha
    protonEi.add(protonAi)
    protonEi.position = [0,0,pP1pP2/2]
    protonHi = Group()
    protonHi.add(protonBi)
    protonHi.position = [0,0,-pP1pP2/2]
    alphaAi = Group()
    alphaAi.add(protonEi)
    alphaAi.add(protonHi)
    
    protonFi = Group() # 2nd alpha
    protonFi.add(protonCi)
    protonFi.position = [0,0,pP1pP2/2]
    protonJi = Group()
    protonJi.add(protonDi)
    protonJi.position = [0,0,-pP1pP2/2]
    alphaCi = Group()
    alphaCi.add(protonFi)
    alphaCi.add(protonJi)

    alpha1i = Group()
    alpha1i.add(alphaAi)
    alpha1i.position = [0,0,-p1p2/2-pP1pP2/2]
    alpha2i = Group()
    alpha2i.add(alphaCi)
    alpha2i.position = [0,0,p1p2/2+pP1pP2/2]
    dblAlphai = Group()
    dblAlphai.add(alpha1i)
    dblAlphai.add(alpha2i)
    
    if i == 0:
        if 1 == atomicNumber: # Hydrogen.
            neutronAi.position = [0,0,-p1n2]
            grpAn.add( protonAi )
            maxZNeg = 0  
            maxZPos = 0
            print('protonAi[',i+1,']', protonAi.position)
        if 46 <= atomicNumber < 48:            
            protonAi.remove(neutronAi)
            protonAi.position = [0,p1p2/2+pP1pP2+2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 49 == atomicNumber:            
            protonAi.remove(neutronAi)
            protonAi.position = [0,p1p2/2+pP1pP2+2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 53 == atomicNumber:            
            alphaAi.position = [0,p1p2/2+pP1pP2+2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpAn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
            
    if i == 1:
        if 2 <= atomicNumber < 10: # Helium
            alphaAi.position = [0,0,pP1pP2 + p2p3]
            grpAn.add( alphaAi )
            maxZNeg = 0
            maxZPos = 0
            print('alphaAi[',i+1,']', alphaAi.position)
        if 45 <= atomicNumber < 48: # hook position            
            protonAi.remove(neutronAi)
            protonAi.position = [0,-p1p2/2-pP1pP2-2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 51 == atomicNumber:            
            protonAi.remove(neutronAi)
            protonAi.position = [0,-p1p2/2-pP1pP2-2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 53 == atomicNumber :            
            protonAi.remove(neutronAi)
            protonAi.position = [0,-p1p2/2-pP1pP2-2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
            
    if i == 2:
        if 3 <= atomicNumber < 10: # Lithium
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0, 3*pP1pP2/2+p2p3+2*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -pP1pP2/2
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 10 <= atomicNumber < 14:
            alphaAi.position = [0, 0, pP1pP2+4*flipPN]            
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 17 <= atomicNumber < 18:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 44 <= atomicNumber < 47:            
            protonAi.remove(neutronAi)
            protonAi.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 50 == atomicNumber:            
            #protonAi.remove(neutronAi)
            alphaAi.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpAn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 51 == atomicNumber:            
            protonAi.remove(neutronAi)
            protonAi.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 52 == atomicNumber :            
            #protonAi.remove(neutronAi)
            alphaAi.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpAn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 53 == atomicNumber :            
            protonAi.remove(neutronAi)
            protonAi.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
            
    if i == 3:
        if 4 == atomicNumber < 5: # Beryllium
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0, 0, pP1pP2/2+p2p3 -2*flipPN]
            grpAn.add(protonAi)
            maxZNeg = pP1pP2/2+p2p3 -2*flipPN
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 43 <= atomicNumber < 47:            
            protonAi.remove(neutronAi)
            protonAi.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 50 == atomicNumber:            
            alphaAi.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpAn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 51 == atomicNumber:            
            protonAi.remove(neutronAi)
            protonAi.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 52 == atomicNumber:            
            alphaAi.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpAn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 53 == atomicNumber :            
            protonAi.remove(neutronAi)
            protonAi.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
            
    if i == 4:
        if 5 <= atomicNumber < 36: # Boron
            alphaAi.position = [0, 0, 0]
            grpAn.add(alphaAi)
            maxZNeg = -pP1pP2/2
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber < 54 :
            dblAlphai.position = [0,0,0]
            grpAn.add(dblAlphai)
            print('dblAlphai[',i+1,']', dblAlphai.position)
        if 54 <= atomicNumber:
            trplAlpha = Group()                
            buildTripleAlpha()
            trplAlpha.position = [0, 0, 0]                
            grpAn.add(trplAlpha)
            print('trplAlpha[',i+1,']', trplAlpha.position)
            
    if i == 5:
        if 6 == atomicNumber < 7: # Carbon
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0,-pP1pP2/2-2*flipPN]
            grpAn.add(protonAi)
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            maxZNeg = -pP1pP2/2-2*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 15 <= atomicNumber < 16: # Carbon
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0,-3*pP1pP2/2-6*flipPN]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)

    if i == 6:
        if 7 <= atomicNumber < 10: # Nitrogen
            alphaAi.position = [0,0,-pP1pP2-p2p3]
            grpAn.add(alphaAi)
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            maxZNeg = -pP1pP2-p2p3
            print('alphaAi[',i+1,']', alphaAi.position)
        if 10 <= atomicNumber < 14:
            alphaAi.position = [0,0,-pP1pP2-4*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 15 == atomicNumber:
            alphaAi.position = [0,0,-pP1pP2-4*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)            
        if 16 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.position = [0,0,-pP1pP2/2-4*flipPN]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 17 <= atomicNumber < 36:
            alphaAi.position = [0,0,-pP1pP2-4*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 36 <= atomicNumber < 54:
            dblAlphai.rotateY(piG/2)
            dblAlphai.position = [-2*flipPN-p1p2/2-pP1pP2,0,0]
            grpAn.add(dblAlphai)
            print('dblAlphai[',i+1,']',dblAlphai.position)  
        if 54 <= atomicNumber:
            trplAlpha = Group()                
            buildTripleAlpha()
            trplAlpha.rotateY(piG/2)                
            trplAlpha.position = [-p2p3-3*pP1pP2/2-2*flipPN,0,0]                
            grpAn.add(trplAlpha)
            print('trplAlpha[',i+1,']', trplAlpha.position)

    if i == 7:
        if 8 == atomicNumber: # Oxygen
            protonAi.remove(neutronAi)  
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0,-3*pP1pP2/2-p2p3-2*flipPN]
            grpAn.add(protonAi)
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            maxZNeg = -3*pP1pP2/2-p2p3-2*flipPN            
            print('protonAi[',i+1,']', protonAi.position)
        if 9 == atomicNumber:
            protonAi.remove(neutronAi)  
            protonAi.rotateX(piG/2)
            protonAi.position = [0,pP1pP2/2,-3*pP1pP2/2-p2p3-2*flipPN]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 10 <= atomicNumber < 36:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0,-pP1pP2/2-2*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber < 54:
            dblAlphai.rotateX(piG/2)
            dblAlphai.position = [0,0,-p1p2/2-pP1pP2-2*flipPN]
            grpAn.add(dblAlphai)
            print('dblAlphai[',i+1,']', dblAlphai.position)
        if 54 <= atomicNumber:
            trplAlpha = Group()                
            buildTripleAlpha()
            trplAlpha.rotateX(piG/2)                
            trplAlpha.position = [0,0,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpAn.add(trplAlpha)
            print('trplAlpha[',i+1,']', trplAlpha.position)
            
    if i == 8:
        if 9 == atomicNumber < 10: # Fluorine
            protonAi.remove(neutronAi)  
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2,-3*pP1pP2/2-p2p3-2*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -3*pP1pP2/2-p2p3-2*flipPN
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 39 <= atomicNumber < 48:        
            protonAi.remove(neutronAi)
            #protonAi.rotateX(piG/2)          
            protonAi.position = [4*pP1pP2/2+p1p2+4*flipPN,0,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 48 <= atomicNumber < 54:        
            alphaAi.position = [4*pP1pP2/2+p1p2+4*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)

    if i == 9:
        if 10 <= atomicNumber < 36:  # Neon
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, pP1pP2/2 + 2*flipPN]
            grpAn.add(alphaAi)
            maxZNeg = -3*pP1pP2/2-p2p3-2*flipPN
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber < 54:
            dblAlphai.rotateY(piG/2)
            dblAlphai.position = [2*flipPN+p1p2/2+pP1pP2,0,0]
            grpAn.add(dblAlphai)
            print('dblAlphai[',i+1,']', dblAlphai.position)
        if 54 <= atomicNumber:
            trplAlpha = Group()                
            buildTripleAlpha()
            trplAlpha.rotateY(piG/2)                
            trplAlpha.position = [p2p3+3*pP1pP2/2+2*flipPN,0,0]                
            grpAn.add(trplAlpha)
            print('trplAlpha[',i+1,']', trplAlpha.position)

    if i == 10:
        if 11 <= atomicNumber < 14: # Sodium
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,0, pP1pP2+6*flipPN]
            grpAn.add(protonAi)
            maxZPos =  pP1pP2+6*flipPN
            maxZNeg = -pP1pP2-4*flipPN        
            print('protonAi[',i+1,']', protonAi.position)
        if 14 == atomicNumber:
            alphaAi.rotateX(-piG/2)
            #alphaAi.rotateZ(-piG/2)
            alphaAi.rotateY(-piG/2)
            alphaAi.position = [ -pP1pP2/2-2*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 15 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.rotateY(piG/2)
            protonAi.position = [-2*flipPN,0, 0]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 16 <= atomicNumber < 36:
            alphaAi.rotateX(-piG/2)
            alphaAi.rotateY(-piG/2)
            alphaAi.position = [ -pP1pP2/2-2*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        
    if i == 11:
        if 12 == atomicNumber: # Magnesium
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0, 0, -pP1pP2 - 6*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -pP1pP2 - 6*flipPN
            maxZPos =  pP1pP2 + 6*flipPN                
            print('protonAi[',i+1,']', protonAi.position)
        if 13 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0, pP1pP2/2+2*flipPN, 0]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 14 <= atomicNumber < 15:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,pP1pP2/2+2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 15 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,2*flipPN, 0]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 16 == atomicNumber:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,pP1pP2/2+2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 18 <= atomicNumber < 36:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,pP1pP2/2+2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber < 54:
            dblAlphai.rotateX(piG/2)
            dblAlphai.position = [0,0,p1p2/2+pP1pP2+2*flipPN]
            grpAn.add(dblAlphai)
        if 54 <= atomicNumber:
            trplAlpha = Group()                
            buildTripleAlpha()
            trplAlpha.rotateX(piG/2)                
            trplAlpha.position = [0,0,p2p3+3*pP1pP2/2+2*flipPN]                
            grpAn.add(trplAlpha)
            print('trplAlpha[',i+1,']', trplAlpha.position)
            
    if i == 12:
        if 13 == atomicNumber: # Aluminum
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,-pP1pP2/2-2*flipPN,0]
            grpAn.add(protonAi)
            maxZNeg = -pP1pP2-4*flipPN
            maxZPos =  3*pP1pP2/2 + 6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 14 == atomicNumber:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,-pP1pP2/2-2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 15 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,-2*flipPN,0]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)            
        if 16 == atomicNumber:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,-pP1pP2/2-2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 18 <= atomicNumber < 36:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,-pP1pP2/2-2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
            
    if i == 13:
        if 14 == atomicNumber: # Silicon, the carousal level
            alphaAi.rotateX(-piG/2)
            alphaAi.rotateY(piG/2)
            alphaAi.position = [ pP1pP2/2+2*flipPN,0,0]
            grpAn.add( alphaAi )
            maxZNeg = -pP1pP2-4*flipPN
            maxZPos = pP1pP2+4*flipPN            
            print('alphaAi[',i+1,']', alphaAi.position)
        if 15 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.rotateY(piG/2)
            protonAi.position = [2*flipPN,0,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 16 <= atomicNumber < 36:
            alphaAi.rotateX(-piG/2)
            alphaAi.rotateY(piG/2)
            alphaAi.position = [ pP1pP2/2+2*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
  
    if i == 14:
        if 15 == atomicNumber: # Phosphorus 
            alphaAi.rotateX(piG)
            alphaAi.position = [0, 0, pP1pP2 + 4*flipPN]
            grpAn.add( alphaAi )
            maxZNeg = -pP1pP2/2 - 4*flipPN
            maxZPos =  pP1pP2/2 + 4*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 16 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG)
            protonAi.position = [0, 0, pP1pP2/2 + 4*flipPN]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 17 <= atomicNumber < 18:
            alphaAi.rotateX(piG)
            alphaAi.position = [0, 0, pP1pP2 + 4*flipPN]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 42 <= atomicNumber < 47:
            protonAi.remove(neutronAi)
            protonAi.position = [0,4*pP1pP2/2+p1p2+4*flipPN,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 47 <= atomicNumber < 54 :
            alphaAi.position = [0,4*pP1pP2/2+p1p2+4*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)          

    if i == 15:
        if 16 == atomicNumber: # Sulfur
            protonAi.remove(neutronAi)
            protonAi.position = [0, 0, -pP1pP2/2 - 4*flipPN]
            grpAn.add( protonAi )
            maxZNeg = -pP1pP2/2 - 4*flipPN
            maxZPos = pP1pP2/2 + 4*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 41 <= atomicNumber < 47:
            protonAi.remove(neutronAi)
            protonAi.position = [0,-4*pP1pP2/2-p1p2-4*flipPN,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)  
        if 47 <= atomicNumber < 54:
            alphaAi.position = [0,-4*pP1pP2/2-p1p2-4*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)            

    if i == 16:
        if 17 == atomicNumber: # Chlorine
            alphaAi.rotateX(piG/2)          
            alphaAi.position = [0,0,-3*pP1pP2/2-6*flipPN]
            grpAn.add( alphaAi )
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN        
            print('alphaAi[',i+1,']', alphaAi.position)
        if 39 <= atomicNumber < 48:
            protonAi.remove(neutronAi)
            protonAi.position = [-4*pP1pP2/2-p1p2-4*flipPN,0,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 48 <= atomicNumber < 54:
            #alphaAi.remove(neutronAi)
            alphaAi.position = [-4*pP1pP2/2-p1p2-4*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)

    if i == 17:
        if 18 <=atomicNumber < 36: # Argon
            alphaAi.position = [0, 0, pP1pP2 + 4*flipPN]            
            grpAn.add( alphaAi )
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos = 3*pP1pP2/2+4*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber < 54:
            dblAlphai.rotateX(piG/2)
            dblAlphai.position = [0,-2*flipPN-p1p2/2-pP1pP2,0]
            grpAn.add(dblAlphai)
            print('dblAlphai[',i+1,']', dblAlphai.position)
        if 54 <= atomicNumber:
            trplAlpha = Group()                
            buildTripleAlpha()
            trplAlpha.rotateX(piG/2)                
            trplAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN, 0]                
            grpAn.add(trplAlpha)
            print('trplAlpha[',i+1,']', trplAlpha.position)

    if i == 18:
        if 19 <= atomicNumber < 21: # Potassium
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN            
            print('protonAi[',i+1,']', protonAi.position)
        if 21 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            neutronBi.position = [0,3*pP1pP2/2+6*flipPN,-pP1pP2 - 2*flipPN - p1n2]
            protonAi.add(neutronBi)
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 22 <= atomicNumber < 27:
            neutronAi.position = [0,0, p1n2]            
            protonAi.rotateZ(piG/2)    
            protonAi.position = [0, pP1pP2+4*flipPN,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 27 == atomicNumber:
            neutronAi.position = [0,p1n2+pP1pP2+2*flipPN,0]
            grpAn.add( neutronAi )
            print('neutronAi[',i+1,']', neutronAi.position)
        if 29 <= atomicNumber < 30:          
            neutronAi.position = [0,pP1pP2/2+p1n2,p2p3-pP1pP2/2-2*flipPN]
            grpAn.add( neutronAi )
            neutronBi.position = [0,pP1pP2/2+p1n2,-p2p3-pP1pP2/2-2*flipPN]
            grpAn.add( neutronBi )
            print('2 hook neutrons[',i+1,']', neutronAi.position)            
        if 30 == atomicNumber :
            protonAi.remove(neutronAi)
            protonAi.position = [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 32 <= atomicNumber < 35 :
            protonAi.remove(neutronAi)
            protonAi.position = [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 35 == atomicNumber :
            alphaAi.position = [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]
            grpAn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber < 54:
            #dblAlphai.rotateX(piG/2)
            dblAlphai.position = [0,0,-p1p2/2-pP1pP2-p1p2/2-pP1pP2-4*flipPN]
            grpAn.add( dblAlphai )            
            print('dblAlphai[',i+1,']', dblAlphai.position)
        if 54 <= atomicNumber:
            trplAlpha = Group()                
            buildTripleAlpha()
            #trplAlpha.rotateX(piG/2)                
            trplAlpha.position = [0,0,-2*p2p3-3*pP1pP2-4*flipPN]
            grpAn.add(trplAlpha)
            print('trplAlpha[',i+1,']', trplAlpha.position)
            
    if i == 19:
        if 20 == atomicNumber: # Calcium
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)            
            protonAi.position = [0,0,-3*pP1pP2/2-6*flipPN]          
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 21 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateZ(piG/2)
            protonAi.position = [4*flipPN+pP1pP2,0,0]
            neutronBi.position = [2*flipPN+pP1pP2 +p1n2,pP1pP2+4*flipPN,0]
            protonAi.add(neutronBi)
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 22 <= atomicNumber < 27:
            neutronAi.position = [0,0,-p1n2]
            protonAi.rotateZ(-piG/2)
            protonAi.position = [4*flipPN+pP1pP2,0,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 27 <= atomicNumber < 36:
            alphaAi.position = [0,0,-p1n2]
            alphaAi.rotateZ(-piG/2)
            alphaAi.position = [4*flipPN+pP1pP2,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)

    if i == 20:
        if 21 == atomicNumber: # Scandium 
            protonAi.remove(neutronAi)
            protonAi.rotateZ(piG/2)            
            protonAi.position = [-pP1pP2-4*flipPN,0,0]
            neutronBi.position = [0,-pP1pP2-4*flipPN,-3*pP1pP2/2-4*flipPN-p1n2]
            protonAi.add(neutronBi)            
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 22 <= atomicNumber < 27 :
            neutronAi.position = [0,0,p1n2]
            protonAi.rotateZ(-piG/2)            
            protonAi.position = [-pP1pP2-4*flipPN,0,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 27 <= atomicNumber < 36:
            alphaAi.position = [0,0,p1n2]
            alphaAi.rotateZ(-piG/2)            
            alphaAi.position = [-pP1pP2-4*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber < 54:
            dblAlphai.rotateX(piG/2)
            dblAlphai.position = [0,p1p2/2+pP1pP2+2*flipPN,0]
            grpAn.add( dblAlphai )            
            print('dblAlphai[',i+1,']', dblAlphai.position)
        if 54 <= atomicNumber:
            trplAlpha = Group()                
            buildTripleAlpha()
            trplAlpha.rotateX(piG/2)                
            trplAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN, 0]            
            grpAn.add(trplAlpha)
            print('trplAlpha[',i+1,']', trplAlpha.position)
            
    if i == 21:
        if 22 <= atomicNumber < 29: # Titanium
            neutronAi.position = [0,0,-p1n2]
            protonAi.rotateZ(piG/2)    
            protonAi.position = [0,-pP1pP2-4*flipPN,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 29 <= atomicNumber < 36:
            alphaAi.rotateZ(piG/2)    
            alphaAi.position = [0,-pP1pP2-4*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)

    if i == 22:
        if 23 <= atomicNumber < 26: # Vanadium
            protonAi.rotateX(piG/2)
            protonAi.remove(neutronAi)
            protonAi.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN        
            print('protonAi[',i+1,']', protonAi.position)
        if 26 <= atomicNumber < 29:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpAn.add(alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 29 <= atomicNumber < 31:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpAn.add(protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 31 <= atomicNumber < 36:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpAn.add(alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
          
    if i == 23:
        if 24 <= atomicNumber < 26: # Chromium
            protonAi.rotateX(piG/2)
            protonAi.remove(neutronAi)
            protonAi.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-8*flipPN
            maxZPos =  3*pP1pP2/2+8*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 26 <= atomicNumber < 30:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 30 == atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.remove(neutronAi)
            protonAi.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 31 <= atomicNumber < 36:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
          
    if i == 24:
        if 25 == atomicNumber: # Manganese
            protonAi.remove(neutronAi)
            protonAi.position = [0,-pP1pP2/2-2*flipPN, pP1pP2/2+2*flipPN]
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-8*flipPN
            maxZPos =  3*pP1pP2/2+8*flipPN
            print('hook protonAi[',i+1,']', protonAi.position)
        if 26 <= atomicNumber < 29: # Three hook position neutrons
            neutronAi.position = [0,-pP1pP2/2-p1n2,pP1pP2/2 + 2*flipPN]
            grpAn.add( neutronAi )
            neutronBi.position = [0,-pP1pP2/2-p1n2,-pP1pP2/2 - 2*flipPN]
            grpAn.add( neutronBi )
            neutronGi.position = [0,pP1pP2/2+p1n2,-pP1pP2/2 - 2*flipPN]
            grpAn.add( neutronGi )
            print('3 ea hook neutrons[',i+1,']', neutronAi.position)
        if 29 <= atomicNumber < 34:
            neutronAi.position = [0,-pP1pP2/2-p1n2,-pP1pP2/2 - 2*flipPN]
            grpAn.add( neutronAi )
            print('hook neutronAi[',i+1,']', neutronAi.position)
        if 34 <= atomicNumber < 36:
            protonAi.remove(neutronAi)
            protonAi.position = [0,-pP1pP2/2- 2*flipPN,-pP1pP2/2 - 2*flipPN]
            grpAn.add( protonAi )
            print('hook protonAi[',i+1,']', protonAi.position)
            
    if i == 25:
        if 26 <= atomicNumber < 29: # Iron
            print('[',i+1,'] Iron. New objects added elsewhere')
        if 29 == atomicNumber:
            neutronAi.position = [0,-pP1pP2/2-p1n2,p2p3+pP1pP2/2+2*flipPN]
            grpAn.add( neutronAi )
            neutronBi.position = [0,-pP1pP2/2-p1n2,-p2p3+pP1pP2/2+2*flipPN]
            grpAn.add( neutronBi )
            print('2 ea hook neutrons[',i+1,']', neutronAi.position)
        if 30 <= atomicNumber < 36:
            protonAi.remove(neutronAi)
            protonAi.position = [0,-pP1pP2/2-2*flipPN,pP1pP2/2+2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 36 <= atomicNumber < 54:
            dblAlphai.position = [0,0,p1p2/2+pP1pP2+p1p2/2+pP1pP2+4*flipPN]
            grpAn.add(dblAlphai)
            print('dblAlphai[',i+1,']', dblAlphai.position)
        if 54 <= atomicNumber:
            trplAlpha = Group()                
            buildTripleAlpha()
            #trplAlpha.rotateX(piG/2)                
            trplAlpha.position = [0,0,2*p2p3+3*pP1pP2+4*flipPN]
            grpAn.add(trplAlpha)
            print('trplAlpha[',i+1,']', trplAlpha.position)

    if i == 26:
        if 27 <= atomicNumber < 33: # Cobalt
            neutronAi.position = [0, pP1pP2/2+p1n2, pP1pP2/2+2*flipPN]
            grpAn.add(neutronAi)
        if 33 <= atomicNumber < 36:
            protonAi.remove(neutronAi)
            protonAi.position = [0, pP1pP2/2+2*flipPN, pP1pP2/2+2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)

    if i == 27:
        if 28 == atomicNumber: # Nickel
            protonAi.remove(neutronAi)
            protonAi.position = [0, pP1pP2+4*flipPN, 0]
            grpAn.add(protonAi)
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
            
    if i == 28:
        if 29 <= atomicNumber < 36: # Copper
            alphaAi.position = [0, pP1pP2+4*flipPN, 0]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)

    if i == 36:
        if 37 <= atomicNumber < 48: # Rubidium
            neutronAi.position = [0,2*flipPN-p2p3,p2p3]
            protonAi.rotateX(-piG/2)  
            protonAi.position = [0,-p2p3/2,3*p1p2/2+6*pP1pP2/2+6*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -3*p1p2/2-5*pP1pP2/2-4*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 48 <= atomicNumber < 50:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0, 0, 3*p1p2/2+6*pP1pP2/2+6*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 50 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,0,3*p1p2/2+6*pP1pP2/2+6*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 51 <= atomicNumber < 54:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0, 0, 3*p1p2/2+6*pP1pP2/2+6*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 55 <= atomicNumber :
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-4*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            
    if i == 37:
        if 38 == atomicNumber: # Strontium
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 40 <= atomicNumber < 47:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 47 <= atomicNumber < 50:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpAn.add(alphaAi)
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 50 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 51 <= atomicNumber < 54:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpAn.add(alphaAi)
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 56 <= atomicNumber :
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*flipPN]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
  
grpAn.position = [0,0,(-maxZNeg + maxZPos)/2 - maxZPos]

In[6]
scene = Scene(children=[grpAn, camera, key_light, ambient_light])
controller = OrbitControls(controlling=camera, screenSpacePanning=True)

In[7]
renderer = Renderer(camera=camera, scene=scene, controls=[controller],
                    width=view_width, height=view_height)
scene = Scene()  # initialising the scene

In[8]
renderer

In[9]
spin_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 2], values=[0, 2*piG])
spin_clip = AnimationClip(tracks=[spin_track])
spin_action = AnimationAction(AnimationMixer(grpAn), spin_clip, grpAn) # best
spin_action
We have Joy!

Well, no great accomplishment to a regular programmer, but it's my first python pythreejs jupyter notebook function, buildTripleAlpha(). Twenty four code lines that I would otherwise have needed to repeat up to nine times for xenon has been reduced to nine function calls. The function returns a triple alpha to the calling i-loop register which rotates and positions the group() as needed - saving a couple hundred code lines, slowing the code’s growth, something I was desperately hoping for.

After just three triple alpha core atoms, xenon, caesium and barium, surprise(!) the atoms switch to the lanthanum (57, La) series, atoms built with a nine-double Alpha + proton, a 5 proton unit core. That promised to be another three hundred code line growth. I’m hoping this new function may be modified to build any desired size proton/alpha group.
 
Creating multiple objects – up to millions or more, using instancing does not appear to offer any solution, at least not at my programming level, since instancing is used with “shaders”, which this particular project/version does not.

Using BufferGeometry, as this project does, it should be possible to merge geometries. I’ve tried merging a proton with its emissions at least a dozen times, using code which I knew was “good”, but which jupyter did not agree or allow. Same with copying or cloning - nope. As I see it, the code simply creates objects and groups which are added to the desired atom, which is then added to the scene.

Eventually, I have no idea when, the alpha’s neutrons will orbit each other and the electrons will orbit the charge channels.
 
Lanthanum first.

Miles Periodic Table with Standard Periodic Table reference - Page 2 Ithrub10
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Mon Sep 20, 2021 3:58 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Lathru10

First part of a two part posting.

Cr6,

The current code can display any of the first 72 elements and the main atom building In[] cell is 1400 code lines long – better than I feared or expected. The last four elements added (ending with lutetium, ytterbium and hafnium) transitioned from the Lanthanum series 5-proton unit core back to xenon’s 3 alpha unit core and involved almost all the maximum 19 i-loop registers, adding about a hundred forty code lines. I’m hoping we can make it to 100 elements or maybe a six-alpha core (9*12=108). The code will continue to grow, but I’ve quit worrying about possible jupyter notebook limits and how one might get around them i.e. putting separate periodic table periods (rows) into their own In[] cells.

The buildTripleAlpha() function is now buildMultiAlphas(a), where the “a” specifies the desired number of alphas, 2 through 6. The previous i-loop alphaAi creation code is used something like 140 times and only uses three code lines each time, as opposed to the multiAlpha(1)’s five lines, so alphaAi remains; however, I removed the previous double alpha object from the i-loop overhead. It may yet return as part of some animation solution.

Unable to make do with just a single proton group generator function, I added a second function, buildProtonAlphaSet(a), where a is the total number of protons, an odd number (3,5,7,…), which occurs when adding some number of alphas and a single proton. I may make one function out of the them yet.

Code lines 1 - 741

Code:

In[1]:
from pythreejs import *
from IPython.display import display
import ipywidgets
from math import sqrt
phi = (1+sqrt(5))/2  # calculating phi-based-pi, piG.
piG = 4/sqrt(phi)    # piG is used instead of pi.

In[2]:
view_width = 600
view_height = 400
factor = 40 # orthographic "scaler"
camera = PerspectiveCamera(position=[10, 0, 0], up=[0, 0, 1], aspect=view_width/view_height)
#camera = PerspectiveCamera(position=[10, 0, 0], up=[1, 0, 0], aspect=view_width/view_height)
camera = PerspectiveCamera(position=[10, 0, 0], up=[0, 1, 0], aspect=view_width/view_height)
#camera = OrthographicCamera(view_width/-factor,view_width/factor,view_height / factor,
#    view_height / - factor,0.1,1000)  # The orbital controls doesn't work with ortho(?)
key_light = DirectionalLight(position=[0, 10, 10])
ambient_light = AmbientLight()

In[3]
elements = ["1 Hydrogen H","2 Helium He","3 Lithium Li","4 Beryllium Be",
           "5 Boron B","6 Carbon C","7 Nitrogen N","8 Oxygen O",
           "9 Fluorine F","10 Neon Ne","11 Sodium Na","12 Magnesium Mg",
           "13 Aluminum Al","14 Silicon Si","15 Phosphorus P","16 Sulfur S",
           "17 Chlorine Cl","18 Argon Ar","19 Potassium P","20 Calcium Ca",
           "21 Scandium Sc","22 Titanium Ti","23 Vanadium V","24 Chromium Cr",
           "25 Manganese Mn","26 Iron Fe","27 Cobalt Co","28 Nickel Ni",
           "29 Copper Cu","30 Zinc Zn","31 Gallium Ga","32 Germanium Ge",
           "33 Arsenic As","34 Selenium Se","35 Bromine Br","36 Krypton Kr",
           "37 Rubidium Rb","38 Strontium Sr","39 Yttrium Y","40 Zirconium Zr",
           "41 Niobium Nb","42 Molybdenum Mo","43 Technetium Tc","44 Ruthenium Ru",
           "45 Rhodium Rh","46 Palladium Pd","47 Silver Ag","48 Cadmium Cd",
           "49 Indium In", "50 Tin Sn","51 Antimony Sb","52 Tellurium Te",
           "53 Iodine I","54 Xenon Xe","55 Caesium Cs","56 Barium Ba",
           "57 Lanthanum La","58 Cerium Ce","59 Praseodymium Pr","60 Neodymium Nd",
           "61 Promethium Pm","62 Samarium Sm","63 Europium Eu","64 Gadolinium Gd",
           "65 Terbium Tb","66 Dysprosium Dy","67 Holmium Ho","68 Erbium Er",
           "69 Thulium Tm","70 Ytterbium Yb","71 Lutetium Lu","72 Hafnium Hf"]
print( elements )

In[4]
number = input( "Please enter the Atomic number: " )
number = int( number )
print( "The Atomic number selected is", elements[number-1])

In[5]
grpAn = Group()   # An - Atomic Number
#atomicNumber = 2 # Easier place to change An when coding
atomicNumber = number  # Enter the desired number of protons

# Dimensions
pP1pP2 = 1.5 # Proton 1 to proton 2, Pole-to-pole separation.
pRadius = 0.5
nRadius = 0.6
eRadius = 2*pRadius/10
emRadius = 6
p1p2 = pRadius*2.5  # small gap
#p2p3 = pRadius*3  # small gap
p2p3 = pRadius*2.85  # small gap
n1n2 = 4.0  # Alpha, left-right (y) neutron-neutron orbital separation
p1n1 = pP1pP2/2 # Alpha, up-down (z) proton-orbital neutron separation
p1n2 = pRadius + nRadius + 0.5  # In line proton and neutron
p1e1 = pRadius + 1.5*pP1pP2/10  # Alpha, top-bottom (z) proton-electron separation
e1e2 = 0.75  # 0.5  # electron-electron separation
flipPN = 3 # Dist. between adjacent vertical and horiz protons
maxZNeg = 0.0 # maxZNeg and maxZPos are Used to center(z) the atom on the screen
maxZPos = 0.0  

# Proton set Geometries and Materials
protonGeometry =  SphereBufferGeometry(pRadius, 24, 16)
neutronGeometry =  SphereBufferGeometry(nRadius, 24, 16)
electronGeometry =  SphereBufferGeometry(eRadius, 8, 16)
emissionGeometry = CircleGeometry(emRadius, 24)
emissionTopGeometry = CircleGeometry(emRadius, 24)
emissionBotGeometry = CircleGeometry(emRadius, 24)

protonMaterial = MeshStandardMaterial(color='blue')
protonMaterialB = MeshStandardMaterial(color='green')
neutronMaterial = MeshStandardMaterial(color='red')
electronMaterial = MeshStandardMaterial(color='cyan')
emissionmaterial = MeshStandardMaterial(color='gray',
    transparent = True,opacity = 0.25)

def buildMultiAlphas(a): # a is the number of alphas. Using 2 and 3 so far.
    num = 0          
    while num < a*2 :
        protonMi = Group()
        protonMi.add(Mesh(protonGeometry, protonMaterial))    
        emissionM2i = Mesh( emissionGeometry, emissionmaterial)
        emissionM2i.rotateX(piG)
        protonMi.add(Mesh(emissionGeometry, emissionmaterial))
        protonMi.add(emissionM2i)
        neutronMi = Object3D()
        neutronMi.add(Mesh(neutronGeometry, neutronMaterial))
        neutronMi.position = [0,-n1n2/2,-p1n1]
        protonMi.add(neutronMi)                
        electronMi = Object3D()
        electronMi.add(Mesh(electronGeometry, electronMaterial))
        electronMi.position = [0,-e1e2/2,-p1e1]
        protonMi.add(electronMi)
        if num%2 != 0:
            protonMi.rotateX(piG)
        protonMi.position = [0,0,a*pP1pP2/2+(a-1)*p2p3/2-(p2p3/2+pP1pP2/2)*num]
        multiAlpha.add(protonMi)                
        num += 1
    return

def buildProtonAlphaSet(a): # Odd numbers, alphas and one proton. a is the tot # of protons
    num = 0  
    while num < a:
        protonMi = Group()
        protonMi.add(Mesh(protonGeometry, protonMaterial))    
        emissionM2i = Mesh( emissionGeometry, emissionmaterial)
        emissionM2i.rotateX(piG)
        protonMi.add(Mesh(emissionGeometry, emissionmaterial))
        protonMi.add(emissionM2i)
        electronMi = Object3D()
        electronMi.add(Mesh(electronGeometry, electronMaterial))
        electronMi.position = [0,-e1e2/2,-p1e1]
        protonMi.add(electronMi)
        neutronMi = Object3D()
        neutronMi.add(Mesh(neutronGeometry, neutronMaterial))
        neutronMi.position = [0,-n1n2/2,-p1n1]
        if num%2 == 0 and num < a-1 :
            protonMi.add(neutronMi)
        if num%2 != 0 :
            protonMi.add(neutronMi)
            protonMi.rotateX(piG)
        protonMi.position = [0,0,(a//2)*pP1pP2/2+(a//2)*p2p3/2-(p2p3/2+pP1pP2/2)*num]            
        pASet.add(protonMi)                
        num += 1
    return
        
# Assemble the atomic models.
for i in range( atomicNumber ):
    emissionA2i = Mesh( emissionGeometry, emissionmaterial)
    emissionA2i.rotateX(piG)
    protonAi = Group()
    protonAi.add(Mesh(protonGeometry, protonMaterial))
    protonAi.add(Mesh(emissionGeometry, emissionmaterial))
    protonAi.add(emissionA2i)
    neutronAi = Object3D()
    neutronAi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronAi.position = [0,-n1n2/2,-p1n1]
    protonAi.add(neutronAi)
    electronAi = Object3D()
    electronAi.add(Mesh(electronGeometry, electronMaterial))
    electronAi.position = [0,-e1e2/2,-p1e1]
    protonAi.add(electronAi)
    emissionB2i = Mesh( emissionGeometry, emissionmaterial)
    emissionB2i.rotateX(piG)
    protonBi = Group()
    protonBi.add(Mesh(protonGeometry, protonMaterial))
    protonBi.add(Mesh(emissionGeometry, emissionmaterial))
    protonBi.add(emissionB2i)
    neutronBi = Object3D()
    neutronBi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronBi.position = [0,-n1n2/2,-p1n1]
    protonBi.add(neutronBi)
    electronBi = Object3D()  
    electronBi.add(Mesh(electronGeometry, electronMaterial))
    electronBi.position = [0,-e1e2/2,-p1e1]
    protonBi.add(electronBi)
    protonBi.rotateY(piG)
    protonBi.rotateZ(piG)

    emissionC2i = Mesh( emissionGeometry, emissionmaterial)
    emissionC2i.rotateX(piG)
    protonCi = Group()
    protonCi.add(Mesh(protonGeometry, protonMaterial))
    protonCi.add(Mesh(emissionGeometry, emissionmaterial))
    protonCi.add(emissionC2i)
    neutronCi = Object3D()
    neutronCi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronCi.position = [0,-n1n2/2,-p1n1]
    protonCi.add(neutronCi)
    electronCi = Object3D()
    electronCi.add(Mesh(electronGeometry, electronMaterial))
    electronCi.position = [0,-e1e2/2,-p1e1]
    protonCi.add(electronCi)    
    emissionD2i = Mesh( emissionGeometry, emissionmaterial)
    emissionD2i.rotateX(piG)
    protonDi = Group()
    protonDi.add(Mesh(protonGeometry, protonMaterial))
    protonDi.add(Mesh(emissionGeometry, emissionmaterial))
    protonDi.add(emissionD2i)
    neutronDi = Object3D()
    neutronDi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronDi.position = [0,-n1n2/2,-p1n1]
    protonDi.add(neutronDi)
    electronDi = Object3D()  
    electronDi.add(Mesh(electronGeometry, electronMaterial))
    electronDi.position = [0,-e1e2/2,-p1e1]
    protonDi.add(electronDi)
    protonDi.rotateY(piG)
    protonDi.rotateZ(piG)
    
    neutronGi = Object3D()
    neutronGi.add(Mesh(neutronGeometry, neutronMaterial))
    
    protonEi = Group() # alpha
    protonEi.add(protonAi)
    protonEi.position = [0,0,pP1pP2/2]
    protonHi = Group()
    protonHi.add(protonBi)
    protonHi.position = [0,0,-pP1pP2/2]
    alphaAi = Group()
    alphaAi.add(protonEi)
    alphaAi.add(protonHi)

    if i == 0:
        if 1 == atomicNumber: # Hydrogen.
            neutronAi.position = [0,0,-p1n2]
            grpAn.add( protonAi )
            maxZNeg = 0  
            maxZPos = 0
            print('protonAi[',i+1,']', protonAi.position)
        if 46 <= atomicNumber < 48:            
            protonAi.remove(neutronAi)
            protonAi.position = [0,p1p2/2+pP1pP2+2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 49 == atomicNumber:            
            protonAi.remove(neutronAi)
            protonAi.position = [0,p1p2/2+pP1pP2+2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 53 == atomicNumber:            
            alphaAi.position = [0,p1p2/2+pP1pP2+2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpAn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 60 <= atomicNumber < 62:
            protonAi.remove(neutronAi)
            protonAi.position = [0,p2p3+pP1pP2+2*flipPN,p2p3+pP1pP2+2*flipPN]            
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 64 <= atomicNumber < 66:
            alphaAi.position = [0,p2p3+pP1pP2+2*flipPN,p2p3+pP1pP2+2*flipPN]
            grpAn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 70 == atomicNumber :
            protonAi.remove(neutronAi)
            protonAi.position = [0,p2p3+pP1pP2+2*flipPN,p2p3+pP1pP2+2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 72 == atomicNumber :
            protonAi.remove(neutronAi)
            protonAi.position = [0,p2p3+pP1pP2+2*flipPN,p2p3+pP1pP2+2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
            
    if i == 1:
        if 2 <= atomicNumber < 10: # Helium
            alphaAi.position = [0,0,pP1pP2 + p2p3]
            grpAn.add( alphaAi )
            maxZNeg = 0
            maxZPos = 0
            print('alphaAi[',i+1,']', alphaAi.position)
        if 45 <= atomicNumber < 48: # hook position            
            protonAi.remove(neutronAi)
            protonAi.position = [0,-p1p2/2-pP1pP2-2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 51 == atomicNumber:            
            protonAi.remove(neutronAi)
            protonAi.position = [0,-p1p2/2-pP1pP2-2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 53 == atomicNumber :            
            protonAi.remove(neutronAi)
            protonAi.position = [0,-p1p2/2-pP1pP2-2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 59 <= atomicNumber < 63 :
            protonAi.remove(neutronAi)
            protonAi.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]            
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 65 <= atomicNumber < 66 :
            protonAi.remove(neutronAi)
            protonAi.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]            
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 68 == atomicNumber :
            protonAi.remove(neutronAi)
            protonAi.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 69 == atomicNumber :
            alphaAi.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpAn.add( alphaAi )
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 70 == atomicNumber :
            protonAi.remove(neutronAi)
            protonAi.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 72 <= atomicNumber :
            protonAi.remove(neutronAi)
            protonAi.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
            
    if i == 2:
        if 3 <= atomicNumber < 10: # Lithium
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0, 3*pP1pP2/2+p2p3+2*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -pP1pP2/2
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 10 <= atomicNumber < 14:
            alphaAi.position = [0, 0, pP1pP2+4*flipPN]            
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 17 <= atomicNumber < 18:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 44 <= atomicNumber < 47:            
            protonAi.remove(neutronAi)
            protonAi.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 50 == atomicNumber:            
            #protonAi.remove(neutronAi)
            alphaAi.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpAn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 51 == atomicNumber:            
            protonAi.remove(neutronAi)
            protonAi.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 52 == atomicNumber :            
            #protonAi.remove(neutronAi)
            alphaAi.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpAn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 53 == atomicNumber :            
            protonAi.remove(neutronAi)
            protonAi.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 57 <= atomicNumber < 68 :
            alphaAi.position = [0,-p2p3-pP1pP2-2*flipPN,p2p3+pP1pP2+2*flipPN]
            grpAn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 70 == atomicNumber :
            protonAi.remove(neutronAi)
            protonAi.position = [0,-p2p3-pP1pP2-2*flipPN,p2p3+pP1pP2+2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 71 == atomicNumber :
            protonAi.remove(neutronAi)
            protonAi.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)

    if i == 3:
        if 4 == atomicNumber < 5: # Beryllium
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0, 0, pP1pP2/2+p2p3 -2*flipPN]
            grpAn.add(protonAi)
            maxZNeg = pP1pP2/2+p2p3 -2*flipPN
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 43 <= atomicNumber < 47:            
            protonAi.remove(neutronAi)
            protonAi.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 50 == atomicNumber:            
            alphaAi.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpAn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 51 == atomicNumber:            
            protonAi.remove(neutronAi)
            protonAi.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 52 == atomicNumber:            
            alphaAi.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpAn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 53 == atomicNumber:            
            protonAi.remove(neutronAi)
            protonAi.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 57 == atomicNumber < 58:
            protonAi.remove(neutronAi)
            protonAi.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 58 <= atomicNumber < 63:
            #protonAi.remove(neutronAi)
            alphaAi.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpAn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 63 == atomicNumber :
            protonAi.remove(neutronAi)
            protonAi.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 66 <= atomicNumber < 68 :
            alphaAi.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpAn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 68 <= atomicNumber < 71:
            protonAi.remove(neutronAi)
            protonAi.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 71 == atomicNumber :
            protonAi.remove(neutronAi)
            protonAi.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
            
    if i == 4:
        if 5 <= atomicNumber < 36: # Boron
            alphaAi.position = [0, 0, 0]
            grpAn.add(alphaAi)
            maxZNeg = -pP1pP2/2
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber < 54 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, 0, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0, 0, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0, 0, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0, 0, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 5:
        if 6 == atomicNumber < 7: # Carbon
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0,-pP1pP2/2-2*flipPN]
            grpAn.add(protonAi)
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            maxZNeg = -pP1pP2/2-2*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 15 <= atomicNumber < 16: # Carbon
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0,-3*pP1pP2/2-6*flipPN]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)

    if i == 6:
        if 7 <= atomicNumber < 10: # Nitrogen
            alphaAi.position = [0,0,-pP1pP2-p2p3]
            grpAn.add(alphaAi)
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            maxZNeg = -pP1pP2-p2p3
            print('alphaAi[',i+1,']', alphaAi.position)
        if 10 <= atomicNumber < 14:
            alphaAi.position = [0,0,-pP1pP2-4*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 15 == atomicNumber:
            alphaAi.position = [0,0,-pP1pP2-4*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)            
        if 16 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.position = [0,0,-pP1pP2/2-4*flipPN]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 17 <= atomicNumber < 36:
            alphaAi.position = [0,0,-pP1pP2-4*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-2*flipPN-p1p2/2-pP1pP2,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-p2p3-3*pP1pP2/2-2*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateY(piG/2)
            pASet.position = [-p2p3-pP1pP2-2*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-p2p3-3*pP1pP2/2-2*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 7:
        if 8 == atomicNumber: # Oxygen
            protonAi.remove(neutronAi)  
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0,-3*pP1pP2/2-p2p3-2*flipPN]
            grpAn.add(protonAi)
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            maxZNeg = -3*pP1pP2/2-p2p3-2*flipPN            
            print('protonAi[',i+1,']', protonAi.position)
        if 9 == atomicNumber:
            protonAi.remove(neutronAi)  
            protonAi.rotateX(piG/2)
            protonAi.position = [0,pP1pP2/2,-3*pP1pP2/2-p2p3-2*flipPN]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 10 <= atomicNumber < 36:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0,-pP1pP2/2-2*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,-p1p2/2-pP1pP2-2*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)  
        if 57 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)  
            pASet.position = [0,0,-p2p3-pP1pP2-2*flipPN]
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 8:
        if 9 == atomicNumber < 10: # Fluorine
            protonAi.remove(neutronAi)  
            protonAi.rotateX(piG/2)
            protonAi.position = [0,-pP1pP2/2,-3*pP1pP2/2-p2p3-2*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -3*pP1pP2/2-p2p3-2*flipPN
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 39 <= atomicNumber < 48:        
            protonAi.remove(neutronAi)
            #protonAi.rotateX(piG/2)          
            protonAi.position = [4*pP1pP2/2+p1p2+4*flipPN,0,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 48 <= atomicNumber < 54:        
            alphaAi.position = [4*pP1pP2/2+p1p2+4*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 57 <= atomicNumber < 63:
            alphaAi.position = [2*p2p3+2*pP1pP2+4*flipPN,0,0]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 63 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [2*p2p3+2*pP1pP2+4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            alphaAi.position = [2*p2p3+3*pP1pP2+4*flipPN,0,0]  
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
            
    if i == 9:
        if 10 <= atomicNumber < 36:  # Neon
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, pP1pP2/2 + 2*flipPN]
            grpAn.add(alphaAi)
            maxZNeg = -3*pP1pP2/2-p2p3-2*flipPN
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [2*flipPN+p1p2/2+pP1pP2,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)          
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [p2p3+3*pP1pP2/2+2*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)            
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateY(piG/2)
            pASet.position = [p2p3+pP1pP2+2*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [p2p3+3*pP1pP2/2+2*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)  
            
    if i == 10:
        if 11 <= atomicNumber < 14: # Sodium
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,0, pP1pP2+6*flipPN]
            grpAn.add(protonAi)
            maxZPos =  pP1pP2+6*flipPN
            maxZNeg = -pP1pP2-4*flipPN        
            print('protonAi[',i+1,']', protonAi.position)
        if 14 == atomicNumber:
            alphaAi.rotateX(-piG/2)
            #alphaAi.rotateZ(-piG/2)
            alphaAi.rotateY(-piG/2)
            alphaAi.position = [ -pP1pP2/2-2*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 15 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.rotateY(piG/2)
            protonAi.position = [-2*flipPN,0, 0]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 16 <= atomicNumber < 36:
            alphaAi.rotateX(-piG/2)
            alphaAi.rotateY(-piG/2)
            alphaAi.position = [ -pP1pP2/2-2*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        
    if i == 11:
        if 12 == atomicNumber: # Magnesium
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0, 0, -pP1pP2 - 6*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -pP1pP2 - 6*flipPN
            maxZPos =  pP1pP2 + 6*flipPN                
            print('protonAi[',i+1,']', protonAi.position)
        if 13 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0, pP1pP2/2+2*flipPN, 0]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 14 <= atomicNumber < 15:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,pP1pP2/2+2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 15 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,2*flipPN, 0]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 16 == atomicNumber:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,pP1pP2/2+2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 18 <= atomicNumber < 36:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,pP1pP2/2+2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,p1p2/2+pP1pP2+2*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)                
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,p2p3+3*pP1pP2/2+2*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)              
        if 57 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)  
            pASet.position = [0,0,p2p3+pP1pP2+2*flipPN]
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,p2p3+3*pP1pP2/2+2*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)

See the following post for the remaing code.

Miles Periodic Table with Standard Periodic Table reference - Page 2 Pmthru10
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Mon Sep 20, 2021 4:11 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Tbthru10

Second part of a two-part message.

I believe this project has demonstrated proof of concept, able to handle a respectable amount of elements, although 1. more atoms and 2. neutron/electron spins are needed. If neutron spins are too difficult, I should at least give the neutrons random fixed initial spin positions that will improve the atoms’ appearance that may suffice.

Have you tried playing with the code? I have a very pared down version that serves as a sandbox, selecting hydrogen and using its i-loop register to try ideas or to follow various on-line coding examples with different geometries, materials, meshes all of which require the code’s “just happens to be available” camera, lights, scene and renderer. Sure, I'm lazy but I used it to work out the details for the new, create proton/alpha group functions. Or change the atomic dimensions. I believe that Miles charge field model “protons as discs” implies a much larger distance between adjacent orthogonal (equator to pole) protons than adjacent pole to pole spacing, ... . I’ve differed from the slot layout diagrams in three or four places, concerned with the code length, passing on hook position switches if it appeared the atom’s spin balance wouldn’t be adversely affected.

Trying to correct errors as fast as I find them, I fixed a position problem with barium (55) and caesium’s (56) top proton position from my previous posted code.

Your comments, suggestions, ideas and directions are welcome, I wouldn't have gotten this far without you.

code lines 742-1467
Code:

            
    if i == 12:
        if 13 == atomicNumber: # Aluminum
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,-pP1pP2/2-2*flipPN,0]
            grpAn.add(protonAi)
            maxZNeg = -pP1pP2-4*flipPN
            maxZPos =  3*pP1pP2/2 + 6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 14 == atomicNumber:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,-pP1pP2/2-2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 15 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [ 0,-2*flipPN,0]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)            
        if 16 == atomicNumber:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,-pP1pP2/2-2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 18 <= atomicNumber < 36:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,-pP1pP2/2-2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
            
    if i == 13:
        if 14 == atomicNumber: # Silicon, the carousal level
            alphaAi.rotateX(-piG/2)
            alphaAi.rotateY(piG/2)
            alphaAi.position = [ pP1pP2/2+2*flipPN,0,0]
            grpAn.add( alphaAi )
            maxZNeg = -pP1pP2-4*flipPN
            maxZPos = pP1pP2+4*flipPN            
            print('alphaAi[',i+1,']', alphaAi.position)
        if 15 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.rotateY(piG/2)
            protonAi.position = [2*flipPN,0,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 16 <= atomicNumber < 36:
            alphaAi.rotateX(-piG/2)
            alphaAi.rotateY(piG/2)
            alphaAi.position = [ pP1pP2/2+2*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
  
    if i == 14:
        if 15 == atomicNumber: # Phosphorus 
            alphaAi.rotateX(piG)
            alphaAi.position = [0, 0, pP1pP2 + 4*flipPN]
            grpAn.add( alphaAi )
            maxZNeg = -pP1pP2/2 - 4*flipPN
            maxZPos =  pP1pP2/2 + 4*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 16 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG)
            protonAi.position = [0, 0, pP1pP2/2 + 4*flipPN]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 17 <= atomicNumber < 18:
            alphaAi.rotateX(piG)
            alphaAi.position = [0, 0, pP1pP2 + 4*flipPN]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 42 <= atomicNumber < 47:
            protonAi.remove(neutronAi)
            protonAi.position = [0,4*pP1pP2/2+p1p2+4*flipPN,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 47 <= atomicNumber < 54 :
            alphaAi.position = [0,4*pP1pP2/2+p1p2+4*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 57 <= atomicNumber < 61:
            protonAi.remove(neutronAi)
            protonAi.position = [0, 2*p2p3+2*pP1pP2+4*flipPN, 0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 61 <= atomicNumber < 67:
            alphaAi.position = [0, 2*p2p3+2*pP1pP2+4*flipPN, 0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)        
        if 67 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, 2*p2p3+2*pP1pP2+4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 68 <= atomicNumber < 71 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            #multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 2*p2p3+2*pP1pP2+4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 71 == atomicNumber :
            alphaAi.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]  
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)            
        if 72 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            #pASet.rotateX(-piG/2)            
            pASet.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
            
    if i == 15:
        if 16 == atomicNumber: # Sulfur
            protonAi.remove(neutronAi)
            protonAi.position = [0, 0, -pP1pP2/2 - 4*flipPN]
            grpAn.add( protonAi )
            maxZNeg = -pP1pP2/2 - 4*flipPN
            maxZPos = pP1pP2/2 + 4*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 41 <= atomicNumber < 47:
            protonAi.remove(neutronAi)
            protonAi.position = [0,-4*pP1pP2/2-p1p2-4*flipPN,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)  
        if 47 <= atomicNumber < 54:
            alphaAi.position = [0,-4*pP1pP2/2-p1p2-4*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 57 <= atomicNumber < 61:
            protonAi.remove(neutronAi)
            protonAi.position = [0, -2*p2p3-2*pP1pP2-4*flipPN, 0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)  
        if 61 <= atomicNumber < 67:
            alphaAi.position = [0, -2*p2p3-2*pP1pP2-4*flipPN, 0]
            grpAn.add( alphaAi  )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 67 <= atomicNumber < 68:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, -2*p2p3-2*pP1pP2-4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 68 <= atomicNumber < 71 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            #multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, -2*p2p3-2*pP1pP2-4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 71 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            #pASet.rotateX(-piG/2)            
            pASet.position = [0, -2*p2p3-3*pP1pP2-4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
            
    if i == 16:
        if 17 == atomicNumber: # Chlorine
            alphaAi.rotateX(piG/2)          
            alphaAi.position = [0,0,-3*pP1pP2/2-6*flipPN]
            grpAn.add( alphaAi )
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN        
            print('alphaAi[',i+1,']', alphaAi.position)
        if 39 <= atomicNumber < 48:
            protonAi.remove(neutronAi)
            protonAi.position = [-4*pP1pP2/2-p1p2-4*flipPN,0,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 48 <= atomicNumber < 54:
            alphaAi.position = [-4*pP1pP2/2-p1p2-4*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 57 <= atomicNumber < 63 :
            alphaAi.position = [-2*p2p3-2*pP1pP2-4*flipPN,0,0]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 63 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-2*pP1pP2-4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 71 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-3*pP1pP2-4*flipPN, 0, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 72 == atomicNumber :
            #alphaAi.rotateX(piG/2)
            alphaAi.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]  
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
            
    if i == 17:
        if 18 <=atomicNumber < 36: # Argon
            alphaAi.position = [0, 0, pP1pP2 + 4*flipPN]            
            grpAn.add( alphaAi )
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos = 3*pP1pP2/2+4*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-2*flipPN-p1p2/2-pP1pP2,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)            
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)
            pASet.position = [0,-p2p3-pP1pP2-2*flipPN,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 18:
        if 19 <= atomicNumber < 21: # Potassium
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN            
            print('protonAi[',i+1,']', protonAi.position)
        if 21 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            neutronBi.position = [0,3*pP1pP2/2+6*flipPN,-pP1pP2 - 2*flipPN - p1n2]
            protonAi.add(neutronBi)
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 22 <= atomicNumber < 27:
            neutronAi.position = [0,0, p1n2]            
            protonAi.rotateZ(piG/2)    
            protonAi.position = [0, pP1pP2+4*flipPN,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 27 == atomicNumber:
            neutronAi.position = [0,p1n2+pP1pP2+2*flipPN,0]
            grpAn.add( neutronAi )
            print('neutronAi[',i+1,']', neutronAi.position)
        if 29 <= atomicNumber < 30:          
            neutronAi.position = [0,pP1pP2/2+p1n2,p2p3-pP1pP2/2-2*flipPN]
            grpAn.add( neutronAi )
            neutronBi.position = [0,pP1pP2/2+p1n2,-p2p3-pP1pP2/2-2*flipPN]
            grpAn.add( neutronBi )
            print('2 hook neutrons[',i+1,']', neutronAi.position)            
        if 30 == atomicNumber :
            protonAi.remove(neutronAi)
            protonAi.position = [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 32 <= atomicNumber < 35 :
            protonAi.remove(neutronAi)
            protonAi.position = [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 35 == atomicNumber :
            alphaAi.position = [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]
            grpAn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0,0,-p1p2/2-pP1pP2-p1p2/2-pP1pP2-4*flipPN]              
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)              
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,-2*p2p3-3*pP1pP2-4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0,0,-2*p2p3-2*pP1pP2-4*flipPN]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,-2*p2p3-3*pP1pP2-4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 19:
        if 20 == atomicNumber: # Calcium
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)            
            protonAi.position = [0,0,-3*pP1pP2/2-6*flipPN]          
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 21 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateZ(piG/2)
            protonAi.position = [4*flipPN+pP1pP2,0,0]
            neutronBi.position = [2*flipPN+pP1pP2 +p1n2,pP1pP2+4*flipPN,0]
            protonAi.add(neutronBi)
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 22 <= atomicNumber < 27:
            neutronAi.position = [0,0,-p1n2]
            protonAi.rotateZ(-piG/2)
            protonAi.position = [4*flipPN+pP1pP2,0,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 27 <= atomicNumber < 36:
            alphaAi.position = [0,0,-p1n2]
            alphaAi.rotateZ(-piG/2)
            alphaAi.position = [4*flipPN+pP1pP2,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)

    if i == 20:
        if 21 == atomicNumber: # Scandium 
            protonAi.remove(neutronAi)
            protonAi.rotateZ(piG/2)            
            protonAi.position = [-pP1pP2-4*flipPN,0,0]
            neutronBi.position = [0,-pP1pP2-4*flipPN,-3*pP1pP2/2-4*flipPN-p1n2]
            protonAi.add(neutronBi)            
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 22 <= atomicNumber < 27 :
            neutronAi.position = [0,0,p1n2]
            protonAi.rotateZ(-piG/2)            
            protonAi.position = [-pP1pP2-4*flipPN,0,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 27 <= atomicNumber < 36:
            alphaAi.position = [0,0,p1n2]
            alphaAi.rotateZ(-piG/2)            
            alphaAi.position = [-pP1pP2-4*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,p1p2/2+pP1pP2+2*flipPN,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)                
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)                
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)
            pASet.position = [0,p2p3+pP1pP2+2*flipPN,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 21:
        if 22 <= atomicNumber < 29: # Titanium
            neutronAi.position = [0,0,-p1n2]
            protonAi.rotateZ(piG/2)    
            protonAi.position = [0,-pP1pP2-4*flipPN,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 29 <= atomicNumber < 36:
            alphaAi.rotateZ(piG/2)    
            alphaAi.position = [0,-pP1pP2-4*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)

    if i == 22:
        if 23 <= atomicNumber < 26: # Vanadium
            protonAi.rotateX(piG/2)
            protonAi.remove(neutronAi)
            protonAi.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN        
            print('protonAi[',i+1,']', protonAi.position)
        if 26 <= atomicNumber < 29:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpAn.add(alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 29 <= atomicNumber < 31:
            protonAi.remove(neutronAi)
            protonAi.rotateX(piG/2)
            protonAi.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpAn.add(protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 31 <= atomicNumber < 36:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpAn.add(alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
          
    if i == 23:
        if 24 <= atomicNumber < 26: # Chromium
            protonAi.rotateX(piG/2)
            protonAi.remove(neutronAi)
            protonAi.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-8*flipPN
            maxZPos =  3*pP1pP2/2+8*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 26 <= atomicNumber < 30:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 30 == atomicNumber:
            protonAi.rotateX(piG/2)
            protonAi.remove(neutronAi)
            protonAi.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 31 <= atomicNumber < 36:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
          
    if i == 24:
        if 25 == atomicNumber: # Manganese
            protonAi.remove(neutronAi)
            protonAi.position = [0,-pP1pP2/2-2*flipPN, pP1pP2/2+2*flipPN]
            grpAn.add( protonAi )
            maxZNeg = -3*pP1pP2/2-8*flipPN
            maxZPos =  3*pP1pP2/2+8*flipPN
            print('hook protonAi[',i+1,']', protonAi.position)
        if 26 <= atomicNumber < 29: # Three hook position neutrons
            neutronAi.position = [0,-pP1pP2/2-p1n2,pP1pP2/2 + 2*flipPN]
            grpAn.add( neutronAi )
            neutronBi.position = [0,-pP1pP2/2-p1n2,-pP1pP2/2 - 2*flipPN]
            grpAn.add( neutronBi )
            neutronGi.position = [0,pP1pP2/2+p1n2,-pP1pP2/2 - 2*flipPN]
            grpAn.add( neutronGi )
            print('3 ea hook neutrons[',i+1,']', neutronAi.position)
        if 29 <= atomicNumber < 34:
            neutronAi.position = [0,-pP1pP2/2-p1n2,-pP1pP2/2 - 2*flipPN]
            grpAn.add( neutronAi )
            print('hook neutronAi[',i+1,']', neutronAi.position)
        if 34 <= atomicNumber < 36:
            protonAi.remove(neutronAi)
            protonAi.position = [0,-pP1pP2/2- 2*flipPN,-pP1pP2/2 - 2*flipPN]
            grpAn.add( protonAi )
            print('hook protonAi[',i+1,']', protonAi.position)
            
    if i == 25:
        if 29 == atomicNumber:
            neutronAi.position = [0,-pP1pP2/2-p1n2,p2p3+pP1pP2/2+2*flipPN]
            grpAn.add( neutronAi )
            neutronBi.position = [0,-pP1pP2/2-p1n2,-p2p3+pP1pP2/2+2*flipPN]
            grpAn.add( neutronBi )
            print('2 ea hook neutrons[',i+1,']', neutronAi.position)
        if 30 <= atomicNumber < 36:
            protonAi.remove(neutronAi)
            protonAi.position = [0,-pP1pP2/2-2*flipPN,pP1pP2/2+2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0,0,p1p2/2+pP1pP2+p1p2/2+pP1pP2+4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,2*p2p3+3*pP1pP2+4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)            
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0,0,2*p2p3+2*pP1pP2+4*flipPN]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,2*p2p3+3*pP1pP2+4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 26:
        if 27 <= atomicNumber < 33: # Cobalt
            neutronAi.position = [0, pP1pP2/2+p1n2, pP1pP2/2+2*flipPN]
            grpAn.add(neutronAi)
        if 33 <= atomicNumber < 36:
            protonAi.remove(neutronAi)
            protonAi.position = [0, pP1pP2/2+2*flipPN, pP1pP2/2+2*flipPN]
            grpAn.add(protonAi)
            print('hook protonAi[',i+1,']', protonAi.position)

    if i == 27:
        if 28 == atomicNumber: # Nickel
            protonAi.remove(neutronAi)
            protonAi.position = [0, pP1pP2+4*flipPN, 0]
            grpAn.add(protonAi)
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
            
    if i == 28:
        if 29 <= atomicNumber < 36: # Copper
            alphaAi.position = [0, pP1pP2+4*flipPN, 0]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)

    if i == 36:
        if 37 <= atomicNumber < 48: # Rubidium
            neutronAi.position = [0,2*flipPN-p2p3,p2p3]
            protonAi.rotateX(-piG/2)  
            protonAi.position = [0,-p2p3/2,3*p1p2/2+6*pP1pP2/2+6*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -3*p1p2/2-5*pP1pP2/2-4*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 48 <= atomicNumber < 50:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0, 0, 3*p1p2/2+6*pP1pP2/2+6*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 50 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,0,3*p1p2/2+6*pP1pP2/2+6*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 51 <= atomicNumber < 54:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0, 0, 3*p1p2/2+6*pP1pP2/2+6*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 55 <= atomicNumber < 57 :
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)            
        if 57 <= atomicNumber < 62:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0,3*p2p3+3*pP1pP2+6*flipPN]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 62 <= atomicNumber < 66 :
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [0, 0,3*p2p3+3*pP1pP2+6*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 66 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+3*pP1pP2+6*flipPN]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 71 == atomicNumber :
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 72 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
            
    if i == 37:
        if 38 == atomicNumber: # Strontium
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 40 <= atomicNumber < 47:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 47 <= atomicNumber < 50:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpAn.add(alphaAi)
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 50 == atomicNumber:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpAn.add(protonAi)
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 51 <= atomicNumber < 54:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpAn.add(alphaAi)
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 56 == atomicNumber < 57:
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*flipPN]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)
        if 57 <= atomicNumber < 61:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 61 == atomicNumber :
            protonAi.remove(neutronAi)
            protonAi.rotateX(-piG/2)
            protonAi.position = [0,0,-3*p2p3-3*pP1pP2-6*flipPN]
            grpAn.add(protonAi)
            print('protonAi[',i+1,']', protonAi.position)            
        if 62 == atomicNumber :
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 63 <= atomicNumber < 66 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)            
        if 66 == atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 67 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 68 <= atomicNumber < 71 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 71 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*flipPN]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
            
grpAn.position = [0,0,(-maxZNeg + maxZPos)/2 - maxZPos]

In[6]
scene = Scene(children=[grpAn, camera, key_light, ambient_light])
controller = OrbitControls(controlling=camera, screenSpacePanning=True)

In[7]
renderer = Renderer(camera=camera, scene=scene, controls=[controller],
                    width=view_width, height=view_height)
scene = Scene()  # initialising the scene

In[8]
renderer

In[9]
spin_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 2], values=[0, 2*piG])
spin_clip = AnimationClip(tracks=[spin_track])
spin_action = AnimationAction(AnimationMixer(grpAn), spin_clip, grpAn) # best
spin_action

Miles Periodic Table with Standard Periodic Table reference - Page 2 Tmthru10
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Tue Sep 21, 2021 2:05 am

Hi LTAM,

Don't mean to be mute on your work. It is really outstanding. I get the same vibe looking at it and running it like I saw with Nevyn's work. This should allow for a lot of cool builds going forward. Looks great with good insight. We may have to write out a python class library that can be imported and leveraged if it just gets too big. I see binding as specialized functions for different slot configs at some point. Frankly I'm just looking at playing with your cool scripts at this point.

Chromium6

Posts : 727
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Thu Sep 23, 2021 5:43 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Tathru10

First half of a two part posting


Thanks Cr6. I’ve had tougher bosses, but you’re among the better motivators. I’ll try harder.

This project has certainly expanded my appreciation and understanding of Miles’ atomic models. I don’t know about that Nevyn vibe, what with Miles’ drawings and CD (compact disc) renditions the large gap between adjacent proton equators and poles is well-nigh charge field conventional wisdom. I think its too large to sustain the charge channel, the protons should be much closer together. They started closer together when this project began, but I decided against make any radical assertions of my own. Binding functions identifying the factors at play might provide a justifiable alternative.  

code lines 1 thru 822
Code:

In[1]:
from pythreejs import *
from IPython.display import display
import ipywidgets
from math import sqrt
from random import random , randint , seed
phi = (1+sqrt(5))/2  # calculating phi-based-pi, piG.
piG = 4/sqrt(phi)    # piG is used instead of pi.

In[2]:
view_width = 600
view_height = 400
factor = 40 # orthographic "scaler"
camera = PerspectiveCamera(position=[10, 0, 0], up=[0, 0, 1], aspect=view_width/view_height)
#camera = PerspectiveCamera(position=[10, 0, 0], up=[1, 0, 0], aspect=view_width/view_height)
camera = PerspectiveCamera(position=[10, 0, 0], up=[0, 1, 0], aspect=view_width/view_height)
#camera = OrthographicCamera(view_width/-factor,view_width/factor,view_height / factor,
#    view_height / - factor,0.1,1000)  # The orbital controls doesn't work with ortho(?)
key_light = DirectionalLight(position=[0, 10, 10])
ambient_light = AmbientLight()

In[3]
elements = ["1 Hydrogen H","2 Helium He","3 Lithium Li","4 Beryllium Be",
           "5 Boron B","6 Carbon C","7 Nitrogen N","8 Oxygen O",
           "9 Fluorine F","10 Neon Ne","11 Sodium Na","12 Magnesium Mg",
           "13 Aluminum Al","14 Silicon Si","15 Phosphorus P","16 Sulfur S",
           "17 Chlorine Cl","18 Argon Ar","19 Potassium P","20 Calcium Ca",
           "21 Scandium Sc","22 Titanium Ti","23 Vanadium V","24 Chromium Cr",
           "25 Manganese Mn","26 Iron Fe","27 Cobalt Co","28 Nickel Ni",
           "29 Copper Cu","30 Zinc Zn","31 Gallium Ga","32 Germanium Ge",
           "33 Arsenic As","34 Selenium Se","35 Bromine Br","36 Krypton Kr",
           "37 Rubidium Rb","38 Strontium Sr","39 Yttrium Y","40 Zirconium Zr",
           "41 Niobium Nb","42 Molybdenum Mo","43 Technetium Tc","44 Ruthenium Ru",
           "45 Rhodium Rh","46 Palladium Pd","47 Silver Ag","48 Cadmium Cd",
           "49 Indium In", "50 Tin Sn","51 Antimony Sb","52 Tellurium Te",
           "53 Iodine I","54 Xenon Xe","55 Caesium Cs","56 Barium Ba",
           "57 Lanthanum La","58 Cerium Ce","59 Praseodymium Pr","60 Neodymium Nd",
           "61 Promethium Pm","62 Samarium Sm","63 Europium Eu","64 Gadolinium Gd",
           "65 Terbium Tb","66 Dysprosium Dy","67 Holmium Ho","68 Erbium Er",
           "69 Thulium Tm","70 Ytterbium Yb","71 Lutetium Lu","72 Hafnium Hf",
           "73 Tantalum Ta","74 Tungsten W","75 Rhenium Re","76 Osmium Os",
           "77 Iridium Ir","78 Platinum Pt","79 Gold Au","80 Mercury Hg",
           "81 Thallium Tl","82 Lead Pb","83 Bismuth Bi","84 Polonium Po",
           "85 Astatine At","86 Radon Rn","87 Francium Fr","88 Radium Ra"]
print( elements )

In[4]
#atomicNumber = 2 # Easier place to change An when coding
atomicNumber = number  # Enter the desired number of protons above
grpAn = Group()  # The rotation widget spins grpAn, slots 1,4 and 5.  
grpBn = Group()  # These objects, generally top, bottom and hook
# positions will not spin with widget grpAn objects.
# Dimensions
pP1pP2 = 1.5 # Proton 1 to proton 2, Pole-to-pole separation.
pRadius = 0.5
nRadius = 0.6
eRadius = 2*pRadius/10
emRadius = 6
p1p2 = pRadius*2.5  # small gap
#p2p3 = pRadius*3  # small gap
p2p3 = pRadius*2.85  # small gap
n1n2 = 4.0  # Alpha, left-right (y) neutron-neutron orbital separation
p1n1 = pP1pP2/2 # Alpha, up-down (z) proton-orbital neutron separation
p1n2 = pRadius + nRadius + 0.5  # In line proton and neutron
p1e1 = pRadius + 1.5*pP1pP2/10  # Alpha, top-bottom (z) proton-electron separation
e1e2 = 0.75  # 0.5  # electron-electron separation
flipPN = 3 # Dist. between adjacent vertical and horiz protons
maxZNeg = 0.0 # maxZNeg and maxZPos are Used to center(z) the atom on the screen
maxZPos = 0.0  

# Proton set Geometries and Materials
protonGeometry =  SphereBufferGeometry(pRadius, 24, 16)
neutronGeometry =  SphereBufferGeometry(nRadius, 24, 16)
electronGeometry =  SphereBufferGeometry(eRadius, 8, 16)
emissionGeometry = CircleGeometry(emRadius, 24)
emissionTopGeometry = CircleGeometry(emRadius, 24)
emissionBotGeometry = CircleGeometry(emRadius, 24)

protonMaterial = MeshStandardMaterial(color='blue')
protonMaterialB = MeshStandardMaterial(color='green')
neutronMaterial = MeshStandardMaterial(color='red')
neutronMaterialB = MeshStandardMaterial(color='green')
electronMaterial = MeshStandardMaterial(color='cyan')
emissionmaterial = MeshStandardMaterial(color='gray',
    transparent = True,opacity = 0.25)

def buildMultiAlphasB(a): # a is the number of alphas. Using 2 and 3 so far.
    num = 0          
    while num < a*2 :
        protonMi = Group()
        protonMi.add(Mesh(protonGeometry, protonMaterial))    
        emissionM2i = Mesh( emissionGeometry, emissionmaterial)
        emissionM2i.rotateX(piG)
        protonMi.add(Mesh(emissionGeometry, emissionmaterial))
        protonMi.add(emissionM2i)
        neutronMi = Object3D()
        neutronMi.add(Mesh(neutronGeometry, neutronMaterial))
        neutronMi.position = [0,-n1n2/2,-p1n1]
        protonMi.add(neutronMi)                
        electronMi = Object3D()
        electronMi.add(Mesh(electronGeometry, electronMaterial))
        electronMi.position = [0,-e1e2/2,-p1e1]
        protonMi.add(electronMi)
        if num%2 != 0:
            protonMi.rotateX(piG)
        protonMi.position = [0,0,a*pP1pP2/2+(a-1)*p2p3/2-(p2p3/2+pP1pP2/2)*num]
        multiAlpha.add(protonMi)                
        num += 1
    return

def buildMultiAlphas(a): # a is the number of alphas. Using 2 and 3 so far.  
    num = 0          
    while num < a*2 :
        protonMi = Group()
        protonMi.add(Mesh(protonGeometry, protonMaterial))    
        emissionM2i = Mesh( emissionGeometry, emissionmaterial)
        emissionM2i.rotateX(piG)
        protonMi.add(Mesh(emissionGeometry, emissionmaterial))
        protonMi.add(emissionM2i)
        electronMi = Object3D()
        electronMi.add(Mesh(electronGeometry, electronMaterial))
        electronMi.position = [0,-e1e2/2 ,-p1e1]
        protonMi.add(electronMi)
        if num%2 != 0:
            neutronPair = Group()
            neutronMi = Object3D()
            neutronMi.add(Mesh(neutronGeometry, neutronMaterial))
            neutronMi.position = [0,-n1n2/2,-p1n1]
            neutronNi = Object3D()
            neutronNi.add(Mesh(neutronGeometry, neutronMaterial))
            #neutronNi.add(Mesh(neutronGeometry, neutronMaterialB))
            neutronNi.position = [0,n1n2/2,-p1n1]
            neutronPair.add(neutronMi)
            neutronPair.add(neutronNi)
            #neutronPair.rotateZ(random()*2*piG) # Initial random spin positions
            protonMi.add(neutronPair)
            protonMi.rotateX(piG)
        protonMi.position = [0,0,a*pP1pP2/2+(a-1)*p2p3/2-(p2p3/2+pP1pP2/2)*num]
        multiAlpha.add(protonMi)                
        num += 1
    return

def buildProtonAlphaSet(a): # Odd numbers, alphas and one proton.
    num = 0                 # a is the total # of protons
    while num < a:
        protonMi = Group()
        protonMi.add(Mesh(protonGeometry, protonMaterial))    
        emissionM2i = Mesh( emissionGeometry, emissionmaterial)
        emissionM2i.rotateX(piG)
        protonMi.add(Mesh(emissionGeometry, emissionmaterial))
        protonMi.add(emissionM2i)
        electronMi = Object3D()
        electronMi.add(Mesh(electronGeometry, electronMaterial))
        electronMi.position = [0,-e1e2/2,-p1e1]
        protonMi.add(electronMi)
        neutronMi = Object3D()
        neutronMi.add(Mesh(neutronGeometry, neutronMaterial))
        neutronMi.position = [0,-n1n2/2,-p1n1]
        if num%2 == 0 and num < a-1 :
            protonMi.add(neutronMi)
        if num%2 != 0 :
            protonMi.add(neutronMi)
            protonMi.rotateX(piG)
        protonMi.position = [0,0,(a//2)*pP1pP2/2+(a//2)*p2p3/2-(p2p3/2+pP1pP2/2)*num]            
        pASet.add(protonMi)                
        num += 1
    return
        
# Assemble the atomic models.
for i in range( atomicNumber ):
    
    protonWoN = Group() # Proton Without a Neutron
    emissionWoN2 = Mesh( emissionGeometry, emissionmaterial)
    emissionWoN2.rotateX(piG)
    protonWoN.add(Mesh(protonGeometry, protonMaterial))
    protonWoN.add(Mesh(emissionGeometry, emissionmaterial))
    protonWoN.add(emissionWoN2)
    electronWoN = Object3D()
    electronWoN.add(Mesh(electronGeometry, electronMaterial))
    electronWoN.position = [0,-e1e2/2,-p1e1]
    protonWoN.add(electronWoN)      

    emissionA2i = Mesh( emissionGeometry, emissionmaterial)
    emissionA2i.rotateX(piG)    
    protonAi = Group()
    protonAi.add(Mesh(protonGeometry, protonMaterial))
    protonAi.add(Mesh(emissionGeometry, emissionmaterial))
    protonAi.add(emissionA2i)
    neutronAi = Object3D()
    neutronAi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronAi.position = [0,-n1n2/2,-p1n1]
    protonAi.add(neutronAi)
    electronAi = Object3D()
    electronAi.add(Mesh(electronGeometry, electronMaterial))
    electronAi.position = [0,-e1e2/2,-p1e1]
    protonAi.add(electronAi)
    emissionB2i = Mesh( emissionGeometry, emissionmaterial)
    emissionB2i.rotateX(piG)
    protonBi = Group()
    protonBi.add(Mesh(protonGeometry, protonMaterial))
    protonBi.add(Mesh(emissionGeometry, emissionmaterial))
    protonBi.add(emissionB2i)
    neutronBi = Object3D()
    neutronBi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronBi.position = [0,-n1n2/2,-p1n1]
    protonBi.add(neutronBi)
    electronBi = Object3D()  
    electronBi.add(Mesh(electronGeometry, electronMaterial))
    electronBi.position = [0,-e1e2/2,-p1e1]
    protonBi.add(electronBi)
    protonBi.rotateY(piG)
    protonBi.rotateZ(piG)

    emissionC2i = Mesh( emissionGeometry, emissionmaterial)
    emissionC2i.rotateX(piG)
    protonCi = Group()
    protonCi.add(Mesh(protonGeometry, protonMaterial))
    protonCi.add(Mesh(emissionGeometry, emissionmaterial))
    protonCi.add(emissionC2i)
    neutronCi = Object3D()
    neutronCi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronCi.position = [0,-n1n2/2,-p1n1]
    protonCi.add(neutronCi)
    electronCi = Object3D()
    electronCi.add(Mesh(electronGeometry, electronMaterial))
    electronCi.position = [0,-e1e2/2,-p1e1]
    protonCi.add(electronCi)    
    emissionD2i = Mesh( emissionGeometry, emissionmaterial)
    emissionD2i.rotateX(piG)
    protonDi = Group()
    protonDi.add(Mesh(protonGeometry, protonMaterial))
    protonDi.add(Mesh(emissionGeometry, emissionmaterial))
    protonDi.add(emissionD2i)
    neutronDi = Object3D()
    neutronDi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronDi.position = [0,-n1n2/2,-p1n1]
    protonDi.add(neutronDi)
    electronDi = Object3D()  
    electronDi.add(Mesh(electronGeometry, electronMaterial))
    electronDi.position = [0,-e1e2/2,-p1e1]
    protonDi.add(electronDi)
    protonDi.rotateY(piG)
    protonDi.rotateZ(piG)
    
    neutronGi = Object3D()
    neutronGi.add(Mesh(neutronGeometry, neutronMaterial))
    
    protonEi = Group() # alpha
    protonEi.add(protonAi)
    protonEi.position = [0,0,pP1pP2/2]
    protonHi = Group()
    protonHi.add(protonBi)
    protonHi.position = [0,0,-pP1pP2/2]
    alphaAi = Group()
    alphaAi.add(protonEi)
    alphaAi.add(protonHi)

    if i == 0:
        if 1 == atomicNumber: # Hydrogen.
            neutronAi.position = [0,0,-p1n2]
            grpAn.add( protonAi )
            maxZNeg = 0  
            maxZPos = 0
            print('protonAi[',i+1,']', protonAi.position)
        if 33 <= atomicNumber < 36:
            protonWoN.position = [0, pP1pP2/2+2*flipPN, pP1pP2/2+2*flipPN]
            grpBn.add( protonWoN )
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 46 <= atomicNumber < 48:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)            
        if 49 == atomicNumber:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)            
        if 53 == atomicNumber:            
            alphaAi.position = [0,p1p2/2+pP1pP2+2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpBn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 60 <= atomicNumber < 62:
            protonWoN.position = [0,p2p3+pP1pP2+2*flipPN,p2p3+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)              
        if 64 <= atomicNumber < 66:
            alphaAi.position = [0,p2p3+pP1pP2+2*flipPN,p2p3+pP1pP2+2*flipPN]
            grpBn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 70 == atomicNumber :
            protonWoN.position = [0,p2p3+pP1pP2+2*flipPN,p2p3+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)    
        if 72 <= atomicNumber < 74:
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)  
        if 75 == atomicNumber :
            alphaAi.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 77 <= atomicNumber < 80:
            alphaAi.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 81 == atomicNumber :
            alphaAi.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 82 == atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 83 <= atomicNumber < 86 :
            alphaAi.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 87 <= atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)  
            
    if i == 1:
        if 2 <= atomicNumber < 10: # Helium
            alphaAi.position = [0,0,pP1pP2 + p2p3]
            grpAn.add( alphaAi )
            maxZNeg = pP1pP2 + p2p3
            maxZPos = pP1pP2 + p2p3
            print('alphaAi[',i+1,']', alphaAi.position)
        if 29 <= atomicNumber < 34:
            neutronAi.position = [0,-pP1pP2/2-p1n2,-pP1pP2/2 - 2*flipPN]
            grpBn.add( neutronAi )
            print('hook neutronAi[',i+1,']', neutronAi.position)
        if 34 <= atomicNumber < 36:
            protonWoN.position = [0,-pP1pP2/2- 2*flipPN,-pP1pP2/2 - 2*flipPN]
            grpBn.add( protonWoN )
            print('hook protonWoN[',i+1,']', protonWoN.position)  
        if 45 <= atomicNumber < 48: # hook position            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 51 == atomicNumber:            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 53 == atomicNumber :            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 59 <= atomicNumber < 63 :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 65 <= atomicNumber < 66 :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 68 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 69 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 70 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 72 == atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 73 == atomicNumber :
            alphaAi.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add( alphaAi )
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 74 == atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 75 == atomicNumber :
            alphaAi.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add( alphaAi )
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 77 <= atomicNumber < 80 :
            alphaAi.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add( alphaAi )
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 81 <= atomicNumber < 84:
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 84 <= atomicNumber < 86 :
            alphaAi.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add( alphaAi )
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 87 <= atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
            
    if i == 2:
        if 3 <= atomicNumber < 10: # Lithium
            protonWoN.rotateX(-piG/2)            
            protonWoN.position = [0, 0, 3*pP1pP2/2+p2p3+2*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -pP1pP2/2
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 10 <= atomicNumber < 14:
            alphaAi.position = [0, 0, pP1pP2+4*flipPN]            
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 17 <= atomicNumber < 18:
            protonWoN.rotateX(-piG/2)            
            protonWoN.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 30 <= atomicNumber < 36:
            protonWoN.position = [0,-pP1pP2/2-2*flipPN,pP1pP2/2+2*flipPN]
            grpBn.add( protonWoN )
            print('hook protonWoN[',i+1,']', protonWoN.position)  
        if 44 <= atomicNumber < 47:            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 50 == atomicNumber:            
            alphaAi.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpBn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 51 == atomicNumber:            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 52 == atomicNumber :            
            alphaAi.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpBn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 53 == atomicNumber :            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 57 <= atomicNumber < 68 :
            alphaAi.position = [0,-p2p3-pP1pP2-2*flipPN,p2p3+pP1pP2+2*flipPN]
            grpBn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 70 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,p2p3+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 71 == atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 76 == atomicNumber:
            alphaAi.position = [0,-p2p3-pP1pP2-2*flipPN,p2p3+pP1pP2+2*flipPN]
            grpBn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 77 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,p2p3+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 80 <= atomicNumber < 81 :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 85 <= atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
            
    if i == 3:
        if 4 == atomicNumber < 5: # Beryllium
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, pP1pP2/2+p2p3 -2*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = pP1pP2/2+p2p3 -2*flipPN
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 29 <= atomicNumber < 30:          
            neutronBi.position = [0,pP1pP2/2+p1n2,p2p3-pP1pP2/2-2*flipPN]
            grpBn.add( neutronAi )
            neutronBi.position = [0,pP1pP2/2+p1n2,-p2p3-pP1pP2/2-2*flipPN]
            grpBn.add( neutronBi )
            print('2 hook neutrons[',i+1,']', neutronAi.position)            
        if 30 == atomicNumber :
            protonWoN.position =  [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 32 <= atomicNumber < 35 :
            protonWoN.position =  [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 35 == atomicNumber :
            alphaAi.position = [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]
            grpBn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 43 <= atomicNumber < 47:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 50 == atomicNumber:            
            alphaAi.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 51 == atomicNumber:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 52 == atomicNumber:            
            alphaAi.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 53 == atomicNumber:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 57 == atomicNumber < 58:
            protonWoN.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 58 <= atomicNumber < 63:
            alphaAi.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 63 == atomicNumber :
            protonWoN.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 66 <= atomicNumber < 68 :
            alphaAi.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)
        if 68 <= atomicNumber < 71:
            protonWoN.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 71 == atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 74 == atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 76 == atomicNumber :
            alphaAi.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(alphaAi)
            print('hook alphaAi[',i+1,']', alphaAi.position)            
        if 80 <= atomicNumber < 81:
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 86 == atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 88 <= atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
            
    if i == 4:
        if 5 <= atomicNumber < 36: # Boron
            alphaAi.position = [0, 0, 0]
            grpAn.add(alphaAi)
            maxZNeg = -pP1pP2/2
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber < 54 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, 0, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0, 0, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0, 0, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0, 0, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 5:
        if 6 == atomicNumber < 7: # Carbon
            protonWoN.rotateX(piG/2)            
            protonWoN.position = [0,0,-pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            maxZNeg = -pP1pP2/2-2*flipPN            
            print('protonWoN[',i+1,']', protonWoN.position)
        if 15 <= atomicNumber < 16:
            protonWoN.rotateX(piG/2)            
            protonWoN.position = [0,0,-3*pP1pP2/2-6*flipPN]
            grpBn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
            
    if i == 6:
        if 7 <= atomicNumber < 10: # Nitrogen
            alphaAi.position = [0,0,-pP1pP2-p2p3]
            grpAn.add(alphaAi)
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            maxZNeg = -pP1pP2-p2p3
            print('alphaAi[',i+1,']', alphaAi.position)
        if 10 <= atomicNumber < 14:
            alphaAi.position = [0,0,-pP1pP2-4*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 15 == atomicNumber:
            alphaAi.position = [0,0,-pP1pP2-4*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)            
        if 16 == atomicNumber:
            protonWoN.position = [0,0,-pP1pP2/2-4*flipPN]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 17 <= atomicNumber < 36:
            alphaAi.position = [0,0,-pP1pP2-4*flipPN]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-2*flipPN-p1p2/2-pP1pP2,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-p2p3-3*pP1pP2/2-2*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateY(piG/2)
            pASet.position = [-p2p3-pP1pP2-2*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-p2p3-3*pP1pP2/2-2*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 7:
        if 8 == atomicNumber: # Oxygen
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0,0,-3*pP1pP2/2-p2p3-2*flipPN]
            grpBn.add(protonWoN)
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            maxZNeg = -3*pP1pP2/2-p2p3-2*flipPN            
            print('protonWoN[',i+1,']', protonWoN.position)
        if 9 == atomicNumber:
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0,pP1pP2/2,-3*pP1pP2/2-p2p3-2*flipPN]
            grpBn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 10 <= atomicNumber < 36:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0,-pP1pP2/2-2*flipPN]
            grpBn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,-p1p2/2-pP1pP2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)  
        if 57 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)  
            pASet.position = [0,0,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 8:
        if 9 == atomicNumber < 10: # Fluorine
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0,-pP1pP2/2,-3*pP1pP2/2-p2p3-2*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-p2p3-2*flipPN
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 39 <= atomicNumber < 48:        
            #protonAi.position = [4*pP1pP2/2+p1p2+4*flipPN,0,0]
            #grpAn.add( protonAi )
            protonWoN.position = [4*pP1pP2/2+p1p2+4*flipPN,0,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 48 <= atomicNumber < 54:        
            alphaAi.position = [4*pP1pP2/2+p1p2+4*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 57 <= atomicNumber < 63:
            alphaAi.position = [2*p2p3+2*pP1pP2+4*flipPN,0,0]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 63 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [2*p2p3+2*pP1pP2+4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 71 <= atomicNumber < 74:
            alphaAi.position = [2*p2p3+3*pP1pP2+4*flipPN,0,0]  
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 74 <= atomicNumber < 80:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [2*p2p3+3*pP1pP2+4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 80 <= atomicNumber < 82:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [2*p2p3+3*pP1pP2+4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [2*p2p3+3*pP1pP2+4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
            
    if i == 9:
        if 10 <= atomicNumber < 36:  # Neon
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, pP1pP2/2 + 2*flipPN]
            grpBn.add(alphaAi)
            maxZNeg = -3*pP1pP2/2-p2p3-2*flipPN
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [2*flipPN+p1p2/2+pP1pP2,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)          
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [p2p3+3*pP1pP2/2+2*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)            
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateY(piG/2)
            pASet.position = [p2p3+pP1pP2+2*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [p2p3+3*pP1pP2/2+2*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)  
            
    if i == 10:
        if 11 <= atomicNumber < 14: # Sodium
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [ 0,0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(protonWoN)
            maxZPos =  3*pP1pP2/2+6*flipPN
            maxZNeg = -pP1pP2-4*flipPN  
            print('protonWoN[',i+1,']', protonWoN.position)
        if 14 == atomicNumber:
            alphaAi.rotateX(-piG/2)
            alphaAi.rotateY(-piG/2)
            alphaAi.position = [ -pP1pP2/2-2*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 15 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.rotateY(piG/2)
            protonWoN.position = [-2*flipPN,0, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 16 <= atomicNumber < 36:
            alphaAi.rotateX(-piG/2)
            alphaAi.rotateY(-piG/2)
            alphaAi.position = [ -pP1pP2/2-2*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
  
Positive progress. The changes include:
1. The code can now display any atom up to Radium (88).

2. The main cell is 1575 lines long and seems to run a little better. There’s no way of knowing for sure since there’s no frames per second stats indicator such as is usually included in threejs projects. I believe most of the processing time is spent in conjuring up all the atom’s objects as a worldspace model or something. The small, simple groups, single neutrons or non-alpha pairs of neutron-less protons are declared and made available within each i-loop while the larger object groups created by the proton/multi-alpha functions are declared before the i-loop. The functions helped, and so did some cleanup.
Eliminated 77 occurrences of the statement: “protonAi.remove(neutronAi)” by creating and replacing the “protonAi” group at those locations with a new proton type group - without a neutron -  “protonWoN”. The slightly larger i-loop overhead is preferable to removing neutrons that were already added to the other proton group.

Continued in second part.

Miles Periodic Table with Standard Periodic Table reference - Page 2 Irthru10
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Thu Sep 23, 2021 5:49 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Tlthru10

Code:

    if i == 11:
        if 12 == atomicNumber: # Magnesium
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, -pP1pP2 - 6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -pP1pP2 - 6*flipPN
            maxZPos =  pP1pP2 + 6*flipPN                
            print('protonWoN[',i+1,']', protonWoN.position)
        if 13 == atomicNumber:
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 2*flipPN, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 14 <= atomicNumber < 15:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,pP1pP2/2+2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 15 == atomicNumber:
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0,2*flipPN, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 16 == atomicNumber:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,pP1pP2/2+2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 18 <= atomicNumber < 36:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,pP1pP2/2+2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,p1p2/2+pP1pP2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)                
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)              
        if 57 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)  
            pASet.position = [0,0,p2p3+pP1pP2+2*flipPN]
            grpBn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 12:
        if 13 == atomicNumber: # Aluminum
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [ 0,-2*flipPN,0]
            grpAn.add(protonWoN)
            maxZNeg = -pP1pP2-4*flipPN
            maxZPos =  3*pP1pP2/2 + 6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)            
        if 14 == atomicNumber:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,-pP1pP2/2-2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 15 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [ 0,-2*flipPN,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)  
        if 16 == atomicNumber:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,-pP1pP2/2-2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 18 <= atomicNumber < 36:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,-pP1pP2/2-2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
            
    if i == 13:
        if 14 == atomicNumber: # Silicon, the carousal level
            alphaAi.rotateX(-piG/2)
            alphaAi.rotateY(piG/2)
            alphaAi.position = [ pP1pP2/2+2*flipPN,0,0]
            grpAn.add( alphaAi )
            maxZNeg = -pP1pP2-4*flipPN
            maxZPos = pP1pP2+4*flipPN            
            print('alphaAi[',i+1,']', alphaAi.position)
        if 15 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.rotateY(piG/2)
            protonWoN.position = [2*flipPN,0,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)  
        if 16 <= atomicNumber < 36:
            alphaAi.rotateX(-piG/2)
            alphaAi.rotateY(piG/2)
            alphaAi.position = [ pP1pP2/2+2*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
  
    if i == 14:
        if 15 == atomicNumber: # Phosphorus 
            alphaAi.rotateX(piG)
            alphaAi.position = [0, 0, pP1pP2 + 4*flipPN]
            grpAn.add( alphaAi )
            maxZNeg = -pP1pP2 - 6*flipPN
            maxZPos =  pP1pP2/2 + 4*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 16 == atomicNumber:
            protonWoN.rotateX(piG)
            protonWoN.position = [0, 0, pP1pP2/2 + 4*flipPN]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 17 <= atomicNumber < 18:
            alphaAi.rotateX(piG)
            alphaAi.position = [0, 0, pP1pP2 + 4*flipPN]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 42 <= atomicNumber < 47:
            protonWoN.position = [0,4*pP1pP2/2+p1p2+4*flipPN,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 47 <= atomicNumber < 54 :
            alphaAi.position = [0,4*pP1pP2/2+p1p2+4*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 57 <= atomicNumber < 61:
            protonWoN.position = [0, 2*p2p3+2*pP1pP2+4*flipPN, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 61 <= atomicNumber < 67:
            alphaAi.position = [0, 2*p2p3+2*pP1pP2+4*flipPN, 0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)        
        if 67 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, 2*p2p3+2*pP1pP2+4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 68 <= atomicNumber < 71 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, 2*p2p3+2*pP1pP2+4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 71 == atomicNumber :
            alphaAi.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]  
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)            
        if 72 <= atomicNumber < 79:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 79 <= atomicNumber < 82 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber < 86:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 86 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
            
    if i == 15:
        if 16 == atomicNumber: # Sulfur
            protonWoN.position = [0, 0, -pP1pP2/2 - 4*flipPN]
            grpAn.add(protonWoN)
            maxZNeg = -pP1pP2/2 - 4*flipPN
            maxZPos = pP1pP2/2 + 4*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 41 <= atomicNumber < 47:
            protonWoN.position = [0,-4*pP1pP2/2-p1p2-4*flipPN,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 47 <= atomicNumber < 54:
            alphaAi.position = [0,-4*pP1pP2/2-p1p2-4*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 57 <= atomicNumber < 61:
            protonWoN.position = [0, -2*p2p3-2*pP1pP2-4*flipPN, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 61 <= atomicNumber < 67:
            alphaAi.position = [0, -2*p2p3-2*pP1pP2-4*flipPN, 0]
            grpAn.add( alphaAi  )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 67 <= atomicNumber < 68:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, -2*p2p3-2*pP1pP2-4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 68 <= atomicNumber < 71 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, -2*p2p3-2*pP1pP2-4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 71 <= atomicNumber < 79:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, -2*p2p3-3*pP1pP2-4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 79 <= atomicNumber < 82 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, -2*p2p3-3*pP1pP2-4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber < 86:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, -2*p2p3-3*pP1pP2-4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 86 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0, -2*p2p3-3*pP1pP2-4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
            
    if i == 16:
        if 17 == atomicNumber: # Chlorine
            alphaAi.rotateX(piG/2)          
            alphaAi.position = [0,0,-3*pP1pP2/2-6*flipPN]
            grpBn.add( alphaAi )
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN        
            print('alphaAi[',i+1,']', alphaAi.position)
        if 39 <= atomicNumber < 48:
            protonWoN.position = [-4*pP1pP2/2-p1p2-4*flipPN,0,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 48 <= atomicNumber < 54:
            alphaAi.position = [-4*pP1pP2/2-p1p2-4*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 57 <= atomicNumber < 63 :
            alphaAi.position = [-2*p2p3-2*pP1pP2-4*flipPN,0,0]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 63 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-2*pP1pP2-4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 71 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-3*pP1pP2-4*flipPN, 0, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 72 <= atomicNumber < 74 :
            alphaAi.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]  
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 74 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 75 == atomicNumber :
            alphaAi.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]  
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 76 <= atomicNumber < 80 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 80 <= atomicNumber < 82:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
            
    if i == 17:
        if 18 <=atomicNumber < 36: # Argon
            alphaAi.position = [0, 0, pP1pP2 + 4*flipPN]            
            grpAn.add( alphaAi )
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos = 3*pP1pP2/2+4*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-2*flipPN-p1p2/2-pP1pP2,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)            
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)
            pASet.position = [0,-p2p3-pP1pP2-2*flipPN,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 18:
        if 19 <= atomicNumber < 21: # Potassium
            protonWoN.rotateX(-piG/2)
            protonWoN.position =  [0, 0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN  
            print('protonWoN[',i+1,']', protonWoN.position)
        if 21 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position =  [0, 0, 3*pP1pP2/2+6*flipPN]
            neutronBi.position = [0,3*pP1pP2/2+6*flipPN,-pP1pP2 - 2*flipPN - p1n2]
            protonWoN.add(neutronBi)
            grpBn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 22 <= atomicNumber < 27:
            neutronAi.position = [0,0, p1n2]            
            protonAi.rotateZ(piG/2)    
            protonAi.position = [0, pP1pP2+4*flipPN,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 27 == atomicNumber:
            neutronAi.position = [0,p1n2+pP1pP2+2*flipPN,0]
            grpAn.add( neutronAi )
            print('neutronAi[',i+1,']', neutronAi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0,0,-p1p2/2-pP1pP2-p1p2/2-pP1pP2-4*flipPN]              
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)              
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,-2*p2p3-3*pP1pP2-4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0,0,-2*p2p3-2*pP1pP2-4*flipPN]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,-2*p2p3-3*pP1pP2-4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 19:
        if 20 == atomicNumber: # Calcium
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0,0,-3*pP1pP2/2-6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 21 == atomicNumber:
            protonWoN.rotateZ(piG/2)
            protonWoN.position = [4*flipPN+pP1pP2,0,0]
            neutronBi.position = [2*flipPN+pP1pP2 +p1n2,pP1pP2+4*flipPN,0]
            protonWoN.add(neutronBi)
            grpAn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)
        if 22 <= atomicNumber < 27:
            neutronAi.position = [0,0,-p1n2]
            protonAi.rotateZ(-piG/2)
            protonAi.position = [4*flipPN+pP1pP2,0,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 27 <= atomicNumber < 36:
            alphaAi.position = [0,0,-p1n2]
            alphaAi.rotateZ(-piG/2)
            alphaAi.position = [4*flipPN+pP1pP2,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)

    if i == 20:
        if 21 == atomicNumber: # Scandium 
            protonWoN.rotateZ(piG/2)
            protonWoN.position = [-pP1pP2-4*flipPN,0,0]
            neutronBi.position = [0,-pP1pP2-4*flipPN,-3*pP1pP2/2-4*flipPN-p1n2]
            protonWoN.add(neutronBi)
            grpAn.add( protonWoN )
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)            
        if 22 <= atomicNumber < 27 :
            neutronAi.position = [0,0,p1n2]
            protonAi.rotateZ(-piG/2)            
            protonAi.position = [-pP1pP2-4*flipPN,0,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 27 <= atomicNumber < 36:
            alphaAi.position = [0,0,p1n2]
            alphaAi.rotateZ(-piG/2)            
            alphaAi.position = [-pP1pP2-4*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,p1p2/2+pP1pP2+2*flipPN,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)                
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)                
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)
            pASet.position = [0,p2p3+pP1pP2+2*flipPN,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 21:
        if 22 <= atomicNumber < 29: # Titanium
            neutronAi.position = [0,0,-p1n2]
            protonAi.rotateZ(piG/2)    
            protonAi.position = [0,-pP1pP2-4*flipPN,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 29 <= atomicNumber < 36:
            alphaAi.rotateZ(piG/2)    
            alphaAi.position = [0,-pP1pP2-4*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)

    if i == 22:
        if 23 <= atomicNumber < 26: # Vanadium
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpBn.add( protonWoN )
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN  
            print('protonWoN[',i+1,']', protonWoN.position)            
        if 26 <= atomicNumber < 29:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 29 <= atomicNumber < 31:
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)  
        if 31 <= atomicNumber < 36:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
          
    if i == 23:
        if 24 <= atomicNumber < 26: # Chromium
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpBn.add( protonWoN )
            maxZNeg = -3*pP1pP2/2-8*flipPN
            maxZPos =  3*pP1pP2/2+8*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)              
        if 26 <= atomicNumber < 30:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpBn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 30 == atomicNumber:
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)              
        if 31 <= atomicNumber < 36:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpBn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
          
    if i == 24:
        if 25 == atomicNumber: # Manganese
            protonWoN.position = [0,-pP1pP2/2-2*flipPN, pP1pP2/2+2*flipPN]
            grpBn.add( protonWoN )
            maxZNeg = -3*pP1pP2/2-8*flipPN
            maxZPos =  3*pP1pP2/2+8*flipPN
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 26 <= atomicNumber < 29: # Three hook position neutrons
            neutronAi.position = [0,-pP1pP2/2-p1n2,pP1pP2/2 + 2*flipPN]
            grpBn.add( neutronAi )
            neutronBi.position = [0,-pP1pP2/2-p1n2,-pP1pP2/2 - 2*flipPN]
            grpBn.add( neutronBi )
            neutronGi.position = [0,pP1pP2/2+p1n2,-pP1pP2/2 - 2*flipPN]
            grpBn.add( neutronGi )
            print('3 ea hook neutrons[',i+1,']', neutronAi.position)
    
    if i == 25:
        if 29 == atomicNumber:
            neutronAi.position = [0,-pP1pP2/2-p1n2,p2p3+pP1pP2/2+2*flipPN]
            grpBn.add( neutronAi )
            neutronBi.position = [0,-pP1pP2/2-p1n2,-p2p3+pP1pP2/2+2*flipPN]
            grpBn.add( neutronBi )
            print('2 ea hook neutrons[',i+1,']', neutronAi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0,0,p1p2/2+pP1pP2+p1p2/2+pP1pP2+4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,2*p2p3+3*pP1pP2+4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)            
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0,0,2*p2p3+2*pP1pP2+4*flipPN]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,2*p2p3+3*pP1pP2+4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 26:
        if 27 <= atomicNumber < 33: # Cobalt
            neutronAi.position = [0, pP1pP2/2+p1n2, pP1pP2/2+2*flipPN]
            grpBn.add(neutronAi)
            print('neutronAi[',i+1,']', neutronAi.position)
            
    if i == 27:
        if 28 == atomicNumber: # Nickel
            protonWoN.position = [0, pP1pP2+4*flipPN, 0]
            grpAn.add( protonWoN )
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
            
    if i == 28:
        if 29 <= atomicNumber < 36: # Copper
            alphaAi.position = [0, pP1pP2+4*flipPN, 0]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)

    if i == 36:
        if 37 <= atomicNumber < 48: # Rubidium
            neutronAi.position = [0,2*flipPN-p2p3,p2p3]
            protonAi.rotateX(-piG/2)  
            protonAi.position = [0,-p2p3/2,3*p1p2/2+6*pP1pP2/2+6*flipPN]
            grpBn.add(protonAi)
            maxZNeg = -3*p1p2/2-5*pP1pP2/2-4*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 48 <= atomicNumber < 50:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0, 0, 3*p1p2/2+6*pP1pP2/2+6*flipPN]
            grpBn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 50 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,3*p1p2/2+6*pP1pP2/2+6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)            
        if 51 <= atomicNumber < 54:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0, 0, 3*p1p2/2+6*pP1pP2/2+6*flipPN]
            grpBn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 55 <= atomicNumber < 57 :
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)  
        if 57 <= atomicNumber < 62:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0,3*p2p3+3*pP1pP2+6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)  
        if 62 <= atomicNumber < 66 :
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [0, 0,3*p2p3+3*pP1pP2+6*flipPN]
            grpBn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 66 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+3*pP1pP2+6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 71 == atomicNumber :
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]
            grpBn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 72 <= atomicNumber < 78 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 78 == atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 79 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 80 <= atomicNumber < 82 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
            
    if i == 37:
        if 38 == atomicNumber: # Strontium
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpBn.add( protonWoN )
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)              
        if 40 <= atomicNumber < 47:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpBn.add( protonWoN )
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN # needed for 40
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN            
            print('protonWoN[',i+1,']', protonWoN.position)                
        if 47 <= atomicNumber < 50:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpBn.add(alphaAi)
            #maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN
            #maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 50 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)
        if 51 <= atomicNumber < 54:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpBn.add(alphaAi)
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 56 == atomicNumber < 57:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)
        if 57 <= atomicNumber < 61:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]
            grpBn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 61 == atomicNumber :
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,-3*p2p3-3*pP1pP2-6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)    
        if 62 == atomicNumber :
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]
            grpBn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 63 <= atomicNumber < 66 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)            
        if 66 == atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 67 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 68 <= atomicNumber < 71 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 71 <= atomicNumber < 79 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 79 <= atomicNumber < 82 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
            
grpAn.position = [0,0,(-maxZNeg + maxZPos)/2 - maxZPos]
grpBn.position = [0,0,(-maxZNeg + maxZPos)/2 - maxZPos]

In[6]
scene = Scene(children=[grpAn, grpBn, camera, key_light, ambient_light])
controller = OrbitControls(controlling=camera, screenSpacePanning=True)

In[7]
renderer = Renderer(camera=camera, scene=scene, controls=[controller],
                    width=view_width, height=view_height)
scene = Scene()  # initialising the scene

In[8]
renderer

In[9]
spin_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 12], values=[0, 2*piG])
spin_clip = AnimationClip(tracks=[spin_track])
spin_action = AnimationAction(AnimationMixer(grpAn), spin_clip, grpAn)
spin_action
lines 823 thru 1640

3. Carousal spinner animation. Much better than the previous, widget spinning the entire atom as a single group about the z-axis. Created a new Group(), grpBn, to contain all the objects that cannot spin about the atom’s main up/down z-axis. Slots 2 and 3, and their attached hook positions, and slots 14 and 15, the sometimes top and bottom objects with spin axis orthogonal to the z-axis. The rotation widget now spins three vertical axis slots: 1, 4, and 5. The carousal, the four directions front/back, left/right are connected to slot 1. Everything in those slots spin as a single object which of course is not correct, nevertheless, for the time being, I believe it makes an acceptable animation. Four or so of this last batch of images include the imitation carousal spin, it allows a tighter group of images.

4. There’s a commented out, initial alpha neutron pair, spin position randomizer (whew) in the buildMultiAlphas(a) function - #neutronPair.rotateZ(random()*2*piG). It makes sense to use it to break up the uniform lines of neutrons and works well in the widget rotated slots. Unfortunately, the random number function was on (not commented out) when I experienced two “aw snap” jupyter notebook memory overloads. I need to look at the randomizer more closely before deciding whether to include it or something else.

By the way, to set the record straight, I found a copy of Nevyn’s AtomicViewer project folder after starting this project. I’d forgotten about it and was looking for a periodic table, I have a small few here and there. AtomicViewer works, displaying a single selected vertically oriented atom, with thin and wide alphas. His code’s written in a parent/child hierarchical functional style in separate file docs similar to the third version pi=4 project he had me write. In no way – as far as I can tell - structured like this jupyter pythreejs project. I’ll try looking at it again in the hopefully not too distant future.

Miles Periodic Table with Standard Periodic Table reference - Page 2 Atthru10
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Fri Sep 24, 2021 7:29 pm

LongtimeAirman wrote:.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Tlthru10

Code:

    if i == 11:
        if 12 == atomicNumber: # Magnesium
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, -pP1pP2 - 6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -pP1pP2 - 6*flipPN
            maxZPos =  pP1pP2 + 6*flipPN                
            print('protonWoN[',i+1,']', protonWoN.position)
        if 13 == atomicNumber:
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 2*flipPN, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 14 <= atomicNumber < 15:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,pP1pP2/2+2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)  
        if 15 == atomicNumber:
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0,2*flipPN, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 16 == atomicNumber:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,pP1pP2/2+2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 18 <= atomicNumber < 36:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,pP1pP2/2+2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,p1p2/2+pP1pP2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)                
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)              
        if 57 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)  
            pASet.position = [0,0,p2p3+pP1pP2+2*flipPN]
            grpBn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 12:
        if 13 == atomicNumber: # Aluminum
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [ 0,-2*flipPN,0]
            grpAn.add(protonWoN)
            maxZNeg = -pP1pP2-4*flipPN
            maxZPos =  3*pP1pP2/2 + 6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)            
        if 14 == atomicNumber:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,-pP1pP2/2-2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 15 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [ 0,-2*flipPN,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)  
        if 16 == atomicNumber:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,-pP1pP2/2-2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 18 <= atomicNumber < 36:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [ 0,-pP1pP2/2-2*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
            
    if i == 13:
        if 14 == atomicNumber: # Silicon, the carousal level
            alphaAi.rotateX(-piG/2)
            alphaAi.rotateY(piG/2)
            alphaAi.position = [ pP1pP2/2+2*flipPN,0,0]
            grpAn.add( alphaAi )
            maxZNeg = -pP1pP2-4*flipPN
            maxZPos = pP1pP2+4*flipPN            
            print('alphaAi[',i+1,']', alphaAi.position)
        if 15 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.rotateY(piG/2)
            protonWoN.position = [2*flipPN,0,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)  
        if 16 <= atomicNumber < 36:
            alphaAi.rotateX(-piG/2)
            alphaAi.rotateY(piG/2)
            alphaAi.position = [ pP1pP2/2+2*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
  
    if i == 14:
        if 15 == atomicNumber: # Phosphorus 
            alphaAi.rotateX(piG)
            alphaAi.position = [0, 0, pP1pP2 + 4*flipPN]
            grpAn.add( alphaAi )
            maxZNeg = -pP1pP2 - 6*flipPN
            maxZPos =  pP1pP2/2 + 4*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 16 == atomicNumber:
            protonWoN.rotateX(piG)
            protonWoN.position = [0, 0, pP1pP2/2 + 4*flipPN]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 17 <= atomicNumber < 18:
            alphaAi.rotateX(piG)
            alphaAi.position = [0, 0, pP1pP2 + 4*flipPN]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 42 <= atomicNumber < 47:
            protonWoN.position = [0,4*pP1pP2/2+p1p2+4*flipPN,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 47 <= atomicNumber < 54 :
            alphaAi.position = [0,4*pP1pP2/2+p1p2+4*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 57 <= atomicNumber < 61:
            protonWoN.position = [0, 2*p2p3+2*pP1pP2+4*flipPN, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 61 <= atomicNumber < 67:
            alphaAi.position = [0, 2*p2p3+2*pP1pP2+4*flipPN, 0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)        
        if 67 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, 2*p2p3+2*pP1pP2+4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 68 <= atomicNumber < 71 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, 2*p2p3+2*pP1pP2+4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 71 == atomicNumber :
            alphaAi.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]  
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)            
        if 72 <= atomicNumber < 79:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 79 <= atomicNumber < 82 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber < 86:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 86 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
            
    if i == 15:
        if 16 == atomicNumber: # Sulfur
            protonWoN.position = [0, 0, -pP1pP2/2 - 4*flipPN]
            grpAn.add(protonWoN)
            maxZNeg = -pP1pP2/2 - 4*flipPN
            maxZPos = pP1pP2/2 + 4*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 41 <= atomicNumber < 47:
            protonWoN.position = [0,-4*pP1pP2/2-p1p2-4*flipPN,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 47 <= atomicNumber < 54:
            alphaAi.position = [0,-4*pP1pP2/2-p1p2-4*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 57 <= atomicNumber < 61:
            protonWoN.position = [0, -2*p2p3-2*pP1pP2-4*flipPN, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 61 <= atomicNumber < 67:
            alphaAi.position = [0, -2*p2p3-2*pP1pP2-4*flipPN, 0]
            grpAn.add( alphaAi  )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 67 <= atomicNumber < 68:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, -2*p2p3-2*pP1pP2-4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 68 <= atomicNumber < 71 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, -2*p2p3-2*pP1pP2-4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 71 <= atomicNumber < 79:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, -2*p2p3-3*pP1pP2-4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 79 <= atomicNumber < 82 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, -2*p2p3-3*pP1pP2-4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber < 86:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, -2*p2p3-3*pP1pP2-4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 86 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0, -2*p2p3-3*pP1pP2-4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
            
    if i == 16:
        if 17 == atomicNumber: # Chlorine
            alphaAi.rotateX(piG/2)          
            alphaAi.position = [0,0,-3*pP1pP2/2-6*flipPN]
            grpBn.add( alphaAi )
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN        
            print('alphaAi[',i+1,']', alphaAi.position)
        if 39 <= atomicNumber < 48:
            protonWoN.position = [-4*pP1pP2/2-p1p2-4*flipPN,0,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 48 <= atomicNumber < 54:
            alphaAi.position = [-4*pP1pP2/2-p1p2-4*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 57 <= atomicNumber < 63 :
            alphaAi.position = [-2*p2p3-2*pP1pP2-4*flipPN,0,0]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 63 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-2*pP1pP2-4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 71 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-3*pP1pP2-4*flipPN, 0, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 72 <= atomicNumber < 74 :
            alphaAi.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]  
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 74 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 75 == atomicNumber :
            alphaAi.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]  
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 76 <= atomicNumber < 80 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 80 <= atomicNumber < 82:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
            
    if i == 17:
        if 18 <=atomicNumber < 36: # Argon
            alphaAi.position = [0, 0, pP1pP2 + 4*flipPN]            
            grpAn.add( alphaAi )
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos = 3*pP1pP2/2+4*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-2*flipPN-p1p2/2-pP1pP2,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)            
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)
            pASet.position = [0,-p2p3-pP1pP2-2*flipPN,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 18:
        if 19 <= atomicNumber < 21: # Potassium
            protonWoN.rotateX(-piG/2)
            protonWoN.position =  [0, 0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN  
            print('protonWoN[',i+1,']', protonWoN.position)
        if 21 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position =  [0, 0, 3*pP1pP2/2+6*flipPN]
            neutronBi.position = [0,3*pP1pP2/2+6*flipPN,-pP1pP2 - 2*flipPN - p1n2]
            protonWoN.add(neutronBi)
            grpBn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 22 <= atomicNumber < 27:
            neutronAi.position = [0,0, p1n2]            
            protonAi.rotateZ(piG/2)    
            protonAi.position = [0, pP1pP2+4*flipPN,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 27 == atomicNumber:
            neutronAi.position = [0,p1n2+pP1pP2+2*flipPN,0]
            grpAn.add( neutronAi )
            print('neutronAi[',i+1,']', neutronAi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0,0,-p1p2/2-pP1pP2-p1p2/2-pP1pP2-4*flipPN]              
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)              
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,-2*p2p3-3*pP1pP2-4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0,0,-2*p2p3-2*pP1pP2-4*flipPN]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,-2*p2p3-3*pP1pP2-4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 19:
        if 20 == atomicNumber: # Calcium
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0,0,-3*pP1pP2/2-6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 21 == atomicNumber:
            protonWoN.rotateZ(piG/2)
            protonWoN.position = [4*flipPN+pP1pP2,0,0]
            neutronBi.position = [2*flipPN+pP1pP2 +p1n2,pP1pP2+4*flipPN,0]
            protonWoN.add(neutronBi)
            grpAn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)
        if 22 <= atomicNumber < 27:
            neutronAi.position = [0,0,-p1n2]
            protonAi.rotateZ(-piG/2)
            protonAi.position = [4*flipPN+pP1pP2,0,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 27 <= atomicNumber < 36:
            alphaAi.position = [0,0,-p1n2]
            alphaAi.rotateZ(-piG/2)
            alphaAi.position = [4*flipPN+pP1pP2,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)

    if i == 20:
        if 21 == atomicNumber: # Scandium 
            protonWoN.rotateZ(piG/2)
            protonWoN.position = [-pP1pP2-4*flipPN,0,0]
            neutronBi.position = [0,-pP1pP2-4*flipPN,-3*pP1pP2/2-4*flipPN-p1n2]
            protonWoN.add(neutronBi)
            grpAn.add( protonWoN )
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)            
        if 22 <= atomicNumber < 27 :
            neutronAi.position = [0,0,p1n2]
            protonAi.rotateZ(-piG/2)            
            protonAi.position = [-pP1pP2-4*flipPN,0,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 27 <= atomicNumber < 36:
            alphaAi.position = [0,0,p1n2]
            alphaAi.rotateZ(-piG/2)            
            alphaAi.position = [-pP1pP2-4*flipPN,0,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,p1p2/2+pP1pP2+2*flipPN,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)                
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)                
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)
            pASet.position = [0,p2p3+pP1pP2+2*flipPN,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 21:
        if 22 <= atomicNumber < 29: # Titanium
            neutronAi.position = [0,0,-p1n2]
            protonAi.rotateZ(piG/2)    
            protonAi.position = [0,-pP1pP2-4*flipPN,0]
            grpAn.add( protonAi )
            print('protonAi[',i+1,']', protonAi.position)
        if 29 <= atomicNumber < 36:
            alphaAi.rotateZ(piG/2)    
            alphaAi.position = [0,-pP1pP2-4*flipPN,0]
            grpAn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)

    if i == 22:
        if 23 <= atomicNumber < 26: # Vanadium
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpBn.add( protonWoN )
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN  
            print('protonWoN[',i+1,']', protonWoN.position)            
        if 26 <= atomicNumber < 29:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 29 <= atomicNumber < 31:
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)  
        if 31 <= atomicNumber < 36:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
          
    if i == 23:
        if 24 <= atomicNumber < 26: # Chromium
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpBn.add( protonWoN )
            maxZNeg = -3*pP1pP2/2-8*flipPN
            maxZPos =  3*pP1pP2/2+8*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)              
        if 26 <= atomicNumber < 30:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpBn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
        if 30 == atomicNumber:
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)              
        if 31 <= atomicNumber < 36:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpBn.add( alphaAi )
            print('alphaAi[',i+1,']', alphaAi.position)
          
    if i == 24:
        if 25 == atomicNumber: # Manganese
            protonWoN.position = [0,-pP1pP2/2-2*flipPN, pP1pP2/2+2*flipPN]
            grpBn.add( protonWoN )
            maxZNeg = -3*pP1pP2/2-8*flipPN
            maxZPos =  3*pP1pP2/2+8*flipPN
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 26 <= atomicNumber < 29: # Three hook position neutrons
            neutronAi.position = [0,-pP1pP2/2-p1n2,pP1pP2/2 + 2*flipPN]
            grpBn.add( neutronAi )
            neutronBi.position = [0,-pP1pP2/2-p1n2,-pP1pP2/2 - 2*flipPN]
            grpBn.add( neutronBi )
            neutronGi.position = [0,pP1pP2/2+p1n2,-pP1pP2/2 - 2*flipPN]
            grpBn.add( neutronGi )
            print('3 ea hook neutrons[',i+1,']', neutronAi.position)
    
    if i == 25:
        if 29 == atomicNumber:
            neutronAi.position = [0,-pP1pP2/2-p1n2,p2p3+pP1pP2/2+2*flipPN]
            grpBn.add( neutronAi )
            neutronBi.position = [0,-pP1pP2/2-p1n2,-p2p3+pP1pP2/2+2*flipPN]
            grpBn.add( neutronBi )
            print('2 ea hook neutrons[',i+1,']', neutronAi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0,0,p1p2/2+pP1pP2+p1p2/2+pP1pP2+4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,2*p2p3+3*pP1pP2+4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)            
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0,0,2*p2p3+2*pP1pP2+4*flipPN]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,2*p2p3+3*pP1pP2+4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 26:
        if 27 <= atomicNumber < 33: # Cobalt
            neutronAi.position = [0, pP1pP2/2+p1n2, pP1pP2/2+2*flipPN]
            grpBn.add(neutronAi)
            print('neutronAi[',i+1,']', neutronAi.position)
            
    if i == 27:
        if 28 == atomicNumber: # Nickel
            protonWoN.position = [0, pP1pP2+4*flipPN, 0]
            grpAn.add( protonWoN )
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
            
    if i == 28:
        if 29 <= atomicNumber < 36: # Copper
            alphaAi.position = [0, pP1pP2+4*flipPN, 0]
            grpAn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)

    if i == 36:
        if 37 <= atomicNumber < 48: # Rubidium
            neutronAi.position = [0,2*flipPN-p2p3,p2p3]
            protonAi.rotateX(-piG/2)  
            protonAi.position = [0,-p2p3/2,3*p1p2/2+6*pP1pP2/2+6*flipPN]
            grpBn.add(protonAi)
            maxZNeg = -3*p1p2/2-5*pP1pP2/2-4*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('protonAi[',i+1,']', protonAi.position)
        if 48 <= atomicNumber < 50:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0, 0, 3*p1p2/2+6*pP1pP2/2+6*flipPN]
            grpBn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 50 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,3*p1p2/2+6*pP1pP2/2+6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)            
        if 51 <= atomicNumber < 54:
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0, 0, 3*p1p2/2+6*pP1pP2/2+6*flipPN]
            grpBn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 55 <= atomicNumber < 57 :
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)  
        if 57 <= atomicNumber < 62:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0,3*p2p3+3*pP1pP2+6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)  
        if 62 <= atomicNumber < 66 :
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [0, 0,3*p2p3+3*pP1pP2+6*flipPN]
            grpBn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 66 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+3*pP1pP2+6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 71 == atomicNumber :
            alphaAi.rotateX(piG/2)
            alphaAi.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]
            grpBn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 72 <= atomicNumber < 78 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 78 == atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 79 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 80 <= atomicNumber < 82 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
            
    if i == 37:
        if 38 == atomicNumber: # Strontium
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpBn.add( protonWoN )
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)              
        if 40 <= atomicNumber < 47:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpBn.add( protonWoN )
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN # needed for 40
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN            
            print('protonWoN[',i+1,']', protonWoN.position)                
        if 47 <= atomicNumber < 50:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpBn.add(alphaAi)
            #maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN
            #maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 50 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)
        if 51 <= atomicNumber < 54:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpBn.add(alphaAi)
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('alphaAi[',i+1,']', alphaAi.position)
        if 56 == atomicNumber < 57:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)
        if 57 <= atomicNumber < 61:
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]
            grpBn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 61 == atomicNumber :
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,-3*p2p3-3*pP1pP2-6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)    
        if 62 == atomicNumber :
            alphaAi.rotateX(-piG/2)
            alphaAi.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]
            grpBn.add(alphaAi)
            print('alphaAi[',i+1,']', alphaAi.position)
        if 63 <= atomicNumber < 66 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)            
        if 66 == atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 67 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 68 <= atomicNumber < 71 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 71 <= atomicNumber < 79 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 79 <= atomicNumber < 82 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
            
grpAn.position = [0,0,(-maxZNeg + maxZPos)/2 - maxZPos]
grpBn.position = [0,0,(-maxZNeg + maxZPos)/2 - maxZPos]

In[6]
scene = Scene(children=[grpAn, grpBn, camera, key_light, ambient_light])
controller = OrbitControls(controlling=camera, screenSpacePanning=True)

In[7]
renderer = Renderer(camera=camera, scene=scene, controls=[controller],
                    width=view_width, height=view_height)
scene = Scene()  # initialising the scene

In[8]
renderer

In[9]
spin_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 12], values=[0, 2*piG])
spin_clip = AnimationClip(tracks=[spin_track])
spin_action = AnimationAction(AnimationMixer(grpAn), spin_clip, grpAn)
spin_action
lines 823 thru 1640

3. Carousal spinner animation. Much better than the previous, widget spinning the entire atom as a single group about the z-axis. Created a new Group(), grpBn, to contain all the objects that cannot spin about the atom’s main up/down z-axis. Slots 2 and 3, and their attached hook positions, and slots 14 and 15, the sometimes top and bottom objects with spin axis orthogonal to the z-axis. The rotation widget now spins three vertical axis slots: 1, 4, and 5. The carousal, the four directions front/back, left/right are connected to slot 1. Everything in those slots spin as a single object which of course is not correct, nevertheless, for the time being, I believe it makes an acceptable animation. Four or so of this last batch of images include the imitation carousal spin, it allows a tighter group of images.

4. There’s a commented out, initial alpha neutron pair, spin position randomizer (whew) in the buildMultiAlphas(a) function - #neutronPair.rotateZ(random()*2*piG). It makes sense to use it to break up the uniform lines of neutrons and works well in the widget rotated slots. Unfortunately, the random number function was on (not commented out) when I experienced two “aw snap” jupyter notebook memory overloads. I need to look at the randomizer more closely before deciding whether to include it or something else.

By the way, to set the record straight, I found a copy of Nevyn’s AtomicViewer project folder after starting this project. I’d forgotten about it and was looking for a periodic table, I have a small few here and there. AtomicViewer works, displaying a single selected vertically oriented atom, with thin and wide alphas. His code’s written in a parent/child hierarchical functional style in separate file docs similar to the third version pi=4 project he had me write. In no way – as far as I can tell - structured like this jupyter pythreejs project. I’ll try looking at it again in the hopefully not too distant future.

Miles Periodic Table with Standard Periodic Table reference - Page 2 Atthru10
.

Ace job here LTAM ... seriously!!!

Finally got the latest script running on Anaconda. Looks good and nice job with the functions. btw had to add a display(renderer) after seeing just the controls show up.  Hats off it is fun.  Was looking to add a text label maybe via the Text class. I know randomization can slow things down and run the CPU a bit.  I guess getting this a bit more optimized is a good step. Your step #3 is ace thinking.

Chromium6

Posts : 727
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Sat Sep 25, 2021 5:52 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Acandt10

First 827 lines, text and the rest of the code is continued in the next post
Code:

In[1]:
from pythreejs import *
from IPython.display import display
import ipywidgets
from math import sqrt
from random import random , randint , seed
phi = (1+sqrt(5))/2  # calculating phi-based-pi, piG.
piG = 4/sqrt(phi)    # piG is used instead of pi.

In[2]:
view_width = 600
view_height = 400
factor = 40 # orthographic "scaler"
camera = PerspectiveCamera(position=[10, 0, 0], up=[0, 0, 1], aspect=view_width/view_height)
#camera = PerspectiveCamera(position=[10, 0, 0], up=[1, 0, 0], aspect=view_width/view_height)
camera = PerspectiveCamera(position=[10, 0, 0], up=[0, 1, 0], aspect=view_width/view_height)
#camera = OrthographicCamera(view_width/-factor,view_width/factor,view_height / factor,
#    view_height / - factor,0.1,1000)  # The orbital controls doesn't work with ortho(?)
key_light = DirectionalLight(position=[0, 10, 10])
ambient_light = AmbientLight()

In[3]
elements = ["1 Hydrogen H","2 Helium He","3 Lithium Li","4 Beryllium Be",
           "5 Boron B","6 Carbon C","7 Nitrogen N","8 Oxygen O",
           "9 Fluorine F","10 Neon Ne","11 Sodium Na","12 Magnesium Mg",
           "13 Aluminum Al","14 Silicon Si","15 Phosphorus P","16 Sulfur S",
           "17 Chlorine Cl","18 Argon Ar","19 Potassium P","20 Calcium Ca",
           "21 Scandium Sc","22 Titanium Ti","23 Vanadium V","24 Chromium Cr",
           "25 Manganese Mn","26 Iron Fe","27 Cobalt Co","28 Nickel Ni",
           "29 Copper Cu","30 Zinc Zn","31 Gallium Ga","32 Germanium Ge",
           "33 Arsenic As","34 Selenium Se","35 Bromine Br","36 Krypton Kr",
           "37 Rubidium Rb","38 Strontium Sr","39 Yttrium Y","40 Zirconium Zr",
           "41 Niobium Nb","42 Molybdenum Mo","43 Technetium Tc","44 Ruthenium Ru",
           "45 Rhodium Rh","46 Palladium Pd","47 Silver Ag","48 Cadmium Cd",
           "49 Indium In", "50 Tin Sn","51 Antimony Sb","52 Tellurium Te",
           "53 Iodine I","54 Xenon Xe","55 Caesium Cs","56 Barium Ba",
           "57 Lanthanum La","58 Cerium Ce","59 Praseodymium Pr","60 Neodymium Nd",
           "61 Promethium Pm","62 Samarium Sm","63 Europium Eu","64 Gadolinium Gd",
           "65 Terbium Tb","66 Dysprosium Dy","67 Holmium Ho","68 Erbium Er",
           "69 Thulium Tm","70 Ytterbium Yb","71 Lutetium Lu","72 Hafnium Hf",
           "73 Tantalum Ta","74 Tungsten W","75 Rhenium Re","76 Osmium Os",
           "77 Iridium Ir","78 Platinum Pt","79 Gold Au","80 Mercury Hg",
           "81 Thallium Tl","82 Lead Pb","83 Bismuth Bi","84 Polonium Po",
           "85 Astatine At","86 Radon Rn","87 Francium Fr","88 Radium Ra",
           "89 Actinium Ac","90 Thorium Th"]
print( elements )

In[4]
#atomicNumber = 2 # Easier place to change An when coding
atomicNumber = number  # Enter the desired number of protons above
grpAn = Group()  # The rotation widget spins grpAn, slots 1,4 and 5.  
grpBn = Group()  # These objects, generally top, bottom and hook
# positions will not spin with widget grpAn objects.
# Dimensions
pP1pP2 = 1.5 # Proton 1 to proton 2, Pole-to-pole separation.
pRadius = 0.5
nRadius = 0.6
eRadius = 2*pRadius/10
emRadius = 6
p1p2 = pRadius*2.5  # small gap
#p2p3 = pRadius*3  # small gap
p2p3 = pRadius*2.85  # small gap
n1n2 = 4.0  # Alpha, left-right (y) neutron-neutron orbital separation
p1n1 = pP1pP2/2 # Alpha, up-down (z) proton-orbital neutron separation
p1n2 = pRadius + nRadius + 0.5  # In line proton and neutron
p1e1 = pRadius + 1.5*pP1pP2/10  # Alpha, top-bottom (z) proton-electron separation
e1e2 = 0.75  # 0.5  # electron-electron separation
flipPN = 3 # Dist. between adjacent vertical and horiz protons
maxZNeg = 0.0 # maxZNeg and maxZPos are Used to center(z) the atom on the screen
maxZPos = 0.0  

# Proton set Geometries and Materials
protonGeometry =  SphereBufferGeometry(pRadius, 24, 16)
neutronGeometry =  SphereBufferGeometry(nRadius, 24, 16)
electronGeometry =  SphereBufferGeometry(eRadius, 8, 16)
emissionGeometry = CircleGeometry(emRadius, 24)
emissionTopGeometry = CircleGeometry(emRadius, 24)
emissionBotGeometry = CircleGeometry(emRadius, 24)

protonMaterial = MeshStandardMaterial(color='blue')
protonMaterialB = MeshStandardMaterial(color='green')
neutronMaterial = MeshStandardMaterial(color='red')
neutronMaterialB = MeshStandardMaterial(color='green')
electronMaterial = MeshStandardMaterial(color='cyan')
emissionmaterial = MeshStandardMaterial(color='gray',
    transparent = True,opacity = 0.25)

def buildMultiAlphas(a): # a is the number of alphas. 1,2,3, ...  
    num = 0          
    while num < a*2 :
        protonMi = Group()
        protonMi.add(Mesh(protonGeometry, protonMaterial))    
        emissionM2i = Mesh( emissionGeometry, emissionmaterial)
        emissionM2i.rotateX(piG)
        protonMi.add(Mesh(emissionGeometry, emissionmaterial))
        protonMi.add(emissionM2i)
        electronMi = Object3D()
        electronMi.add(Mesh(electronGeometry, electronMaterial))
        electronMi.position = [0,-e1e2/2 ,-p1e1]
        protonMi.add(electronMi)
        if num%2 != 0:
            neutronPair = Group()
            neutronMi = Object3D()
            neutronMi.add(Mesh(neutronGeometry, neutronMaterial))
            neutronMi.position = [0,-n1n2/2,-p1n1]
            neutronNi = Object3D()
            neutronNi.add(Mesh(neutronGeometry, neutronMaterial))
            #neutronNi.add(Mesh(neutronGeometry, neutronMaterialB))
            neutronNi.position = [0,n1n2/2,-p1n1]
            neutronPair.add(neutronMi)
            neutronPair.add(neutronNi)
            neutronPair.rotateZ(random()*2*piG) # Initial random spin positions
            protonMi.add(neutronPair)
            protonMi.rotateX(piG)
        protonMi.position = [0,0,a*pP1pP2/2+(a-1)*p2p3/2-(p2p3/2+pP1pP2/2)*num]
        multiAlpha.add(protonMi)                
        num += 1
    return

def buildProtonAlphaSet(a): # Odd numbers, alphas and one proton.
    num = 0                 # a is the total # of protons
    while num < a:
        protonMi = Group()
        protonMi.add(Mesh(protonGeometry, protonMaterial))    
        emissionM2i = Mesh( emissionGeometry, emissionmaterial)
        emissionM2i.rotateX(piG)
        protonMi.add(Mesh(emissionGeometry, emissionmaterial))
        protonMi.add(emissionM2i)
        electronMi = Object3D()
        electronMi.add(Mesh(electronGeometry, electronMaterial))
        electronMi.position = [0,-e1e2/2,-p1e1]
        protonMi.add(electronMi)
        if num%2 != 0:
            neutronPair = Group()
            neutronMi = Object3D()
            neutronMi.add(Mesh(neutronGeometry, neutronMaterial))
            neutronMi.position = [0,-n1n2/2,-p1n1]
            neutronNi = Object3D()
            neutronNi.add(Mesh(neutronGeometry, neutronMaterial))
            neutronNi.position = [0,n1n2/2,-p1n1]
            neutronPair.add(neutronMi)
            neutronPair.add(neutronNi)
            neutronPair.rotateZ(random()*2*piG) # Initial random spin positions
            protonMi.add(neutronPair)
            protonMi.rotateX(piG)
        protonMi.position = [0,0,(a//2)*pP1pP2/2+(a//2)*p2p3/2-(p2p3/2+pP1pP2/2)*num]            
        pASet.add(protonMi)                
        num += 1
    return
        
# Assemble the atomic models.
for i in range( atomicNumber ):
    neutronGi = Object3D()
    neutronGi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronKi = Object3D()
    neutronKi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronLi = Object3D()
    neutronLi.add(Mesh(neutronGeometry, neutronMaterial))
    
    protonWoN = Group() # Proton Without a Neutron
    emissionWoN2 = Mesh( emissionGeometry, emissionmaterial)
    emissionWoN2.rotateX(piG)
    protonWoN.add(Mesh(protonGeometry, protonMaterial))
    protonWoN.add(Mesh(emissionGeometry, emissionmaterial))
    protonWoN.add(emissionWoN2)
    electronWoN = Object3D()
    electronWoN.add(Mesh(electronGeometry, electronMaterial))
    electronWoN.position = [0,-e1e2/2,-p1e1]
    protonWoN.add(electronWoN)  
    
    protonWiN = Group() # Proton With a Neutron
    emissionWiN2 = Mesh( emissionGeometry, emissionmaterial)
    emissionWiN2.rotateX(piG)
    protonWiN.add(Mesh(protonGeometry, protonMaterial))
    protonWiN.add(Mesh(emissionGeometry, emissionmaterial))
    protonWiN.add(emissionWiN2)
    electronWiN = Object3D()
    electronWiN.add(Mesh(electronGeometry, electronMaterial))
    electronWiN.position = [0,-e1e2/2,-p1e1]
    protonWiN.add(electronWiN)
    neutronWiN = Object3D()
    neutronWiN.add(Mesh(neutronGeometry, neutronMaterial))
    neutronWiN.position = [0,-n1n2/2,-p1n1]
    protonWiN.add(neutronWiN)

    if i == 0:
        if 1 == atomicNumber: # Hydrogen.
            neutronWiN.position = [0,0,-p1n2]
            grpAn.add( protonWiN )
            maxZNeg = 0  
            maxZPos = 0
            print('protonWiN[',i+1,']', protonWiN.position)
        if 33 <= atomicNumber < 36:
            protonWoN.position = [0, pP1pP2/2+2*flipPN, pP1pP2/2+2*flipPN]
            grpBn.add( protonWoN )
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 46 <= atomicNumber < 48:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)            
        if 49 == atomicNumber:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)            
        if 53 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p1p2/2+pP1pP2+2*flipPN,p1p2/2+pP1pP2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)              
        if 60 <= atomicNumber < 62:
            protonWoN.position = [0,p2p3+pP1pP2+2*flipPN,p2p3+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)              
        if 64 <= atomicNumber < 66:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+pP1pP2+2*flipPN,p2p3+pP1pP2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)    
        if 70 == atomicNumber :
            protonWoN.position = [0,p2p3+pP1pP2+2*flipPN,p2p3+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)    
        if 72 <= atomicNumber < 74:
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)  
        if 75 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 77 <= atomicNumber < 80:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)            
        if 81 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)          
        if 82 == atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 83 <= atomicNumber < 86 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 87 <= atomicNumber < 89 :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)  
        if 89 <= atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
            
    if i == 1:
        if 2 <= atomicNumber < 10: # Helium
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,0,pP1pP2 + p2p3]                
            grpAn.add(multiAlpha)
            maxZNeg = pP1pP2 + p2p3
            maxZPos = pP1pP2 + p2p3
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 29 <= atomicNumber < 34:
            neutronGi.position = [0,-pP1pP2/2-p1n2,-pP1pP2/2 - 2*flipPN]
            grpBn.add( neutronGi )
            print('hook neutronGi[',i+1,']', neutronGi.position)
        if 34 <= atomicNumber < 36:
            protonWoN.position = [0,-pP1pP2/2- 2*flipPN,-pP1pP2/2 - 2*flipPN]
            grpBn.add( protonWoN )
            print('hook protonWoN[',i+1,']', protonWoN.position)  
        if 45 <= atomicNumber < 48: # hook position            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 51 == atomicNumber:            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 53 == atomicNumber :            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 59 <= atomicNumber < 63 :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 65 <= atomicNumber < 66 :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 68 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 69 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 70 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 72 == atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 73 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 74 == atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 75 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 77 <= atomicNumber < 80 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 81 <= atomicNumber < 84:
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 84 <= atomicNumber < 86 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 87 <= atomicNumber < 90 :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 90 <= atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
            
    if i == 2:
        if 3 <= atomicNumber < 10: # Lithium
            protonWoN.rotateX(-piG/2)            
            protonWoN.position = [0, 0, 3*pP1pP2/2+p2p3+2*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -pP1pP2/2
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 10 <= atomicNumber < 14:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 0, pP1pP2+4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 17 <= atomicNumber < 18:
            protonWoN.rotateX(-piG/2)            
            protonWoN.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 30 <= atomicNumber < 36:
            protonWoN.position = [0,-pP1pP2/2-2*flipPN,pP1pP2/2+2*flipPN]
            grpBn.add( protonWoN )
            print('hook protonWoN[',i+1,']', protonWoN.position)  
        if 44 <= atomicNumber < 47:            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 50 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 51 == atomicNumber:            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 52 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 53 == atomicNumber :            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 57 <= atomicNumber < 68 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-pP1pP2-2*flipPN,p2p3+pP1pP2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 70 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,p2p3+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 71 == atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 76 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-pP1pP2-2*flipPN,p2p3+pP1pP2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 77 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,p2p3+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 80 <= atomicNumber < 81 :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 85 <= atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
            
    if i == 3:
        if 4 == atomicNumber < 5: # Beryllium
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, pP1pP2/2+p2p3 -2*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = pP1pP2/2+p2p3 -2*flipPN
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 29 <= atomicNumber < 30:
            neutronGi.position = [0,pP1pP2/2+p1n2,p2p3-pP1pP2/2-2*flipPN]
            grpBn.add( neutronGi )
            neutronKi.position = [0,pP1pP2/2+p1n2,-p2p3-pP1pP2/2-2*flipPN]
            grpBn.add( neutronKi )
            print('2 hook neutrons[',i+1,']', neutronGi.position)            
        if 30 == atomicNumber :
            protonWoN.position =  [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 32 <= atomicNumber < 35 :
            protonWoN.position =  [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 35 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 43 <= atomicNumber < 47:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 50 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 51 == atomicNumber:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 52 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 53 == atomicNumber:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 57 == atomicNumber < 58:
            protonWoN.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 58 <= atomicNumber < 63:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 63 == atomicNumber :
            protonWoN.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 66 <= atomicNumber < 68 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 68 <= atomicNumber < 71:
            protonWoN.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 71 == atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 74 == atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 76 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 80 <= atomicNumber < 81:
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 86 == atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 88 <= atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
            
    if i == 4:
        if 5 <= atomicNumber < 36: # Boron
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 0, 0]                
            grpAn.add(multiAlpha)
            maxZNeg = -pP1pP2/2
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 36 <= atomicNumber < 54 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, 0, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0, 0, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0, 0, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0, 0, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 5:
        if 6 == atomicNumber < 7: # Carbon
            protonWoN.rotateX(piG/2)            
            protonWoN.position = [0,0,-pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            maxZNeg = -pP1pP2/2-2*flipPN            
            print('protonWoN[',i+1,']', protonWoN.position)
        if 15 <= atomicNumber < 16:
            protonWoN.rotateX(piG/2)            
            protonWoN.position = [0,0,-3*pP1pP2/2-6*flipPN]
            grpBn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
            
    if i == 6:
        if 7 <= atomicNumber < 10: # Nitrogen
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,0,-pP1pP2-p2p3]                
            grpAn.add(multiAlpha)
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            maxZNeg = -pP1pP2-p2p3
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 10 <= atomicNumber < 14:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,0,-pP1pP2-4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 15 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,0,-pP1pP2-4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 16 == atomicNumber:
            protonWoN.position = [0,0,-pP1pP2/2-4*flipPN]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 17 <= atomicNumber < 36:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,0,-pP1pP2-4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-2*flipPN-p1p2/2-pP1pP2,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-p2p3-3*pP1pP2/2-2*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateY(piG/2)
            pASet.position = [-p2p3-pP1pP2-2*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-p2p3-3*pP1pP2/2-2*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 7:
        if 8 == atomicNumber: # Oxygen
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0,0,-3*pP1pP2/2-p2p3-2*flipPN]
            grpBn.add(protonWoN)
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            maxZNeg = -3*pP1pP2/2-p2p3-2*flipPN            
            print('protonWoN[',i+1,']', protonWoN.position)
        if 9 == atomicNumber:
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0,pP1pP2/2,-3*pP1pP2/2-p2p3-2*flipPN]
            grpBn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 10 <= atomicNumber < 36:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,-pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,-p1p2/2-pP1pP2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)  
        if 57 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)  
            pASet.position = [0,0,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 8:
        if 9 == atomicNumber < 10: # Fluorine
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0,-pP1pP2/2,-3*pP1pP2/2-p2p3-2*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-p2p3-2*flipPN
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 39 <= atomicNumber < 48:        
            protonWoN.position = [4*pP1pP2/2+p1p2+4*flipPN,0,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 48 <= atomicNumber < 54:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [4*pP1pP2/2+p1p2+4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 63:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [2*p2p3+2*pP1pP2+4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 63 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [2*p2p3+2*pP1pP2+4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 71 <= atomicNumber < 74:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [2*p2p3+3*pP1pP2+4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 74 <= atomicNumber < 80:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [2*p2p3+3*pP1pP2+4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 80 <= atomicNumber < 82:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [2*p2p3+3*pP1pP2+4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [2*p2p3+3*pP1pP2+4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
            
    if i == 9:
        if 10 <= atomicNumber < 36:  # Neon
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0, pP1pP2/2 + 2*flipPN]                
            grpBn.add(multiAlpha)
            maxZNeg = -3*pP1pP2/2-p2p3-2*flipPN
            maxZPos = 3*pP1pP2/2+p2p3+2*flipPN
            print('multiAlpha 1[',i+1,']', multiAlpha.position)            
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [2*flipPN+p1p2/2+pP1pP2,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)          
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [p2p3+3*pP1pP2/2+2*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)            
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateY(piG/2)
            pASet.position = [p2p3+pP1pP2+2*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [p2p3+3*pP1pP2/2+2*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)  
            
    if i == 10:
        if 11 <= atomicNumber < 14: # Sodium
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [ 0,0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(protonWoN)
            maxZPos =  3*pP1pP2/2+6*flipPN
            maxZNeg = -pP1pP2-4*flipPN  
            print('protonWoN[',i+1,']', protonWoN.position)
        if 14 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.rotateY(-piG/2)            
            multiAlpha.position = [ -pP1pP2/2-2*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 15 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.rotateY(piG/2)
            protonWoN.position = [-2*flipPN,0, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 16 <= atomicNumber < 36:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.rotateY(-piG/2)            
            multiAlpha.position = [ -pP1pP2/2-2*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Sat Sep 25, 2021 5:57 pm

.
Ace job here LTAM ... seriously!!!

Thank you Sir, delighted to hear it, you sound as pleasantly surprised as I was. Using the widget spinner to spin the entire atom was wrong. Limiting the spinning to the carousal was a logical improvement that occurred to me one moment and I started working on the next. Despite the inaccuracies, the spinning carousal clearly displays an essential part of the charge field atomic model.      

Finally got the latest script running on Anaconda. Looks good and nice job with the functions. btw had to add a display(renderer) after seeing just the controls show up.

I can now actually watch for that special moment and press the button at the same time, thank you very much. You get bonus points for getting this thing up and running as well as minimizing the spin widget’s irksome problem.
   
Hats off it is fun.  Was looking to add a text label maybe via the Text class.

I’ve only concerned myself with coding and displaying objects, and not with creating any jupyter notebook text, illustrated images or information cells. Or do you mean adding text to the rendered scene?
 
I know randomization can slow things down and run the CPU a bit.  I guess getting this a bit more optimized is a good step. Your step #3 is ace thinking.
The spinning carousal makes a big difference.

Turns out, (pseudo)randomization is not a problem, in the latest code all the alpha neutron pairs include it. The neutrons are no longer arranged in straight lines, only protons sharing the same charge channel can be found in straight lines. One can realign the neutrons back again by commenting out the random line in both the proton/multAlpha functions. In addition to the atomic number I suppose we might give the user the opportunity to change some variables.

My memory bombs had an easy fix, pause the animation before selecting a new atom. I’d say optimizing is still needed. Yesterday, to more easily implement randomization, I removed all occurrences (about 400) of alphaAi, replacing them with the function call buildMultiAlphas(1). The code now includes only five i-loop overhead objects. 1. protonWoN (w/o a neutron). 2. protonWiN (with a neutron). 3. neutronGi. 4. neutronKi. and neutronLi. It increased the code about 50 lines but I’d swear it runs faster.

Only two atoms this post, Actinium (89) and Thorium (90). Your periodic table slot layouts end there. Should we take some time to diagram some more? I think many atoms could use another neutron or two. Uranium (92) as two krypton (36) atoms, one 18 argon atom and two shared protons is not currently an option.

Any thoughts on moving forward?


lines 828-1718
Code:

        
    if i == 11:
        if 12 == atomicNumber: # Magnesium
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, -pP1pP2 - 6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -pP1pP2 - 6*flipPN
            maxZPos =  pP1pP2 + 6*flipPN                
            print('protonWoN[',i+1,']', protonWoN.position)
        if 13 == atomicNumber:
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 2*flipPN, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 14 <= atomicNumber < 15:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0,pP1pP2/2+2*flipPN,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)            
        if 15 == atomicNumber:
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0,2*flipPN, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 16 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0,pP1pP2/2+2*flipPN,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 18 <= atomicNumber < 36:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0,pP1pP2/2+2*flipPN,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,p1p2/2+pP1pP2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)                
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)              
        if 57 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)  
            pASet.position = [0,0,p2p3+pP1pP2+2*flipPN]
            grpBn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 12:
        if 13 == atomicNumber: # Aluminum
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [ 0,-2*flipPN,0]
            grpAn.add(protonWoN)
            maxZNeg = -pP1pP2-4*flipPN
            maxZPos =  3*pP1pP2/2 + 6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)            
        if 14 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [ 0,-pP1pP2/2-2*flipPN,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 15 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [ 0,-2*flipPN,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)  
        if 16 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [ 0,-pP1pP2/2-2*flipPN,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 18 <= atomicNumber < 36:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [ 0,-pP1pP2/2-2*flipPN,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
            
    if i == 13:
        if 14 == atomicNumber: # Silicon, the carousal level            
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [ pP1pP2/2+2*flipPN,0,0]                
            grpAn.add(multiAlpha)
            maxZNeg = -pP1pP2-4*flipPN
            maxZPos = pP1pP2+4*flipPN    
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 15 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.rotateY(piG/2)
            protonWoN.position = [2*flipPN,0,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)  
        if 16 <= atomicNumber < 36:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [pP1pP2/2+2*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)  
  
    if i == 14:
        if 15 == atomicNumber: # Phosphorus
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG)
            multiAlpha.position = [0, 0, pP1pP2 + 4*flipPN]                
            grpAn.add(multiAlpha)
            maxZNeg = -pP1pP2 - 6*flipPN
            maxZPos =  pP1pP2/2 + 4*flipPN  
            print('multiAlpha 1[',i+1,']', multiAlpha.position)            
        if 16 == atomicNumber:
            protonWoN.rotateX(piG)
            protonWoN.position = [0, 0, pP1pP2/2 + 4*flipPN]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 17 <= atomicNumber < 18:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG)
            multiAlpha.position = [0, 0, pP1pP2 + 4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 42 <= atomicNumber < 47:
            protonWoN.position = [0,4*pP1pP2/2+p1p2+4*flipPN,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 47 <= atomicNumber < 54 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,4*pP1pP2/2+p1p2+4*flipPN,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 61:
            protonWoN.position = [0, 2*p2p3+2*pP1pP2+4*flipPN, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 61 <= atomicNumber < 67:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 2*p2p3+2*pP1pP2+4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 67 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, 2*p2p3+2*pP1pP2+4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 68 <= atomicNumber < 71 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, 2*p2p3+2*pP1pP2+4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 71 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 72 <= atomicNumber < 79:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 79 <= atomicNumber < 82 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber < 86:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 86 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
            
    if i == 15:
        if 16 == atomicNumber: # Sulfur
            protonWoN.position = [0, 0, -pP1pP2/2 - 4*flipPN]
            grpAn.add(protonWoN)
            maxZNeg = -pP1pP2/2 - 4*flipPN
            maxZPos = pP1pP2/2 + 4*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 41 <= atomicNumber < 47:
            protonWoN.position = [0,-4*pP1pP2/2-p1p2-4*flipPN,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 47 <= atomicNumber < 54:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-4*pP1pP2/2-p1p2-4*flipPN,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 61:
            protonWoN.position = [0, -2*p2p3-2*pP1pP2-4*flipPN, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 61 <= atomicNumber < 67:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, -2*p2p3-2*pP1pP2-4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 67 <= atomicNumber < 68:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, -2*p2p3-2*pP1pP2-4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 68 <= atomicNumber < 71 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, -2*p2p3-2*pP1pP2-4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 71 <= atomicNumber < 79:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, -2*p2p3-3*pP1pP2-4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 79 <= atomicNumber < 82 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, -2*p2p3-3*pP1pP2-4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber < 86:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, -2*p2p3-3*pP1pP2-4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 86 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0, -2*p2p3-3*pP1pP2-4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
            
    if i == 16:
        if 17 == atomicNumber: # Chlorine
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,-3*pP1pP2/2-6*flipPN]                
            grpBn.add(multiAlpha)
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN    
            print('multiAlpha 1[',i+1,']', multiAlpha.position)  
        if 39 <= atomicNumber < 48:
            protonWoN.position = [-4*pP1pP2/2-p1p2-4*flipPN,0,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 48 <= atomicNumber < 54:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [-4*pP1pP2/2-p1p2-4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)            
        if 57 <= atomicNumber < 63 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [-2*p2p3-2*pP1pP2-4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 63 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-2*pP1pP2-4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 71 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-3*pP1pP2-4*flipPN, 0, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 72 <= atomicNumber < 74 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 74 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 75 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 76 <= atomicNumber < 80 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 80 <= atomicNumber < 82:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
            
    if i == 17:
        if 18 <=atomicNumber < 36: # Argon
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 0, pP1pP2 + 4*flipPN]                
            grpAn.add(multiAlpha)
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos = 3*pP1pP2/2+4*flipPN  
            print('multiAlpha 1[',i+1,']', multiAlpha.position)      
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-2*flipPN-p1p2/2-pP1pP2,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)            
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)
            pASet.position = [0,-p2p3-pP1pP2-2*flipPN,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 18:
        if 19 <= atomicNumber < 21: # Potassium
            protonWoN.rotateX(-piG/2)
            protonWoN.position =  [0, 0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN  
            print('protonWoN[',i+1,']', protonWoN.position)
        if 21 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position =  [0, 0, 3*pP1pP2/2+6*flipPN]
            #neutronGi.position = [0,3*pP1pP2/2+6*flipPN,-pP1pP2 - 2*flipPN - p1n2]
            #protonWoN.add(neutronGi)
            grpBn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 22 <= atomicNumber < 27:
            neutronWiN.position = [0,0, p1n2]            
            protonWiN.rotateZ(piG/2)    
            protonWiN.position = [0, pP1pP2+4*flipPN,0]
            grpAn.add( protonWiN )
            print('protonWiN[',i+1,']', protonWiN.position)
        if 27 == atomicNumber:
            neutronGi.position = [0,p1n2+pP1pP2+2*flipPN,0]
            grpAn.add( neutronGi )
            print('neutronGi[',i+1,']', neutronGi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0,0,-p1p2/2-pP1pP2-p1p2/2-pP1pP2-4*flipPN]              
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)              
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,-2*p2p3-3*pP1pP2-4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0,0,-2*p2p3-2*pP1pP2-4*flipPN]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,-2*p2p3-3*pP1pP2-4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 19:
        if 20 == atomicNumber: # Calcium
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0,0,-3*pP1pP2/2-6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 21 == atomicNumber:
            protonWoN.rotateZ(piG/2)
            protonWoN.position = [4*flipPN+pP1pP2,0,0]
            #neutronGi.position = [2*flipPN+pP1pP2 +p1n2,pP1pP2+4*flipPN,0]
            #protonWoN.add(neutronGi)
            grpAn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)
        if 22 <= atomicNumber < 27:
            neutronWiN.position = [0,0, -p1n2]            
            protonWiN.rotateZ(-piG/2)    
            protonWiN.position = [4*flipPN+pP1pP2,0,0]
            grpAn.add( protonWiN )
            print('protonWiN[',i+1,']', protonWiN.position)            
        if 27 <= atomicNumber < 36:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateZ(-piG/2)
            multiAlpha.position = [4*flipPN+pP1pP2,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
            
    if i == 20:
        if 21 == atomicNumber: # Scandium 
            protonWoN.rotateZ(piG/2)
            protonWoN.position = [-pP1pP2-4*flipPN,0,0]
            neutronGi.position = [0,-pP1pP2-4*flipPN,-3*pP1pP2/2-4*flipPN-p1n2]
            protonWoN.add(neutronGi)
            grpAn.add( protonWoN )
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)            
        if 22 <= atomicNumber < 27 :
            neutronWiN.position = [0,0,p1n2]            
            protonWiN.rotateZ(-piG/2)    
            protonWiN.position = [-pP1pP2-4*flipPN,0,0]
            grpAn.add( protonWiN )
            print('protonWiN[',i+1,']', protonWiN.position)              
        if 27 <= atomicNumber < 36:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateZ(-piG/2)
            multiAlpha.position = [-pP1pP2-4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,p1p2/2+pP1pP2+2*flipPN,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)                
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)                
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)
            pASet.position = [0,p2p3+pP1pP2+2*flipPN,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 21:
        if 22 <= atomicNumber < 29: # Titanium
            neutronWiN.position = [0,0,-p1n2]            
            protonWiN.rotateZ(-piG/2)    
            protonWiN.position = [0,-pP1pP2-4*flipPN,0]
            grpAn.add( protonWiN )
            print('protonWiN[',i+1,']', protonWiN.position)
        if 29 <= atomicNumber < 36:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateZ(piG/2)
            multiAlpha.position = [0,-pP1pP2-4*flipPN,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)

    if i == 22:
        if 23 <= atomicNumber < 26: # Vanadium
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpBn.add( protonWoN )
            maxZNeg = -3*pP1pP2/2-4*flipPN
            maxZPos =  3*pP1pP2/2+6*flipPN  
            print('protonWoN[',i+1,']', protonWoN.position)            
        if 26 <= atomicNumber < 29:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0, 3*pP1pP2/2+6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 29 <= atomicNumber < 31:
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0,0, 3*pP1pP2/2+6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)  
        if 31 <= atomicNumber < 36:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,3*pP1pP2/2+6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
          
    if i == 23:
        if 24 <= atomicNumber < 26: # Chromium
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpBn.add( protonWoN )
            maxZNeg = -3*pP1pP2/2-8*flipPN
            maxZPos =  3*pP1pP2/2+8*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)              
        if 26 <= atomicNumber < 30:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0, -3*pP1pP2/2-6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 30 == atomicNumber:
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0,0, -3*pP1pP2/2-6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)              
        if 31 <= atomicNumber < 36:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0, -3*pP1pP2/2-6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
            
    if i == 24:
        if 25 == atomicNumber: # Manganese
            protonWoN.position = [0,-pP1pP2/2-2*flipPN, pP1pP2/2+2*flipPN]
            grpBn.add( protonWoN )
            maxZNeg = -3*pP1pP2/2-8*flipPN
            maxZPos =  3*pP1pP2/2+8*flipPN
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 26 <= atomicNumber < 29: # Three hook position neutrons
            neutronGi.position = [0,-pP1pP2/2-p1n2,pP1pP2/2 + 2*flipPN]
            grpBn.add( neutronGi )
            neutronKi.position = [0,-pP1pP2/2-p1n2,-pP1pP2/2 - 2*flipPN]
            grpBn.add( neutronKi )
            neutronLi.position = [0,pP1pP2/2+p1n2,-pP1pP2/2 - 2*flipPN]
            grpBn.add( neutronLi )
            print('3 ea hook neutrons[',i+1,']', neutronGi.position)
    
    if i == 25:
        if 29 <= atomicNumber < 30:          
            neutronGi.position = [0,-pP1pP2/2-p1n2,p2p3+pP1pP2/2+2*flipPN]
            grpBn.add( neutronGi )
            neutronKi.position = [0,-pP1pP2/2-p1n2,-p2p3+pP1pP2/2+2*flipPN]
            grpBn.add( neutronKi )          
            print('2 ea hook neutrons[',i+1,']', neutronGi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0,0,p1p2/2+pP1pP2+p1p2/2+pP1pP2+4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,2*p2p3+3*pP1pP2+4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)            
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0,0,2*p2p3+2*pP1pP2+4*flipPN]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,2*p2p3+3*pP1pP2+4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 26:
        if 27 <= atomicNumber < 33: # Cobalt
            neutronGi.position = [0, pP1pP2/2+p1n2, pP1pP2/2+2*flipPN]
            grpBn.add(neutronGi)
            print('neutronGi[',i+1,']', neutronGi.position)
            
    if i == 27:
        if 28 == atomicNumber: # Nickel
            protonWoN.position = [0, pP1pP2+4*flipPN, 0]
            grpAn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)
            
    if i == 28:
        if 29 <= atomicNumber < 36: # Copper
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, pP1pP2+4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)  

    if i == 36:
        if 37 <= atomicNumber < 48: # Rubidium
            neutronWiN.position = [0,2*flipPN-p2p3,p2p3]            
            protonWiN.rotateX(-piG/2)    
            protonWiN.position = [0,-p2p3/2,3*p1p2/2+6*pP1pP2/2+6*flipPN]
            grpBn.add( protonWiN )
            maxZNeg = -3*p1p2/2-5*pP1pP2/2-4*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN            
            print('protonWiN[',i+1,']', protonWiN.position)
        if 48 <= atomicNumber < 50:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0, 0, 3*p1p2/2+6*pP1pP2/2+6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 50 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,3*p1p2/2+6*pP1pP2/2+6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)            
        if 51 <= atomicNumber < 54:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0, 0, 3*p1p2/2+6*pP1pP2/2+6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 55 <= atomicNumber < 57 :
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)
            maxZNeg = -3*p1p2/2-5*pP1pP2/2-4*flipPN # centering verified
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN            
        if 57 <= atomicNumber < 62:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0,3*p2p3+3*pP1pP2+6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)  
        if 62 <= atomicNumber < 66 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,3*p2p3+3*pP1pP2+6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 66 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+3*pP1pP2+6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 71 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 72 <= atomicNumber < 78 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 78 == atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 79 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 80 <= atomicNumber < 82 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
            
    if i == 37:
        if 38 == atomicNumber: # Strontium
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpBn.add( protonWoN )
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)              
        if 40 <= atomicNumber < 47:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpBn.add( protonWoN )
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN # verified
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN            
            print('protonWoN[',i+1,']', protonWoN.position)                
        if 47 <= atomicNumber < 50:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]                
            grpBn.add(multiAlpha)
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN # verified
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 50 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)
        if 51 <= atomicNumber < 54:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 56 == atomicNumber < 57:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*flipPN]
            grpBn.add( protonWoN )
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN # needed
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 57 <= atomicNumber < 61:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 61 == atomicNumber :
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,-3*p2p3-3*pP1pP2-6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)    
        if 62 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 63 <= atomicNumber < 66 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)            
        if 66 == atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 67 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 68 <= atomicNumber < 71 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 71 <= atomicNumber < 79 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 79 <= atomicNumber < 82 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
            
grpAn.position = [0,0,(-maxZNeg + maxZPos)/2 - maxZPos]
grpBn.position = [0,0,(-maxZNeg + maxZPos)/2 - maxZPos]

In[6]
scene = Scene(children=[grpAn, grpBn, camera, key_light, ambient_light])
controller = OrbitControls(controlling=camera, screenSpacePanning=True)

In[7]
renderer = Renderer(camera=camera, scene=scene, controls=[controller],
                    width=view_width, height=view_height)
scene = Scene()  # initialising the scene

In[8]
spin_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 12], values=[0, 2*piG])
spin_clip = AnimationClip(tracks=[spin_track])
spin_action = AnimationAction(AnimationMixer(grpAn), spin_clip, grpAn)
spin_action

In[9]
renderer

.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Tue Sep 28, 2021 11:24 am

Yeah LTAM,

Some atom layouts are incomplete since I tried to diagram to atoms as found in Miles' papers. I guess we could try to layout these from more recent papers and updates.  Was also thinking of using a python dataset to pass into functions rather than hardcoded vales per atom. Might provide more flexibility in some cases.

Yes was just looking to add a text label to the rendered.

Chromium6

Posts : 727
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Wed Sep 29, 2021 8:59 pm

.
Code lines 1-894, continued in next post.
Code:

In[1]:
from pythreejs import *
from IPython.display import display
import ipywidgets
from math import sqrt
from random import random , randint , seed
phi = (1+sqrt(5))/2  # calculating phi-based-pi, piG.
piG = 4/sqrt(phi)    # piG is used instead of pi.

In[2]:
view_width = 600
view_height = 400
factor = 40 # orthographic "scaler"
camera = PerspectiveCamera(position=[10, 0, 0], up=[0, 0, 1], aspect=view_width/view_height)
#camera = PerspectiveCamera(position=[10, 0, 0], up=[1, 0, 0], aspect=view_width/view_height)
camera = PerspectiveCamera(position=[10, 0, 0], up=[0, 1, 0], aspect=view_width/view_height)
#camera = OrthographicCamera(view_width/-factor,view_width/factor,view_height / factor,
#    view_height / - factor,0.1,1000)  # The orbital controls doesn't work with ortho(?)
key_light = DirectionalLight(position=[0, 10, 10])
ambient_light = AmbientLight()

In[3]
elements = ["1 Hydrogen H","2 Helium He","3 Lithium Li","4 Beryllium Be",
           "5 Boron B","6 Carbon C","7 Nitrogen N","8 Oxygen O",
           "9 Fluorine F","10 Neon Ne","11 Sodium Na","12 Magnesium Mg",
           "13 Aluminum Al","14 Silicon Si","15 Phosphorus P","16 Sulfur S",
           "17 Chlorine Cl","18 Argon Ar","19 Potassium P","20 Calcium Ca",
           "21 Scandium Sc","22 Titanium Ti","23 Vanadium V","24 Chromium Cr",
           "25 Manganese Mn","26 Iron Fe","27 Cobalt Co","28 Nickel Ni",
           "29 Copper Cu","30 Zinc Zn","31 Gallium Ga","32 Germanium Ge",
           "33 Arsenic As","34 Selenium Se","35 Bromine Br","36 Krypton Kr",
           "37 Rubidium Rb","38 Strontium Sr","39 Yttrium Y","40 Zirconium Zr",
           "41 Niobium Nb","42 Molybdenum Mo","43 Technetium Tc","44 Ruthenium Ru",
           "45 Rhodium Rh","46 Palladium Pd","47 Silver Ag","48 Cadmium Cd",
           "49 Indium In", "50 Tin Sn","51 Antimony Sb","52 Tellurium Te",
           "53 Iodine I","54 Xenon Xe","55 Caesium Cs","56 Barium Ba",
           "57 Lanthanum La","58 Cerium Ce","59 Praseodymium Pr","60 Neodymium Nd",
           "61 Promethium Pm","62 Samarium Sm","63 Europium Eu","64 Gadolinium Gd",
           "65 Terbium Tb","66 Dysprosium Dy","67 Holmium Ho","68 Erbium Er",
           "69 Thulium Tm","70 Ytterbium Yb","71 Lutetium Lu","72 Hafnium Hf",
           "73 Tantalum Ta","74 Tungsten W","75 Rhenium Re","76 Osmium Os",
           "77 Iridium Ir","78 Platinum Pt","79 Gold Au","80 Mercury Hg",
           "81 Thallium Tl","82 Lead Pb","83 Bismuth Bi","84 Polonium Po",
           "85 Astatine At","86 Radon Rn","87 Francium Fr","88 Radium Ra",
           "89 Actinium Ac","90 Thorium Th"]
print( elements )

In[4]
number = input( "Please enter the Atomic number: " )
number = int( number )
print( "The Atomic number selected is", elements[number-1])

In[5]
#atomicNumber = 2 # Easier place to change An when coding
atomicNumber = number  # Enter the desired number of protons above
grpAn = Group()  # The rotation widget spins grpAn, slots 1,4 and 5.  
grpBn = Group()  # grpBn are the orthogonal top, bottom and hook slots.
grpB2 = Group()  # intended to display 'orthogonal' spins in slots 2 & 3
#grpB3 = Group()  

# Dimensions
pP1pP2 = 1.5 # Proton 1 to proton 2, Pole-to-pole separation.
pRadius = 0.5
nRadius = 0.6
eRadius = 2*pRadius/10
emRadius = 6
p1p2 = pRadius*2.5  # small gap
#p2p3 = pRadius*3  # small gap
p2p3 = pRadius*2.85  # small gap
n1n2 = 4.0  # Alpha, left-right (y) neutron-neutron orbital separation
p1n1 = pP1pP2/2 # Alpha, up-down (z) proton-orbital neutron separation
p1n2 = pRadius + nRadius + 0.5  # In line proton and neutron
p1e1 = pRadius + 1.5*pP1pP2/10  # Alpha, top-bottom (z) proton-electron separation
e1e2 = 0.75  # 0.5  # electron-electron separation
flipPN = 3 # Dist. between adjacent vertical and horiz protons
maxZNeg = 0.0 # maxZNeg and maxZPos are Used to center(z) the atom on the screen
maxZPos = 0.0  
caroRate = 6  # animation time in seconds to complete a single carousal rotation.

# Proton set Geometries and Materials
protonGeometry =  SphereBufferGeometry(pRadius, 24, 16)
neutronGeometry =  SphereBufferGeometry(nRadius, 24, 16)
electronGeometry =  SphereBufferGeometry(eRadius, 8, 16)
emissionGeometry = CircleGeometry(emRadius, 24)

protonMaterial = MeshStandardMaterial(color='blue')
protonMaterialB = MeshStandardMaterial(color='green')
neutronMaterial = MeshStandardMaterial(color='red')
neutronMaterialB = MeshStandardMaterial(color='green')
electronMaterial = MeshStandardMaterial(color='cyan')
emissionmaterial = MeshStandardMaterial(color='gray',
    transparent = True,opacity = 0.25)

def neutronsPls(n): # n is the total number of neutrons, 1 or 2
    neutron1 = Object3D()
    neutron1.add(Mesh(neutronGeometry, neutronMaterial))
    if n == 1 :
        neutron1.position = [0,0,0] # the register can move the neut if needed
        neutrons.add(neutron1)
    elif n == 2 :
        neutron1.position = [0,-p2p3,0]
        neutrons.add(neutron1)
        neutron2 = Object3D()
        neutron2.add(Mesh(neutronGeometry, neutronMaterial))
        neutron2.position = [0,p2p3,0]        
        neutrons.add(neutron2)        
        neutrons.rotateY(random()*2*piG) # Initial random spin positions
    return

def buildMultiAlphas(a): # a is the number of alphas. 1,2,3, ...  
    num = 0          
    while num < a*2 :
        protonMi = Group()
        protonMi.add(Mesh(protonGeometry, protonMaterial))    
        emissionM2i = Mesh( emissionGeometry, emissionmaterial)
        emissionM2i.rotateX(piG)
        protonMi.add(Mesh(emissionGeometry, emissionmaterial))
        protonMi.add(emissionM2i)
        electronMi = Object3D()
        electronMi.add(Mesh(electronGeometry, electronMaterial))
        electronMi.position = [0,-e1e2/2 ,-p1e1]
        protonMi.add(electronMi)
        if num%2 != 0:
            neutronPair = Group()
            neutronMi = Object3D()
            neutronMi.add(Mesh(neutronGeometry, neutronMaterial))
            neutronMi.position = [0,-n1n2/2,-p1n1]
            neutronNi = Object3D()
            neutronNi.add(Mesh(neutronGeometry, neutronMaterial))
            #neutronNi.add(Mesh(neutronGeometry, neutronMaterialB))
            neutronNi.position = [0,n1n2/2,-p1n1]
            neutronPair.add(neutronMi)
            neutronPair.add(neutronNi)
            neutronPair.rotateZ(random()*2*piG) # Initial random spin positions
            protonMi.add(neutronPair)
            protonMi.rotateX(piG)
        
        protonMi.position = [0,0,a*pP1pP2/2+(a-1)*p2p3/2-(p2p3/2+pP1pP2/2)*num]
        multiAlpha.add(protonMi)                
        num += 1
    return

def buildProtonAlphaSet(a): # Odd numbers, alphas and one proton.
    num = 0                 # a is the total # of protons
    while num < a:
        protonMi = Group()
        protonMi.add(Mesh(protonGeometry, protonMaterial))    
        emissionM2i = Mesh( emissionGeometry, emissionmaterial)
        emissionM2i.rotateX(piG)
        protonMi.add(Mesh(emissionGeometry, emissionmaterial))
        protonMi.add(emissionM2i)
        electronMi = Object3D()
        electronMi.add(Mesh(electronGeometry, electronMaterial))
        electronMi.position = [0,-e1e2/2,-p1e1]
        protonMi.add(electronMi)
        if num%2 != 0:
            neutronPair = Group()
            neutronMi = Object3D()
            neutronMi.add(Mesh(neutronGeometry, neutronMaterial))
            neutronMi.position = [0,-n1n2/2,-p1n1]
            neutronNi = Object3D()
            neutronNi.add(Mesh(neutronGeometry, neutronMaterial))
            neutronNi.position = [0,n1n2/2,-p1n1]
            neutronPair.add(neutronMi)
            neutronPair.add(neutronNi)
            neutronPair.rotateZ(random()*2*piG) # Initial random spin positions
            protonMi.add(neutronPair)
            protonMi.rotateX(piG)
        protonMi.position = [0,0,(a//2)*pP1pP2/2+(a//2)*p2p3/2-(p2p3/2+pP1pP2/2)*num]            
        pASet.add(protonMi)                
        num += 1
    return
        
# Assemble the atomic models.
for i in range( atomicNumber ):
    neutronGi = Object3D()
    neutronGi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronKi = Object3D()
    neutronKi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronLi = Object3D()
    neutronLi.add(Mesh(neutronGeometry, neutronMaterial))
    
    protonWoN = Group() # Proton Without a Neutron
    emissionWoN2 = Mesh( emissionGeometry, emissionmaterial)
    emissionWoN2.rotateX(piG)
    protonWoN.add(Mesh(protonGeometry, protonMaterial))
    protonWoN.add(Mesh(emissionGeometry, emissionmaterial))
    protonWoN.add(emissionWoN2)
    electronWoN = Object3D()
    electronWoN.add(Mesh(electronGeometry, electronMaterial))
    electronWoN.position = [0,-e1e2/2,-p1e1]
    protonWoN.add(electronWoN)  
    
    protonWiN = Group() # Proton With a Neutron
    emissionWiN2 = Mesh( emissionGeometry, emissionmaterial)
    emissionWiN2.rotateX(piG)
    protonWiN.add(Mesh(protonGeometry, protonMaterial))
    protonWiN.add(Mesh(emissionGeometry, emissionmaterial))
    protonWiN.add(emissionWiN2)
    electronWiN = Object3D()
    electronWiN.add(Mesh(electronGeometry, electronMaterial))
    electronWiN.position = [0,-e1e2/2,-p1e1]
    protonWiN.add(electronWiN)
    neutronWiN = Object3D()
    neutronWiN.add(Mesh(neutronGeometry, neutronMaterial))
    neutronWiN.position = [0,-n1n2/2,-p1n1]
    protonWiN.add(neutronWiN)

    if i == 0:
        if 1 == atomicNumber: # Hydrogen. Slot 1
            neutronWiN.position = [0,0,-p1n2]
            grpAn.add( protonWiN )
            print('protonWiN[',i+1,']', protonWiN.position)
        if 2 <= atomicNumber < 6: # Helium
            multiAlpha = Group()              
            buildMultiAlphas(1)
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 6 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(2)
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 7 <= atomicNumber < 10 :
            multiAlpha = Group()              
            buildMultiAlphas(3)
            grpAn.add(multiAlpha)
            maxZNeg = -p2p3/2 - pP1pP2 - 2*flipPN
            maxZPos = p2p3/2 + pP1pP2 + 2*flipPN
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
        if 10 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 36 <= atomicNumber < 54 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 1:
        if 2 < atomicNumber < 6:
            protonWoN.rotateX(-piG/2)            
            protonWoN.position = [0, 0, pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -pP1pP2/2
            maxZPos = pP1pP2/2+2*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 6 == atomicNumber : # Lithium
            protonWoN.rotateX(-piG/2)            
            protonWoN.position = [0, 0, p2p3/2+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -pP1pP2/2
            maxZPos = pP1pP2/2+2*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 7 <= atomicNumber < 10 : # Lithium
            protonWoN.rotateX(-piG/2)            
            protonWoN.position = [0, 0, 3*pP1pP2/2 + p2p3 + 2*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2 - p2p3/2
            maxZPos = pP1pP2/2+2*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 10 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0, pP1pP2/2 + 2*flipPN]
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,p1p2/2+pP1pP2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)                
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)              
        if 57 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)  
            pASet.position = [0,0,p2p3+pP1pP2+2*flipPN]
            grpBn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 2:
        if 3 < atomicNumber < 5: # Beryllium
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, -pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -pP1pP2/2-2*flipPN
            maxZPos = pP1pP2/2+2*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 5 == atomicNumber : # Beryllium
            protonWiN.rotateX(piG/2)
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, -p2p3/2, -pP1pP2/2-2*flipPN]
            neutronWiN.position = [0, 0, -p2p3]
            protonWiN.position = [0, p2p3/2, -pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            grpBn.add(protonWiN)
            maxZNeg = -pP1pP2/2-2*flipPN
            maxZPos = pP1pP2/2+2*flipPN
            print('protonWoN and Win[',i+1,']', protonWoN.position)
        if 6 == atomicNumber :
            protonWoN.rotateX(-piG/2)            
            protonWoN.position = [0, 0, -p2p3/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)            
        if 9 == atomicNumber :
            protonWiN.rotateX(piG/2)
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, -p2p3/2, -p2p3-3*pP1pP2/2-2*flipPN]
            neutronWiN.position = [0, 0, -p2p3]
            protonWiN.position = [0, p2p3/2, -p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            grpBn.add(protonWiN)
            print('protonWoN and Win[',i+1,']', protonWoN.position)            
        if 10 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0, -pP1pP2/2 - 2*flipPN]
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,-p1p2/2-pP1pP2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)  
        if 57 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)  
            pASet.position = [0,0,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 3:
        if 10 <= atomicNumber < 14: # Neon
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 0, pP1pP2 + 4*flipPN]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)  
        if 15 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 0, pP1pP2 + 4*flipPN]
            grpAn.add(multiAlpha)
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos = 3*pP1pP2/2+4*flipPN
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 16 == atomicNumber :
            protonWoN.position = [0, 0, pP1pP2/2 + 4*flipPN]
            grpAn.add(protonWoN)
            maxZNeg = -pP1pP2/2-4*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 17 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 0, pP1pP2 + 4*flipPN]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0,0,p1p2/2+pP1pP2+p1p2/2+pP1pP2+4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,2*p2p3+3*pP1pP2+4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)            
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0,0,2*p2p3+2*pP1pP2+4*flipPN]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,2*p2p3+3*pP1pP2+4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 4:
        if 10 <= atomicNumber < 14 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 0, -pP1pP2 - 4*flipPN]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)  
        if 15 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 0, -pP1pP2 - 4*flipPN]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 16 == atomicNumber :
            protonWoN.position = [0, 0, -pP1pP2/2 - 4*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -pP1pP2/2-4*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 17 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 0, -pP1pP2 - 4*flipPN]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 21 <= atomicNumber < 22 :
            neutronGi.position = [0,0,-3*pP1pP2/2-4*flipPN-p1p2]
            grpAn.add(neutronGi)
            print('and a neutron[',i+1,']', neutronGi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0,0,-p1p2/2-pP1pP2-p1p2/2-pP1pP2-4*flipPN]              
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)              
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,-2*p2p3-3*pP1pP2-4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0,0,-2*p2p3-2*pP1pP2-4*flipPN]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,-2*p2p3-3*pP1pP2-4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 5:
        if 11 <= atomicNumber  < 14 :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -pP1pP2/2-4*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 17 <= atomicNumber < 18 :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)  
        if 19 <= atomicNumber < 22 :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2-4*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 23 <= atomicNumber < 26 :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2-4*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 26 <= atomicNumber < 29:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 29 <= atomicNumber < 31:
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2-4*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 31 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 37 <= atomicNumber < 48:
            neutronWiN.position = [0,2*flipPN-p2p3,p2p3]            
            protonWiN.rotateX(-piG/2)    
            protonWiN.position = [0,-p2p3/2,3*p1p2/2+6*pP1pP2/2+6*flipPN]
            grpBn.add( protonWiN )
            maxZNeg = -3*p1p2/2-5*pP1pP2/2-4*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN            
            print('protonWiN[',i+1,']', protonWiN.position)
        if 48 <= atomicNumber < 50:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0, 0, 3*p1p2/2+6*pP1pP2/2+6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 50 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,3*p1p2/2+6*pP1pP2/2+6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)            
        if 51 <= atomicNumber < 54:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0, 0, 3*p1p2/2+6*pP1pP2/2+6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 55 <= atomicNumber < 57 :
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)
            maxZNeg = -3*p1p2/2-5*pP1pP2/2-4*flipPN  
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN            
        if 57 <= atomicNumber < 62:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0,3*p2p3+3*pP1pP2+6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)  
        if 62 <= atomicNumber < 66 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,3*p2p3+3*pP1pP2+6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 66 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+3*pP1pP2+6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 71 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 72 <= atomicNumber < 78 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 78 == atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 79 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 80 <= atomicNumber < 82 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
            
    if i == 6:
        if 12 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, -3*pP1pP2/2-6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 15 == atomicNumber:  
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0, -3*pP1pP2/2-6*flipPN]
            grpBn.add(protonWoN)
            print('protonWoN 1[',i+1,']', protonWoN.position)
        if 20 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0, -3*pP1pP2/2-6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN 1[',i+1,']', protonWoN.position)
        if 24 <= atomicNumber < 26:
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, -3*pP1pP2/2-6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 26 <= atomicNumber < 30 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0, 0, -3*pP1pP2/2-6*flipPN]
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 30 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, -3*pP1pP2/2-6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 31 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0, 0, -3*pP1pP2/2-6*flipPN]
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 38 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpBn.add( protonWoN )
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)              
        if 40 <= atomicNumber < 47:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpBn.add( protonWoN )
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN # verified
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN            
            print('protonWoN[',i+1,']', protonWoN.position)                
        if 47 <= atomicNumber < 50:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]                
            grpBn.add(multiAlpha)
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN # verified
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 50 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)
        if 51 <= atomicNumber < 54:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 56 == atomicNumber < 57:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*flipPN]
            grpBn.add( protonWoN )
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN # needed
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 57 <= atomicNumber < 63:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 63 <= atomicNumber < 66 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)            
        if 66 == atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 67 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 68 <= atomicNumber < 71 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 71 <= atomicNumber < 78 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 78 <= atomicNumber < 82 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
            
    if i == 7:
        if 13 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 2*flipPN, 0]
            grpAn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 14 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,pP1pP2/2+2*flipPN, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 15 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 2*flipPN, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 16 <= atomicNumber < 36:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,pP1pP2/2+2*flipPN, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,p1p2/2+pP1pP2+2*flipPN,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)                
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)                
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)
            pASet.position = [0,p2p3+pP1pP2+2*flipPN,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)

    if i == 8:
        if 13 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, -2*flipPN, 0]
            grpAn.add(protonWoN)#            
            maxZNeg = -pP1pP2/2-4*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 14 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-pP1pP2/2-2*flipPN, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 15 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, -2*flipPN, 0]
            grpAn.add(protonWoN)#            
            print('protonWoN[',i+1,']', protonWoN.position)
        if 16 <= atomicNumber < 36:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-pP1pP2/2-2*flipPN, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-2*flipPN-p1p2/2-pP1pP2,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)            
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)
            pASet.position = [0,-p2p3-pP1pP2-2*flipPN,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)

 
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Wed Sep 29, 2021 9:12 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Ytterb10
This image shows success at reordering 19 i-loop registers into a proper slot layout. More organized, easier to read and understand. The change – number the vertical z-column slots first, was necessary since the highest and lowest vertical slots are occupied before any of the front/back or left/right positions, as with magnesium (12, -||=||=||- ).

Post two of two.

Some atom layouts are incomplete since I tried to diagram to atoms as found in Miles' papers. I guess we could try to layout these from more recent papers and updates.
Understood, I was sorry to see them end. 90 atoms is a respectable number. You did a fine job assembling the images, organizing them into a periodic table and providing many slot layouts when there weren’t any images to go by. Complicated by the fact that atoms can also take on different forms. There’s likely a few more recent images, including molecular changes such as carbon to graphene (C 6,-||||-, graphene \//\\\ ) or water. I’m more concerned with neutrons. This project should help fill in the blanks, eventually it might display some alternative forms.
   
Was also thinking of using a python dataset to pass into functions rather than hardcoded vales per atom. Might provide more flexibility in some cases.
This is an ongoing learning experience. As it is, I keep going over and over the code, slowly improving it. All the objects, orientations, slots and positions certainly belong in some array where we may be able to call many atoms at once.

Yes was just looking to add a text label to the rendered.
Yeah, I was acting dumbfounded, rendering text is a whole nuther level of complications. Then again,  we might have multiple renderers, or not. I don’t really have any objection. Starting with the atomic name and number, I assume, or indicate otherwise.

I’ve rotated non-carousal grpBn objects around the atom’s center while the carousal was in motion. I’m new to keyframe animation and am reading up on it. I believe its possible to run a separate keyframe rotation animation for each and every slot, not just the carousal.  All those rotations would be about an axis not necessarily going through the atom or world center (0,0,0) but through the center of each slot object. Its gotta be simple, except for the quaternion arrays.
 
I’m dreading the process of getting this on-line. Your patience is appreciated.  

Code:

    if i == 9:
        if 14 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [pP1pP2/2+2*flipPN, 0, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 15 == atomicNumber :
            protonWoN.rotateX(-piG/2)
            protonWoN.rotateY(piG/2)
            protonWoN.position = [2*flipPN, 0, 0]
            grpAn.add(protonWoN)#            
            print('protonWoN[',i+1,']', protonWoN.position)
        if 16 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [pP1pP2/2+2*flipPN, 0, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 18 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [pP1pP2/2+2*flipPN, 0, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 21 == atomicNumber :
            neutronGi.position = [p2p3+pP1pP2+2*flipPN, 0, 0]
            grpAn.add(neutronGi)
            print('and a neutron[',i+1,']', neutronGi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [2*flipPN+p1p2/2+pP1pP2,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)          
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [p2p3+3*pP1pP2/2+2*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)            
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateY(piG/2)
            pASet.position = [p2p3+pP1pP2+2*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [p2p3+3*pP1pP2/2+2*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 10:
        if 14 == atomicNumber: # Silicon, the carousal level
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-pP1pP2/2-2*flipPN, 0, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 15 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.rotateY(piG/2)
            protonWoN.position = [-2*flipPN, 0, 0]
            grpAn.add(protonWoN)
            print('protonWoN 1[',i+1,']', protonWoN.position)
        if 16 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-pP1pP2/2-2*flipPN, 0, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)  
        if 18 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-pP1pP2/2-2*flipPN, 0, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 21 == atomicNumber :
            neutronGi.position = [-p2p3 -pP1pP2 - 2*flipPN, 0, 0]
            grpAn.add(neutronGi)
            print('and a neutron[',i+1,']', neutronGi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-2*flipPN-p1p2/2-pP1pP2,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-p2p3-3*pP1pP2/2-2*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateY(piG/2)
            pASet.position = [-p2p3-pP1pP2-2*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-p2p3-3*pP1pP2/2-2*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 11:
        if 21 == atomicNumber:
            protonWoN.rotateZ(piG/2)
            protonWoN.position = [0, pP1pP2 + 4*flipPN, 0]
            grpAn.add(protonWoN)
            print('protonWoN 1[',i+1,']', protonWoN.position)
        if 22 <= atomicNumber < 27:
            neutronWiN.position = [0,0, p1n2]            
            protonWiN.rotateZ(piG/2)    
            protonWiN.position = [0, pP1pP2+4*flipPN,0]
            grpAn.add( protonWiN )
            print('protonWiN[',i+1,']', protonWiN.position)
        if 27 == atomicNumber:
            neutronGi.position = [0,p1n2+pP1pP2+2*flipPN,0]
            grpAn.add( neutronGi )
            print('neutronGi[',i+1,']', neutronGi.position)
        if 28 == atomicNumber :
            neutronWiN.position = [0,0,-p1n2]
            protonWiN.rotateZ(piG/2)    
            protonWiN.position = [0, pP1pP2+4*flipPN,0]
            grpAn.add( protonWiN )
            print('protonWiN[',i+1,']', protonWiN.position)
        if 29 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateZ(piG/2)
            multiAlpha.position = [0,pP1pP2+4*flipPN,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)            
        if 42 <= atomicNumber < 47:
            protonWoN.position = [0,4*pP1pP2/2+p1p2+4*flipPN,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 47 <= atomicNumber < 54 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,4*pP1pP2/2+p1p2+4*flipPN,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 61:
            protonWoN.position = [0, 2*p2p3+2*pP1pP2+4*flipPN, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 61 <= atomicNumber < 67:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 2*p2p3+2*pP1pP2+4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 67 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, 2*p2p3+2*pP1pP2+4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 68 <= atomicNumber < 71 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, 2*p2p3+2*pP1pP2+4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 71 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 72 <= atomicNumber < 79:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 79 <= atomicNumber < 82 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber < 86:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 86 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
            
    if i == 12:
        if 21 == atomicNumber: # Silicon, the carousal level
            protonWoN.rotateZ(piG/2)
            protonWoN.position = [0, -pP1pP2 - 4*flipPN, 0]
            grpAn.add(protonWoN)
            print('protonWoN 1[',i+1,']', protonWoN.position)
        if 22 <= atomicNumber < 29: # Titanium
            neutronWiN.position = [0,0,-p1n2]            
            protonWiN.rotateZ(-piG/2)    
            protonWiN.position = [0,-pP1pP2-4*flipPN,0]
            grpAn.add( protonWiN )
            print('protonWiN[',i+1,']', protonWiN.position)
        if 29 <= atomicNumber < 36:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateZ(piG/2)
            multiAlpha.position = [0,-pP1pP2-4*flipPN,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 41 <= atomicNumber < 47:
            protonWoN.position = [0,-4*pP1pP2/2-p1p2-4*flipPN,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 47 <= atomicNumber < 54:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-4*pP1pP2/2-p1p2-4*flipPN,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 61:
            protonWoN.position = [0, -2*p2p3-2*pP1pP2-4*flipPN, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 61 <= atomicNumber < 67:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, -2*p2p3-2*pP1pP2-4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 67 <= atomicNumber < 68:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, -2*p2p3-2*pP1pP2-4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 68 <= atomicNumber < 71 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, -2*p2p3-2*pP1pP2-4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 71 <= atomicNumber < 79:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, -2*p2p3-3*pP1pP2-4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 79 <= atomicNumber < 82 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, -2*p2p3-3*pP1pP2-4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber < 86:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, -2*p2p3-3*pP1pP2-4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 86 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0, -2*p2p3-3*pP1pP2-4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
            
    if i == 13:
        if 22 <= atomicNumber < 27:
            neutronWiN.position = [0,0, -p1n2]            
            protonWiN.rotateZ(-piG/2)    
            protonWiN.position = [4*flipPN+pP1pP2,0,0]
            grpAn.add( protonWiN )
            print('protonWiN[',i+1,']', protonWiN.position)            
        if 27 <= atomicNumber < 36:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateZ(-piG/2)
            multiAlpha.position = [4*flipPN+pP1pP2,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)            
        if 39 <= atomicNumber < 48:        
            protonWoN.position = [4*pP1pP2/2+p1p2+4*flipPN,0,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 48 <= atomicNumber < 54:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [4*pP1pP2/2+p1p2+4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 63:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [2*p2p3+2*pP1pP2+4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 63 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [2*p2p3+2*pP1pP2+4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 71 <= atomicNumber < 74:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [2*p2p3+3*pP1pP2+4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 74 <= atomicNumber < 80:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [2*p2p3+3*pP1pP2+4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 80 <= atomicNumber < 82:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [2*p2p3+3*pP1pP2+4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [2*p2p3+3*pP1pP2+4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)

    if i == 14:
        if 22 <= atomicNumber < 28 :
            protonWoN.position = [-pP1pP2 - 4*flipPN, 0,0]
            grpAn.add(protonWoN)
            print('protonWoN 1[',i+1,']', protonWoN.position)
        if 28 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateZ(-piG/2)
            multiAlpha.position = [-4*flipPN+pP1pP2,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 29 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateZ(-piG/2)
            multiAlpha.position = [-4*flipPN-pP1pP2,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 39 <= atomicNumber < 48:
            protonWoN.position = [-4*pP1pP2/2-p1p2-4*flipPN,0,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 48 <= atomicNumber < 54:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [-4*pP1pP2/2-p1p2-4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)            
        if 57 <= atomicNumber < 63 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [-2*p2p3-2*pP1pP2-4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 63 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-2*pP1pP2-4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 71 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-3*pP1pP2-4*flipPN, 0, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 72 <= atomicNumber < 74 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 74 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 75 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 76 <= atomicNumber < 80 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 80 <= atomicNumber < 82:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
            
    if i == 15:
        if 27 <= atomicNumber < 30:
            neutronGi.position = [0,pP1pP2/2+p1n2,pP1pP2/2 + 2*flipPN]
            grpBn.add( neutronGi )
            print('hook neutron[',i+1,']', neutronGi.position)
        if 33 <= atomicNumber < 36:
            protonWoN.position = [0, pP1pP2/2+2*flipPN, pP1pP2/2+2*flipPN]
            grpBn.add( protonWoN )
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 46 <= atomicNumber < 48:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)            
        if 49 == atomicNumber:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)            
        if 53 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p1p2/2+pP1pP2+2*flipPN,p1p2/2+pP1pP2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)              
        if 60 <= atomicNumber < 62:
            protonWoN.position = [0,p2p3+pP1pP2+2*flipPN,p2p3+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)              
        if 64 <= atomicNumber < 66:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+pP1pP2+2*flipPN,p2p3+pP1pP2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)    
        if 70 == atomicNumber :
            protonWoN.position = [0,p2p3+pP1pP2+2*flipPN,p2p3+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)    
        if 72 <= atomicNumber < 74:
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)  
        if 75 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 77 <= atomicNumber < 80:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)            
        if 81 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)          
        if 82 == atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 83 <= atomicNumber < 86 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 87 <= atomicNumber < 89 :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)  
        if 89 <= atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        
    if i == 16:
        if 26 <= atomicNumber < 30:
            neutronGi.position = [0,-pP1pP2/2-p1n2,-pP1pP2/2 - 2*flipPN]
            grpBn.add( neutronGi )
            print('hook neutron[',i+1,']', neutronGi.position)            
        if 34 <= atomicNumber < 36:
            protonWoN.position = [0,-pP1pP2/2- 2*flipPN,-pP1pP2/2 - 2*flipPN]
            grpBn.add( protonWoN )
            print('hook protonWoN[',i+1,']', protonWoN.position)  
        if 45 <= atomicNumber < 48:            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 51 == atomicNumber:            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 53 == atomicNumber :            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 59 <= atomicNumber < 63 :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 65 <= atomicNumber < 66 :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 68 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 69 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)    
        if 70 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 72 == atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 73 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 74 == atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 75 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 77 <= atomicNumber < 80 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 81 <= atomicNumber < 84:
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 84 <= atomicNumber < 86 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 87 <= atomicNumber < 90 :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 90 <= atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        
    if i == 17:
        if 25 == atomicNumber: # Manganese
            protonWoN.position = [0,-pP1pP2/2-2*flipPN, pP1pP2/2+2*flipPN]
            grpBn.add( protonWoN )
            maxZNeg = -3*pP1pP2/2-8*flipPN
            maxZPos =  3*pP1pP2/2+8*flipPN
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 26 <= atomicNumber < 29:
            neutronGi.position = [0,-pP1pP2/2-p1n2,pP1pP2/2 + 2*flipPN]
            grpBn.add( neutronGi )            
            print('hook neutron[',i+1,']', neutronGi.position)
        if 29 <= atomicNumber < 30:
            neutrons = Group()
            neutronsPls(2)
            neutrons.rotateX(piG/2)
            neutrons.position = [0,-pP1pP2/2-p1n2,+pP1pP2/2+2*flipPN]
            grpBn.add( neutrons )            
            print('pair of hook neutrons[',i+1,']', neutrons.position)            
        if 30 <= atomicNumber < 36:
            protonWoN.position = [0,-pP1pP2/2-2*flipPN,pP1pP2/2+2*flipPN]
            grpBn.add( protonWoN )
            print('hook protonWoN[',i+1,']', protonWoN.position)  
        if 44 <= atomicNumber < 47:            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 50 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 51 == atomicNumber:            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 52 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 53 == atomicNumber :            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 57 <= atomicNumber < 68 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-pP1pP2-2*flipPN,p2p3+pP1pP2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 70 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,p2p3+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 71 == atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 76 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-pP1pP2-2*flipPN,p2p3+pP1pP2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 77 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,p2p3+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 80 <= atomicNumber < 81 :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 85 <= atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
            
    if i == 18:        
        if 26 <= atomicNumber < 29:
            neutronGi.position = [0,pP1pP2/2+p1n2,-pP1pP2/2 - 2*flipPN]
            grpBn.add( neutronGi )
            print('hook neutron[',i+1,']', neutronGi.position)
        if 29 <= atomicNumber < 30:
            neutrons = Group()
            neutronsPls(2)
            neutrons.rotateX(piG/2)
            neutrons.position = [0,pP1pP2/2+p1n2,-pP1pP2/2-2*flipPN]
            grpBn.add( neutrons )            
            print('pair of hook neutrons[',i+1,']', neutrons.position)          
        if 30 == atomicNumber :
            protonWoN.position =  [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 32 <= atomicNumber < 35 :
            protonWoN.position =  [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 35 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 43 <= atomicNumber < 47:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 50 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 51 == atomicNumber:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 52 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 53 == atomicNumber:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 57 == atomicNumber < 58:
            protonWoN.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 58 <= atomicNumber < 63:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 63 == atomicNumber :
            protonWoN.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 66 <= atomicNumber < 68 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 68 <= atomicNumber < 71:
            protonWoN.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 71 == atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 74 == atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 76 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 80 <= atomicNumber < 81:
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 86 == atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 88 <= atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)          

caroRate = 4
grpAn.position = [0,0,(-maxZNeg + maxZPos)/2 - maxZPos]
grpBn.position = [0,0,(-maxZNeg + maxZPos)/2 - maxZPos]


In[6]
scene = Scene(children=[grpAn, grpBn, grpB2, camera, key_light, ambient_light])
controller = OrbitControls(controlling=camera, screenSpacePanning=True)

In[7]
renderer = Renderer(camera=camera, scene=scene, controls=[controller],
                    width=view_width, height=view_height)
scene = Scene()  # initialising the scene

In[8]
spinC_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, caroRate], values=[0, 2*piG])
spinC_clip = AnimationClip(tracks=[spinC_track])
spinC_action = AnimationAction(AnimationMixer(grpAn), spinC_clip, grpAn)
spinC_action

In[9]
renderer

Code lines 895 - 1707
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Sat Oct 02, 2021 1:51 am

Looks really nice LTAM.  I see the remapping of the higher levels with the latest version.  Nice.

I added this code to try and import the MilesPeriodicTable.txt file that is tab separated. Trying to build up a loop for it.

Code:
# In[1]:
from pythreejs import *
from IPython.display import display
import ipywidgets
from math import sqrt
from random import random , randint , seed


# Pandas DF operation
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from numpy import array

# Permanently changes the pandas settings
pd.set_option('display.max_rows', None)
pd.set_option('display.max_columns', None)
pd.set_option('display.width', None)
pd.set_option('display.max_colwidth', None)

pd_df = pd.read_csv('C:\SparkInstall\data\MathisPeriodicTable.txt', sep='\t', header='infer', encoding = 'unicode_escape', engine='python')
pd_df.fillna('',inplace=True)
display(pd_df)

pd.reset_option('all')


Was also looking at this K3D library since it is more like Matlab. Just something to look at:

https://k3d-jupyter.org/showcase/index.html

https://github.com/K3D-tools/K3D-jupyter

Conda installer: conda install -c conda-forge k3d

Chromium6

Posts : 727
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Sat Oct 02, 2021 5:38 pm

.
This latest code includes a few changes. Pardon the details: agony, ecstasy, etc.

1. An Atomic Label. Reviewed a dozen sources, starting at threejs.org,
https://threejs.org/docs/?q=text#manual/en/introduction/Creating-text
looking for a working example of text in the rendered display that I might apply to a pythreejs jupyter notebook. CSS Markup is gibberish to me and I became frustrated then angry at the thought of importing fonts and using a geometric extrusion class and the ballooning code.
https://notebook.community/joequant/bitquant/bitstation/web/home/examples/pythreejs-example
I found this line.
Code:
scene = Scene(children=[camera, ambient_light, make_text(‘Hello World’, height=0.6])])
I included the make_text() in our atomic scene and sure enough, there was ‘Hello World’ at 0,0,0, snuggled between and within helium’s protons. As you move the camera about, the text always remains at the same location while always facing the camera/viewer. I tried possible arguments and values and in one error, jupyter informed me the text is a sprite. Ok, Pretty nifty. I’ve changed the label’s size and location, one should also be able change the label’s proportions, the default font or color. As see in similar, more elaborate threejs examples. One alternative is a spread out polygonal formation of labels (6,Cool which reduce the possibility of having a label between you and the atom, while one or more labels is within the rendered view behind the atom. Something to play with. I searched for documentation on make_text() at Ipython, ipywidgets, and google, without success. Let me know what you think.

Continued in next post.

First 1044 lines
Code:

In[1]:
from pythreejs import *
from IPython.display import display
import ipywidgets as widgets
from math import sqrt
from random import random , randint , seed
phi = (1+sqrt(5))/2  # calculating phi-based-pi, piG.
piG = 4/sqrt(phi)    # piG is used instead of pi.

In[2]:
view_width = 600
view_height = 400
camera = PerspectiveCamera(position=[5, 0, 0], up=[0, 0, 1], aspect=view_width/view_height)
#camera = PerspectiveCamera(position=[5, 0, 0], up=[1, 0, 0], aspect=view_width/view_height)
camera = PerspectiveCamera(position=[5, 0, 0], up=[0, 1, 0], aspect=view_width/view_height)
key_light = DirectionalLight(position=[0, 5, 5])
ambient_light = AmbientLight()

In[3]
elements = ((' 1 Hydrogen H ',1),(' 2 Helium He ',2),(' 3 Lithium Li ',3),(' 4 Beryllium Be ',4),
            (' 5 Boron B ',5),(' 6 Carbon C ',6),(' 7 Nitrogen N ',7),(' 8 Oxygen O ',8),
            (' 9 Fluorine F ',9),(' 10 Neon Ne ',10),(' 11 Sodium Na ',11),(' 12 Magnesium Mg ',12),
            (' 13 Aluminum Al ',13),(' 14 Silicon Si ',14),(' 15 Phosphorus P ',15),(' 16 Sulfur S ',16),
            (' 17 Chlorine Cl ',17),(' 18 Argon Ar ',18),(' 19 Potassium P ',19),(' 20 Calcium Ca ',20),
            (' 21 Scandium Sc ',21),(' 22 Titanium Ti ',22),(' 23 Vanadium V ',23),(' 24 Chromium Cr ',24),
            (' 25 Manganese Mn ',25),(' 26 Iron Fe ',26),(' 27 Cobalt Co ',27),(' 28 Nickel Ni ',28),
            (' 29 Copper Cu ',29),(' 30 Zinc Zn ',30),(' 31 Gallium Ga ',31),(' 32 Germanium Ge ',32),
            (' 33 Arsenic As ',33),(' 34 Selenium Se ',34),(' 35 Bromine Br ',35),(' 36 Krypton Kr ',36),
            (' 37 Rubidium Rb ',37),(' 38 Strontium Sr ',38),(' 39 Yttrium Y ',39),(' 40 Zirconium Zr ',40),
            (' 41 Niobium Nb ',41),(' 42 Molybdenum Mo ',42),(' 43 Technetium Tc ',43),(' 44 Ruthenium Ru ',44),
            (' 45 Rhodium Rh ',45),(' 46 Palladium Pd ',46),(' 47 Silver Ag ',47),(' 48 Cadmium Cd ',48),
            (' 49 Indium In ',49),(' 50 Tin Sn ',50),(' 51 Antimony Sb ',51),(' 52 Tellurium Te ',52),
            (' 53 Iodine I ',53),(' 54 Xenon Xe ',54),(' 55 Caesium Cs ',55),(' 56 Barium Ba ',56),
            (' 57 Lanthanum La ',57),(' 58 Cerium Ce ',58),(' 59 Praseodymium Pr ',59),(' 60 Neodymium Nd ',60),
            (' 61 Promethium Pm ',61),(' 62 Samarium Sm ',62),(' 63 Europium Eu ',63),(' 64 Gadolinium Gd ',64),
            (' 65 Terbium Tb ',65),(' 66 Dysprosium Dy ',66),(' 67 Holmium Ho ',67),(' 68 Erbium Er ',68),
            (' 69 Thulium Tm ',69),(' 70 Ytterbium Yb ',70),(' 71 Lutetium Lu ',71),(' 72 Hafnium Hf ',72),
            (' 73 Tantalum Ta ',73),(' 74 Tungsten W ',74),(' 75 Rhenium Re ',75),(' 76 Osmium Os ',76),
            (' 77 Iridium Ir ',77),(' 78 Platinum Pt ',78),(' 79 Gold Au ',79),(' 80 Mercury Hg ',80),
            (' 81 Thallium Tl ',81),(' 82 Lead Pb ',82),(' 83 Bismuth Bi ',83),(' 84 Polonium Po ',84),
            (' 85 Astatine At ',85),(' 86 Radon Rn ',86),(' 87 Francium Fr ',87),(' 88 Radium Ra ',88),
            (' 89 Actinium Ac ',89),(' 90 Thorium Th ',90));

In[4]
selectAtom = widgets.Dropdown(
    options= elements,
    value=2, # default
    description='Atom:',
)

atomsLabel = widgets.Checkbox(
    value=False,
    description='Include Atomic label?',
    disabled=False,
    indent=False
)

selectAtom

In[5]
atomsLabel

In[6]
def handle_change(change):
    global number
    
selectAtom.observe(handle_change, 'value')

number = selectAtom.value

In[7]
An = elements[number-1]
atomicLabel = An[0]
print(atomicLabel)

In[8]
atomicNumber = number  # Select the desired atom from the dropdown widget
grpAn = Group()  # The rotation widget spins grpAn, slots 1,4 and 5.  
grpBn = Group()  # grpBn are the orthogonal top, bottom and hook slots.
grpB2 = Group()  # intended to display 'orthogonal' spins in slots 2 & 3
#grpB3 = Group()  

# Dimensions

pRadius = 0.05
pP1pP2 = 3*pRadius #1.5 # Proton 1 to proton 2, Pole-to-pole separation.
nRadius = pRadius*1.125 # 0.6
eRadius = 2*pRadius/10
emRadius = pRadius * 12 # 6.0
p1p2 = pRadius*2.5  # small gap
p2p3 = pRadius*2.85  # small gap
n1n2 = 8*pRadius # 4.0  # Alpha, left-right (y) neutron-neutron orbital separation
p1n1 = pP1pP2/2 # Alpha, up-down (z) proton-orbital neutron separation
p1n2 = pRadius + nRadius + 1.5*pRadius  # In line proton and neutron
p1e1 = pRadius + 1.5*pP1pP2/10  # Alpha, top-bottom (z) proton-electron separation
e1e2 = 1.5*pRadius # pRadius/0.75  # 0.5  # electron-electron separation
flipPN = pRadius*6 # 3 # Dist. between adjacent vertical and horiz protons
maxZNeg = 0.0 # maxZNeg and maxZPos are Used to center(z) the atom on the screen
maxZPos = 0.0  
caroRate = 6  # animation time in seconds to complete a single carousal rotation
              # should be dependent on the selected atrom's x and y extents.

# Proton set Geometries and Materials
protonGeometry =  SphereBufferGeometry(pRadius, 24, 16)
neutronGeometry =  SphereBufferGeometry(nRadius, 24, 16)
electronGeometry =  SphereBufferGeometry(eRadius, 8, 16)
emissionGeometry = CircleGeometry(emRadius, 24)

protonMaterial = MeshStandardMaterial(color='blue')
protonMaterialB = MeshStandardMaterial(color='green')
neutronMaterial = MeshStandardMaterial(color='red')
neutronMaterialB = MeshStandardMaterial(color='green')
electronMaterial = MeshStandardMaterial(color='cyan')
emissionmaterial = MeshStandardMaterial(color='gray',
    transparent = True,opacity = 0.25)

def neutronsPls(n): # n is the total number of neutrons, 1 or 2
    neutron1 = Object3D()
    neutron1.add(Mesh(neutronGeometry, neutronMaterial))
    if n == 1 :
        neutron1.position = [0,0,0] # the register can move the neut if needed
        neutrons.add(neutron1)
    elif n == 2 :
        neutron1.position = [0,-p2p3,0]
        neutrons.add(neutron1)
        neutron2 = Object3D()
        neutron2.add(Mesh(neutronGeometry, neutronMaterial))
        neutron2.position = [0,p2p3,0]        
        neutrons.add(neutron2)        
        neutrons.rotateY(random()*2*piG) # Initial random spin positions
    return

def buildMultiAlphas(a): # a is the number of alphas. 1,2,3, ...  
    num = 0          
    while num < a*2 :
        protonMi = Group()
        protonMi.add(Mesh(protonGeometry, protonMaterial))    
        emissionM2i = Mesh( emissionGeometry, emissionmaterial)
        emissionM2i.rotateX(piG)
        protonMi.add(Mesh(emissionGeometry, emissionmaterial))
        protonMi.add(emissionM2i)
        electronMi = Object3D()
        electronMi.add(Mesh(electronGeometry, electronMaterial))
        electronMi.position = [0,-e1e2/2 ,-p1e1]
        protonMi.add(electronMi)
        if num%2 != 0:
            neutronPair = Group()
            neutronMi = Object3D()
            neutronMi.add(Mesh(neutronGeometry, neutronMaterial))
            neutronMi.position = [0,-n1n2/2,-p1n1]
            neutronNi = Object3D()
            neutronNi.add(Mesh(neutronGeometry, neutronMaterial))
            #neutronNi.add(Mesh(neutronGeometry, neutronMaterialB))
            neutronNi.position = [0,n1n2/2,-p1n1]
            neutronPair.add(neutronMi)
            neutronPair.add(neutronNi)
            neutronPair.rotateZ(random()*2*piG) # Initial random spin positions
            protonMi.add(neutronPair)
            protonMi.rotateX(piG)
        
        protonMi.position = [0,0,a*pP1pP2/2+(a-1)*p2p3/2-(p2p3/2+pP1pP2/2)*num]
        multiAlpha.add(protonMi)                
        num += 1
    return

def buildProtonAlphaSet(a): # Odd numbers, alphas and one proton.
    num = 0                 # a is the total # of protons
    while num < a:
        protonMi = Group()
        protonMi.add(Mesh(protonGeometry, protonMaterial))    
        emissionM2i = Mesh( emissionGeometry, emissionmaterial)
        emissionM2i.rotateX(piG)
        protonMi.add(Mesh(emissionGeometry, emissionmaterial))
        protonMi.add(emissionM2i)
        electronMi = Object3D()
        electronMi.add(Mesh(electronGeometry, electronMaterial))
        electronMi.position = [0,-e1e2/2,-p1e1]
        protonMi.add(electronMi)
        if num%2 != 0:
            neutronPair = Group()
            neutronMi = Object3D()
            neutronMi.add(Mesh(neutronGeometry, neutronMaterial))
            neutronMi.position = [0,-n1n2/2,-p1n1]
            neutronNi = Object3D()
            neutronNi.add(Mesh(neutronGeometry, neutronMaterial))
            neutronNi.position = [0,n1n2/2,-p1n1]
            neutronPair.add(neutronMi)
            neutronPair.add(neutronNi)
            neutronPair.rotateZ(random()*2*piG) # Initial random spin positions
            protonMi.add(neutronPair)
            protonMi.rotateX(piG)
        protonMi.position = [0,0,(a//2)*pP1pP2/2+(a//2)*p2p3/2-(p2p3/2+pP1pP2/2)*num]            
        pASet.add(protonMi)                
        num += 1
    return
        
# Assemble the atomic models.
for i in range( atomicNumber ):
    neutronGi = Object3D()
    neutronGi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronKi = Object3D()
    neutronKi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronLi = Object3D()
    neutronLi.add(Mesh(neutronGeometry, neutronMaterial))
    
    protonWoN = Group() # Proton Without a Neutron
    emissionWoN2 = Mesh( emissionGeometry, emissionmaterial)
    emissionWoN2.rotateX(piG)
    protonWoN.add(Mesh(protonGeometry, protonMaterial))
    protonWoN.add(Mesh(emissionGeometry, emissionmaterial))
    protonWoN.add(emissionWoN2)
    electronWoN = Object3D()
    electronWoN.add(Mesh(electronGeometry, electronMaterial))
    electronWoN.position = [0,-e1e2/2,-p1e1]
    protonWoN.add(electronWoN)  
    
    protonWiN = Group() # Proton With a Neutron
    emissionWiN2 = Mesh( emissionGeometry, emissionmaterial)
    emissionWiN2.rotateX(piG)
    protonWiN.add(Mesh(protonGeometry, protonMaterial))
    protonWiN.add(Mesh(emissionGeometry, emissionmaterial))
    protonWiN.add(emissionWiN2)
    electronWiN = Object3D()
    electronWiN.add(Mesh(electronGeometry, electronMaterial))
    electronWiN.position = [0,-e1e2/2,-p1e1]
    protonWiN.add(electronWiN)
    neutronWiN = Object3D()
    neutronWiN.add(Mesh(neutronGeometry, neutronMaterial))
    neutronWiN.position = [0,-n1n2/2,-p1n1]
    protonWiN.add(neutronWiN)

    if i == 0:
        if 1 == atomicNumber: # Hydrogen. Slot 1
            neutronWiN.position = [0,0,-p1n2]
            grpAn.add( protonWiN )
            print('protonWiN[',i+1,']', protonWiN.position)
        if 2 <= atomicNumber < 6: # Helium
            multiAlpha = Group()              
            buildMultiAlphas(1)
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 6 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(2)
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 7 <= atomicNumber < 10 :
            multiAlpha = Group()              
            buildMultiAlphas(3)
            grpAn.add(multiAlpha)
            maxZNeg = -p2p3/2 - pP1pP2 - 2*flipPN
            maxZPos = p2p3/2 + pP1pP2 + 2*flipPN
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
        if 10 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 36 <= atomicNumber < 54 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 1:
        if 2 < atomicNumber < 6:
            protonWoN.rotateX(-piG/2)            
            protonWoN.position = [0, 0, pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -pP1pP2/2
            maxZPos = pP1pP2/2+2*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 6 == atomicNumber : # Lithium
            protonWoN.rotateX(-piG/2)            
            protonWoN.position = [0, 0, p2p3/2+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -pP1pP2/2
            maxZPos = pP1pP2/2+2*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 7 <= atomicNumber < 10 : # Lithium
            protonWoN.rotateX(-piG/2)            
            protonWoN.position = [0, 0, 3*pP1pP2/2 + p2p3 + 2*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2 - p2p3/2
            maxZPos = pP1pP2/2+2*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 10 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0, pP1pP2/2 + 2*flipPN]
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,p1p2/2+pP1pP2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)                
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)  
            pASet.position = [0,0,p2p3+pP1pP2+2*flipPN]
            grpBn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 2:
        if 3 < atomicNumber < 5: # Beryllium
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, -pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -pP1pP2/2-2*flipPN
            maxZPos = pP1pP2/2+2*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 5 == atomicNumber : # Beryllium
            protonWiN.rotateX(piG/2)
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, -p2p3/2, -pP1pP2/2-2*flipPN]
            neutronWiN.position = [0, 0, -p2p3]
            protonWiN.position = [0, p2p3/2, -pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            grpBn.add(protonWiN)
            maxZNeg = -pP1pP2/2-2*flipPN
            maxZPos = pP1pP2/2+2*flipPN
            print('protonWoN and Win[',i+1,']', protonWoN.position)
        if 6 == atomicNumber :
            protonWoN.rotateX(-piG/2)            
            protonWoN.position = [0, 0, -p2p3/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)            
        if 9 == atomicNumber :
            protonWiN.rotateX(piG/2)
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, -p2p3/2, -p2p3-3*pP1pP2/2-2*flipPN]
            neutronWiN.position = [0, 0, -p2p3]
            protonWiN.position = [0, p2p3/2, -p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            grpBn.add(protonWiN)
            print('protonWoN and Win[',i+1,']', protonWoN.position)            
        if 10 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0, -pP1pP2/2 - 2*flipPN]
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,-p1p2/2-pP1pP2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)  
        if 57 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)  
            pASet.position = [0,0,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 3:
        if 10 <= atomicNumber < 14: # Neon
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 0, pP1pP2 + 4*flipPN]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)  
        if 15 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 0, pP1pP2 + 4*flipPN]
            grpAn.add(multiAlpha)
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos = 3*pP1pP2/2+4*flipPN
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 16 == atomicNumber :
            protonWoN.position = [0, 0, pP1pP2/2 + 4*flipPN]
            grpAn.add(protonWoN)
            maxZNeg = -pP1pP2/2-4*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 17 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 0, pP1pP2 + 4*flipPN]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0,0,p1p2/2+pP1pP2+p1p2/2+pP1pP2+4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,2*p2p3+3*pP1pP2+4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)            
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0,0,2*p2p3+2*pP1pP2+4*flipPN]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,2*p2p3+3*pP1pP2+4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 4:
        if 10 <= atomicNumber < 14 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 0, -pP1pP2 - 4*flipPN]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)  
        if 15 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 0, -pP1pP2 - 4*flipPN]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 16 == atomicNumber :
            protonWoN.position = [0, 0, -pP1pP2/2 - 4*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -pP1pP2/2-4*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 17 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 0, -pP1pP2 - 4*flipPN]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 21 <= atomicNumber < 22 :
            neutronGi.position = [0,0,-3*pP1pP2/2-4*flipPN-p1p2]
            grpAn.add(neutronGi)
            print('and a neutron[',i+1,']', neutronGi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0,0,-p1p2/2-pP1pP2-p1p2/2-pP1pP2-4*flipPN]              
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)              
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,-2*p2p3-3*pP1pP2-4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0,0,-2*p2p3-2*pP1pP2-4*flipPN]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,-2*p2p3-3*pP1pP2-4*flipPN]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 5:
        if 11 <= atomicNumber  < 14 :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -pP1pP2/2-4*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 17 <= atomicNumber < 18 :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)  
        if 19 <= atomicNumber < 22 :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2-4*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 23 <= atomicNumber < 26 :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2-4*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 26 <= atomicNumber < 29:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 29 <= atomicNumber < 31:
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2-4*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 31 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0, 0, 3*pP1pP2/2+6*flipPN]
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 37 <= atomicNumber < 48:
            neutronWiN.position = [0,2*flipPN-p2p3,p2p3]            
            protonWiN.rotateX(-piG/2)    
            protonWiN.position = [0,-p2p3/2,3*p1p2/2+6*pP1pP2/2+6*flipPN]
            grpBn.add( protonWiN )
            maxZNeg = -3*p1p2/2-5*pP1pP2/2-4*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN            
            print('protonWiN[',i+1,']', protonWiN.position)
        if 48 <= atomicNumber < 50:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0, 0, 3*p1p2/2+6*pP1pP2/2+6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 50 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,3*p1p2/2+6*pP1pP2/2+6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)            
        if 51 <= atomicNumber < 54:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0, 0, 3*p1p2/2+6*pP1pP2/2+6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 55 <= atomicNumber < 57 :
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)
            maxZNeg = -3*p1p2/2-5*pP1pP2/2-4*flipPN  
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN            
        if 57 <= atomicNumber < 62:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0,3*p2p3+3*pP1pP2+6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)  
        if 62 <= atomicNumber < 66 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,3*p2p3+3*pP1pP2+6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 66 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+3*pP1pP2+6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 71 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 72 <= atomicNumber < 78 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 78 == atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 79 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 80 <= atomicNumber < 82 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+4.5*pP1pP2+6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
            
    if i == 6:
        if 12 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, -3*pP1pP2/2-6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 15 == atomicNumber:  
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0, -3*pP1pP2/2-6*flipPN]
            grpBn.add(protonWoN)
            print('protonWoN 1[',i+1,']', protonWoN.position)
        if 20 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0, -3*pP1pP2/2-6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN 1[',i+1,']', protonWoN.position)
        if 24 <= atomicNumber < 26:
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, -3*pP1pP2/2-6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 26 <= atomicNumber < 30 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0, 0, -3*pP1pP2/2-6*flipPN]
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 30 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, -3*pP1pP2/2-6*flipPN]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 31 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0, 0, -3*pP1pP2/2-6*flipPN]
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 38 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpBn.add( protonWoN )
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)              
        if 40 <= atomicNumber < 47:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpBn.add( protonWoN )
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN # verified
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN            
            print('protonWoN[',i+1,']', protonWoN.position)                
        if 47 <= atomicNumber < 50:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]                
            grpBn.add(multiAlpha)
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN # verified
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 50 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)
        if 51 <= atomicNumber < 54:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 56 == atomicNumber < 57:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*flipPN]
            grpBn.add( protonWoN )
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*flipPN # needed
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 57 <= atomicNumber < 63:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 63 <= atomicNumber < 66 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)            
        if 66 == atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 67 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 68 <= atomicNumber < 71 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-3*pP1pP2-6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 71 <= atomicNumber < 78 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 78 <= atomicNumber < 82 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*flipPN]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*flipPN]  
            grpBn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
            
    if i == 7:
        if 13 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 2*flipPN, 0]
            grpAn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 14 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,pP1pP2/2+2*flipPN, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 15 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 2*flipPN, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 16 <= atomicNumber < 36:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,pP1pP2/2+2*flipPN, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,p1p2/2+pP1pP2+2*flipPN,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)                
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)                
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)
            pASet.position = [0,p2p3+pP1pP2+2*flipPN,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 8:
        if 13 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, -2*flipPN, 0]
            grpAn.add(protonWoN)#            
            maxZNeg = -pP1pP2/2-4*flipPN
            maxZPos = 3*pP1pP2/2+6*flipPN
            print('protonWoN[',i+1,']', protonWoN.position)
        if 14 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-pP1pP2/2-2*flipPN, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 15 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, -2*flipPN, 0]
            grpAn.add(protonWoN)#            
            print('protonWoN[',i+1,']', protonWoN.position)
        if 16 <= atomicNumber < 36:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-pP1pP2/2-2*flipPN, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-2*flipPN-p1p2/2-pP1pP2,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)            
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)
            pASet.position = [0,-p2p3-pP1pP2-2*flipPN,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 9:
        if 14 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [pP1pP2/2+2*flipPN, 0, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 15 == atomicNumber :
            protonWoN.rotateX(-piG/2)
            protonWoN.rotateY(piG/2)
            protonWoN.position = [2*flipPN, 0, 0]
            grpAn.add(protonWoN)#            
            print('protonWoN[',i+1,']', protonWoN.position)
        if 16 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [pP1pP2/2+2*flipPN, 0, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 18 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [pP1pP2/2+2*flipPN, 0, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 21 == atomicNumber :
            neutronGi.position = [p2p3+pP1pP2+2*flipPN, 0, 0]
            grpAn.add(neutronGi)
            print('and a neutron[',i+1,']', neutronGi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [2*flipPN+p1p2/2+pP1pP2,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)          
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [p2p3+3*pP1pP2/2+2*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)            
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateY(piG/2)
            pASet.position = [p2p3+pP1pP2+2*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [p2p3+3*pP1pP2/2+2*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
            
    if i == 10:
        if 14 == atomicNumber: # Silicon, the carousal level
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-pP1pP2/2-2*flipPN, 0, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 15 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.rotateY(piG/2)
            protonWoN.position = [-2*flipPN, 0, 0]
            grpAn.add(protonWoN)
            print('protonWoN 1[',i+1,']', protonWoN.position)
        if 16 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-pP1pP2/2-2*flipPN, 0, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)  
        if 18 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-pP1pP2/2-2*flipPN, 0, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 21 == atomicNumber :
            neutronGi.position = [-p2p3 -pP1pP2 - 2*flipPN, 0, 0]
            grpAn.add(neutronGi)
            print('and a neutron[',i+1,']', neutronGi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-2*flipPN-p1p2/2-pP1pP2,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-p2p3-3*pP1pP2/2-2*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateY(piG/2)
            pASet.position = [-p2p3-pP1pP2-2*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-p2p3-3*pP1pP2/2-2*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 3[',i+1,']', multiAlpha.position)
Continued in next post.

.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Sat Oct 02, 2021 5:48 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Rheniu10

2. All Atomic dimensions are now in proton radius “units”. For example, the neutron radius, nRadius = pRadius*1.125. The single hard number is the proton radius. A bit of organizing I should have done sooner. Changing the proton radius from 0.5 to 0.05, makes no difference to the atoms’ appearance (cameras and lights may need small adjustments) but the label became 10x larger and easier to work with.

3. In[3]. elements has been changed from a list to a tuple array. One tuple for each atom, comprised of a (“label”,  and a value), i.e. (“ 42 Molybdenum Mo ”, 42). The label is the text used as the atomic label, and the value is the atomic number.

4. The user now selects the desired atom from a dropdown list. I believe it’s easier than using a keyboard entry. Nevyn included one in his atomic viewer. We’re already using a widget, why not more? I found a good tutorial on the subject, and recreated many of the examples shown.
Jupyter Interactive Widget Ecosystem Tutorial | SciPy 2020 | Craig, Renou, Dafna, Bektas.


https://www.youtube.com/watch?v=8IYbdshUd9c

One of them being the dropdown widget. I also learned that our carousal rotation widget, spinC_action, can be open in different locations at the same time, now above and below the renderer to see which is closest to the rendered output.

5. Atomic label on/off checkbox option. Another widget, a checkbox allowing the user the option of including the atomic label or not.

K3D looks interesting, the three grid planes behind the object of interest is a bit much. The examples include a much nicer dat gui than widgets. Custom widgets is an option I skipped at the end of the tutorial. We’d only need a few user controllable variables unless we go crazy. The alternatives can be overwhelming.

code lines 1045 - 1736
Code:

          
    if i == 11:
        if 21 == atomicNumber:
            protonWoN.rotateZ(piG/2)
            protonWoN.position = [0, pP1pP2 + 4*flipPN, 0]
            grpAn.add(protonWoN)
            print('protonWoN 1[',i+1,']', protonWoN.position)
        if 22 <= atomicNumber < 27:
            neutronWiN.position = [0,0, p1n2]            
            protonWiN.rotateZ(piG/2)    
            protonWiN.position = [0, pP1pP2+4*flipPN,0]
            grpAn.add( protonWiN )
            print('protonWiN[',i+1,']', protonWiN.position)
        if 27 == atomicNumber:
            neutronGi.position = [0,p1n2+pP1pP2+2*flipPN,0]
            grpAn.add( neutronGi )
            print('neutronGi[',i+1,']', neutronGi.position)
        if 28 == atomicNumber :
            neutronWiN.position = [0,0,-p1n2]
            protonWiN.rotateZ(piG/2)    
            protonWiN.position = [0, pP1pP2+4*flipPN,0]
            grpAn.add( protonWiN )
            print('protonWiN[',i+1,']', protonWiN.position)
        if 29 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateZ(piG/2)
            multiAlpha.position = [0,pP1pP2+4*flipPN,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)            
        if 42 <= atomicNumber < 47:
            protonWoN.position = [0,4*pP1pP2/2+p1p2+4*flipPN,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 47 <= atomicNumber < 54 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,4*pP1pP2/2+p1p2+4*flipPN,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 61:
            protonWoN.position = [0, 2*p2p3+2*pP1pP2+4*flipPN, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 61 <= atomicNumber < 67:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 2*p2p3+2*pP1pP2+4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 67 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, 2*p2p3+2*pP1pP2+4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 68 <= atomicNumber < 71 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, 2*p2p3+2*pP1pP2+4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 71 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 72 <= atomicNumber < 79:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 79 <= atomicNumber < 82 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber < 86:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 86 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0, 2*p2p3+3*pP1pP2+4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
            
    if i == 12:
        if 21 == atomicNumber: # Silicon, the carousal level
            protonWoN.rotateZ(piG/2)
            protonWoN.position = [0, -pP1pP2 - 4*flipPN, 0]
            grpAn.add(protonWoN)
            print('protonWoN 1[',i+1,']', protonWoN.position)
        if 22 <= atomicNumber < 29: # Titanium
            neutronWiN.position = [0,0,-p1n2]            
            protonWiN.rotateZ(-piG/2)    
            protonWiN.position = [0,-pP1pP2-4*flipPN,0]
            grpAn.add( protonWiN )
            print('protonWiN[',i+1,']', protonWiN.position)
        if 29 <= atomicNumber < 36:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateZ(piG/2)
            multiAlpha.position = [0,-pP1pP2-4*flipPN,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 41 <= atomicNumber < 47:
            protonWoN.position = [0,-4*pP1pP2/2-p1p2-4*flipPN,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 47 <= atomicNumber < 54:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-4*pP1pP2/2-p1p2-4*flipPN,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 61:
            protonWoN.position = [0, -2*p2p3-2*pP1pP2-4*flipPN, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 61 <= atomicNumber < 67:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, -2*p2p3-2*pP1pP2-4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 67 <= atomicNumber < 68:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, -2*p2p3-2*pP1pP2-4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 68 <= atomicNumber < 71 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, -2*p2p3-2*pP1pP2-4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 71 <= atomicNumber < 79:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, -2*p2p3-3*pP1pP2-4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 79 <= atomicNumber < 82 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, -2*p2p3-3*pP1pP2-4*flipPN, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber < 86:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, -2*p2p3-3*pP1pP2-4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 86 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0, -2*p2p3-3*pP1pP2-4*flipPN, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
            
    if i == 13:
        if 22 <= atomicNumber < 27:
            neutronWiN.position = [0,0, -p1n2]            
            protonWiN.rotateZ(-piG/2)    
            protonWiN.position = [4*flipPN+pP1pP2,0,0]
            grpAn.add( protonWiN )
            print('protonWiN[',i+1,']', protonWiN.position)            
        if 27 <= atomicNumber < 36:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateZ(-piG/2)
            multiAlpha.position = [4*flipPN+pP1pP2,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)            
        if 39 <= atomicNumber < 48:        
            protonWoN.position = [4*pP1pP2/2+p1p2+4*flipPN,0,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 48 <= atomicNumber < 54:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [4*pP1pP2/2+p1p2+4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 63:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [2*p2p3+2*pP1pP2+4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 63 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [2*p2p3+2*pP1pP2+4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 71 <= atomicNumber < 74:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [2*p2p3+3*pP1pP2+4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 74 <= atomicNumber < 80:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [2*p2p3+3*pP1pP2+4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 80 <= atomicNumber < 82:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [2*p2p3+3*pP1pP2+4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [2*p2p3+3*pP1pP2+4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)

    if i == 14:
        if 22 <= atomicNumber < 28 :
            protonWoN.position = [-pP1pP2 - 4*flipPN, 0,0]
            grpAn.add(protonWoN)
            print('protonWoN 1[',i+1,']', protonWoN.position)
        if 28 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateZ(-piG/2)
            multiAlpha.position = [-4*flipPN+pP1pP2,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 29 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateZ(-piG/2)
            multiAlpha.position = [-4*flipPN-pP1pP2,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 39 <= atomicNumber < 48:
            protonWoN.position = [-4*pP1pP2/2-p1p2-4*flipPN,0,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 48 <= atomicNumber < 54:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [-4*pP1pP2/2-p1p2-4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)            
        if 57 <= atomicNumber < 63 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [-2*p2p3-2*pP1pP2-4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 63 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-2*pP1pP2-4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 71 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-3*pP1pP2-4*flipPN, 0, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 72 <= atomicNumber < 74 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 74 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 75 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 1[',i+1,']', multiAlpha.position)
        if 76 <= atomicNumber < 80 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 80 <= atomicNumber < 82:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [-2*p2p3-3*pP1pP2-4*flipPN,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
            
    if i == 15:
        if 27 <= atomicNumber < 30:
            neutronGi.position = [0,pP1pP2/2+p1n2,pP1pP2/2 + 2*flipPN]
            grpBn.add( neutronGi )
            print('hook neutron[',i+1,']', neutronGi.position)
        if 33 <= atomicNumber < 36:
            protonWoN.position = [0, pP1pP2/2+2*flipPN, pP1pP2/2+2*flipPN]
            grpBn.add( protonWoN )
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 46 <= atomicNumber < 48:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)            
        if 49 == atomicNumber:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)            
        if 53 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p1p2/2+pP1pP2+2*flipPN,p1p2/2+pP1pP2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)              
        if 60 <= atomicNumber < 62:
            protonWoN.position = [0,p2p3+pP1pP2+2*flipPN,p2p3+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)              
        if 64 <= atomicNumber < 66:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+pP1pP2+2*flipPN,p2p3+pP1pP2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)    
        if 70 == atomicNumber :
            protonWoN.position = [0,p2p3+pP1pP2+2*flipPN,p2p3+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)    
        if 72 <= atomicNumber < 74:
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)  
        if 75 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 77 <= atomicNumber < 80:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)            
        if 81 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)          
        if 82 == atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 83 <= atomicNumber < 86 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 87 <= atomicNumber < 89 :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)  
        if 89 <= atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        
    if i == 16:
        if 26 <= atomicNumber < 30:
            neutronGi.position = [0,-pP1pP2/2-p1n2,-pP1pP2/2 - 2*flipPN]
            grpBn.add( neutronGi )
            print('hook neutron[',i+1,']', neutronGi.position)            
        if 34 <= atomicNumber < 36:
            protonWoN.position = [0,-pP1pP2/2- 2*flipPN,-pP1pP2/2 - 2*flipPN]
            grpBn.add( protonWoN )
            print('hook protonWoN[',i+1,']', protonWoN.position)  
        if 45 <= atomicNumber < 48:            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 51 == atomicNumber:            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 53 == atomicNumber :            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 59 <= atomicNumber < 63 :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 65 <= atomicNumber < 66 :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 68 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 69 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)    
        if 70 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 72 == atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 73 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 74 == atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 75 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 77 <= atomicNumber < 80 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 81 <= atomicNumber < 84:
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 84 <= atomicNumber < 86 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 87 <= atomicNumber < 90 :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 90 <= atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        
    if i == 17:
        if 25 == atomicNumber: # Manganese
            protonWoN.position = [0,-pP1pP2/2-2*flipPN, pP1pP2/2+2*flipPN]
            grpBn.add( protonWoN )
            maxZNeg = -3*pP1pP2/2-8*flipPN
            maxZPos =  3*pP1pP2/2+8*flipPN
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 26 <= atomicNumber < 29:
            neutronGi.position = [0,-pP1pP2/2-p1n2,pP1pP2/2 + 2*flipPN]
            grpBn.add( neutronGi )            
            print('hook neutron[',i+1,']', neutronGi.position)
        if 29 <= atomicNumber < 30:
            neutrons = Group()
            neutronsPls(2)
            neutrons.rotateX(piG/2)
            neutrons.position = [0,-pP1pP2/2-p1n2,+pP1pP2/2+2*flipPN]
            grpBn.add( neutrons )            
            print('pair of hook neutrons[',i+1,']', neutrons.position)            
        if 30 <= atomicNumber < 36:
            protonWoN.position = [0,-pP1pP2/2-2*flipPN,pP1pP2/2+2*flipPN]
            grpBn.add( protonWoN )
            print('hook protonWoN[',i+1,']', protonWoN.position)  
        if 44 <= atomicNumber < 47:            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 50 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 51 == atomicNumber:            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 52 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 53 == atomicNumber :            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*flipPN,p1p2/2+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 57 <= atomicNumber < 68 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-pP1pP2-2*flipPN,p2p3+pP1pP2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 70 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,p2p3+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 71 == atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 76 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-pP1pP2-2*flipPN,p2p3+pP1pP2+2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 77 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*flipPN,p2p3+pP1pP2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 80 <= atomicNumber < 81 :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 85 <= atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*flipPN,p2p3+3*pP1pP2/2+2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
            
    if i == 18:        
        if 26 <= atomicNumber < 29:
            neutronGi.position = [0,pP1pP2/2+p1n2,-pP1pP2/2 - 2*flipPN]
            grpBn.add( neutronGi )
            print('hook neutron[',i+1,']', neutronGi.position)
        if 29 <= atomicNumber < 30:
            neutrons = Group()
            neutronsPls(2)
            neutrons.rotateX(piG/2)
            neutrons.position = [0,pP1pP2/2+p1n2,-pP1pP2/2-2*flipPN]
            grpBn.add( neutrons )            
            print('pair of hook neutrons[',i+1,']', neutrons.position)          
        if 30 == atomicNumber :
            protonWoN.position =  [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 32 <= atomicNumber < 35 :
            protonWoN.position =  [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 35 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,pP1pP2/2+2*flipPN,-pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 43 <= atomicNumber < 47:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 50 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 51 == atomicNumber:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 52 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 53 == atomicNumber:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*flipPN,-p1p2/2-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 57 == atomicNumber < 58:
            protonWoN.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 58 <= atomicNumber < 63:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 63 == atomicNumber :
            protonWoN.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 66 <= atomicNumber < 68 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 68 <= atomicNumber < 71:
            protonWoN.position = [0,p2p3+pP1pP2+2*flipPN,-p2p3-pP1pP2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 71 == atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 74 == atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 76 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 1[',i+1,']', multiAlpha.position)
        if 80 <= atomicNumber < 81:
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 86 == atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 88 <= atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*flipPN,-p2p3-3*pP1pP2/2-2*flipPN]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)          

caroRate = 4
grpAn.position = [0,0,(-maxZNeg + maxZPos)/2 - maxZPos]
grpBn.position = [0,0,(-maxZNeg + maxZPos)/2 - maxZPos]

In[9]
if atomsLabel.value == True:
    scene = Scene(children=[grpAn, grpBn, grpB2, camera, key_light, ambient_light,
        make_text(atomicLabel, height=0.25, position = [-1,1,number*0.025 + 1.5])])
else:
    scene = Scene(children=[grpAn, grpBn, grpB2, camera, key_light, ambient_light])
controller = OrbitControls(controlling=camera, screenSpacePanning=True)

In[10]
renderer = Renderer(camera=camera, scene=scene, controls=[controller],
                    width=view_width, height=view_height)
scene = Scene()  # initialising the scene

In[11]
spinC_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, caroRate], values=[0, 2*piG])
spinC_clip = AnimationClip(tracks=[spinC_track])
spinC_action = AnimationAction(AnimationMixer(grpAn), spinC_clip, grpAn)
spinC_action

In[12]
renderer

In[13]
spinC_action
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Tue Oct 05, 2021 6:36 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Scsibi10

Part 1 of 2.

Ok, Cr6, unless you have any additional suggestions or requests, I need a break. I’ll stop here.

The latest changes:

1. Proton emission colors. The proton emissions are transparent, allowing us to see all protons and neutrons (and electrons) present so the emission colors appear as very light colors. See the proton emission materials, 1-7 (around line 125) for the colors used in the image above. Emission colors is a user checkbox option, uncheck to return our familiar gray atomic output. I didn’t spent a lot of time on it, feel free to mess with color changes to make an alternate “spectrum” if you like, that’s why I usually leave messy alternatives in the code. The source for the named colors is at Color.js, where you can find many more.
The sprite text atomic label works extremely well, thanks for “suggesting” it, please overlook my original resistance. I’m certainly happy to have found a simple solution. I’ve looked again, still no luck finding any documentation on the (javascript sprite text?) make_text() function. I had originally intended to provide the User with a background color control widget as shown in one of the pythreejs read the docs animation examples, but decided against it when I saw the atomic label becomes an unreadable white or black rectangle when trying to implement it. The sprite texts examples I’ve seen would require a large amount of code in order to make the spite work with the background colors, beyond me at this point.

Continued in next post.

First 956 lines.
Code:

In[1]:
from pythreejs import *
from IPython.display import display
import ipywidgets as widgets
from math import sqrt
from random import random , randint , seed
phi = (1+sqrt(5))/2  # calculating phi-based-pi, piG.
piG = 4/sqrt(phi)    # piG is used instead of pi.
pRadius = 0.05 # proton radius, used by all atomic distances

In[2]:
view_width = 600
view_height = 400
camera = PerspectiveCamera(position=[5, 0, 0], up=[0, 0, 1], aspect=view_width/view_height)
#camera = PerspectiveCamera(position=[5, 0, 0], up=[1, 0, 0], aspect=view_width/view_height)
camera = PerspectiveCamera(position=[5, 0, 0], up=[0, 1, 0], aspect=view_width/view_height)
key_light = DirectionalLight(position=[0, 5, 5])
ambient_light = AmbientLight()

In[3]
elements = ((' 1 Hydrogen H ',1),(' 2 Helium He ',2),(' 3 Lithium Li ',3),(' 4 Beryllium Be ',4),
            (' 5 Boron B ',5),(' 6 Carbon C ',6),(' 7 Nitrogen N ',7),(' 8 Oxygen O ',8),
            (' 9 Fluorine F ',9),(' 10 Neon Ne ',10),(' 11 Sodium Na ',11),(' 12 Magnesium Mg ',12),
            (' 13 Aluminum Al ',13),(' 14 Silicon Si ',14),(' 15 Phosphorus P ',15),(' 16 Sulfur S ',16),
            (' 17 Chlorine Cl ',17),(' 18 Argon Ar ',18),(' 19 Potassium P ',19),(' 20 Calcium Ca ',20),
            (' 21 Scandium Sc ',21),(' 22 Titanium Ti ',22),(' 23 Vanadium V ',23),(' 24 Chromium Cr ',24),
            (' 25 Manganese Mn ',25),(' 26 Iron Fe ',26),(' 27 Cobalt Co ',27),(' 28 Nickel Ni ',28),
            (' 29 Copper Cu ',29),(' 30 Zinc Zn ',30),(' 31 Gallium Ga ',31),(' 32 Germanium Ge ',32),
            (' 33 Arsenic As ',33),(' 34 Selenium Se ',34),(' 35 Bromine Br ',35),(' 36 Krypton Kr ',36),
            (' 37 Rubidium Rb ',37),(' 38 Strontium Sr ',38),(' 39 Yttrium Y ',39),(' 40 Zirconium Zr ',40),
            (' 41 Niobium Nb ',41),(' 42 Molybdenum Mo ',42),(' 43 Technetium Tc ',43),(' 44 Ruthenium Ru ',44),
            (' 45 Rhodium Rh ',45),(' 46 Palladium Pd ',46),(' 47 Silver Ag ',47),(' 48 Cadmium Cd ',48),
            (' 49 Indium In ',49),(' 50 Tin Sn ',50),(' 51 Antimony Sb ',51),(' 52 Tellurium Te ',52),
            (' 53 Iodine I ',53),(' 54 Xenon Xe ',54),(' 55 Caesium Cs ',55),(' 56 Barium Ba ',56),
            (' 57 Lanthanum La ',57),(' 58 Cerium Ce ',58),(' 59 Praseodymium Pr ',59),(' 60 Neodymium Nd ',60),
            (' 61 Promethium Pm ',61),(' 62 Samarium Sm ',62),(' 63 Europium Eu ',63),(' 64 Gadolinium Gd ',64),
            (' 65 Terbium Tb ',65),(' 66 Dysprosium Dy ',66),(' 67 Holmium Ho ',67),(' 68 Erbium Er ',68),
            (' 69 Thulium Tm ',69),(' 70 Ytterbium Yb ',70),(' 71 Lutetium Lu ',71),(' 72 Hafnium Hf ',72),
            (' 73 Tantalum Ta ',73),(' 74 Tungsten W ',74),(' 75 Rhenium Re ',75),(' 76 Osmium Os ',76),
            (' 77 Iridium Ir ',77),(' 78 Platinum Pt ',78),(' 79 Gold Au ',79),(' 80 Mercury Hg ',80),
            (' 81 Thallium Tl ',81),(' 82 Lead Pb ',82),(' 83 Bismuth Bi ',83),(' 84 Polonium Po ',84),
            (' 85 Astatine At ',85),(' 86 Radon Rn ',86),(' 87 Francium Fr ',87),(' 88 Radium Ra ',88),
            (' 89 Actinium Ac ',89),(' 90 Thorium Th ',90));

In[4]
selectAtom = widgets.Dropdown(
    options= elements,
    value=2, # default
    description='Atom:',
)
atomsLabel = widgets.Checkbox(
    value=False,
    description='Atomic label',
    disabled=False,
    indent=False
)
coloredEmissions = widgets.Checkbox(
    value=False,
    description='Color emissions',
    disabled=False,
    indent=False
)
# Changes the distance between adjacent orthogonal protons
oPSlider = widgets.FloatSlider(
    value = pRadius*6,
    min = pRadius*2.25,
    max = pRadius*8,
    step= pRadius/10,
    description='OrthoP distance',
)
widgets.VBox([selectAtom,atomsLabel,coloredEmissions,oPSlider])

In[5]
number = selectAtom.value
def handle_change(change):
    global number
    number = change.new
selectAtom.observe(handle_change, 'value')

orthoP = oPSlider.value
def handle_change(change):
    global orthoP
    orthoP = change.new
oPSlider.observe(handle_change, 'value')

In[6]
An = elements[number-1]
atomicLabel = An[0]
print(atomicLabel) # used to verify An control changes, eliminate this line at any time.  

In[7]
atomicNumber = number  # Select the desired atom from the dropdown widget
grpAn = Group()  # The rotation widget spins grpAn, slots 1,4 and 5.  
grpBn = Group()  # grpBn are the orthogonal top, bottom and hook slots.

# Dimensions
# pRadius = 0.05 # pRadius is now in In[1]
#orthoP = pRadius*6 # Dist. between adjacent vertical and horiz protons. Moved to widget controls
pP1pP2 = 3*pRadius #1.5 # Proton 1 to proton 2, Pole-to-pole separation.
nRadius = pRadius*1.125 # 0.6
eRadius = 2*pRadius/10
emRadius = 2*orthoP #
p1p2 = pP1pP2 # pRadius*2.5
p2p3 = pP1pP2 # pRadius*2.85
n1n2 = 2*orthoP #8*pRadius # 4.0  # Alpha, left-right (y) neutron-neutron orbital separation
p1n1 = pP1pP2/2 # Alpha, up-down (z) proton-orbital neutron separation
p1n2 = pRadius + nRadius + 1.5*pRadius  # In line proton and neutron
p1e1 = pRadius + 1.5*pP1pP2/10  # Alpha, top-bottom (z) proton-electron separation
e1e2 = 0.5*orthoP # 1.5*pRadius # pRadius/0.75  # 0.5  # electron-electron separation
#orthoP = pRadius*6 # 3 # Dist. between adjacent vertical and horiz protons
maxZNeg = 0.0 # maxZNeg and maxZPos are Used to center(z) the atom on the screen
maxZPos = 0.0  

# Proton set Geometries and Materials
protonGeometry =  SphereBufferGeometry(pRadius, 24, 16)
neutronGeometry =  SphereBufferGeometry(nRadius, 24, 16)
electronGeometry =  SphereBufferGeometry(eRadius, 8, 16)
emissionGeometry = CircleGeometry(emRadius, 24)

protonMaterial = MeshStandardMaterial(color='blue')
protonMaterialB = MeshStandardMaterial(color='green')
neutronMaterial = MeshStandardMaterial(color='red')
neutronMaterialB = MeshStandardMaterial(color='green') # Color.js Find a nice color spectrum
electronMaterial = MeshStandardMaterial(color='cyan') #'orangered','salmon','green','cyan','teal','orange'  
emissionmaterial7= MeshStandardMaterial(color='gray', transparent = True,opacity = 0.25)
emissionmaterial1 = MeshStandardMaterial(color='magenta', transparent = True,opacity = 0.25)
emissionmaterial2 = MeshStandardMaterial(color='blue', transparent = True,opacity = 0.25)
emissionmaterial3 = MeshStandardMaterial(color='pink', transparent = True,opacity = 0.25)
emissionmaterial4 = MeshStandardMaterial(color='salmon', transparent = True,opacity = 0.25)
emissionmaterial5 = MeshStandardMaterial(color='lime', transparent = True,opacity = 0.25)
emissionmaterial6 = MeshStandardMaterial(color='skyblue', transparent = True,opacity = 0.25)

def neutronsPls(n): # n is the total number of neutrons, 1 or 2
    neutron1 = Object3D()
    neutron1.add(Mesh(neutronGeometry, neutronMaterial))
    if n == 1 :
        neutron1.position = [0,0,0] # the register can move the neut if needed
        neutrons.add(neutron1)
    elif n == 2 :
        neutron1.position = [0,-p2p3,0]
        neutrons.add(neutron1)
        neutron2 = Object3D()
        neutron2.add(Mesh(neutronGeometry, neutronMaterial))
        neutron2.position = [0,p2p3,0]        
        neutrons.add(neutron2)        
        neutrons.rotateY(random()*2*piG) # Initial random spin positions
    return

def buildMultiAlphas(a): # a is the number of alphas. 1,2,3, ...  
    num = 0
    if coloredEmissions.value == True:
        if a == 1 : emissionmaterial = emissionmaterial2
        if a == 2 : emissionmaterial = emissionmaterial4
        if a == 3 : emissionmaterial = emissionmaterial6
    else:
        emissionmaterial = emissionmaterial7
    while num < a*2 :
        protonMi = Group()
        protonMi.add(Mesh(protonGeometry, protonMaterial))    
        emissionM2i = Mesh( emissionGeometry, emissionmaterial)
        emissionM2i.rotateX(piG)
        protonMi.add(Mesh(emissionGeometry, emissionmaterial))
        protonMi.add(emissionM2i)
        electronMi = Object3D()
        electronMi.add(Mesh(electronGeometry, electronMaterial))
        electronMi.position = [0,-e1e2/2 ,-p1e1]
        protonMi.add(electronMi)
        if num%2 != 0:
            neutronPair = Group()
            neutronMi = Object3D()
            neutronMi.add(Mesh(neutronGeometry, neutronMaterial))
            neutronMi.position = [0,-n1n2/2,-p1n1]
            neutronNi = Object3D()
            neutronNi.add(Mesh(neutronGeometry, neutronMaterial))
            #neutronNi.add(Mesh(neutronGeometry, neutronMaterialB))
            neutronNi.position = [0,n1n2/2,-p1n1]
            neutronPair.add(neutronMi)
            neutronPair.add(neutronNi)
            neutronPair.rotateZ(random()*2*piG) # Initial random spin positions
            protonMi.add(neutronPair)
            protonMi.rotateX(piG)
        protonMi.position = [0,0,a*pP1pP2/2+(a-1)*p2p3/2-(p2p3/2+pP1pP2/2)*num]
        #protonMi.center()
        #protonMi.translate = [0,0,a*pP1pP2/2+(a-1)*p2p3/2-(p2p3/2+pP1pP2/2)*num]
        multiAlpha.add(protonMi)                
        num += 1
    return

def buildProtonAlphaSet(a): # Odd numbers, alphas and one proton.
    num = 0  # a is the total # of protons
    if coloredEmissions.value == True:
        if a == 1 : emissionmaterial = emissionmaterial1
        if a == 3 : emissionmaterial = emissionmaterial3
        if a == 5 : emissionmaterial = emissionmaterial5        
    else:
        emissionmaterial = emissionmaterial7          
    while num < a:
        protonMi = Group()
        protonMi.add(Mesh(protonGeometry, protonMaterial))    
        emissionM2i = Mesh( emissionGeometry, emissionmaterial)
        emissionM2i.rotateX(piG)
        protonMi.add(Mesh(emissionGeometry, emissionmaterial))
        protonMi.add(emissionM2i)
        electronMi = Object3D()
        electronMi.add(Mesh(electronGeometry, electronMaterial))
        electronMi.position = [0,-e1e2/2,-p1e1]
        protonMi.add(electronMi)
        if num%2 != 0:
            neutronPair = Group()
            neutronMi = Object3D()
            neutronMi.add(Mesh(neutronGeometry, neutronMaterial))
            neutronMi.position = [0,-n1n2/2,-p1n1]
            neutronNi = Object3D()
            neutronNi.add(Mesh(neutronGeometry, neutronMaterial))
            neutronNi.position = [0,n1n2/2,-p1n1]
            neutronPair.add(neutronMi)
            neutronPair.add(neutronNi)
            neutronPair.rotateZ(random()*2*piG) # Initial random spin positions
            protonMi.add(neutronPair)
            protonMi.rotateX(piG)
        protonMi.position = [0,0,(a//2)*pP1pP2/2+(a//2)*p2p3/2-(p2p3/2+pP1pP2/2)*num]            
        pASet.add(protonMi)                
        num += 1
    return
        
# Assemble the atomic models.
for i in range( atomicNumber ):
    neutronGi = Object3D()
    neutronGi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronKi = Object3D()
    neutronKi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronLi = Object3D()
    neutronLi.add(Mesh(neutronGeometry, neutronMaterial))
    
    protonWoN = Group() # Proton Without a Neutron
    if coloredEmissions.value == True:
        emissionmaterial = emissionmaterial1
    else:
        emissionmaterial = emissionmaterial7    
    emissionWoN2 = Mesh( emissionGeometry, emissionmaterial)
    emissionWoN2.rotateX(piG)
    protonWoN.add(Mesh(protonGeometry, protonMaterial))
    protonWoN.add(Mesh(emissionGeometry, emissionmaterial))
    protonWoN.add(emissionWoN2)
    electronWoN = Object3D()
    electronWoN.add(Mesh(electronGeometry, electronMaterial))
    electronWoN.position = [0,-e1e2/2,-p1e1]
    protonWoN.add(electronWoN)  
    
    protonWiN = Group() # Proton With a Neutron
    emissionWiN2 = Mesh( emissionGeometry, emissionmaterial)
    emissionWiN2.rotateX(piG)
    protonWiN.add(Mesh(protonGeometry, protonMaterial))
    protonWiN.add(Mesh(emissionGeometry, emissionmaterial))
    protonWiN.add(emissionWiN2)
    electronWiN = Object3D()
    electronWiN.add(Mesh(electronGeometry, electronMaterial))
    electronWiN.position = [0,-e1e2/2,-p1e1]
    protonWiN.add(electronWiN)
    neutronWiN = Object3D()
    neutronWiN.add(Mesh(neutronGeometry, neutronMaterial))
    neutronWiN.position = [0,-n1n2/2,-p1n1]
    protonWiN.add(neutronWiN)

    if i == 0: # Slot 1
        if 1 == atomicNumber: # Hydrogen. Slot 1
            neutronWiN.position = [0,0,-p1n2]
            grpAn.add( protonWiN )
            print('protonWiN[',i+1,']', protonWiN.position)
        if 2 <= atomicNumber < 6: # Helium
            multiAlpha = Group()              
            buildMultiAlphas(1)
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 6 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(2)
            grpAn.add(multiAlpha)
            print('multiAlpha 4[',i+1,']', multiAlpha.position)
        if 7 <= atomicNumber < 10 :
            multiAlpha = Group()              
            buildMultiAlphas(3)
            grpAn.add(multiAlpha)
            maxZNeg = -p2p3/2 - pP1pP2 - 2*orthoP
            maxZPos = p2p3/2 + pP1pP2 + 2*orthoP
            print('multiAlpha 6[',i+1,']', multiAlpha.position)
        if 10 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 36 <= atomicNumber < 54 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            grpAn.add(multiAlpha)
            print('multiAlpha 4[',i+1,']', multiAlpha.position)
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            grpAn.add(multiAlpha)
            print('multiAlpha 6[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            grpAn.add(multiAlpha)
            print('multiAlpha 6[',i+1,']', multiAlpha.position)
            
    if i == 1: # Slot 2
        if 2 < atomicNumber < 6:
            protonWoN.rotateX(-piG/2)            
            protonWoN.position = [0, 0, pP1pP2/2+2*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -pP1pP2/2
            maxZPos = pP1pP2/2+2*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 6 == atomicNumber : # Lithium
            protonWoN.rotateX(-piG/2)            
            protonWoN.position = [0, 0, p2p3/2+pP1pP2+2*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -pP1pP2/2
            maxZPos = pP1pP2/2+2*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 7 <= atomicNumber < 10 : # Lithium
            protonWoN.rotateX(-piG/2)            
            protonWoN.position = [0, 0, 3*pP1pP2/2 + p2p3 + 2*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2 - p2p3/2
            maxZPos = pP1pP2/2+2*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 10 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0, pP1pP2/2 + 2*orthoP]
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,p1p2/2+pP1pP2+2*orthoP]                
            grpBn.add(multiAlpha)
            print('multiAlpha 4[',i+1,']', multiAlpha.position)                
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,p2p3+3*pP1pP2/2+2*orthoP]                
            grpBn.add(multiAlpha)
            print('multiAlpha 6[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)  
            pASet.position = [0,0,p2p3+pP1pP2+2*orthoP]
            grpBn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,p2p3+3*pP1pP2/2+2*orthoP]                
            grpBn.add(multiAlpha)
            print('multiAlpha 6[',i+1,']', multiAlpha.position)
            
    if i == 2: # Slot 3
        if 3 < atomicNumber < 5: # Beryllium
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, -pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -pP1pP2/2-2*orthoP
            maxZPos = pP1pP2/2+2*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 5 == atomicNumber : # Beryllium
            protonWiN.rotateX(piG/2)
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, -p2p3/2, -pP1pP2/2-2*orthoP]
            neutronWiN.position = [0, 0, -p2p3]
            protonWiN.position = [0, p2p3/2, -pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            grpBn.add(protonWiN)
            maxZNeg = -pP1pP2/2-2*orthoP
            maxZPos = pP1pP2/2+2*orthoP
            print('protonWoN and Win[',i+1,']', protonWoN.position)
        if 6 == atomicNumber :
            protonWoN.rotateX(-piG/2)            
            protonWoN.position = [0, 0, -p2p3/2-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)            
        if 9 == atomicNumber :
            protonWiN.rotateX(piG/2)
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, -p2p3/2, -p2p3-3*pP1pP2/2-2*orthoP]
            neutronWiN.position = [0, 0, -p2p3]
            protonWiN.position = [0, p2p3/2, -p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            grpBn.add(protonWiN)
            print('protonWoN and Win[',i+1,']', protonWoN.position)            
        if 10 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0, -pP1pP2/2 - 2*orthoP]
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,-p1p2/2-pP1pP2-2*orthoP]                
            grpBn.add(multiAlpha)
            print('multiAlpha 4[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,-p2p3-3*pP1pP2/2-2*orthoP]                
            grpBn.add(multiAlpha)
            print('multiAlpha 6[',i+1,']', multiAlpha.position)  
        if 57 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)  
            pASet.position = [0,0,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,0,-p2p3-3*pP1pP2/2-2*orthoP]                
            grpBn.add(multiAlpha)
            print('multiAlpha 6[',i+1,']', multiAlpha.position)
            
    if i == 3: # Slot 4
        if 10 <= atomicNumber < 14: # Neon
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 0, pP1pP2 + 4*orthoP]
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)  
        if 15 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 0, pP1pP2 + 4*orthoP]
            grpAn.add(multiAlpha)
            maxZNeg = -3*pP1pP2/2-6*orthoP
            maxZPos = 3*pP1pP2/2+4*orthoP
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 16 == atomicNumber :
            protonWoN.position = [0, 0, pP1pP2/2 + 4*orthoP]
            grpAn.add(protonWoN)
            maxZNeg = -pP1pP2/2-4*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 17 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 0, pP1pP2 + 4*orthoP]
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0,0,p1p2/2+pP1pP2+p1p2/2+pP1pP2+4*orthoP]                
            grpAn.add(multiAlpha)
            print('multiAlpha 4[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,2*p2p3+3*pP1pP2+4*orthoP]                
            grpAn.add(multiAlpha)
            print('multiAlpha 6[',i+1,']', multiAlpha.position)            
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0,0,2*p2p3+2*pP1pP2+4*orthoP]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,2*p2p3+3*pP1pP2+4*orthoP]                
            grpAn.add(multiAlpha)
            print('multiAlpha 6[',i+1,']', multiAlpha.position)
            
    if i == 4: # Slot 5
        if 10 <= atomicNumber < 14 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 0, -pP1pP2 - 4*orthoP]
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)  
        if 15 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 0, -pP1pP2 - 4*orthoP]
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 16 == atomicNumber :
            protonWoN.position = [0, 0, -pP1pP2/2 - 4*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -pP1pP2/2-4*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 17 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 0, -pP1pP2 - 4*orthoP]
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 21 <= atomicNumber < 22 :
            neutronGi.position = [0,0,-3*pP1pP2/2-4*orthoP-p1p2]
            grpAn.add(neutronGi)
            print('and a neutron[',i+1,']', neutronGi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0,0,-p1p2/2-pP1pP2-p1p2/2-pP1pP2-4*orthoP]              
            grpAn.add(multiAlpha)
            print('multiAlpha 4[',i+1,']', multiAlpha.position)              
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,-2*p2p3-3*pP1pP2-4*orthoP]                
            grpAn.add(multiAlpha)
            print('multiAlpha 6[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0,0,-2*p2p3-2*pP1pP2-4*orthoP]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.position = [0,0,-2*p2p3-3*pP1pP2-4*orthoP]                
            grpAn.add(multiAlpha)
            print('multiAlpha 6[',i+1,']', multiAlpha.position)
            
    if i == 5: # Slot 6
        if 11 <= atomicNumber  < 14 :
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0, 3*pP1pP2/2+6*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -pP1pP2/2-4*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 17 <= atomicNumber < 18 :
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0, 3*pP1pP2/2+6*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)  
        if 19 <= atomicNumber < 22 :
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0, 3*pP1pP2/2+6*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2-4*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 23 <= atomicNumber < 26 :
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0, 3*pP1pP2/2+6*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2-4*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 26 <= atomicNumber < 29:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0, 3*pP1pP2/2+6*orthoP]
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 29 <= atomicNumber < 31:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0, 3*pP1pP2/2+6*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2-4*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 31 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0, 3*pP1pP2/2+6*orthoP]
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 37 <= atomicNumber < 48:
            neutronWiN.position = [0,2*orthoP-p2p3,p2p3]            
            protonWiN.rotateX(-piG/2)    
            protonWiN.position = [0,-p2p3/2,3*p1p2/2+6*pP1pP2/2+6*orthoP]
            grpBn.add( protonWiN )
            maxZNeg = -3*p1p2/2-5*pP1pP2/2-4*orthoP
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*orthoP            
            print('protonWiN[',i+1,']', protonWiN.position)
        if 48 <= atomicNumber < 50:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0, 3*p1p2/2+6*pP1pP2/2+6*orthoP]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 50 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,3*p1p2/2+6*pP1pP2/2+6*orthoP]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)            
        if 51 <= atomicNumber < 54:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0, 3*p1p2/2+6*pP1pP2/2+6*orthoP]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 55 <= atomicNumber < 57 :
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0,3*p2p3+4.5*pP1pP2+6*orthoP]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)
            maxZNeg = -3*p1p2/2-5*pP1pP2/2-4*orthoP  
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*orthoP            
        if 57 <= atomicNumber < 62:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0,3*p2p3+3*pP1pP2+6*orthoP]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)  
        if 62 <= atomicNumber < 66 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,3*p2p3+3*pP1pP2+6*orthoP]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 66 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+3*pP1pP2+6*orthoP]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 71 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,3*p2p3+4.5*pP1pP2+6*orthoP]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 72 <= atomicNumber < 78 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+4.5*pP1pP2+6*orthoP]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 78 == atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,3*p2p3+4.5*pP1pP2+6*orthoP]                
            grpBn.add(multiAlpha)
            print('multiAlpha 4[',i+1,']', multiAlpha.position)
        if 79 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+4.5*pP1pP2+6*orthoP]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 80 <= atomicNumber < 82 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,3*p2p3+4.5*pP1pP2+6*orthoP]                
            grpBn.add(multiAlpha)
            print('multiAlpha 4[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,3*p2p3+4.5*pP1pP2+6*orthoP]  
            grpBn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
            
    if i == 6: # Slot 7
        if 8 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, -3*pP1pP2/2-p2p3-2*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-2*orthoP
            maxZPos = 3*pP1pP2/2+2*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 12 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, -3*pP1pP2/2-6*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 15 == atomicNumber:  
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0, -3*pP1pP2/2-6*orthoP]
            grpBn.add(protonWoN)
            print('protonWoN 1[',i+1,']', protonWoN.position)
        if 20 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0, -3*pP1pP2/2-6*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN 1[',i+1,']', protonWoN.position)
        if 24 <= atomicNumber < 26:
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, -3*pP1pP2/2-6*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 26 <= atomicNumber < 30 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0, 0, -3*pP1pP2/2-6*orthoP]
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 30 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, -3*pP1pP2/2-6*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 31 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0, 0, -3*pP1pP2/2-6*orthoP]
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 38 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*orthoP]
            grpBn.add( protonWoN )
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*orthoP
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)              
        if 40 <= atomicNumber < 47:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*orthoP]
            grpBn.add( protonWoN )
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*orthoP # verified
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*orthoP            
            print('protonWoN[',i+1,']', protonWoN.position)                
        if 47 <= atomicNumber < 50:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*orthoP]                
            grpBn.add(multiAlpha)
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*orthoP # verified
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*orthoP
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 50 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*orthoP]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)
        if 51 <= atomicNumber < 54:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*orthoP]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 56 == atomicNumber < 57:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*orthoP]
            grpBn.add( protonWoN )
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*orthoP # needed
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 57 <= atomicNumber < 63:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-3*pP1pP2-6*orthoP]                
            grpBn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 63 <= atomicNumber < 66 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-3*pP1pP2-6*orthoP]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)            
        if 66 == atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-3*pP1pP2-6*orthoP]                
            grpBn.add(multiAlpha)
            print('multiAlpha 4[',i+1,']', multiAlpha.position)
        if 67 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-3*pP1pP2-6*orthoP]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 68 <= atomicNumber < 71 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-3*pP1pP2-6*orthoP]                
            grpBn.add(multiAlpha)
            print('multiAlpha 4[',i+1,']', multiAlpha.position)
        if 71 <= atomicNumber < 78 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*orthoP]  
            grpBn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 78 <= atomicNumber < 82 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*orthoP]                
            grpBn.add(multiAlpha)
            print('multiAlpha 4[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(-piG/2)            
            pASet.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*orthoP]  
            grpBn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
            
    if i == 7: # Slot 8
        if 13 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 2*orthoP, 0]
            grpAn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 14 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,pP1pP2/2+2*orthoP, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 15 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 2*orthoP, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 16 <= atomicNumber < 36:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,pP1pP2/2+2*orthoP, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,p1p2/2+pP1pP2+2*orthoP,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 4[',i+1,']', multiAlpha.position)                
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*orthoP, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 6[',i+1,']', multiAlpha.position)                
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)
            pASet.position = [0,p2p3+pP1pP2+2*orthoP,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*orthoP, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 6[',i+1,']', multiAlpha.position)
            
    if i == 8: # Slot 9
        if 13 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, -2*orthoP, 0]
            grpAn.add(protonWoN)#            
            maxZNeg = -pP1pP2/2-4*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 14 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-pP1pP2/2-2*orthoP, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 15 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, -2*orthoP, 0]
            grpAn.add(protonWoN)#            
            print('protonWoN[',i+1,']', protonWoN.position)
        if 16 <= atomicNumber < 36:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-pP1pP2/2-2*orthoP, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-2*orthoP-p1p2/2-pP1pP2,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 4[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*orthoP, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 6[',i+1,']', multiAlpha.position)            
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateX(piG/2)
            pASet.position = [0,-p2p3-pP1pP2-2*orthoP,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateX(piG/2)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*orthoP, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 6[',i+1,']', multiAlpha.position)
Continued in next post.
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Tue Oct 05, 2021 6:52 pm

.
Part 2 of 2.

Miles Periodic Table with Standard Periodic Table reference - Page 2 Tantal10

2. Widget Controls. Here’s what the controls look like, unfortunately not adjacent to the renderer as shown. Actually you make any changes you like and then go through the several cells’ run commands that end in the rendered output. What’s unusual about this image is the small distance between a proton’s (or alpha’s) equator to the adjacent proton (or alpha) pole, as we’ve briefly discussed in the past. The OrthoP slider allows one to change that distance. The emissions are then sized to that distance. What function could hold orthogonal alphas together? Gravity? Charge pressure?

3. Carousal spin speed. The carousal has three different speeds depending on the atom selected.

4. Slot numbers comments. I added slot number (# slot number) labels to the the code’s i-loops to help clarify how the 19 slot layout registers are set-up.

There’s a change or two I’d want you’re approval on before attempting.
1. An easy one, why do we show the proton with a mathematically precise equatorial emission plane? The answer, because its generally true, and because makes the proton much easier to draw. Let’s replace the equatorial plane with two plus and minus 30 degree emission cones and see what that looks like.  
2. and 3. Adding charge channel objects. Through charge line or cylinder objects within alphas, and something suggesting exterior vortices entering proton or alpha poles.

This project doesn’t use timing, it uses keyframing. I haven’t gotten anywhere with rotating slots (such as 2 and 3) around their own centers’ instead of the atom’s center. Worse, as far as I understand it, all objects can only have a single parent, Slots in the carousal may not be able to include internal spins. I don’t know. I’m taking a break on the subject.
   
You probably have ideas of your own. Your wish is my command.

How do you intend to integrate your periodic table file into the atom builder? I hope it agrees with the slot layout and values in this project. I suppose t should create the dataset this code can be replaced by.

Lines 957-1783
Code:

            
    if i == 9: # Slot 10
        if 14 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [pP1pP2/2+2*orthoP, 0, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 15 == atomicNumber :
            protonWoN.rotateX(-piG/2)
            protonWoN.rotateY(piG/2)
            protonWoN.position = [2*orthoP, 0, 0]
            grpAn.add(protonWoN)#            
            print('protonWoN[',i+1,']', protonWoN.position)
        if 16 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [pP1pP2/2+2*orthoP, 0, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 18 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [pP1pP2/2+2*orthoP, 0, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 21 == atomicNumber :
            neutronGi.position = [p2p3+pP1pP2+2*orthoP, 0, 0]
            grpAn.add(neutronGi)
            print('and a neutron[',i+1,']', neutronGi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [2*orthoP+p1p2/2+pP1pP2,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 4[',i+1,']', multiAlpha.position)          
        if 54 <= atomicNumber < 57 :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [p2p3+3*pP1pP2/2+2*orthoP,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 6[',i+1,']', multiAlpha.position)            
        if 57 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateY(piG/2)
            pASet.position = [p2p3+pP1pP2+2*orthoP,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [p2p3+3*pP1pP2/2+2*orthoP,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 6[',i+1,']', multiAlpha.position)
            
    if i == 10: # Slot 11
        if 14 == atomicNumber: # Silicon, the carousal level
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-pP1pP2/2-2*orthoP, 0, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 15 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.rotateY(piG/2)
            protonWoN.position = [-2*orthoP, 0, 0]
            grpAn.add(protonWoN)
            print('protonWoN 1[',i+1,']', protonWoN.position)
        if 16 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-pP1pP2/2-2*orthoP, 0, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)  
        if 18 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateX(-piG/2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-pP1pP2/2-2*orthoP, 0, 0]
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 21 == atomicNumber :
            neutronGi.position = [-p2p3 -pP1pP2 - 2*orthoP, 0, 0]
            grpAn.add(neutronGi)
            print('and a neutron[',i+1,']', neutronGi.position)
        if 36 <= atomicNumber < 54:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-2*orthoP-p1p2/2-pP1pP2,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 4[',i+1,']', multiAlpha.position)            
        if 54 <= atomicNumber < 57:
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-p2p3-3*pP1pP2/2-2*orthoP,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 6[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.rotateY(piG/2)
            pASet.position = [-p2p3-pP1pP2-2*orthoP,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
        if 71 <= atomicNumber :
            multiAlpha = Group()                
            buildMultiAlphas(3)
            multiAlpha.rotateY(piG/2)
            multiAlpha.position = [-p2p3-3*pP1pP2/2-2*orthoP,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 6[',i+1,']', multiAlpha.position)
            
    if i == 11: # Slot 12
        if 21 == atomicNumber:
            protonWoN.rotateZ(piG/2)
            protonWoN.position = [0, pP1pP2 + 4*orthoP, 0]
            grpAn.add(protonWoN)
            print('protonWoN 1[',i+1,']', protonWoN.position)
        if 22 <= atomicNumber < 27:
            neutronWiN.position = [0,0, p1n2]            
            protonWiN.rotateZ(piG/2)    
            protonWiN.position = [0, pP1pP2+4*orthoP,0]
            grpAn.add( protonWiN )
            print('protonWiN[',i+1,']', protonWiN.position)
        if 27 == atomicNumber:
            neutronGi.position = [0,p1n2+pP1pP2+2*orthoP,0]
            grpAn.add( neutronGi )
            print('neutronGi[',i+1,']', neutronGi.position)
        if 28 == atomicNumber :
            neutronWiN.position = [0,0,-p1n2]
            protonWiN.rotateZ(piG/2)    
            protonWiN.position = [0, pP1pP2+4*orthoP,0]
            grpAn.add( protonWiN )
            print('protonWiN[',i+1,']', protonWiN.position)
        if 29 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateZ(piG/2)
            multiAlpha.position = [0,pP1pP2+4*orthoP,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 42 <= atomicNumber < 47:
            protonWoN.position = [0,4*pP1pP2/2+p1p2+4*orthoP,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 47 <= atomicNumber < 54 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,4*pP1pP2/2+p1p2+4*orthoP,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 61:
            protonWoN.position = [0, 2*p2p3+2*pP1pP2+4*orthoP, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 61 <= atomicNumber < 67:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 2*p2p3+2*pP1pP2+4*orthoP, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 67 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, 2*p2p3+2*pP1pP2+4*orthoP, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 68 <= atomicNumber < 71 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, 2*p2p3+2*pP1pP2+4*orthoP, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 4[',i+1,']', multiAlpha.position)
        if 71 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, 2*p2p3+3*pP1pP2+4*orthoP, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 72 <= atomicNumber < 79:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, 2*p2p3+3*pP1pP2+4*orthoP, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 79 <= atomicNumber < 82 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, 2*p2p3+3*pP1pP2+4*orthoP, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 4[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber < 86:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, 2*p2p3+3*pP1pP2+4*orthoP, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 86 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0, 2*p2p3+3*pP1pP2+4*orthoP, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
            
    if i == 12: # Slot 13
        if 21 == atomicNumber: # Silicon, the carousal level
            protonWoN.rotateZ(piG/2)
            protonWoN.position = [0, -pP1pP2 - 4*orthoP, 0]
            grpAn.add(protonWoN)
            print('protonWoN 1[',i+1,']', protonWoN.position)
        if 22 <= atomicNumber < 29: # Titanium
            neutronWiN.position = [0,0,-p1n2]            
            protonWiN.rotateZ(-piG/2)    
            protonWiN.position = [0,-pP1pP2-4*orthoP,0]
            grpAn.add( protonWiN )
            print('protonWiN[',i+1,']', protonWiN.position)
        if 29 <= atomicNumber < 36:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateZ(piG/2)
            multiAlpha.position = [0,-pP1pP2-4*orthoP,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 41 <= atomicNumber < 47:
            protonWoN.position = [0,-4*pP1pP2/2-p1p2-4*orthoP,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 47 <= atomicNumber < 54:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-4*pP1pP2/2-p1p2-4*orthoP,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 61:
            protonWoN.position = [0, -2*p2p3-2*pP1pP2-4*orthoP, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 61 <= atomicNumber < 67:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0, -2*p2p3-2*pP1pP2-4*orthoP, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 67 <= atomicNumber < 68:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, -2*p2p3-2*pP1pP2-4*orthoP, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 68 <= atomicNumber < 71 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, -2*p2p3-2*pP1pP2-4*orthoP, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 4[',i+1,']', multiAlpha.position)
        if 71 <= atomicNumber < 79:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, -2*p2p3-3*pP1pP2-4*orthoP, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 79 <= atomicNumber < 82 :
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [0, -2*p2p3-3*pP1pP2-4*orthoP, 0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 4[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber < 86:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [0, -2*p2p3-3*pP1pP2-4*orthoP, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 86 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [0, -2*p2p3-3*pP1pP2-4*orthoP, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
            
    if i == 13: # Slot 14
        if 22 <= atomicNumber < 27:
            neutronWiN.position = [0,0, -p1n2]            
            protonWiN.rotateZ(-piG/2)    
            protonWiN.position = [4*orthoP+pP1pP2,0,0]
            grpAn.add( protonWiN )
            print('protonWiN[',i+1,']', protonWiN.position)            
        if 27 <= atomicNumber < 36:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateZ(-piG/2)
            multiAlpha.position = [4*orthoP+pP1pP2,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 39 <= atomicNumber < 48:        
            protonWoN.position = [4*pP1pP2/2+p1p2+4*orthoP,0,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 48 <= atomicNumber < 54:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [4*pP1pP2/2+p1p2+4*orthoP,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 57 <= atomicNumber < 63:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [2*p2p3+2*pP1pP2+4*orthoP,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 63 <= atomicNumber < 71:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [2*p2p3+2*pP1pP2+4*orthoP,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 71 <= atomicNumber < 74:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [2*p2p3+3*pP1pP2+4*orthoP,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 74 <= atomicNumber < 80:
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [2*p2p3+3*pP1pP2+4*orthoP,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 80 <= atomicNumber < 82:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [2*p2p3+3*pP1pP2+4*orthoP,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 4[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [2*p2p3+3*pP1pP2+4*orthoP,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)

    if i == 14: # Slot 15
        if 22 <= atomicNumber < 28 :
            protonWoN.position = [-pP1pP2 - 4*orthoP, 0,0]
            grpAn.add(protonWoN)
            print('protonWoN 1[',i+1,']', protonWoN.position)
        if 28 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateZ(-piG/2)
            multiAlpha.position = [-4*orthoP+pP1pP2,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 29 <= atomicNumber < 36 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.rotateZ(-piG/2)
            multiAlpha.position = [-4*orthoP-pP1pP2,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 39 <= atomicNumber < 48:
            protonWoN.position = [-4*pP1pP2/2-p1p2-4*orthoP,0,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 48 <= atomicNumber < 54:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [-4*pP1pP2/2-p1p2-4*orthoP,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 57 <= atomicNumber < 63 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [-2*p2p3-2*pP1pP2-4*orthoP,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 63 <= atomicNumber < 71 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-2*pP1pP2-4*orthoP,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 71 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-3*pP1pP2-4*orthoP, 0, 0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 72 <= atomicNumber < 74 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [-2*p2p3-3*pP1pP2-4*orthoP,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 74 == atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-3*pP1pP2-4*orthoP,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 75 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [-2*p2p3-3*pP1pP2-4*orthoP,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 2[',i+1,']', multiAlpha.position)
        if 76 <= atomicNumber < 80 :
            pASet = Group()                
            buildProtonAlphaSet(3)
            pASet.position = [-2*p2p3-3*pP1pP2-4*orthoP,0,0]
            grpAn.add(pASet)
            print('proAlphaSet 3[',i+1,']', pASet.position)
        if 80 <= atomicNumber < 82:
            multiAlpha = Group()                
            buildMultiAlphas(2)
            multiAlpha.position = [-2*p2p3-3*pP1pP2-4*orthoP,0,0]                
            grpAn.add(multiAlpha)
            print('multiAlpha 4[',i+1,']', multiAlpha.position)
        if 82 <= atomicNumber :
            pASet = Group()                
            buildProtonAlphaSet(5)
            pASet.position = [-2*p2p3-3*pP1pP2-4*orthoP,0,0]  
            grpAn.add(pASet)
            print('proAlphaSet 5[',i+1,']', pASet.position)
            
    if i == 15: # Slot 16
        if 27 <= atomicNumber < 30:
            neutronGi.position = [0,pP1pP2/2+p1n2,pP1pP2/2 + 2*orthoP]
            grpBn.add( neutronGi )
            print('hook neutron[',i+1,']', neutronGi.position)
        if 33 <= atomicNumber < 36:
            protonWoN.position = [0, pP1pP2/2+2*orthoP, pP1pP2/2+2*orthoP]
            grpBn.add( protonWoN )
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 46 <= atomicNumber < 48:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*orthoP,p1p2/2+pP1pP2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)            
        if 49 == atomicNumber:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*orthoP,p1p2/2+pP1pP2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)            
        if 53 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p1p2/2+pP1pP2+2*orthoP,p1p2/2+pP1pP2+2*orthoP]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 2[',i+1,']', multiAlpha.position)              
        if 60 <= atomicNumber < 62:
            protonWoN.position = [0,p2p3+pP1pP2+2*orthoP,p2p3+pP1pP2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)              
        if 64 <= atomicNumber < 66:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+pP1pP2+2*orthoP,p2p3+pP1pP2+2*orthoP]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 2[',i+1,']', multiAlpha.position)    
        if 70 == atomicNumber :
            protonWoN.position = [0,p2p3+pP1pP2+2*orthoP,p2p3+pP1pP2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)    
        if 72 <= atomicNumber < 74:
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)  
        if 75 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 2[',i+1,']', multiAlpha.position)
        if 77 <= atomicNumber < 80:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 2[',i+1,']', multiAlpha.position)            
        if 81 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 2[',i+1,']', multiAlpha.position)          
        if 82 == atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 83 <= atomicNumber < 86 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 2[',i+1,']', multiAlpha.position)
        if 87 <= atomicNumber < 89 :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)  
        if 89 <= atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 2[',i+1,']', multiAlpha.position)
        
    if i == 16: # Slot 17
        if 26 <= atomicNumber < 30:
            neutronGi.position = [0,-pP1pP2/2-p1n2,-pP1pP2/2 - 2*orthoP]
            grpBn.add( neutronGi )
            print('hook neutron[',i+1,']', neutronGi.position)            
        if 34 <= atomicNumber < 36:
            protonWoN.position = [0,-pP1pP2/2- 2*orthoP,-pP1pP2/2 - 2*orthoP]
            grpBn.add( protonWoN )
            print('hook protonWoN[',i+1,']', protonWoN.position)  
        if 45 <= atomicNumber < 48:            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*orthoP,-p1p2/2-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 51 == atomicNumber:            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*orthoP,-p1p2/2-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 53 == atomicNumber :            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*orthoP,-p1p2/2-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 59 <= atomicNumber < 63 :
            protonWoN.position = [0,-p2p3-pP1pP2-2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 65 <= atomicNumber < 66 :
            protonWoN.position = [0,-p2p3-pP1pP2-2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 68 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 69 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-pP1pP2-2*orthoP,-p2p3-pP1pP2-2*orthoP]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 2[',i+1,']', multiAlpha.position)    
        if 70 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 72 == atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 73 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 2[',i+1,']', multiAlpha.position)
        if 74 == atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 75 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 2[',i+1,']', multiAlpha.position)
        if 77 <= atomicNumber < 80 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 2[',i+1,']', multiAlpha.position)
        if 81 <= atomicNumber < 84:
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 84 <= atomicNumber < 86 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 2[',i+1,']', multiAlpha.position)
        if 87 <= atomicNumber < 90 :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 90 <= atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 2[',i+1,']', multiAlpha.position)
        
    if i == 17: # Slot 18
        if 25 == atomicNumber: # Manganese
            protonWoN.position = [0,-pP1pP2/2-2*orthoP, pP1pP2/2+2*orthoP]
            grpBn.add( protonWoN )
            maxZNeg = -3*pP1pP2/2-8*orthoP
            maxZPos =  3*pP1pP2/2+8*orthoP
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 26 <= atomicNumber < 29:
            neutronGi.position = [0,-pP1pP2/2-p1n2,pP1pP2/2 + 2*orthoP]
            grpBn.add( neutronGi )            
            print('hook neutron[',i+1,']', neutronGi.position)
        if 29 <= atomicNumber < 30:
            neutrons = Group()
            neutronsPls(2)
            neutrons.rotateX(piG/2)
            neutrons.position = [0,-pP1pP2/2-p1n2,+pP1pP2/2+2*orthoP]
            grpBn.add( neutrons )            
            print('pair of hook neutrons[',i+1,']', neutrons.position)            
        if 30 <= atomicNumber < 36:
            protonWoN.position = [0,-pP1pP2/2-2*orthoP,pP1pP2/2+2*orthoP]
            grpBn.add( protonWoN )
            print('hook protonWoN[',i+1,']', protonWoN.position)  
        if 44 <= atomicNumber < 47:            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*orthoP,p1p2/2+pP1pP2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 50 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p1p2/2-pP1pP2-2*orthoP,p1p2/2+pP1pP2+2*orthoP]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 2[',i+1,']', multiAlpha.position)
        if 51 == atomicNumber:            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*orthoP,p1p2/2+pP1pP2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 52 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p1p2/2-pP1pP2-2*orthoP,p1p2/2+pP1pP2+2*orthoP]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 2[',i+1,']', multiAlpha.position)
        if 53 == atomicNumber :            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*orthoP,p1p2/2+pP1pP2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 57 <= atomicNumber < 68 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-pP1pP2-2*orthoP,p2p3+pP1pP2+2*orthoP]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 2[',i+1,']', multiAlpha.position)
        if 70 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*orthoP,p2p3+pP1pP2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 71 == atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 76 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,-p2p3-pP1pP2-2*orthoP,p2p3+pP1pP2+2*orthoP]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 2[',i+1,']', multiAlpha.position)
        if 77 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*orthoP,p2p3+pP1pP2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 80 <= atomicNumber < 81 :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 85 <= atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
            
    if i == 18: # Slot 19        
        if 26 <= atomicNumber < 29:
            neutronGi.position = [0,pP1pP2/2+p1n2,-pP1pP2/2 - 2*orthoP]
            grpBn.add( neutronGi )
            print('hook neutron[',i+1,']', neutronGi.position)
        if 29 <= atomicNumber < 30:
            neutrons = Group()
            neutronsPls(2)
            neutrons.rotateX(piG/2)
            neutrons.position = [0,pP1pP2/2+p1n2,-pP1pP2/2-2*orthoP]
            grpBn.add( neutrons )            
            print('pair of hook neutrons[',i+1,']', neutrons.position)          
        if 30 == atomicNumber :
            protonWoN.position =  [0,pP1pP2/2+2*orthoP,-pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 32 <= atomicNumber < 35 :
            protonWoN.position =  [0,pP1pP2/2+2*orthoP,-pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 35 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,pP1pP2/2+2*orthoP,-pP1pP2/2-2*orthoP]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 2[',i+1,']', multiAlpha.position)
        if 43 <= atomicNumber < 47:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*orthoP,-p1p2/2-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 50 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p1p2/2+pP1pP2+2*orthoP,-p1p2/2-pP1pP2-2*orthoP]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 2[',i+1,']', multiAlpha.position)
        if 51 == atomicNumber:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*orthoP,-p1p2/2-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 52 == atomicNumber:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p1p2/2+pP1pP2+2*orthoP,-p1p2/2-pP1pP2-2*orthoP]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 2[',i+1,']', multiAlpha.position)
        if 53 == atomicNumber:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*orthoP,-p1p2/2-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 57 == atomicNumber < 58:
            protonWoN.position = [0,p2p3+pP1pP2+2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 58 <= atomicNumber < 63:
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+pP1pP2+2*orthoP,-p2p3-pP1pP2-2*orthoP]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 2[',i+1,']', multiAlpha.position)
        if 63 == atomicNumber :
            protonWoN.position = [0,p2p3+pP1pP2+2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 66 <= atomicNumber < 68 :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+pP1pP2+2*orthoP,-p2p3-pP1pP2-2*orthoP]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 2[',i+1,']', multiAlpha.position)
        if 68 <= atomicNumber < 71:
            protonWoN.position = [0,p2p3+pP1pP2+2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 71 == atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 74 == atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 76 == atomicNumber :
            multiAlpha = Group()              
            buildMultiAlphas(1)
            multiAlpha.position = [0,p2p3+3*pP1pP2/2+2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]                
            grpBn.add(multiAlpha)
            print('hook multiAlpha 2[',i+1,']', multiAlpha.position)
        if 80 <= atomicNumber < 81:
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 86 == atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 88 <= atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)          

grpAn.position = [0,0,(-maxZNeg + maxZPos)/2 - maxZPos]
grpBn.position = [0,0,(-maxZNeg + maxZPos)/2 - maxZPos]

In[8]
if atomsLabel.value == True:
    scene = Scene(children=[grpAn, grpB2, grpBn, camera, key_light, ambient_light,
        make_text(atomicLabel,
                  height=0.25,
                  position = [-1,1,number*0.025 + 1.5])]) # move the label +z as the atom grows
else:
    scene = Scene(children=[grpAn, grpB2, grpBn, camera, key_light, ambient_light])
controller = OrbitControls(controlling=camera, screenSpacePanning=True)

In[9]
renderer = Renderer(camera=camera, scene=scene, controls=[controller],
                    width=view_width, height=view_height)
scene = Scene()  # initialising the scene

In[10]
# caroSecs, the number of seconds to complete a single carousal rotation
if 1 <= number < 13:
    caroSecs = 2.5
if 14 <= number < 20:
    caroSecs = 4.0
if 21 <= number :
    caroSecs = 6.0
 
spinC_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, caroSecs], values=[0, 2*piG])
spinC_clip = AnimationClip(tracks=[spinC_track])
spinC_action = AnimationAction(AnimationMixer(grpAn), spinC_clip, grpAn)
spinC_action

In[11]
renderer


End of part 2 of 2.

P.S. Oops, I see In[9] Beginning with " if atomsLabel.value == True:" , causes an error, "grpB2 is not defined". Easy fix, remove grpB2, from both children=[] lists.
Change from
scene = Scene(children=[grpAn, grpBn, grpB2, camera, key_light, ambient_light])
to
scene = Scene(children=[grpAn, grpBn, camera, key_light, ambient_light])
.


Last edited by LongtimeAirman on Wed Oct 06, 2021 2:24 pm; edited 1 time in total (Reason for editing : Added P.S.)

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Thu Oct 07, 2021 3:44 pm

Hi LTAM,

Wow again awesome job on this! It is starting to feel like Nevyn's old site with the same coolness factors.

The labels and emissions colors are a nice add. For the base 19 slots you've built up they look good. It might be challenging to show paths and independent rotations of all legs-hooks. Definitely take a break. Smile

LongtimeAirman wrote:There’s a change or two I’d want you’re approval on before attempting.
1. An easy one, why do we show the proton with a mathematically precise equatorial emission plane? The answer, because its generally true, and because makes the proton much easier to draw. Let’s replace the equatorial plane with two plus and minus 30 degree emission cones and see what that looks like. (Sounds good to me.)
2. and 3. Adding charge channel objects. Through charge line or cylinder objects within alphas, and something suggesting exterior vortices entering proton or alpha poles.

This project doesn’t use timing, it uses keyframing. I haven’t gotten anywhere with rotating slots (such as 2 and 3) around their own centers’ instead of the atom’s center. Worse, as far as I understand it, all objects can only have a single parent, Slots in the carousal may not be able to include internal spins. I don’t know. I’m taking a break on the subject.

You probably have ideas of your own. Your wish is my command.


Chromium6

Posts : 727
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Sun Oct 10, 2021 5:05 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Chromi10
The new plane and cone emissions on the right, compared to the previous plane emissions alone.

Part 1 of 2 part post.

Success Cr6, We have cone emissions! And I’ve gone days without thinking of my rotation problems). It wasn’t as easy as I’d expected. The first problem was the fact that, like the circle, threejs cones default to single-sided rendered objects. This time however, material.side=’DoubleSide’, made both sides visible, the same statement allowed me to eliminate the second, 180deg flipped circular emission planes from the proton group’s code. The next obstacle was a math error; changing the distance between alphas resulted in displacing the alpha’s neutrons sideways. The solution to that involved creating the single proton stack building function that lists the proton locations instead of calculating them. The first two proton functions are gone. The line total for the main In[] cell dropped to 1675.

First 947 lines of code below. Continued in the next post.
Code:

In[1]:
from pythreejs import *
from IPython.display import display
import ipywidgets as widgets
from math import sqrt, tan
from random import random , randint , seed
phi = (1+sqrt(5))/2  # calculating phi-based-pi, piG.
piG = 4/sqrt(phi)    # piG is used instead of pi.
pRadius = 0.05 # proton radius, used by all atomic distances

In[2]:
view_width = 600
view_height = 400
camera = PerspectiveCamera(position=[5, 0, 0], up=[0, 0, 1], aspect=view_width/view_height)
#camera = PerspectiveCamera(position=[5, 0, 0], up=[1, 0, 0], aspect=view_width/view_height)
camera = PerspectiveCamera(position=[5, 0, 0], up=[0, 1, 0], aspect=view_width/view_height)
key_light = DirectionalLight(position=[0, 5, 5])
ambient_light = AmbientLight()

In[3]
elements = ((' 1 Hydrogen H ',1),(' 2 Helium He ',2),(' 3 Lithium Li ',3),(' 4 Beryllium Be ',4),
            (' 5 Boron B ',5),(' 6 Carbon C ',6),(' 7 Nitrogen N ',7),(' 8 Oxygen O ',8),
            (' 9 Fluorine F ',9),(' 10 Neon Ne ',10),(' 11 Sodium Na ',11),(' 12 Magnesium Mg ',12),
            (' 13 Aluminum Al ',13),(' 14 Silicon Si ',14),(' 15 Phosphorus P ',15),(' 16 Sulfur S ',16),
            (' 17 Chlorine Cl ',17),(' 18 Argon Ar ',18),(' 19 Potassium P ',19),(' 20 Calcium Ca ',20),
            (' 21 Scandium Sc ',21),(' 22 Titanium Ti ',22),(' 23 Vanadium V ',23),(' 24 Chromium Cr ',24),
            (' 25 Manganese Mn ',25),(' 26 Iron Fe ',26),(' 27 Cobalt Co ',27),(' 28 Nickel Ni ',28),
            (' 29 Copper Cu ',29),(' 30 Zinc Zn ',30),(' 31 Gallium Ga ',31),(' 32 Germanium Ge ',32),
            (' 33 Arsenic As ',33),(' 34 Selenium Se ',34),(' 35 Bromine Br ',35),(' 36 Krypton Kr ',36),
            (' 37 Rubidium Rb ',37),(' 38 Strontium Sr ',38),(' 39 Yttrium Y ',39),(' 40 Zirconium Zr ',40),
            (' 41 Niobium Nb ',41),(' 42 Molybdenum Mo ',42),(' 43 Technetium Tc ',43),(' 44 Ruthenium Ru ',44),
            (' 45 Rhodium Rh ',45),(' 46 Palladium Pd ',46),(' 47 Silver Ag ',47),(' 48 Cadmium Cd ',48),
            (' 49 Indium In ',49),(' 50 Tin Sn ',50),(' 51 Antimony Sb ',51),(' 52 Tellurium Te ',52),
            (' 53 Iodine I ',53),(' 54 Xenon Xe ',54),(' 55 Caesium Cs ',55),(' 56 Barium Ba ',56),
            (' 57 Lanthanum La ',57),(' 58 Cerium Ce ',58),(' 59 Praseodymium Pr ',59),(' 60 Neodymium Nd ',60),
            (' 61 Promethium Pm ',61),(' 62 Samarium Sm ',62),(' 63 Europium Eu ',63),(' 64 Gadolinium Gd ',64),
            (' 65 Terbium Tb ',65),(' 66 Dysprosium Dy ',66),(' 67 Holmium Ho ',67),(' 68 Erbium Er ',68),
            (' 69 Thulium Tm ',69),(' 70 Ytterbium Yb ',70),(' 71 Lutetium Lu ',71),(' 72 Hafnium Hf ',72),
            (' 73 Tantalum Ta ',73),(' 74 Tungsten W ',74),(' 75 Rhenium Re ',75),(' 76 Osmium Os ',76),
            (' 77 Iridium Ir ',77),(' 78 Platinum Pt ',78),(' 79 Gold Au ',79),(' 80 Mercury Hg ',80),
            (' 81 Thallium Tl ',81),(' 82 Lead Pb ',82),(' 83 Bismuth Bi ',83),(' 84 Polonium Po ',84),
            (' 85 Astatine At ',85),(' 86 Radon Rn ',86),(' 87 Francium Fr ',87),(' 88 Radium Ra ',88),
            (' 89 Actinium Ac ',89),(' 90 Thorium Th ',90));

In[4]
selectAtom = widgets.Dropdown(
    options= elements,
    value=2,
    description='Atom:',
)
atomsLabel = widgets.Checkbox(
    value=False,
    description='Atomic label',
    disabled=False,
    indent=False
)
emissionType= widgets.Dropdown(
    options=['plane', 'cones'],
    value='plane',
    description='Emission:',
)
coloredEmissions = widgets.Checkbox(
    value=False,
    description='Color emissions',
    disabled=False,
    indent=False
)
# Changes the distance between adjacent orthogonal protons
ePSlider = widgets.FloatSlider(
    value = pRadius*6.0,
    min = pRadius*4.0,
    max = pRadius*8.0,
    step= pRadius/100,
    description='Equ1_Pole2',
)
# Changes the distance tween top and bottom alpha parallel protons
pPSlider = widgets.FloatSlider(
    value = pRadius*6.0,
    min = pRadius*4.0,
    max = pRadius*8.0,
    step= pRadius/100,
    description='A width',
)
# Changes the pole to pole distance between 2 adjacent alphas
p2p3Slider = widgets.FloatSlider(
    value = pRadius*4.0,
    min = pRadius*3.0,
    max = pRadius*6.0,
    step= pRadius/100,
    description='A1_A2 Sep',
)
widgets.VBox([selectAtom,atomsLabel,emissionType,
              coloredEmissions,ePSlider,pPSlider,p2p3Slider])

In[5]
number = selectAtom.value
def handle_change(change):
    global number
    number = change.new
selectAtom.observe(handle_change, 'value')

orthoP = ePSlider.value # proton1 equator to proton2 pole
def handle_change(change):
    global orthoP
    orthoP = change.new
ePSlider.observe(handle_change, 'value');

pPTP = pPSlider.value  # proton pole to proton pole
def handle_change(change):
    global pPTP
    pPTP = change.new
pPSlider.observe(handle_change, 'value')

p2p3Dist = p2p3Slider.value # between 2 adjacent alphas
def handle_change(change):
    global p2p3Dist
    p2p3Dist = change.new
p2p3Slider.observe(handle_change, 'value')

In[6]
An = elements[number-1]
atomicLabel = An[0]
print(atomicLabel) # used to verify An control changes, eliminate this line at any time.
print(emissionType.value)  

In[7]
atomicNumber = number  # Select the desired atom from the dropdown widget
grpAn = Group()  # The rotation widget spins grpAn, slots 1,4 and 5.  
grpBn = Group()  # grpBn are the orthogonal top, bottom and hook slots.

# Dimensions
# pRadius is now in In[1]
orthoP = pRadius*6 # Dist. between adjacent vertical and horiz protons. Moved to widget controls
emRadius = 2*orthoP # Widget control
coneAngle = 2*piG/12 # Cone emission angle from the equator.
coneHeight = emRadius*tan(coneAngle) #emRadius*tan(2*piG/7.5) # 40deg #emRadius*tan(piG/6)
pP1pP2 = pPTP # Separation of an alpha's two protons .
nRadius = pRadius*1.125 # Neutron radius
eRadius = 2*pRadius/10 # Electron radius
p1p2 = pRadius*2.5  #0.75*pP1pP2 # pRadius*2.5
p2p3 = p2p3Dist # 0.5*pP1pP2 # pRadius*2.85 #p2p3 = 0.5*pP1pP2 # pRadius*2.85
n1n2 = pP1pP2 # Within the Alpha, neutron-neutron orbital separation (y)
p1n1 = pP1pP2/2 #pP1pP2/2 #pP1pP2/2 # Alpha, up-down (z) proton-orbital neutron separation
p1n2 = pP1pP2/2 #pRadius + nRadius + 1.5*pRadius  # In line proton and neutron
p1e1 = pRadius + 0.05*pP1pP2 # Alpha, top-bottom (z) proton-electron separation
e1e2 = 0.25*orthoP # 1.5*pRadius # pRadius/0.75  # 0.5  # electron-electron separation
maxZNeg = 0.0 # maxZNeg and maxZPos are Used to center(z) the atom on the screen
maxZPos = 0.0  

# Proton set Geometries and Materials
protonGeometry =  SphereBufferGeometry(pRadius, 24, 16)
neutronGeometry =  SphereBufferGeometry(nRadius, 24, 16)
electronGeometry =  SphereBufferGeometry(eRadius, 8, 16)
emissionGeometryP = CircleGeometry(emRadius, 24)
emissionGeometryX = ConeGeometry( emRadius, coneHeight, 16, openEnded = True )
protonMaterial = MeshStandardMaterial(color='blue')
protonMaterialB = MeshStandardMaterial(color='green')
neutronMaterial = MeshStandardMaterial(color='red')
neutronMaterialB = MeshStandardMaterial(color='green') # Color.js Find a nice color spectrum
electronMaterial = MeshStandardMaterial(color='cyan') #'orangered','salmon','green','cyan','teal','orange'
emissionmaterial7= MeshStandardMaterial(color='gray',side='DoubleSide',transparent = True,opacity = 0.20)
emissionmaterial1 = MeshStandardMaterial(color='magenta',side='DoubleSide',transparent = True,opacity = 0.20)
emissionmaterial2 = MeshStandardMaterial(color='blue',side='DoubleSide',transparent = True,opacity = 0.20)
emissionmaterial3 = MeshStandardMaterial(color='pink',side='DoubleSide',transparent = True,opacity = 0.20)
emissionmaterial4 = MeshStandardMaterial(color='salmon',side='DoubleSide',transparent = True,opacity = 0.20)
emissionmaterial5 = MeshStandardMaterial(color='lime',side='DoubleSide',transparent = True,opacity = 0.20)
emissionmaterial6 = MeshStandardMaterial(color='skyblue',side='DoubleSide',transparent = True,opacity = 0.20)

def neutronsPls(n): # n is the total number of neutrons, 1 or 2
    neutron1 = Object3D()
    neutron1.add(Mesh(neutronGeometry, neutronMaterial))
    if n == 1 :
        neutron1.position = [0,0,0] # the register can move the neut if needed
        neutrons.add(neutron1)
    elif n == 2 :
        neutron1.position = [0,-p2p3,0]
        neutrons.add(neutron1)
        neutron2 = Object3D()
        neutron2.add(Mesh(neutronGeometry, neutronMaterial))
        neutron2.position = [0,p2p3,0]        
        neutrons.add(neutron2)        
        neutrons.rotateY(random()*2*piG) # Initial random spin positions
    return

def buildProtonStack(a): #  a is the total # of protons.
    num = 0  
    if coloredEmissions.value == True:
        if a == 2 : emissionmaterial = emissionmaterial2
        if a == 3 : emissionmaterial = emissionmaterial3
        if a == 4 : emissionmaterial = emissionmaterial4
        if a == 5 : emissionmaterial = emissionmaterial5
        if a == 6 : emissionmaterial = emissionmaterial6
    else:
        emissionmaterial = emissionmaterial7
    # Proton z positions:
    if a == 2 : pPositions = [pP1pP2/2,-pP1pP2/2]
    if a == 3 : pPositions = [pP1pP2/2+p2p3/2,-pP1pP2/2+p2p3/2,-pP1pP2/2-p2p3/2]
    if a == 4 : pPositions = [pP1pP2+p2p3/2,p2p3/2,-p2p3/2,-pP1pP2-p2p3/2]
    if a == 5 : pPositions = [pP1pP2+p2p3,p2p3,0,-pP1pP2,-pP1pP2-p2p3]
    if a == 6 : pPositions = [3*pP1pP2/2+p2p3,pP1pP2/2+p2p3,pP1pP2/2,-pP1pP2/2,-pP1pP2/2-p2p3,-3*pP1pP2/2-p2p3]
    while num < a:
        protonMi = Group()
        protonMi.add(Mesh(protonGeometry, protonMaterial))    
        if emissionType.value == 'plane':
            protonMi.add(Mesh(emissionGeometry, emissionmaterial))  
        if emissionType.value == 'cones':
            emission1 = Object3D()
            emission1.add(Mesh(emissionGeometry, emissionmaterial))
            emission1.position = [0,0,coneHeight/2]            
            emission1.rotateX(-piG/2)
            protonMi.add(emission1)
            emission2 = Object3D()
            emission2.add(Mesh(emissionGeometry, emissionmaterial))
            emission2.position = [0,0,-coneHeight/2]            
            emission2.rotateX(piG/2)
            protonMi.add(emission2)
            protonMi.add(Mesh(emissionGeometryP, emissionmaterial))
        electronMi = Object3D()
        electronMi.add(Mesh(electronGeometry, electronMaterial))
        electronMi.position = [0,-e1e2/2,-p1e1]
        protonMi.add(electronMi)
        if num%2 != 0:
            neutronPair = Group()
            neutronMi = Object3D()
            neutronMi.add(Mesh(neutronGeometry, neutronMaterial))
            neutronMi.position = [0,-n1n2/2,-p1n1]
            neutronNi = Object3D()
            neutronNi.add(Mesh(neutronGeometry, neutronMaterial))
            neutronNi.position = [0,n1n2/2,-p1n1]
            neutronPair.add(neutronMi)
            neutronPair.add(neutronNi)
            neutronPair.rotateZ(random()*2*piG) # Initial random spin positions
            protonMi.add(neutronPair)
            protonMi.rotateX(piG)
        protonMi.position = [0,0,pPositions[num]]        
        proStack.add(protonMi)                
        num += 1
    return
        
# Assemble the atomic models.
for i in range( atomicNumber ):

    if emissionType.value == 'plane':
        emissionGeometry = emissionGeometryP
    if emissionType.value == 'cones':
        emissionGeometry = emissionGeometryX    

    neutronGi = Object3D()
    neutronGi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronKi = Object3D()
    neutronKi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronLi = Object3D()
    neutronLi.add(Mesh(neutronGeometry, neutronMaterial))
    
    protonWoN = Group() # Proton Without a Neutron
    if coloredEmissions.value == True:
        emissionmaterial = emissionmaterial1
    else:
        emissionmaterial = emissionmaterial7
    
    protonWoN.add(Mesh(protonGeometry, protonMaterial))
    if emissionType.value == 'plane':
            protonWoN.add(Mesh(emissionGeometry, emissionmaterial))  
    if emissionType.value == 'cones':
            emission1 = Object3D()
            emission1.add(Mesh(emissionGeometry, emissionmaterial))
            emission1.position = [0,0,coneHeight/2]            
            emission1.rotateX(-piG/2)
            protonWoN.add(emission1)
            emission2 = Object3D()
            emission2.add(Mesh(emissionGeometry, emissionmaterial))
            emission2.position = [0,0,-coneHeight/2]            
            emission2.rotateX(piG/2)
            protonWoN.add(emission2)
            protonWoN.add(Mesh(emissionGeometryP, emissionmaterial))
    electronWoN = Object3D()
    electronWoN.add(Mesh(electronGeometry, electronMaterial))
    electronWoN.position = [0,-e1e2/2,-p1e1]
    protonWoN.add(electronWoN)  
    
    protonWiN = Group() # Proton With a Neutron
    protonWiN.add(Mesh(protonGeometry, protonMaterial))
    if emissionType.value == 'plane':
            protonWiN.add(Mesh(emissionGeometry, emissionmaterial))  
    if emissionType.value == 'cones':
            emission1 = Object3D()
            emission1.add(Mesh(emissionGeometry, emissionmaterial))
            emission1.position = [0,0,coneHeight/2]            
            emission1.rotateX(-piG/2)
            protonWiN.add(emission1)
            emission2 = Object3D()
            emission2.add(Mesh(emissionGeometry, emissionmaterial))
            emission2.position = [0,0,-coneHeight/2]            
            emission2.rotateX(piG/2)
            protonWiN.add(emission2)
            protonWiN.add(Mesh(emissionGeometryP, emissionmaterial))
    electronWiN = Object3D()
    electronWiN.add(Mesh(electronGeometry, electronMaterial))
    electronWiN.position = [0,-e1e2/2,-p1e1]
    protonWiN.add(electronWiN)
    neutronWiN = Object3D()
    neutronWiN.add(Mesh(neutronGeometry, neutronMaterial))
    neutronWiN.position = [0,-n1n2/2,-p1n1]
    protonWiN.add(neutronWiN)

    if i == 0: # Slot 1
        if 1 == atomicNumber: # Hydrogen. Slot 1
            neutronWiN.position = [0,0,-p1n2]
            grpAn.add( protonWiN )
            print('protonWiN[',i+1,']', protonWiN.position)
        if 2 <= atomicNumber < 6: # Helium
            proStack = Group()
            buildProtonStack(2)            
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)            
        if 6 == atomicNumber :
            proStack = Group()
            buildProtonStack(4)            
            grpAn.add(proStack)
            print('proStack 4[',i+1,']', proStack.position)
            maxZNeg = -p2p3/2 - pP1pP2 - 2*orthoP
            maxZPos = p2p3/2 + pP1pP2 + 2*orthoP
        if 7 <= atomicNumber < 10 :
            proStack = Group()
            buildProtonStack(6)            
            grpAn.add(proStack)
            print('proStack 6[',i+1,']', proStack.position)
            maxZNeg = -p2p3/2 - pP1pP2 - 2*orthoP
            maxZPos = p2p3/2 + pP1pP2 + 2*orthoP
        if 10 <= atomicNumber < 36 :
            proStack = Group()
            buildProtonStack(2)            
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 36 <= atomicNumber < 54 :
            proStack = Group()
            buildProtonStack(4)            
            grpAn.add(proStack)
            print('proStack 4[',i+1,']', proStack.position)
        if 54 <= atomicNumber < 57:
            proStack = Group()
            buildProtonStack(6)            
            grpAn.add(proStack)
            print('proStack 6[',i+1,']', proStack.position)
        if 57 <= atomicNumber < 71:
            proStack = Group()
            buildProtonStack(5)            
            grpAn.add(proStack)
            print('proStack 5[',i+1,']', proStack.position)
        if 71 <= atomicNumber :
            proStack = Group()
            buildProtonStack(6)            
            grpAn.add(proStack)
            print('proStack 6[',i+1,']', proStack.position)
            
    if i == 1: # Slot 2
        if 2 < atomicNumber < 6:
            protonWoN.rotateX(-piG/2)            
            protonWoN.position = [0, 0, pP1pP2/2+2*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -pP1pP2/2
            maxZPos = pP1pP2/2+2*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 6 == atomicNumber : # Lithium
            protonWoN.rotateX(-piG/2)            
            protonWoN.position = [0, 0, p2p3/2+pP1pP2+2*orthoP]
            grpBn.add(protonWoN)
            #maxZNeg = -pP1pP2/2
            #maxZPos = pP1pP2/2+2*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 7 <= atomicNumber < 10 : # Lithium
            protonWoN.rotateX(-piG/2)            
            protonWoN.position = [0, 0, 3*pP1pP2/2 + p2p3 + 2*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2 - p2p3/2
            maxZPos = pP1pP2/2+2*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 10 <= atomicNumber < 36 :
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateX(-piG/2)
            proStack.position = [0, 0, pP1pP2/2 + 2*orthoP]
            grpBn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 36 <= atomicNumber < 54:
            proStack = Group()
            buildProtonStack(4)
            proStack.rotateX(piG/2)
            proStack.position = [0,0,p1p2/2+pP1pP2+2*orthoP]
            grpBn.add(proStack)
            print('proStack 4[',i+1,']', proStack.position)
        if 54 <= atomicNumber < 57 :
            proStack = Group()
            buildProtonStack(6)
            proStack.rotateX(piG/2)
            proStack.position = [0,0,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(proStack)
            print('proStack 6[',i+1,']', proStack.position)            
        if 57 <= atomicNumber < 71 :
            proStack = Group()
            buildProtonStack(5)
            proStack.rotateX(piG/2)  
            proStack.position = [0,0,p2p3+pP1pP2+2*orthoP]
            grpBn.add(proStack)
            print('proStack 5[',i+1,']', proStack.position)
        if 71 <= atomicNumber :
            proStack = Group()
            buildProtonStack(6)
            proStack.rotateX(piG/2)
            proStack.position = [0,0,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(proStack)
            print('proStack 6[',i+1,']', proStack.position)            

    if i == 2: # Slot 3
        if 3 < atomicNumber < 5: # Beryllium
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, -pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -pP1pP2/2-2*orthoP
            maxZPos = pP1pP2/2+2*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 5 == atomicNumber : # Beryllium
            protonWiN.rotateX(piG/2)
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, -p2p3/2, -pP1pP2/2-2*orthoP]
            neutronWiN.position = [0, 0, -p2p3]
            protonWiN.position = [0, p2p3/2, -pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            grpBn.add(protonWiN)
            maxZNeg = -pP1pP2/2-2*orthoP
            maxZPos = pP1pP2/2+2*orthoP
            print('protonWoN and Win[',i+1,']', protonWoN.position)
        if 6 == atomicNumber :
            protonWoN.rotateX(-piG/2)            
            protonWoN.position = [0, 0, -p2p3/2-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)            
        if 9 == atomicNumber :
            protonWiN.rotateX(piG/2)
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, -p2p3/2, -p2p3-3*pP1pP2/2-2*orthoP]
            neutronWiN.position = [0, 0, -p2p3]
            protonWiN.position = [0, p2p3/2, -p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            grpBn.add(protonWiN)
            print('protonWoN and Win[',i+1,']', protonWoN.position)            
        if 10 <= atomicNumber < 36 :
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateX(-piG/2)
            proStack.position = [0, 0, -pP1pP2/2 - 2*orthoP]
            grpBn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 36 <= atomicNumber < 54 :
            proStack = Group()
            buildProtonStack(4)
            proStack.rotateX(piG/2)
            proStack.position = [0,0,-p1p2/2-pP1pP2-2*orthoP]
            grpBn.add(proStack)
            print('proStack 4[',i+1,']', proStack.position)            
        if 54 <= atomicNumber < 57 :
            proStack = Group()
            buildProtonStack(6)
            proStack.rotateX(piG/2)
            proStack.position = [0,0,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack)
            print('proStack 6[',i+1,']', proStack.position)  
        if 57 <= atomicNumber < 71 :
            proStack = Group()
            buildProtonStack(5)
            proStack.rotateX(piG/2)  
            proStack.position = [0,0,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(proStack)
            print('proStack 5[',i+1,']', proStack.position)
        if 71 <= atomicNumber :
            proStack = Group()
            buildProtonStack(6)
            proStack.rotateX(piG/2)
            proStack.position = [0,0,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack)
            print('proStack 6[',i+1,']', proStack.position)            
            
    if i == 3: # Slot 4
        if 10 <= atomicNumber < 14: # Neon
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0, 0, pP1pP2 + 4*orthoP]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 15 == atomicNumber :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0, 0, pP1pP2 + 4*orthoP]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
            maxZNeg = -3*pP1pP2/2-6*orthoP
            maxZPos = 3*pP1pP2/2+4*orthoP
        if 16 == atomicNumber :
            protonWoN.position = [0, 0, pP1pP2/2 + 4*orthoP]
            grpAn.add(protonWoN)
            maxZNeg = -pP1pP2/2-4*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 17 <= atomicNumber < 36 :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0, 0, pP1pP2 + 4*orthoP]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 36 <= atomicNumber < 54:
            proStack = Group()
            buildProtonStack(4)
            proStack.position = [0,0,p1p2/2+pP1pP2+p1p2/2+pP1pP2+4*orthoP]
            grpAn.add(proStack)
            print('proStack 4[',i+1,']', proStack.position)            
        if 54 <= atomicNumber < 57:
            proStack = Group()
            buildProtonStack(6)
            proStack.position = [0,0,2*p2p3+3*pP1pP2+4*orthoP]
            grpAn.add(proStack)
            print('proStack 6[',i+1,']', proStack.position)
        if 57 <= atomicNumber < 71:
            proStack = Group()
            buildProtonStack(5)
            proStack.position = [0,0,2*p2p3+2*pP1pP2+4*orthoP]
            grpAn.add(proStack)
            print('proStack 5[',i+1,']', proStack.position)
        if 71 <= atomicNumber :
            proStack = Group()
            buildProtonStack(6)
            proStack.position = [0,0,2*p2p3+3*pP1pP2+4*orthoP]
            grpAn.add(proStack)              
            print('proStack 6[',i+1,']', proStack.position)
            
    if i == 4: # Slot 5
        if 10 <= atomicNumber < 14 :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0, 0, -pP1pP2 - 4*orthoP]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 15 == atomicNumber :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0, 0, -pP1pP2 - 4*orthoP]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 16 == atomicNumber :
            protonWoN.position = [0, 0, -pP1pP2/2 - 4*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -pP1pP2/2-4*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 17 <= atomicNumber < 36 :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0, 0, -pP1pP2 - 4*orthoP]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 21 <= atomicNumber < 22 :
            neutronGi.position = [0,0,-3*pP1pP2/2-4*orthoP-p1p2]
            grpAn.add(neutronGi)
            print('and a neutron[',i+1,']', neutronGi.position)
        if 36 <= atomicNumber < 54:
            proStack = Group()
            buildProtonStack(4)
            proStack.position = [0,0,-p1p2/2-pP1pP2-p1p2/2-pP1pP2-4*orthoP]
            grpAn.add(proStack)            
            print('proStack 4[',i+1,']', proStack.position)
        if 54 <= atomicNumber < 57:
            proStack = Group()
            buildProtonStack(6)
            proStack.position = [0,0,-2*p2p3-3*pP1pP2-4*orthoP]
            grpAn.add(proStack)            
            print('proStack 6[',i+1,']', proStack.position)
        if 57 <= atomicNumber < 71:
            proStack = Group()
            buildProtonStack(5)
            proStack.position = [0,0,-2*p2p3-2*pP1pP2-4*orthoP]
            grpAn.add(proStack)
            print('proStack 5[',i+1,']', proStack.position)
        if 71 <= atomicNumber :
            proStack = Group()
            buildProtonStack(6)
            proStack.position = [0,0,-2*p2p3-3*pP1pP2-4*orthoP]
            grpAn.add(proStack)            
            print('proStack 6[',i+1,']', proStack.position)
            
    if i == 5: # Slot 6
        if 11 <= atomicNumber  < 14 :
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0, 3*pP1pP2/2+6*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -pP1pP2/2-4*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 17 <= atomicNumber < 18 :
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0, 3*pP1pP2/2+6*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)  
        if 19 <= atomicNumber < 22 :
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0, 3*pP1pP2/2+6*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2-4*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 23 <= atomicNumber < 26 :
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0, 3*pP1pP2/2+6*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2-4*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 26 <= atomicNumber < 29:
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateX(-piG/2)
            proStack.position = [0, 0, 3*pP1pP2/2+6*orthoP]
            grpBn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 29 <= atomicNumber < 31:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0, 3*pP1pP2/2+6*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2-4*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 31 <= atomicNumber < 36 :
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateX(-piG/2)
            proStack.position = [0, 0, 3*pP1pP2/2+6*orthoP]
            grpBn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 37 <= atomicNumber < 48:
            neutronWiN.position = [0,2*orthoP-p2p3,p2p3]            
            protonWiN.rotateX(-piG/2)    
            protonWiN.position = [0,-p2p3/2,3*p1p2/2+6*pP1pP2/2+6*orthoP]
            grpBn.add( protonWiN )
            maxZNeg = -3*p1p2/2-5*pP1pP2/2-4*orthoP
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*orthoP            
            print('protonWiN[',i+1,']', protonWiN.position)
        if 48 <= atomicNumber < 50:
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateX(-piG/2)
            proStack.position = [0, 0, 3*p1p2/2+6*pP1pP2/2+6*orthoP]
            grpBn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 50 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,3*p1p2/2+6*pP1pP2/2+6*orthoP]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)            
        if 51 <= atomicNumber < 54:
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateX(-piG/2)
            proStack.position = [0, 0, 3*p1p2/2+6*pP1pP2/2+6*orthoP]
            grpBn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 55 <= atomicNumber < 57 :
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0,3*p2p3+4.5*pP1pP2+6*orthoP]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)
            maxZNeg = -3*p1p2/2-5*pP1pP2/2-4*orthoP  
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*orthoP            
        if 57 <= atomicNumber < 62:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0,3*p2p3+3*pP1pP2+6*orthoP]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)  
        if 62 <= atomicNumber < 66 :
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateX(-piG/2)
            proStack.position = [0, 0,3*p2p3+3*pP1pP2+6*orthoP]
            grpBn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)                  
        if 66 <= atomicNumber < 71:
            proStack = Group()
            buildProtonStack(3)
            proStack.rotateX(-piG/2)
            proStack.position = [0, 0,3*p2p3+3*pP1pP2+6*orthoP]
            grpBn.add(proStack)
            print('proStack 3[',i+1,']', proStack.position)  
        if 71 == atomicNumber :
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateX(-piG/2)
            proStack.position = [0, 0,3*p2p3+4.5*pP1pP2+6*orthoP]
            grpBn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 72 <= atomicNumber < 78 :
            pASet = Group()
            proStack = Group()
            buildProtonStack(3)
            proStack.rotateX(-piG/2)
            proStack.position = [0, 0,3*p2p3+4.5*pP1pP2+6*orthoP]
            grpBn.add(proStack)
            print('proStack 3[',i+1,']', proStack.position)
        if 78 == atomicNumber :
            proStack = Group()
            buildProtonStack(4)
            proStack.rotateX(-piG/2)
            proStack.position = [0, 0,3*p2p3+4.5*pP1pP2+6*orthoP]
            grpBn.add(proStack)            
            print('proStack 4[',i+1,']', proStack.position)            
        if 79 == atomicNumber :
            pASet = Group()
            proStack = Group()
            buildProtonStack(3)
            proStack.rotateX(-piG/2)
            proStack.position = [0, 0,3*p2p3+4.5*pP1pP2+6*orthoP]
            grpBn.add(proStack)
            print('proStack 3[',i+1,']', proStack.position)
        if 80 <= atomicNumber < 82 :
            proStack = Group()
            buildProtonStack(4)
            proStack.rotateX(-piG/2)
            proStack.position = [0, 0,3*p2p3+4.5*pP1pP2+6*orthoP]
            grpBn.add(proStack)            
            print('proStack 4[',i+1,']', proStack.position)            
        if 82 <= atomicNumber :
            proStack = Group()
            buildProtonStack(5)
            proStack.rotateX(-piG/2)  
            proStack.position = [0, 0,3*p2p3+4.5*pP1pP2+6*orthoP]
            grpBn.add(proStack)
            print('proStack 5[',i+1,']', proStack.position)
            
    if i == 6: # Slot 7
        if 8 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, -3*pP1pP2/2-p2p3-2*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-2*orthoP
            maxZPos = 3*pP1pP2/2+2*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 12 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, -3*pP1pP2/2-6*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 15 == atomicNumber:  
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0, -3*pP1pP2/2-6*orthoP]
            grpBn.add(protonWoN)
            print('protonWoN 1[',i+1,']', protonWoN.position)
        if 20 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0, -3*pP1pP2/2-6*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN 1[',i+1,']', protonWoN.position)
        if 24 <= atomicNumber < 26:
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, -3*pP1pP2/2-6*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 26 <= atomicNumber < 30 :
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateX(piG/2)
            proStack.position = [0, 0, -3*pP1pP2/2-6*orthoP]
            grpBn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 30 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 0, -3*pP1pP2/2-6*orthoP]
            grpBn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 31 <= atomicNumber < 36 :
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateX(piG/2)
            proStack.position = [0, 0, -3*pP1pP2/2-6*orthoP]
            grpBn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)                  
        if 38 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*orthoP]
            grpBn.add( protonWoN )
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*orthoP
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)              
        if 40 <= atomicNumber < 47:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*orthoP]
            grpBn.add( protonWoN )
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*orthoP # verified
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*orthoP            
            print('protonWoN[',i+1,']', protonWoN.position)                
        if 47 <= atomicNumber < 50:
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateX(-piG/2)
            proStack.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*orthoP]
            grpBn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)  
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*orthoP
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*orthoP
        if 50 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*orthoP]
            grpBn.add( protonWoN )
            print('protonWoN[',i+1,']', protonWoN.position)
        if 51 <= atomicNumber < 54:
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateX(-piG/2)
            proStack.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*orthoP]
            grpBn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)  
        if 56 == atomicNumber < 57:
            protonWoN.rotateX(-piG/2)
            protonWoN.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*orthoP]
            grpBn.add( protonWoN )
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*orthoP # needed
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 57 <= atomicNumber < 63:
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateX(-piG/2)
            proStack.position = [0, 0,-3*p2p3-3*pP1pP2-6*orthoP]
            grpBn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 63 <= atomicNumber < 66 :
            pASet = Group()
            proStack = Group()
            buildProtonStack(3)
            proStack.rotateX(-piG/2)
            proStack.position = [0, 0,-3*p2p3-3*pP1pP2-6*orthoP]
            grpBn.add(proStack)
            print('proStack 3[',i+1,']', proStack.position)          
        if 66 == atomicNumber :
            proStack = Group()
            buildProtonStack(4)
            proStack.rotateX(-piG/2)
            proStack.position = [0, 0,-3*p2p3-3*pP1pP2-6*orthoP]
            grpBn.add(proStack)            
            print('proStack 4[',i+1,']', proStack.position)            
        if 67 == atomicNumber :
            pASet = Group()
            proStack = Group()
            buildProtonStack(3)
            proStack.rotateX(-piG/2)
            proStack.position = [0, 0,-3*p2p3-3*pP1pP2-6*orthoP]
            grpBn.add(proStack)
            print('proStack 3[',i+1,']', proStack.position)
        if 68 <= atomicNumber < 71 :
            proStack = Group()
            buildProtonStack(4)
            proStack.rotateX(-piG/2)
            proStack.position = [0, 0,-3*p2p3-3*pP1pP2-6*orthoP]
            grpBn.add(proStack)            
            print('proStack 4[',i+1,']', proStack.position)            
        if 71 <= atomicNumber < 78 :
            proStack = Group()
            buildProtonStack(3)
            proStack.rotateX(-piG/2)
            proStack.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*orthoP]
            grpBn.add(proStack)
            print('proStack 3[',i+1,']', proStack.position)  
        if 78 <= atomicNumber < 82 :
            proStack = Group()
            buildProtonStack(4)
            proStack.rotateX(-piG/2)
            proStack.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*orthoP]
            grpBn.add(proStack)            
            print('proStack 4[',i+1,']', proStack.position)    
        if 82 <= atomicNumber :
            proStack = Group()
            buildProtonStack(5)
            proStack.rotateX(-piG/2)  
            proStack.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*orthoP]
            grpBn.add(proStack)
            print('proStack 5[',i+1,']', proStack.position)            
            
    if i == 7: # Slot 8
        if 13 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 2*orthoP, 0]
            grpAn.add(protonWoN)
            maxZNeg = -3*pP1pP2/2-6*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 14 == atomicNumber :
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateX(piG/2)
            proStack.position = [0,pP1pP2/2+2*orthoP, 0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)                  
        if 15 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, 2*orthoP, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 16 <= atomicNumber < 36:
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateX(piG/2)
            proStack.position = [0,pP1pP2/2+2*orthoP, 0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 36 <= atomicNumber < 54:
            proStack = Group()
            buildProtonStack(4)
            proStack.rotateX(piG/2)
            proStack.position = [0,p1p2/2+pP1pP2+2*orthoP,0]
            grpAn.add(proStack)            
            print('proStack 4[',i+1,']', proStack.position)            
        if 54 <= atomicNumber < 57 :
            proStack = Group()
            buildProtonStack(6)
            proStack.rotateX(piG/2)
            proStack.position = [0,p2p3+3*pP1pP2/2+2*orthoP, 0]
            grpAn.add(proStack)            
            print('proStack 6[',i+1,']', proStack.position)            
        if 57 <= atomicNumber < 71:
            proStack = Group()
            buildProtonStack(5)
            proStack.rotateX(piG/2)  
            proStack.position = [0,p2p3+pP1pP2+2*orthoP,0]
            grpAn.add(proStack)
            print('proStack 5[',i+1,']', proStack.position)
        if 71 <= atomicNumber :
            proStack = Group()
            buildProtonStack(6)
            proStack.rotateX(piG/2)
            proStack.position = [0,p2p3+3*pP1pP2/2+2*orthoP, 0]
            grpAn.add(proStack)            
            print('proStack 6[',i+1,']', proStack.position)    
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Sun Oct 10, 2021 5:13 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Hthrou10

Part 2 of 2.

This image shows both protons’ plane and ‘cone’ emissions for Hydrogen through Carbon mashed with the control panel settings. Note the 3 user variable distances. 1. Equ1_Pole2, the distance between orthogonal emission plane protons, such as the top two (or bottom two) carbon protons on the right. 2. A width, the distance between the two protons within an alpha, such as between helium’s protons. 3. A1_A2 separation, the distance between alphas, in this image seen only at the center of the carbon atom. The coneAngle = 2*piG/12, +/-30deg, needs a control. The side viewpoint, no colors and values used were selected for clarity. You may quibble about the angle, I say limiting the emission field to the flat equatorial plane is plain wrong. The cones and plane indicate the directions of emission field maxima. The atomic result looks like the beveled glass of a Fresnel lighthouse lens. There’s always a minimum emission zone, well protected in the center of the alpha. I would add that one can more easily imagine charge vortices spinning into the cones' polar concavities than into the usual atomic model’s flat disc.  

Lines 948 – 1830. Code end.
Code:


    if i == 8: # Slot 9
        if 13 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, -2*orthoP, 0]
            grpAn.add(protonWoN)#            
            maxZNeg = -pP1pP2/2-4*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('protonWoN[',i+1,']', protonWoN.position)
        if 14 == atomicNumber :
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateX(piG/2)
            proStack.position = [0,-pP1pP2/2-2*orthoP, 0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 15 == atomicNumber :
            protonWoN.rotateX(piG/2)
            protonWoN.position = [0, -2*orthoP, 0]
            grpAn.add(protonWoN)#            
            print('protonWoN[',i+1,']', protonWoN.position)
        if 16 <= atomicNumber < 36:
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateX(piG/2)
            proStack.position = [0,-pP1pP2/2-2*orthoP, 0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 36 <= atomicNumber < 54:
            proStack = Group()
            buildProtonStack(4)
            proStack.rotateX(piG/2)
            proStack.position = [0,-2*orthoP-p1p2/2-pP1pP2,0]
            grpAn.add(proStack)            
            print('proStack 4[',i+1,']', proStack.position)        
        if 54 <= atomicNumber < 57:
            proStack = Group()
            buildProtonStack(6)
            proStack.rotateX(piG/2)
            proStack.position = [0,-p2p3-3*pP1pP2/2-2*orthoP, 0]
            grpAn.add(proStack)            
            print('proStack 6[',i+1,']', proStack.position)                
        if 57 <= atomicNumber < 71:
            proStack = Group()
            buildProtonStack(5)
            proStack.rotateX(piG/2)  
            proStack.position = [0,-p2p3-pP1pP2-2*orthoP,0]
            grpAn.add(proStack)
            print('proStack 5[',i+1,']', proStack.position)
        if 71 <= atomicNumber :
            proStack = Group()
            buildProtonStack(6)
            proStack.rotateX(piG/2)
            proStack.position = [0,-p2p3-3*pP1pP2/2-2*orthoP, 0]
            grpAn.add(proStack)            
            print('proStack 6[',i+1,']', proStack.position)            
            
    if i == 9: # Slot 10
        if 14 == atomicNumber:
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateX(-piG/2)
            proStack.rotateY(piG/2)
            proStack.position = [pP1pP2/2+2*orthoP, 0, 0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)                  
        if 15 == atomicNumber :
            protonWoN.rotateX(-piG/2)
            protonWoN.rotateY(piG/2)
            protonWoN.position = [2*orthoP, 0, 0]
            grpAn.add(protonWoN)#            
            print('protonWoN[',i+1,']', protonWoN.position)
        if 16 == atomicNumber:
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateX(-piG/2)
            proStack.rotateY(piG/2)
            proStack.position = [pP1pP2/2+2*orthoP, 0, 0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 18 <= atomicNumber < 36 :
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateX(-piG/2)
            proStack.rotateY(piG/2)
            proStack.position = [pP1pP2/2+2*orthoP, 0, 0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 21 == atomicNumber :
            neutronGi.position = [p2p3+pP1pP2+2*orthoP, 0, 0]
            grpAn.add(neutronGi)
            print('and a neutron[',i+1,']', neutronGi.position)
        if 36 <= atomicNumber < 54:
            proStack = Group()
            buildProtonStack(4)
            proStack.rotateY(piG/2)
            proStack.position = [2*orthoP+p1p2/2+pP1pP2,0,0]
            grpAn.add(proStack)            
            print('proStack 4[',i+1,']', proStack.position)                    
        if 54 <= atomicNumber < 57 :
            proStack = Group()
            buildProtonStack(6)
            proStack.rotateY(piG/2)
            proStack.position = [p2p3+3*pP1pP2/2+2*orthoP,0,0]
            grpAn.add(proStack)            
            print('proStack 6[',i+1,']', proStack.position)            
        if 57 <= atomicNumber < 71:
            proStack = Group()
            buildProtonStack(5)
            proStack.rotateY(piG/2)  
            proStack.position = [p2p3+pP1pP2+2*orthoP,0,0]
            grpAn.add(proStack)
            print('proStack 5[',i+1,']', proStack.position)
        if 71 <= atomicNumber :
            proStack = Group()
            buildProtonStack(6)
            proStack.rotateY(piG/2)
            proStack.position = [p2p3+3*pP1pP2/2+2*orthoP,0,0]
            grpAn.add(proStack)            
            print('proStack 6[',i+1,']', proStack.position)            
            
    if i == 10: # Slot 11
        if 14 == atomicNumber: # Silicon, the carousal level
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateX(-piG/2)
            proStack.rotateY(piG/2)
            proStack.position = [-pP1pP2/2-2*orthoP, 0, 0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 15 == atomicNumber:
            protonWoN.rotateX(-piG/2)
            protonWoN.rotateY(piG/2)
            protonWoN.position = [-2*orthoP, 0, 0]
            grpAn.add(protonWoN)
            print('protonWoN 1[',i+1,']', protonWoN.position)
        if 16 == atomicNumber:
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateX(-piG/2)
            proStack.rotateY(piG/2)
            proStack.position = [-pP1pP2/2-2*orthoP, 0, 0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 18 <= atomicNumber < 36 :
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateX(-piG/2)
            proStack.rotateY(piG/2)
            proStack.position = [-pP1pP2/2-2*orthoP, 0, 0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 21 == atomicNumber :
            neutronGi.position = [-p2p3 -pP1pP2 - 2*orthoP, 0, 0]
            grpAn.add(neutronGi)
            print('and a neutron[',i+1,']', neutronGi.position)
        if 36 <= atomicNumber < 54:
            proStack = Group()
            buildProtonStack(4)
            proStack.rotateY(piG/2)
            proStack.position = [-2*orthoP-p1p2/2-pP1pP2,0,0]
            grpAn.add(proStack)            
            print('proStack 4[',i+1,']', proStack.position)                      
        if 54 <= atomicNumber < 57:
            proStack = Group()
            buildProtonStack(6)
            proStack.rotateY(piG/2)
            proStack.position = [-p2p3-3*pP1pP2/2-2*orthoP,0,0]
            grpAn.add(proStack)            
            print('proStack 6[',i+1,']', proStack.position)            
        if 57 <= atomicNumber < 71 :
            proStack = Group()
            buildProtonStack(5)
            proStack.rotateY(piG/2)  
            proStack.position = [-p2p3-pP1pP2-2*orthoP,0,0]
            grpAn.add(proStack)
            print('proStack 5[',i+1,']', proStack.position)
        if 71 <= atomicNumber :
            proStack = Group()
            buildProtonStack(6)
            proStack.rotateY(piG/2)
            proStack.position = [-p2p3-3*pP1pP2/2-2*orthoP,0,0]
            grpAn.add(proStack)            
            print('proStack 6[',i+1,']', proStack.position)              
            
    if i == 11: # Slot 12
        if 21 == atomicNumber:
            protonWoN.rotateZ(piG/2)
            protonWoN.position = [0, pP1pP2 + 4*orthoP, 0]
            grpAn.add(protonWoN)
            print('protonWoN 1[',i+1,']', protonWoN.position)
        if 22 <= atomicNumber < 27:
            neutronWiN.position = [0,0, p1n2]            
            protonWiN.rotateZ(piG/2)    
            protonWiN.position = [0, pP1pP2+4*orthoP,0]
            grpAn.add( protonWiN )
            print('protonWiN[',i+1,']', protonWiN.position)
        if 27 == atomicNumber:
            neutronGi.position = [0,p1n2+pP1pP2+2*orthoP,0]
            grpAn.add( neutronGi )
            print('neutronGi[',i+1,']', neutronGi.position)
        if 28 == atomicNumber :
            neutronWiN.position = [0,0,-p1n2]
            protonWiN.rotateZ(piG/2)    
            protonWiN.position = [0, pP1pP2+4*orthoP,0]
            grpAn.add( protonWiN )
            print('protonWiN[',i+1,']', protonWiN.position)
        if 29 <= atomicNumber < 36 :
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateZ(piG/2)
            proStack.position = [0,pP1pP2+4*orthoP,0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)      
        if 42 <= atomicNumber < 47:
            protonWoN.position = [0,4*pP1pP2/2+p1p2+4*orthoP,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 47 <= atomicNumber < 54 :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,4*pP1pP2/2+p1p2+4*orthoP,0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 57 <= atomicNumber < 61:
            protonWoN.position = [0, 2*p2p3+2*pP1pP2+4*orthoP, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 61 <= atomicNumber < 67:
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0, 2*p2p3+2*pP1pP2+4*orthoP, 0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 67 == atomicNumber :
            proStack = Group()
            buildProtonStack(3)
            proStack.position = [0, 2*p2p3+2*pP1pP2+4*orthoP, 0]
            grpAn.add(proStack)
            print('proStack 3[',i+1,']', proStack.position)
        if 68 <= atomicNumber < 71 :
            proStack = Group()
            buildProtonStack(4)
            proStack.position = [0, 2*p2p3+2*pP1pP2+4*orthoP, 0]
            grpAn.add(proStack)            
            print('proStack 4[',i+1,']', proStack.position)            
        if 71 == atomicNumber :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0, 2*p2p3+3*pP1pP2+4*orthoP, 0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 72 <= atomicNumber < 79:
            proStack = Group()
            buildProtonStack(3)
            proStack.position = [0, 2*p2p3+3*pP1pP2+4*orthoP, 0]
            grpAn.add(proStack)
            print('proStack 3[',i+1,']', proStack.position)
        if 79 <= atomicNumber < 82 :
            proStack = Group()
            buildProtonStack(4)
            proStack.position = [0, 2*p2p3+3*pP1pP2+4*orthoP, 0]
            grpAn.add(proStack)            
            print('proStack 4[',i+1,']', proStack.position)            
        if 82 <= atomicNumber < 86:
            proStack = Group()
            buildProtonStack(3)
            proStack.position = [0, 2*p2p3+3*pP1pP2+4*orthoP, 0]
            grpAn.add(proStack)
            print('proStack 3[',i+1,']', proStack.position)
        if 86 <= atomicNumber :
            proStack = Group()
            buildProtonStack(5)
            proStack.position = [0, 2*p2p3+3*pP1pP2+4*orthoP, 0]
            grpAn.add(proStack)
            print('proStack 5[',i+1,']', proStack.position)
            
    if i == 12: # Slot 13
        if 21 == atomicNumber: # Silicon, the carousal level
            protonWoN.rotateZ(piG/2)
            protonWoN.position = [0, -pP1pP2 - 4*orthoP, 0]
            grpAn.add(protonWoN)
            print('protonWoN 1[',i+1,']', protonWoN.position)
        if 22 <= atomicNumber < 29: # Titanium
            neutronWiN.position = [0,0,-p1n2]            
            protonWiN.rotateZ(-piG/2)    
            protonWiN.position = [0,-pP1pP2-4*orthoP,0]
            grpAn.add( protonWiN )
            print('protonWiN[',i+1,']', protonWiN.position)
        if 29 <= atomicNumber < 36:
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateZ(piG/2)
            proStack.position = [0,-pP1pP2-4*orthoP,0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 41 <= atomicNumber < 47:
            protonWoN.position = [0,-4*pP1pP2/2-p1p2-4*orthoP,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 47 <= atomicNumber < 54:
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,-4*pP1pP2/2-p1p2-4*orthoP,0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 57 <= atomicNumber < 61:
            protonWoN.position = [0, -2*p2p3-2*pP1pP2-4*orthoP, 0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 61 <= atomicNumber < 67:
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0, -2*p2p3-2*pP1pP2-4*orthoP, 0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 67 <= atomicNumber < 68:
            proStack = Group()
            buildProtonStack(3)
            proStack.position = [0, -2*p2p3-2*pP1pP2-4*orthoP, 0]
            grpAn.add(proStack)
            print('proStack 3[',i+1,']', proStack.position)
        if 68 <= atomicNumber < 71 :
            proStack = Group()
            buildProtonStack(4)
            proStack.position = [0, -2*p2p3-2*pP1pP2-4*orthoP, 0]
            grpAn.add(proStack)            
            print('proStack 4[',i+1,']', proStack.position)            
        if 71 <= atomicNumber < 79:
            proStack = Group()
            buildProtonStack(3)
            proStack.position = [0, -2*p2p3-3*pP1pP2-4*orthoP, 0]
            grpAn.add(proStack)
            print('proStack 3[',i+1,']', proStack.position)
        if 79 <= atomicNumber < 82 :
            proStack = Group()
            buildProtonStack(4)
            proStack.position = [0, -2*p2p3-3*pP1pP2-4*orthoP, 0]
            grpAn.add(proStack)            
            print('proStack 4[',i+1,']', proStack.position)            
        if 82 <= atomicNumber < 86:
            proStack = Group()
            buildProtonStack(3)
            proStack.position = [0, -2*p2p3-3*pP1pP2-4*orthoP, 0]
            grpAn.add(proStack)
            print('proStack 3[',i+1,']', proStack.position)
        if 86 <= atomicNumber :
            proStack = Group()
            buildProtonStack(5)
            proStack.position = [0, -2*p2p3-3*pP1pP2-4*orthoP, 0]
            grpAn.add(proStack)
            print('proStack 5[',i+1,']', proStack.position)
            
    if i == 13: # Slot 14
        if 22 <= atomicNumber < 27:
            neutronWiN.position = [0,0, -p1n2]            
            protonWiN.rotateZ(-piG/2)    
            protonWiN.position = [4*orthoP+pP1pP2,0,0]
            grpAn.add( protonWiN )
            print('protonWiN[',i+1,']', protonWiN.position)            
        if 27 <= atomicNumber < 36:
            proStack = Group()
            buildProtonStack(2)
            proStack.rotateZ(-piG/2)
            proStack.position = [4*orthoP+pP1pP2,0,0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 39 <= atomicNumber < 48:        
            protonWoN.position = [4*pP1pP2/2+p1p2+4*orthoP,0,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 48 <= atomicNumber < 54:
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [4*pP1pP2/2+p1p2+4*orthoP,0,0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 57 <= atomicNumber < 63:
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [2*p2p3+2*pP1pP2+4*orthoP,0,0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 63 <= atomicNumber < 71:
            proStack = Group()
            buildProtonStack(3)
            proStack.position = [2*p2p3+2*pP1pP2+4*orthoP,0,0]
            grpAn.add(proStack)
            print('proStack 3[',i+1,']', proStack.position)
        if 71 <= atomicNumber < 74:
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [2*p2p3+3*pP1pP2+4*orthoP,0,0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 74 <= atomicNumber < 80:
            proStack = Group()
            buildProtonStack(3)
            proStack.position = [2*p2p3+3*pP1pP2+4*orthoP,0,0]
            grpAn.add(proStack)
            print('proStack 3[',i+1,']', proStack.position)
        if 80 <= atomicNumber < 82:
            proStack = Group()
            buildProtonStack(4)
            proStack.position = [2*p2p3+3*pP1pP2+4*orthoP,0,0]
            grpAn.add(proStack)            
            print('proStack 4[',i+1,']', proStack.position)    
        if 82 <= atomicNumber :
            proStack = Group()
            buildProtonStack(5)
            proStack.position = [2*p2p3+3*pP1pP2+4*orthoP,0,0]
            grpAn.add(proStack)
            print('proStack 5[',i+1,']', proStack.position)

    if i == 14: # Slot 15
        if 22 <= atomicNumber < 28 :
            protonWoN.position = [-pP1pP2 - 4*orthoP, 0,0]
            grpAn.add(protonWoN)
            print('protonWoN 1[',i+1,']', protonWoN.position)
        if 28 == atomicNumber :
            proStack = Group()
            buildProtonStack(2)
            multiAlpha.rotateZ(-piG/2)
            proStack.position = [-4*orthoP-pP1pP2,0,0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 29 <= atomicNumber < 36 :
            proStack = Group()
            buildProtonStack(2)
            multiAlpha.rotateZ(-piG/2)
            proStack.position = [-4*orthoP-pP1pP2,0,0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 39 <= atomicNumber < 48:
            protonWoN.position = [-4*pP1pP2/2-p1p2-4*orthoP,0,0]
            grpAn.add(protonWoN)
            print('protonWoN[',i+1,']', protonWoN.position)
        if 48 <= atomicNumber < 54:
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [-4*pP1pP2/2-p1p2-4*orthoP,0,0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)    
        if 57 <= atomicNumber < 63 :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [-2*p2p3-2*pP1pP2-4*orthoP,0,0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 63 <= atomicNumber < 71 :####################################Check
            proStack = Group()
            buildProtonStack(3)
            proStack.position = [-2*p2p3-2*pP1pP2-4*orthoP,0,0]
            grpAn.add(proStack)
            print('proStack 3[',i+1,']', proStack.position)
        if 71 == atomicNumber :####################################
            proStack = Group()
            buildProtonStack(3)
            proStack.position = [-2*p2p3-3*pP1pP2-4*orthoP, 0, 0]
            grpAn.add(proStack)
            print('proStack 3[',i+1,']', proStack.position)
        if 72 <= atomicNumber < 74 :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [-2*p2p3-3*pP1pP2-4*orthoP,0,0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 74 == atomicNumber :
            proStack = Group()
            buildProtonStack(3)
            proStack.position = [-2*p2p3-3*pP1pP2-4*orthoP,0,0]
            grpAn.add(proStack)
            print('proStack 3[',i+1,']', proStack.position)
        if 75 == atomicNumber :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [-2*p2p3-3*pP1pP2-4*orthoP,0,0]
            grpAn.add(proStack)
            print('proStack 2[',i+1,']', proStack.position)
        if 76 <= atomicNumber < 80 :
            proStack = Group()
            buildProtonStack(3)
            proStack.position = [-2*p2p3-3*pP1pP2-4*orthoP,0,0]
            grpAn.add(proStack)
            print('proStack 3[',i+1,']', proStack.position)
        if 80 <= atomicNumber < 82:
            proStack = Group()
            buildProtonStack(4)
            proStack.position = [-2*p2p3-3*pP1pP2-4*orthoP,0,0]
            grpAn.add(proStack)            
            print('proStack 4[',i+1,']', proStack.position)              
        if 82 <= atomicNumber :
            proStack = Group()
            buildProtonStack(5)
            proStack.position = [-2*p2p3-3*pP1pP2-4*orthoP,0,0]
            grpAn.add(proStack)
            print('proStack 5[',i+1,']', proStack.position)
            
    if i == 15: # Slot 16
        if 27 <= atomicNumber < 30:
            neutronGi.position = [0,pP1pP2/2+p1n2,pP1pP2/2 + 2*orthoP]
            grpBn.add( neutronGi )
            print('hook neutron[',i+1,']', neutronGi.position)
        if 33 <= atomicNumber < 36:
            protonWoN.position = [0, pP1pP2/2+2*orthoP, pP1pP2/2+2*orthoP]
            grpBn.add( protonWoN )
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 46 <= atomicNumber < 48:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*orthoP,p1p2/2+pP1pP2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)            
        if 49 == atomicNumber:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*orthoP,p1p2/2+pP1pP2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)            
        if 53 == atomicNumber:
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,p1p2/2+pP1pP2+2*orthoP,p1p2/2+pP1pP2+2*orthoP]
            grpBn.add(proStack)
            print('hook proStack 2[',i+1,']', proStack.position)          
        if 60 <= atomicNumber < 62:
            protonWoN.position = [0,p2p3+pP1pP2+2*orthoP,p2p3+pP1pP2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)              
        if 64 <= atomicNumber < 66:
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,p2p3+pP1pP2+2*orthoP,p2p3+pP1pP2+2*orthoP]
            grpBn.add(proStack)
            print('hook proStack 2[',i+1,']', proStack.position)  
        if 70 == atomicNumber :
            protonWoN.position = [0,p2p3+pP1pP2+2*orthoP,p2p3+pP1pP2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)    
        if 72 <= atomicNumber < 74:
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)  
        if 75 == atomicNumber :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,p2p3+3*pP1pP2/2+2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(proStack)
            print('hook proStack 2[',i+1,']', proStack.position)
        if 77 <= atomicNumber < 80:
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,p2p3+3*pP1pP2/2+2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(proStack)
            print('hook proStack 2[',i+1,']', proStack.position)          
        if 81 == atomicNumber :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,p2p3+3*pP1pP2/2+2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(proStack)
            print('hook proStack 2[',i+1,']', proStack.position)        
        if 82 == atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 83 <= atomicNumber < 86 :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,p2p3+3*pP1pP2/2+2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(proStack)
            print('hook proStack 2[',i+1,']', proStack.position)
        if 87 <= atomicNumber < 89 :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)  
        if 89 <= atomicNumber :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,p2p3+3*pP1pP2/2+2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(proStack)
            print('hook proStack 2[',i+1,']', proStack.position)
        
    if i == 16: # Slot 17
        if 26 <= atomicNumber < 30:
            neutronGi.position = [0,-pP1pP2/2-p1n2,-pP1pP2/2 - 2*orthoP]
            grpBn.add( neutronGi )
            print('hook neutron[',i+1,']', neutronGi.position)            
        if 34 <= atomicNumber < 36:
            protonWoN.position = [0,-pP1pP2/2- 2*orthoP,-pP1pP2/2 - 2*orthoP]
            grpBn.add( protonWoN )
            print('hook protonWoN[',i+1,']', protonWoN.position)  
        if 45 <= atomicNumber < 48:            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*orthoP,-p1p2/2-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 51 == atomicNumber:            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*orthoP,-p1p2/2-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 53 == atomicNumber :            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*orthoP,-p1p2/2-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 59 <= atomicNumber < 63 :
            protonWoN.position = [0,-p2p3-pP1pP2-2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 65 <= atomicNumber < 66 :
            protonWoN.position = [0,-p2p3-pP1pP2-2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 68 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 69 == atomicNumber :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,-p2p3-pP1pP2-2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(proStack)
            print('hook proStack 2[',i+1,']', proStack.position)
        if 70 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 72 == atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 73 == atomicNumber :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack)
            print('hook proStack 2[',i+1,']', proStack.position)
        if 74 == atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 75 == atomicNumber :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack)
            print('hook proStack 2[',i+1,']', proStack.position)
        if 77 <= atomicNumber < 80 :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack)
            print('hook proStack 2[',i+1,']', proStack.position)
        if 81 <= atomicNumber < 84:
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 84 <= atomicNumber < 86 :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack)
            print('hook proStack 2[',i+1,']', proStack.position)
        if 87 <= atomicNumber < 90 :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 90 <= atomicNumber :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack)
            print('hook proStack 2[',i+1,']', proStack.position)
        
    if i == 17: # Slot 18
        if 25 == atomicNumber: # Manganese
            protonWoN.position = [0,-pP1pP2/2-2*orthoP, pP1pP2/2+2*orthoP]
            grpBn.add( protonWoN )
            maxZNeg = -3*pP1pP2/2-8*orthoP
            maxZPos =  3*pP1pP2/2+8*orthoP
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 26 <= atomicNumber < 29:
            neutronGi.position = [0,-pP1pP2/2-p1n2,pP1pP2/2 + 2*orthoP]
            grpBn.add( neutronGi )            
            print('hook neutron[',i+1,']', neutronGi.position)
        if 29 <= atomicNumber < 30:
            neutrons = Group()
            neutronsPls(2)
            neutrons.rotateX(piG/2)
            neutrons.position = [0,-pP1pP2/2-p1n2,+pP1pP2/2+2*orthoP]
            grpBn.add( neutrons )            
            print('pair of hook neutrons[',i+1,']', neutrons.position)            
        if 30 <= atomicNumber < 36:
            protonWoN.position = [0,-pP1pP2/2-2*orthoP,pP1pP2/2+2*orthoP]
            grpBn.add( protonWoN )
            print('hook protonWoN[',i+1,']', protonWoN.position)  
        if 44 <= atomicNumber < 47:            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*orthoP,p1p2/2+pP1pP2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 50 == atomicNumber:
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,-p1p2/2-pP1pP2-2*orthoP,p1p2/2+pP1pP2+2*orthoP]
            grpBn.add(proStack)
            print('hook proStack 2[',i+1,']', proStack.position)
        if 51 == atomicNumber:            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*orthoP,p1p2/2+pP1pP2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 52 == atomicNumber :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,-p1p2/2-pP1pP2-2*orthoP,p1p2/2+pP1pP2+2*orthoP]
            grpBn.add(proStack)
            print('hook proStack 2[',i+1,']', proStack.position)
        if 53 == atomicNumber :            
            protonWoN.position = [0,-p1p2/2-pP1pP2-2*orthoP,p1p2/2+pP1pP2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 57 <= atomicNumber < 68 :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,-p2p3-pP1pP2-2*orthoP,p2p3+pP1pP2+2*orthoP]
            grpBn.add(proStack)
            print('hook proStack 2[',i+1,']', proStack.position)
        if 70 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*orthoP,p2p3+pP1pP2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 71 == atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 76 == atomicNumber:
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,-p2p3-pP1pP2-2*orthoP,p2p3+pP1pP2+2*orthoP]
            grpBn.add(proStack)
            print('hook proStack 2[',i+1,']', proStack.position)
        if 77 == atomicNumber :
            protonWoN.position = [0,-p2p3-pP1pP2-2*orthoP,p2p3+pP1pP2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 80 <= atomicNumber < 81 :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 85 <= atomicNumber :
            protonWoN.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
            
    if i == 18: # Slot 19        
        if 26 <= atomicNumber < 29:
            neutronGi.position = [0,pP1pP2/2+p1n2,-pP1pP2/2 - 2*orthoP]
            grpBn.add( neutronGi )
            print('hook neutron[',i+1,']', neutronGi.position)
        if 29 <= atomicNumber < 30:
            neutrons = Group()
            neutronsPls(2)
            neutrons.rotateX(piG/2)
            neutrons.position = [0,pP1pP2/2+p1n2,-pP1pP2/2-2*orthoP]
            grpBn.add( neutrons )            
            print('pair of hook neutrons[',i+1,']', neutrons.position)          
        if 30 == atomicNumber :
            protonWoN.position =  [0,pP1pP2/2+2*orthoP,-pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 32 <= atomicNumber < 35 :
            protonWoN.position =  [0,pP1pP2/2+2*orthoP,-pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 35 == atomicNumber :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,pP1pP2/2+2*orthoP,-pP1pP2/2-2*orthoP]
            grpBn.add(proStack)
            print('hook proStack 2[',i+1,']', proStack.position)
        if 43 <= atomicNumber < 47:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*orthoP,-p1p2/2-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 50 == atomicNumber:
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,p1p2/2+pP1pP2+2*orthoP,-p1p2/2-pP1pP2-2*orthoP]
            grpBn.add(proStack)
            print('hook proStack 2[',i+1,']', proStack.position)
        if 51 == atomicNumber:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*orthoP,-p1p2/2-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 52 == atomicNumber:
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,p1p2/2+pP1pP2+2*orthoP,-p1p2/2-pP1pP2-2*orthoP]
            grpBn.add(proStack)
            print('hook proStack 2[',i+1,']', proStack.position)
        if 53 == atomicNumber:            
            protonWoN.position = [0,p1p2/2+pP1pP2+2*orthoP,-p1p2/2-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 57 == atomicNumber < 58:
            protonWoN.position = [0,p2p3+pP1pP2+2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 58 <= atomicNumber < 63:
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,p2p3+pP1pP2+2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(proStack)
            print('hook proStack 2[',i+1,']', proStack.position)
        if 63 == atomicNumber :
            protonWoN.position = [0,p2p3+pP1pP2+2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 66 <= atomicNumber < 68 :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,p2p3+pP1pP2+2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(proStack)
            print('hook proStack 2[',i+1,']', proStack.position)
        if 68 <= atomicNumber < 71:
            protonWoN.position = [0,p2p3+pP1pP2+2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 71 == atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 74 == atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 76 == atomicNumber :
            proStack = Group()
            buildProtonStack(2)
            proStack.position = [0,p2p3+3*pP1pP2/2+2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack)
            print('hook proStack 2[',i+1,']', proStack.position)
        if 80 <= atomicNumber < 81:
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 86 == atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)
        if 88 <= atomicNumber :
            protonWoN.position = [0,p2p3+3*pP1pP2/2+2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(protonWoN)
            print('hook protonWoN[',i+1,']', protonWoN.position)          

grpAn.position = [0,0,(-maxZNeg + maxZPos)/2 - maxZPos]
grpBn.position = [0,0,(-maxZNeg + maxZPos)/2 - maxZPos]
print(emissionType.value)

In[8]
if atomsLabel.value == True:
    scene = Scene(children=[grpAn, grpBn, camera, key_light, ambient_light,
        make_text(atomicLabel,
                  height=0.25,
                  position = [-1,1,number*0.025 + 1.5])]) # move the label +z as the atom grows
else:
    scene = Scene(children=[grpAn, grpBn, camera, key_light, ambient_light])
controller = OrbitControls(controlling=camera, screenSpacePanning=True)

In[9]
renderer = Renderer(camera=camera, scene=scene, controls=[controller],
                    width=view_width, height=view_height)
scene = Scene()  # initialising the scene

In[10]
# caroSecs, the number of seconds to complete a single carousal rotation
if 1 <= number < 13:
    caroSecs = 2.5
if 14 <= number < 20:
    caroSecs = 4.0
if 21 <= number :
    caroSecs = 6.0
    
spinC_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, caroSecs], values=[0, 2*piG])
spinC_clip = AnimationClip(tracks=[spinC_track])
spinC_action = AnimationAction(AnimationMixer(grpAn), spinC_clip, grpAn)
spinC_action

In[11]
renderer

End of part 2 of 2.
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Fri Oct 15, 2021 3:57 am

Hi LTAM...if you use this in the command line of Anaconda, it can install pyMOL which could be used for seeing "classic" molecule builds:

conda install -c schrodinger pymol-bundle

Chromium6

Posts : 727
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Fri Oct 15, 2021 7:08 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Europi10
Showing Europium and the widget rotation controls for slot two, and a glimpse of slot three’s.

You may need to remind me about those classical bonds later Cr6. I’m currently overwhelmed.

We now have slot rotations, all the cats and dogs have come home to roost. Any and all slot objects can now spin about their centers, even those in the moving carousal, provided they are included in the proStackX group, X being one of the 1-19 slots. The protons, neutrons and electrons within that slot all rotate at the same rate.

The current buildProtonStack(a,j) function returns the proper proStackX group, a = number of protons, and atomic accompaniment, to the calling slot register - j. I need to figure out how best to convert all the lone neutrons, protonWiNs and protonWoNs into their respective proStackx groups. Limited by the current slot structure, I had to eliminate the special cases, such as displaying carbon through fluorine with slot 1 occupants of two or three pairs of alphas, they are now strictly slot 1, four or six proton alphas.

I have 20 rotation animation widgets (19 plus the carousal) open at the same time – that’s crazy – to see what problems I may find. I need a way to consolidate them, including how to deal with widget errors if that particular slot for that particular atom is empty – maybe each and every register needs to declare – if it hasn't already, a proStackX group even though its empty.

I’ve also added ‘cone angle’ and ‘emission radius’ to the widget controls and cleaned up the pRadius dimensions some more.
 
Anyway, I wanted to share the good news, even if the many “loose ends” at present prevent me from sharing the whole thing.

Here’s the latest buildProtonStack(a,j) function, you can see each slot group is uniquely identified.
Code:

def buildProtonStack(a,j): #  a is the total # of protons. j indicates the calling register
    num = 0  
    if coloredEmissions.value == True:
        if a == 1 : emissionmaterial = emissionmaterial1
        if a == 2 : emissionmaterial = emissionmaterial2
        if a == 3 : emissionmaterial = emissionmaterial3
        if a == 4 : emissionmaterial = emissionmaterial4
        if a == 5 : emissionmaterial = emissionmaterial5
        if a == 6 : emissionmaterial = emissionmaterial6
    else:
        emissionmaterial = emissionmaterial7
        # Proton z positions: # The possible formula solution, rather than the list, may be in these 2 lines
        # protonMi.position = [0,0,a*pP1pP2/2+(a-1)*p2p3/2-(p2p3/2+pP1pP2/2)*num] # multiAlpha solution - Not
        # protonMi.position = [0,0,(a//2)*pP1pP2/2+(a//2)*p2p3/2-(p2p3/2+pP1pP2/2)*num] # pSet
    if a == 1 : pPositions = [0]
    if a == 2 : pPositions = [pP1pP2/2,-pP1pP2/2]
    if a == 3 : pPositions = [pP1pP2/2+p2p3/2,-pP1pP2/2+p2p3/2,-pP1pP2/2-p2p3/2]
    if a == 4 : pPositions = [pP1pP2+p2p3/2,p2p3/2,-p2p3/2,-pP1pP2-p2p3/2]
    if a == 5 : pPositions = [pP1pP2+p2p3,p2p3,0,-pP1pP2,-pP1pP2-p2p3]
    if a == 6 : pPositions = [3*pP1pP2/2+p2p3,pP1pP2/2+p2p3,pP1pP2/2,-pP1pP2/2,-pP1pP2/2-p2p3,-3*pP1pP2/2-p2p3]
    while num < a:
        protonMi = Group()
        protonMi.add(Mesh(protonGeometry, protonMaterial))    
        if emissionType.value == 'plane':
            protonMi.add(Mesh(emissionGeometry, emissionmaterial))  
        if emissionType.value == 'cones':
            emission1 = Object3D()
            emission1.add(Mesh(emissionGeometry, emissionmaterial))
            emission1.position = [0,0,coneHeight/2]            
            emission1.rotateX(-piG/2)
            protonMi.add(emission1)
            emission2 = Object3D()
            emission2.add(Mesh(emissionGeometry, emissionmaterial))
            emission2.position = [0,0,-coneHeight/2]            
            emission2.rotateX(piG/2)
            protonMi.add(emission2)
            protonMi.add(Mesh(emissionGeometryP, emissionmaterial))
        electronMi = Object3D()
        electronMi.add(Mesh(electronGeometry, electronMaterial))
        electronMi.position = [0,-n1n2/10,-p1e1]
        protonMi.add(electronMi)
        protonMi.rotateZ(random()*2*piG)
        if num%2 != 0:
            neutronPair = Group()
            neutronMi = Object3D()
            neutronMi.add(Mesh(neutronGeometry, neutronMaterial))
            neutronMi.position = [0,-n1n2/2,-p1n1]
            neutronNi = Object3D()
            neutronNi.add(Mesh(neutronGeometry, neutronMaterial))
            neutronNi.position = [0,n1n2/2,-p1n1]
            neutronPair.add(neutronMi)
            neutronPair.add(neutronNi)
            neutronPair.rotateZ(random()*2*piG)
            protonMi.add(neutronPair)
            protonMi.rotateX(piG)
            protonMi.rotateZ(random()*2*piG)
        protonMi.position = [0,0,pPositions[num]]
        if j == 0 : proStack1.add(protonMi)
        if j == 1 : proStack2.add(protonMi)    
        if j == 2 : proStack3.add(protonMi)
        if j == 3 : proStack4.add(protonMi)
        if j == 4 : proStack5.add(protonMi)
        if j == 5 : proStack6.add(protonMi)
        if j == 6 : proStack7.add(protonMi)
        if j == 7 : proStack8.add(protonMi)
        if j == 8 : proStack9.add(protonMi)
        if j == 9 : proStack10.add(protonMi)
        if j == 10 : proStack11.add(protonMi)
        if j == 11 : proStack12.add(protonMi)
        if j == 12 : proStack13.add(protonMi)
        if j == 13 : proStack14.add(protonMi)
        if j == 14 : proStack15.add(protonMi)
        if j == 15 : proStack16.add(protonMi)
        if j == 16 : proStack17.add(protonMi)
        if j == 17 : proStack18.add(protonMi)
        if j == 18 : proStack19.add(protonMi)
        num += 1
    return
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Sat Oct 16, 2021 8:47 pm

Really great and impressive LTAM!  The new def BuildProtonStack is ace work. 

Yeah just threw up Pymol because it can provide a dataset for molecules. Might be a decent and ready source to work with binding...like Nevyn had working. The cone angle is great. Just wamted to give you a big clap. I know it is kind a cheesy but your investigation is noted. The question is do you want to throw it on github? cheers

Chromium6

Posts : 727
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Mon Oct 18, 2021 5:54 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Gold10

Part 1 of 2.

Thanks for the positive feedback Cr6. People looking sideways at me is nothing new.

As I’ve mentioned, I rarely do anything right the first several times. This project has been the opposite. Going over it again and again I’ve definitely been able to get it well started. I also believe in the Muses, and I know they’ve helped, sweet Serendipity is one of them.    
The question is do you want to throw it on github?
Getting the atom builder on github is our stated goal. You sound impatient, but I agree, even without consolidated rotation controls or commentary we’re far enough along, that would be great. Yes, go for it.

Lines 1 - 965, continued in next post.
Code:

In[1]:
from pythreejs import *
from IPython.display import display
import ipywidgets as widgets
from math import sqrt, tan
from random import random , randint , seed
phi = (1+sqrt(5))/2  # calculating phi-based-pi, piG.
piG = 4/sqrt(phi)    # piG is used instead of pi.
pRadius = 0.05 # proton radius, used by all atomic distances
caroSecs = 1 # time in secs for the carousal to make one rotation

In[2]:
view_width = 600
view_height = 400
camera = PerspectiveCamera(position=[5, 0, 0], up=[0, 0, 1], aspect=view_width/view_height)
#camera = PerspectiveCamera(position=[5, 0, 0], up=[1, 0, 0], aspect=view_width/view_height)
camera = PerspectiveCamera(position=[5, 0, 0], up=[0, 1, 0], aspect=view_width/view_height)
key_light = DirectionalLight(position=[0, 5, 5])
ambient_light = AmbientLight()

In[3]
elements = ((' 1 Hydrogen H ',1),(' 2 Helium He ',2),(' 3 Lithium Li ',3),(' 4 Beryllium Be ',4),
            (' 5 Boron B ',5),(' 6 Carbon C ',6),(' 7 Nitrogen N ',7),(' 8 Oxygen O ',8),
            (' 9 Fluorine F ',9),(' 10 Neon Ne ',10),(' 11 Sodium Na ',11),(' 12 Magnesium Mg ',12),
            (' 13 Aluminum Al ',13),(' 14 Silicon Si ',14),(' 15 Phosphorus P ',15),(' 16 Sulfur S ',16),
            (' 17 Chlorine Cl ',17),(' 18 Argon Ar ',18),(' 19 Potassium P ',19),(' 20 Calcium Ca ',20),
            (' 21 Scandium Sc ',21),(' 22 Titanium Ti ',22),(' 23 Vanadium V ',23),(' 24 Chromium Cr ',24),
            (' 25 Manganese Mn ',25),(' 26 Iron Fe ',26),(' 27 Cobalt Co ',27),(' 28 Nickel Ni ',28),
            (' 29 Copper Cu ',29),(' 30 Zinc Zn ',30),(' 31 Gallium Ga ',31),(' 32 Germanium Ge ',32),
            (' 33 Arsenic As ',33),(' 34 Selenium Se ',34),(' 35 Bromine Br ',35),(' 36 Krypton Kr ',36),
            (' 37 Rubidium Rb ',37),(' 38 Strontium Sr ',38),(' 39 Yttrium Y ',39),(' 40 Zirconium Zr ',40),
            (' 41 Niobium Nb ',41),(' 42 Molybdenum Mo ',42),(' 43 Technetium Tc ',43),(' 44 Ruthenium Ru ',44),
            (' 45 Rhodium Rh ',45),(' 46 Palladium Pd ',46),(' 47 Silver Ag ',47),(' 48 Cadmium Cd ',48),
            (' 49 Indium In ',49),(' 50 Tin Sn ',50),(' 51 Antimony Sb ',51),(' 52 Tellurium Te ',52),
            (' 53 Iodine I ',53),(' 54 Xenon Xe ',54),(' 55 Caesium Cs ',55),(' 56 Barium Ba ',56),
            (' 57 Lanthanum La ',57),(' 58 Cerium Ce ',58),(' 59 Praseodymium Pr ',59),(' 60 Neodymium Nd ',60),
            (' 61 Promethium Pm ',61),(' 62 Samarium Sm ',62),(' 63 Europium Eu ',63),(' 64 Gadolinium Gd ',64),
            (' 65 Terbium Tb ',65),(' 66 Dysprosium Dy ',66),(' 67 Holmium Ho ',67),(' 68 Erbium Er ',68),
            (' 69 Thulium Tm ',69),(' 70 Ytterbium Yb ',70),(' 71 Lutetium Lu ',71),(' 72 Hafnium Hf ',72),
            (' 73 Tantalum Ta ',73),(' 74 Tungsten W ',74),(' 75 Rhenium Re ',75),(' 76 Osmium Os ',76),
            (' 77 Iridium Ir ',77),(' 78 Platinum Pt ',78),(' 79 Gold Au ',79),(' 80 Mercury Hg ',80),
            (' 81 Thallium Tl ',81),(' 82 Lead Pb ',82),(' 83 Bismuth Bi ',83),(' 84 Polonium Po ',84),
            (' 85 Astatine At ',85),(' 86 Radon Rn ',86),(' 87 Francium Fr ',87),(' 88 Radium Ra ',88),
            (' 89 Actinium Ac ',89),(' 90 Thorium Th ',90));

In[4]
selectAtom = widgets.Dropdown(
    options= elements,
    value=2,
    description='Atom:',
)
atomsLabel = widgets.Checkbox(
    value=False,
    description='Atomic label',
    disabled=False,
    indent=False
)
emissionType= widgets.Dropdown(
    options=['plane', 'cones'],
    value='plane',
    description='Emission:',
)
coloredEmissions = widgets.Checkbox(
    value=False,
    description='Color emissions',
    disabled=False,
    indent=False,
)
# Changes the distance between adjacent orthogonal protons
emRSlider = widgets.FloatSlider(
    value = 5.0,
    min = 2.0,
    max = 8.0,
    step= 0.1,
    description='EmRadius',
)
# Changes the distance between adjacent orthogonal protons
ePSlider = widgets.FloatSlider(
    value = 5.0,
    min = 3.0,
    max = 7.0,
    step= 0.1,
    description='Equ1_Pole2',
)
# Changes the distance tween top and bottom alpha parallel protons
pPSlider = widgets.FloatSlider(
    value = 4.0,
    min = 3.0,
    max = 6.0,
    step= 0.1,
    description='A width',
)
# Changes the pole to pole distance between 2 adjacent alphas
p2p3Slider = widgets.FloatSlider(
    value = 3.0,
    min = 2.0,
    max = 5.0,
    step= 0.1,
    description='A1_A2 Sep',
)
# Changes the cone emission angle
coneAngleSlider = widgets.FloatSlider(
    value = 30,  # deg  
    min = 20,  
    max = 40,  
    step= 0.1,
    description='Cone angle',
)
widgets.VBox([selectAtom,atomsLabel,emissionType,
              coloredEmissions,emRSlider,ePSlider,
              pPSlider,p2p3Slider,coneAngleSlider])

In[5]
number = selectAtom.value
def handle_change(change):
    global number
    number = change.new
selectAtom.observe(handle_change, 'value')

emR = emRSlider.value
def handle_change(change):
    global emR
    emR = change.new
emRSlider.observe(handle_change, 'value');

ortho = ePSlider.value # proton1 equator to proton2 pole
def handle_change(change):
    global ortho
    ortho = change.new
ePSlider.observe(handle_change, 'value');

pPTP = pPSlider.value  # proton pole to proton pole
def handle_change(change):
    global pPTP
    pPTP = change.new
pPSlider.observe(handle_change, 'value')

p2p3Dist = p2p3Slider.value # between 2 adjacent alphas
def handle_change(change):
    global p2p3Dist
    p2p3Dist = change.new
p2p3Slider.observe(handle_change, 'value')

cAngleDeg = coneAngleSlider.value # cone angle
def handle_change(change):
    global cAngleDeg
    cAngleDeg = change.new
coneAngleSlider.observe(handle_change, 'value')

In[6]
An = elements[number-1]
atomicLabel = An[0]
print(atomicLabel) # used to verify An control changes, eliminate this line at any time.
print(emissionType.value)

In[7]
atomicNumber = number  # Select the desired atom from the dropdown widget
grpAn = Group()  # The rotation widget spins grpAn, slots 1,4 and 5.  
grpBn = Group()  # grpBn are the orthogonal top, bottom and hook slots.

if 1 <= number < 13:
    caroSecs = 2.5
if 14 <= number < 20:
    caroSecs = 4.0
if 21 <= number :
    caroSecs = 6.0
    
# Dimensions # pRadius is now in In[1]
nRadius = pRadius*1.125 # Neutron radius
eRadius = 2*pRadius/10 # Electron radius

# Widget Controlled variables 1. ortho, 2.pPTP, 3. p2p3Dist, 4. cAngleDeg
orthoP = ortho*pRadius
emRadius = 2*emR*pRadius # 2*orthoP - pRadius/2
coneAngle = cAngleDeg*2*piG/360
coneHeight = emRadius*tan(coneAngle)
pP1pP2 = 2*pPTP*pRadius # Widget control.
p2p3 = 2*p2p3Dist*pRadius # Widget control
n1n2 = (pP1pP2- 2*nRadius)/tan(coneAngle) # neutron-neutron orbital separation (y) inside the alpha
# e1e2 = -n1n2/10
p1p2 = pRadius*2.5  #0.75*pP1pP2 # pRadius*2.5
p1n1 = pP1pP2/2 #pP1pP2/2 #pP1pP2/2 # Alpha, up-down (z) proton-orbital neutron separation
p1n2 = pP1pP2/2 #pRadius + nRadius + 1.5*pRadius  # In line proton and neutron
p1e1 = pRadius + 0.05*pP1pP2 # Alpha, top-bottom (z) proton-electron separation
maxZNeg = 0.0 # maxZNeg and maxZPos are Used to center(z) the atom on the screen
maxZPos = 0.0  

# Proton set Geometries and Materials
protonGeometry =  SphereBufferGeometry(pRadius, 24, 16)
neutronGeometry =  SphereBufferGeometry(nRadius, 24, 16)
electronGeometry =  SphereBufferGeometry(eRadius, 8, 16)
emissionGeometryP = CircleGeometry(emRadius, 24)
emissionGeometryX = ConeGeometry( emRadius, coneHeight, 16, openEnded = True )
protonMaterial = MeshStandardMaterial(color='blue')
protonMaterialB = MeshStandardMaterial(color='green')
neutronMaterial = MeshStandardMaterial(color='red')
neutronMaterialB = MeshStandardMaterial(color='green') # Color.js Find a nice color spectrum
electronMaterial = MeshStandardMaterial(color='cyan') #'orangered','salmon','green','cyan','teal','orange'
emissionmaterial7= MeshStandardMaterial(color='gray',side='DoubleSide',transparent = True,opacity = 0.20)
emissionmaterial1 = MeshStandardMaterial(color='magenta',side='DoubleSide',transparent = True,opacity = 0.20)
emissionmaterial2 = MeshStandardMaterial(color='blue',side='DoubleSide',transparent = True,opacity = 0.20)
emissionmaterial3 = MeshStandardMaterial(color='pink',side='DoubleSide',transparent = True,opacity = 0.20)
emissionmaterial4 = MeshStandardMaterial(color='salmon',side='DoubleSide',transparent = True,opacity = 0.20)
emissionmaterial5 = MeshStandardMaterial(color='lime',side='DoubleSide',transparent = True,opacity = 0.20)
emissionmaterial6 = MeshStandardMaterial(color='skyblue',side='DoubleSide',transparent = True,opacity = 0.20)

def buildProtonStack(a,j): #  a is the total # of protons. j indicates the calling register
    num = 0  
    if coloredEmissions.value == True:
        if a == 1 : emissionmaterial = emissionmaterial1
        if a == 2 : emissionmaterial = emissionmaterial2
        if a == 3 : emissionmaterial = emissionmaterial3
        if a == 4 : emissionmaterial = emissionmaterial4
        if a == 5 : emissionmaterial = emissionmaterial5
        if a == 6 : emissionmaterial = emissionmaterial6
    else:
        emissionmaterial = emissionmaterial7
        # Proton z positions: # The possible formula solution, rather than the list, may be in these 2 lines
        # protonMi.position = [0,0,a*pP1pP2/2+(a-1)*p2p3/2-(p2p3/2+pP1pP2/2)*num] # multiAlpha solution - Not
        # protonMi.position = [0,0,(a//2)*pP1pP2/2+(a//2)*p2p3/2-(p2p3/2+pP1pP2/2)*num] # pSet
    if a == 1 : pPositions = [0]
    if a == 2 : pPositions = [pP1pP2/2,-pP1pP2/2]
    if a == 3 : pPositions = [pP1pP2/2+p2p3/2,-pP1pP2/2+p2p3/2,-pP1pP2/2-p2p3/2]
    if a == 4 : pPositions = [pP1pP2+p2p3/2,p2p3/2,-p2p3/2,-pP1pP2-p2p3/2]
    if a == 5 : pPositions = [pP1pP2+p2p3,p2p3,0,-pP1pP2,-pP1pP2-p2p3]
    if a == 6 : pPositions = [3*pP1pP2/2+p2p3,pP1pP2/2+p2p3,pP1pP2/2,-pP1pP2/2,-pP1pP2/2-p2p3,-3*pP1pP2/2-p2p3]
    while num < a:
        protonMi = Group()
        protonMi.add(Mesh(protonGeometry, protonMaterial))    
        if emissionType.value == 'plane':
            protonMi.add(Mesh(emissionGeometry, emissionmaterial))  
        if emissionType.value == 'cones':
            emission1 = Object3D()
            emission1.add(Mesh(emissionGeometry, emissionmaterial))
            emission1.position = [0,0,coneHeight/2]            
            emission1.rotateX(-piG/2)
            protonMi.add(emission1)
            emission2 = Object3D()
            emission2.add(Mesh(emissionGeometry, emissionmaterial))
            emission2.position = [0,0,-coneHeight/2]            
            emission2.rotateX(piG/2)
            protonMi.add(emission2)
            protonMi.add(Mesh(emissionGeometryP, emissionmaterial))
        electronMi = Object3D()
        electronMi.add(Mesh(electronGeometry, electronMaterial))
        electronMi.position = [0,-n1n2/10,-p1e1]
        protonMi.add(electronMi)
        protonMi.rotateZ(random()*2*piG)
        if num%2 != 0:
            neutronPair = Group()
            neutronMi = Object3D()
            neutronMi.add(Mesh(neutronGeometry, neutronMaterial))
            neutronMi.position = [0,-n1n2/2,-p1n1]
            neutronNi = Object3D()
            neutronNi.add(Mesh(neutronGeometry, neutronMaterial))
            neutronNi.position = [0,n1n2/2,-p1n1]
            neutronPair.add(neutronMi)
            neutronPair.add(neutronNi)
            neutronPair.rotateZ(random()*2*piG)
            protonMi.add(neutronPair)
            protonMi.rotateX(piG)
            protonMi.rotateZ(random()*2*piG)
        protonMi.position = [0,0,pPositions[num]]
        if j == 0 : proStack1.add(protonMi)
        if j == 1 : proStack2.add(protonMi)    
        if j == 2 : proStack3.add(protonMi)
        if j == 3 : proStack4.add(protonMi)
        if j == 4 : proStack5.add(protonMi)
        if j == 5 : proStack6.add(protonMi)
        if j == 6 : proStack7.add(protonMi)
        if j == 7 : proStack8.add(protonMi)
        if j == 8 : proStack9.add(protonMi)
        if j == 9 : proStack10.add(protonMi)
        if j == 10 : proStack11.add(protonMi)
        if j == 11 : proStack12.add(protonMi)
        if j == 12 : proStack13.add(protonMi)
        if j == 13 : proStack14.add(protonMi)
        if j == 14 : proStack15.add(protonMi)
        if j == 15 : proStack16.add(protonMi)
        if j == 16 : proStack17.add(protonMi)
        if j == 17 : proStack18.add(protonMi)
        if j == 18 : proStack19.add(protonMi)
        num += 1
    return
        
# Assemble the atomic models.
for i in range( atomicNumber ):
    if emissionType.value == 'plane':
        emissionGeometry = emissionGeometryP
    if emissionType.value == 'cones':
        emissionGeometry = emissionGeometryX    
    if coloredEmissions.value == True:
        emissionmaterial = emissionmaterial1
    else:
        emissionmaterial = emissionmaterial7
    neutronGi = Object3D()
    neutronGi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronKi = Object3D()
    neutronKi.add(Mesh(neutronGeometry, neutronMaterial))
    neutronLi = Object3D()
    neutronLi.add(Mesh(neutronGeometry, neutronMaterial))

    if i == 0: # Slot 1
        proStack1 = Group()
        if 1 == atomicNumber: # Hydrogen. Slot 1
            buildProtonStack(1,i)
            neutronGi.position = [0,0,-p1n2]
            proStack1.position = [0, 0, 0]
            proStack1.add(neutronGi)
            grpAn.add(proStack1)
            print('proStack1 1[',i+1,']', proStack1.position)            
        if 2 <= atomicNumber < 6: # Helium
            buildProtonStack(2,i)            
            grpAn.add(proStack1)
            print('proStack1 2[',i+1,']', proStack1.position)
        if 6 == atomicNumber :
            buildProtonStack(4,i)            
            grpAn.add(proStack1)
            maxZNeg = -3*pP1pP2/2-2*orthoP
            maxZPos = 3*pP1pP2/2+2*orthoP
            print('proStack1 4[',i+1,']', proStack1.position)
        if 7 <= atomicNumber < 10 :
            buildProtonStack(6,i)            
            grpAn.add(proStack1)
            maxZNeg = -3*pP1pP2/2-p2p3
            maxZPos = p2p3+3*pP1pP2/2+2*orthoP
            print('proStack1 6[',i+1,']', proStack1.position)
        if 10 <= atomicNumber < 36 :
            buildProtonStack(2,i)            
            grpAn.add(proStack1)
            print('proStack1 2[',i+1,']', proStack1.position)
        if 36 <= atomicNumber < 54 :
            buildProtonStack(4,i)            
            grpAn.add(proStack1)
            print('proStack1 4[',i+1,']', proStack1.position)
        if 54 <= atomicNumber < 57:
            buildProtonStack(6,i)            
            grpAn.add(proStack1)
            print('proStack1 6[',i+1,']', proStack1.position)
        if 57 <= atomicNumber < 71:
            buildProtonStack(5,i)            
            grpAn.add(proStack1)
            print('proStack1 5[',i+1,']', proStack1.position)
        if 71 <= atomicNumber :
            buildProtonStack(6,i)            
            grpAn.add(proStack1)
            print('proStack1 6[',i+1,']', proStack1.position)
            
    if i == 1: # Slot 2
        proStack2 = Group()
        if 2 < atomicNumber < 6:
            buildProtonStack(1,i)
            proStack2.rotateX(-piG/2)
            proStack2.position = [0, 0, pP1pP2/2 + 2*orthoP]
            grpBn.add(proStack2)
            print('proStack2 1[',i+1,']', proStack2.position)            
        if 6 == atomicNumber :
            buildProtonStack(1,i)
            proStack2.rotateX(-piG/2)
            proStack2.position = [0, 0,p2p3/2+pP1pP2+2*orthoP]
            grpBn.add(proStack2)
            print('proStack2 1[',i+1,']', proStack2.position)
        if 7 <= atomicNumber < 10:
            buildProtonStack(1,i)
            proStack2.rotateX(-piG/2)
            proStack2.position = [0, 0,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(proStack2)
            print('proStack2 1[',i+1,']', proStack2.position)            
        if 10 <= atomicNumber < 36 :
            buildProtonStack(2,i)
            proStack2.rotateX(-piG/2)
            proStack2.position = [0, 0, pP1pP2/2 + 2*orthoP]
            grpBn.add(proStack2)
            print('proStack2 2[',i+1,']', proStack2.position)
        if 36 <= atomicNumber < 54:
            buildProtonStack(4,i)
            proStack2.rotateX(piG/2)
            proStack2.position = [0,0,p1p2/2+pP1pP2+2*orthoP]
            grpBn.add(proStack2)
            print('proStack2 4[',i+1,']', proStack2.position)
        if 54 <= atomicNumber < 57 :
            buildProtonStack(6,i)
            proStack2.rotateX(piG/2)
            proStack2.position = [0,0,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(proStack2)
            print('proStack2 6[',i+1,']', proStack2.position)            
        if 57 <= atomicNumber < 71 :
            buildProtonStack(5,i)
            proStack2.rotateX(piG/2)  
            proStack2.position = [0,0,p2p3+pP1pP2+2*orthoP]
            grpBn.add(proStack2)
            print('proStack2 5[',i+1,']', proStack2.position)
        if 71 <= atomicNumber :
            buildProtonStack(6,i)
            proStack2.rotateX(piG/2)
            proStack2.position = [0,0,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(proStack2)
            print('proStack2 6[',i+1,']', proStack2.position)            

    if i == 2: # Slot 3
        proStack3 = Group()
        if 3 < atomicNumber < 5:
            buildProtonStack(1,i)
            proStack3.rotateX(-piG/2)
            proStack3.position = [0, 0, -pP1pP2/2 - 2*orthoP]
            grpBn.add(proStack3)
            print('proStack3 1[',i+1,']', proStack3.position)
        if 5 == atomicNumber :
            buildProtonStack(2,i)
            proStack3.rotateX(-piG/2)
            proStack3.position = [0, 0, -pP1pP2/2 - 2*orthoP]
            grpBn.add(proStack3)
            print('proStack3 2[',i+1,']', proStack3.position)            
        if 6 == atomicNumber :
            buildProtonStack(1,i)
            proStack3.rotateX(-piG/2)
            proStack3.position = [0, 0, -p2p3/2-pP1pP2-2*orthoP]
            grpBn.add(proStack3)
            print('proStack3 1[',i+1,']', proStack3.position)
        if 8 == atomicNumber :
            buildProtonStack(1,i)
            proStack3.rotateX(-piG/2)
            proStack3.position = [0, 0,-3*pP1pP2/2-p2p3-2*orthoP]
            grpBn.add(proStack3)
            maxZNeg = -3*pP1pP2/2-p2p3-2*orthoP
            maxZPos = 3*pP1pP2/2+p2p3+2*orthoP            
            print('proStack3 1[',i+1,']', proStack3.position)
        if 9 == atomicNumber :
            buildProtonStack(2,i)
            proStack3.rotateX(-piG/2)
            proStack3.position = [0, 0,-3*pP1pP2/2-p2p3-2*orthoP]
            grpBn.add(proStack3)
            maxZNeg = -3*pP1pP2/2-p2p3-2*orthoP
            maxZPos = 3*pP1pP2/2+p2p3+2*orthoP            
            print('proStack3 2[',i+1,']', proStack3.position)
        if 10 <= atomicNumber < 36 :
            buildProtonStack(2,i)
            proStack3.rotateX(-piG/2)
            proStack3.position = [0, 0, -pP1pP2/2 - 2*orthoP]
            grpBn.add(proStack3)
            print('proStack3 2[',i+1,']', proStack3.position)
        if 36 <= atomicNumber < 54 :
            buildProtonStack(4,i)
            proStack3.rotateX(piG/2)
            proStack3.position = [0,0,-p1p2/2-pP1pP2-2*orthoP]
            grpBn.add(proStack3)
            print('proStack3 4[',i+1,']', proStack3.position)            
        if 54 <= atomicNumber < 57 :
            buildProtonStack(6,i)
            proStack3.rotateX(piG/2)
            proStack3.position = [0,0,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack3)
            print('proStack3 6[',i+1,']', proStack3.position)  
        if 57 <= atomicNumber < 71 :
            buildProtonStack(5,i)
            proStack3.rotateX(piG/2)  
            proStack3.position = [0,0,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(proStack3)
            print('proStack3 5[',i+1,']', proStack3.position)
        if 71 <= atomicNumber :
            buildProtonStack(6,i)
            proStack3.rotateX(piG/2)
            proStack3.position = [0,0,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack3)
            print('proStack3 6[',i+1,']', proStack3.position)            
            
    if i == 3: # Slot 4
        proStack4 = Group()
        if 10 <= atomicNumber < 14: # Neon
            buildProtonStack(2,i)
            proStack4.position = [0, 0, pP1pP2 + 4*orthoP]
            grpBn.add(proStack4)
            print('proStack4 2[',i+1,']', proStack4.position)
        if 15 == atomicNumber :
            buildProtonStack(2,i)
            proStack4.position = [0, 0, pP1pP2 + 4*orthoP]
            grpBn.add(proStack4)
            print('proStack4 2[',i+1,']', proStack4.position)
            maxZNeg = -3*pP1pP2/2-6*orthoP
            maxZPos = 3*pP1pP2/2+4*orthoP
        if 16 == atomicNumber :
            buildProtonStack(1,i)
            proStack4.position = [0, 0, pP1pP2/2 + 4*orthoP]
            grpBn.add(proStack4)
            print('proStack4 1[',i+1,']', proStack4.position)
            maxZNeg = -pP1pP2/2-4*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
        if 17 <= atomicNumber < 36 :
            buildProtonStack(2,i)
            proStack4.position = [0, 0, pP1pP2 + 4*orthoP]
            grpBn.add(proStack4)
            print('proStack4 2[',i+1,']', proStack4.position)
        if 36 <= atomicNumber < 54:
            buildProtonStack(4,i)
            proStack4.position = [0,0,p1p2/2+pP1pP2+p1p2/2+pP1pP2+4*orthoP]
            grpBn.add(proStack4)
            print('proStack4 4[',i+1,']', proStack4.position)            
        if 54 <= atomicNumber < 57:
            buildProtonStack(6,i)
            proStack4.position = [0,0,2*p2p3+3*pP1pP2+4*orthoP]
            grpBn.add(proStack4)
            print('proStack4 6[',i+1,']', proStack4.position)
        if 57 <= atomicNumber < 71:
            buildProtonStack(5,i)
            proStack4.position = [0,0,2*p2p3+2*pP1pP2+4*orthoP]
            grpBn.add(proStack4)
            print('proStack4 5[',i+1,']', proStack4.position)
        if 71 <= atomicNumber :
            buildProtonStack(6,i)
            proStack4.position = [0,0,2*p2p3+3*pP1pP2+4*orthoP]
            grpBn.add(proStack4)              
            print('proStack4 6[',i+1,']', proStack4.position)
            
    if i == 4: # Slot 5
        proStack5 = Group()
        if 10 <= atomicNumber < 14 :
            buildProtonStack(2,i)
            proStack5.position = [0, 0, -pP1pP2 - 4*orthoP]
            grpBn.add(proStack5)
            print('proStack5 2[',i+1,']', proStack5.position)
        if 15 == atomicNumber :
            buildProtonStack(2,i)
            proStack5.position = [0, 0, -pP1pP2 - 4*orthoP]
            grpBn.add(proStack5)
            print('proStack5 2[',i+1,']', proStack5.position)
        if 16 == atomicNumber :
            buildProtonStack(1,i)
            proStack5.position = [0, 0, -pP1pP2/2 - 4*orthoP]
            grpBn.add(proStack5)
            print('proStack5 1[',i+1,']', proStack5.position)
            maxZNeg = -pP1pP2/2-4*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP          
        if 17 <= atomicNumber < 21 :
            buildProtonStack(2,i)
            proStack5.position = [0, 0, -pP1pP2 - 4*orthoP]
            grpBn.add(proStack5)
            print('proStack5 2[',i+1,']', proStack5.position)
        if 21 == atomicNumber :
            buildProtonStack(2,i)
            neutronGi.position = [0, 0, -pP1pP2/2 - p1n2]
            proStack5.add(neutronGi)            
            proStack5.position = [0, 0, -pP1pP2 - 4*orthoP]
            grpBn.add(proStack5)
            print('proStack5 2 w neutron[',i+1,']', proStack5.position)
        if 22 <= atomicNumber < 36 :
            buildProtonStack(2,i)              
            proStack5.position = [0, 0, -pP1pP2 - 4*orthoP]
            grpBn.add(proStack5)
            print('proStack5 2[',i+1,']', proStack5.position)
        if 36 <= atomicNumber < 54:
            proStack5 = Group()
            buildProtonStack(4,i)
            proStack5.position = [0,0,-p1p2/2-pP1pP2-p1p2/2-pP1pP2-4*orthoP]
            grpBn.add(proStack5)            
            print('proStack5 4[',i+1,']', proStack5.position)
        if 54 <= atomicNumber < 57:
            buildProtonStack(6,i)
            proStack5.position = [0,0,-2*p2p3-3*pP1pP2-4*orthoP]
            grpBn.add(proStack5)            
            print('proStack5 6[',i+1,']', proStack5.position)
        if 57 <= atomicNumber < 71:
            buildProtonStack(5,i)
            proStack5.position = [0,0,-2*p2p3-2*pP1pP2-4*orthoP]
            grpBn.add(proStack5)
            print('proStack5 5[',i+1,']', proStack5.position)
        if 71 <= atomicNumber :
            buildProtonStack(6,i)
            proStack5.position = [0,0,-2*p2p3-3*pP1pP2-4*orthoP]
            grpBn.add(proStack5)            
            print('proStack5 6[',i+1,']', proStack5.position)
            
    if i == 5: # Slot 6
        proStack6 = Group()
        if 11 <= atomicNumber  < 14 :
            buildProtonStack(1,i)
            proStack6.rotateX(-piG/2)
            proStack6.position = [0,0, 3*pP1pP2/2+6*orthoP]
            grpBn.add(proStack6)            
            print('proStack6 1[',i+1,']', proStack6.position)            
        if 17 <= atomicNumber < 18 :
            buildProtonStack(2,i)
            proStack6.rotateX(-piG/2)
            proStack6.position = [0, 0, 3*pP1pP2/2+6*orthoP]
            grpBn.add(proStack6)            
            print('proStack6 2[',i+1,']', proStack6.position)              
            maxZNeg = -3*pP1pP2/2-6*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP            
        if 19 <= atomicNumber < 22 :
            buildProtonStack(1,i)
            proStack6.rotateX(-piG/2)
            proStack6.position = [0, 0, 3*pP1pP2/2+6*orthoP]
            grpBn.add(proStack6)            
            print('proStack6 1[',i+1,']', proStack6.position)              
            maxZNeg = -3*pP1pP2-4*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
        if 23 <= atomicNumber < 26 :
            buildProtonStack(1,i)
            proStack6.rotateX(-piG/2)
            proStack6.position = [0, 0, 3*pP1pP2/2+6*orthoP]
            grpBn.add(proStack6)            
            print('proStack6 1[',i+1,']', proStack6.position)              
            maxZNeg = -3*pP1pP2-4*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
        if 26 <= atomicNumber < 29:
            buildProtonStack(2,i)
            proStack6.rotateX(-piG/2)
            proStack6.position = [0, 0, 3*pP1pP2/2+6*orthoP]
            grpBn.add(proStack6)
            print('proStack6 2[',i+1,']', proStack6.position)
        if 29 <= atomicNumber < 31:
            buildProtonStack(1,i)
            proStack6.rotateX(-piG/2)
            proStack6.position = [0, 0, 3*pP1pP2/2+6*orthoP]
            grpBn.add(proStack6)
            print('proStack6 2[',i+1,']', proStack6.position)            
            maxZNeg = -3*pP1pP2-4*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
        if 31 <= atomicNumber < 36 :
            buildProtonStack(2,i)
            proStack6.rotateX(-piG/2)
            proStack6.position = [0, 0, 3*pP1pP2/2+6*orthoP]
            grpBn.add(proStack6)
            print('proStack6 2[',i+1,']', proStack6.position)
        if 37 <= atomicNumber < 48:    
            buildProtonStack(1,i)
            proStack6.rotateX(-piG/2)
            proStack6.position = [0,0,3*p1p2/2+6*pP1pP2/2+6*orthoP]
            grpBn.add(proStack6)
            print('proStack6 1[',i+1,']', proStack6.position)            
            maxZNeg = -3*p1p2/2-5*pP1pP2/2-4*orthoP
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*orthoP            
        if 48 <= atomicNumber < 50:
            buildProtonStack(2,i)
            proStack6.rotateX(-piG/2)
            proStack6.position = [0, 0, 3*p1p2/2+6*pP1pP2/2+6*orthoP]
            grpBn.add(proStack6)
            print('proStack6 2[',i+1,']', proStack6.position)
        if 50 == atomicNumber:
            buildProtonStack(1,i)
            proStack6.rotateX(-piG/2)
            proStack6.position = [0,0,3*p1p2/2+6*pP1pP2/2+6*orthoP]
            grpBn.add(proStack6)            
            print('proStack6 1[',i+1,']', proStack6.position)          
        if 51 <= atomicNumber < 54:
            buildProtonStack(2,i)
            proStack6.rotateX(-piG/2)
            proStack6.position = [0, 0, 3*p1p2/2+6*pP1pP2/2+6*orthoP]
            grpBn.add(proStack6)
            print('proStack6 2[',i+1,']', proStack6.position)
        if 55 <= atomicNumber < 57 :
            buildProtonStack(1,i)
            proStack6.rotateX(-piG/2)
            proStack6.position = [0, 0,3*p2p3+4.5*pP1pP2+6*orthoP]
            grpBn.add(proStack6)            
            print('proStack6 1[',i+1,']', proStack6.position)  
            maxZNeg = -3*p1p2/2-5*pP1pP2/2-4*orthoP  
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*orthoP            
        if 57 <= atomicNumber < 62:
            buildProtonStack(1,i)
            proStack6.rotateX(-piG/2)
            proStack6.position = [0, 0,3*p2p3+3*pP1pP2+6*orthoP]
            grpBn.add(proStack6)            
            print('proStack6 1[',i+1,']', proStack6.position)
        if 62 <= atomicNumber < 66 :
            buildProtonStack(2,i)
            proStack6.rotateX(-piG/2)
            proStack6.position = [0, 0,3*p2p3+3*pP1pP2+6*orthoP]
            grpBn.add(proStack6)
            print('proStack6 2[',i+1,']', proStack6.position)                  
        if 66 <= atomicNumber < 71:
            buildProtonStack(3,i)
            proStack6.rotateX(-piG/2)
            proStack6.position = [0, 0,3*p2p3+3*pP1pP2+6*orthoP]
            grpBn.add(proStack6)
            print('proStack6 3[',i+1,']', proStack6.position)  
        if 71 == atomicNumber :
            buildProtonStack(2,i)
            proStack6.rotateX(-piG/2)
            proStack6.position = [0, 0,3*p2p3+4.5*pP1pP2+6*orthoP]
            grpBn.add(proStack6)
            print('proStack6 2[',i+1,']', proStack6.position)
        if 72 <= atomicNumber < 78 :
            buildProtonStack(3,i)
            proStack6.rotateX(-piG/2)
            proStack6.position = [0, 0,3*p2p3+4.5*pP1pP2+6*orthoP]
            grpBn.add(proStack6)
            print('proStack6 3[',i+1,']', proStack6.position)
        if 78 == atomicNumber :          
            buildProtonStack(4,i)
            proStack6.rotateX(-piG/2)
            proStack6.position = [0, 0,3*p2p3+4.5*pP1pP2+6*orthoP]
            grpBn.add(proStack6)            
            print('proStack6 4[',i+1,']', proStack6.position)            
        if 79 == atomicNumber :
            buildProtonStack(3,i)
            proStack6.rotateX(-piG/2)
            proStack6.position = [0, 0,3*p2p3+4.5*pP1pP2+6*orthoP]
            grpBn.add(proStack6)
            print('proStack6 3[',i+1,']', proStack6.position)
        if 80 <= atomicNumber < 82 :
            buildProtonStack(4,i)
            proStack6.rotateX(-piG/2)
            proStack6.position = [0, 0,3*p2p3+4.5*pP1pP2+6*orthoP]
            grpBn.add(proStack6)            
            print('proStack6 4[',i+1,']', proStack6.position)            
        if 82 <= atomicNumber :
            buildProtonStack(5,i)
            proStack6.rotateX(-piG/2)  
            proStack6.position = [0, 0,3*p2p3+4.5*pP1pP2+6*orthoP]
            grpBn.add(proStack6)
            print('proStack6 5[',i+1,']', proStack6.position)
            
    if i == 6: # Slot 7
        proStack7 = Group()
        if 12 == atomicNumber :
            buildProtonStack(1,i)
            proStack7.rotateX(-piG/2)
            proStack7.position = [0,0, -3*pP1pP2/2-6*orthoP]
            grpBn.add(proStack7)            
            print('proStack7 1[',i+1,']', proStack7.position)              
        if 15 == atomicNumber:
            buildProtonStack(1,i)
            proStack7.rotateX(-piG/2)
            proStack7.position = [0, 0, -3*pP1pP2/2-6*orthoP]
            grpBn.add(proStack7)            
            print('proStack7 1[',i+1,']', proStack7.position)  
        if 17 == atomicNumber:
            buildProtonStack(1,i)
            proStack7.rotateX(-piG/2)
            proStack7.position = [0, 0, -3*pP1pP2/2-6*orthoP]
            grpBn.add(proStack7)            
            print('proStack7 1[',i+1,']', proStack7.position)              
        if 20 == atomicNumber:
            buildProtonStack(1,i)
            proStack7.rotateX(-piG/2)
            proStack7.position = [0, 0, -3*pP1pP2/2-6*orthoP]
            grpBn.add(proStack7)            
            maxZNeg = -3*pP1pP2/2-6*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('proStack7 1[',i+1,']', proStack7.position)              
        if 24 <= atomicNumber < 26:
            buildProtonStack(1,i)
            proStack7.rotateX(-piG/2)
            proStack7.position = [0, 0, -3*pP1pP2/2-6*orthoP]
            grpBn.add(proStack7)            
            maxZNeg = -3*pP1pP2/2-6*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('proStack7 1[',i+1,']', proStack7.position)            
        if 26 <= atomicNumber < 30 :
            buildProtonStack(2,i)
            proStack7.rotateX(piG/2)
            proStack7.position = [0, 0, -3*pP1pP2/2-6*orthoP]
            grpBn.add(proStack7)
            print('proStack7 2[',i+1,']', proStack7.position)
        if 30 == atomicNumber :
            buildProtonStack(1,i)
            proStack7.rotateX(piG/2)
            proStack7.position = [0, 0, -3*pP1pP2/2-6*orthoP]      
            grpBn.add(proStack7)
            maxZNeg = -3*pP1pP2/2-6*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
            print('proStack7 1[',i+1,']', proStack7.position)
        if 31 <= atomicNumber < 36 :
            buildProtonStack(2,i)
            proStack7.rotateX(piG/2)
            proStack7.position = [0, 0, -3*pP1pP2/2-6*orthoP]
            grpBn.add(proStack7)
            print('proStack7 2[',i+1,']', proStack7.position)                  
        if 38 == atomicNumber:
            buildProtonStack(1,i)
            proStack7.rotateX(piG/2)
            proStack7.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*orthoP]      
            grpBn.add(proStack7)
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*orthoP
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*orthoP
            print('proStack7 1[',i+1,']', proStack7.position)            
        if 40 <= atomicNumber < 47:
            buildProtonStack(1,i)
            proStack7.rotateX(piG/2)
            proStack7.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*orthoP]      
            grpBn.add(proStack7)
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*orthoP
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*orthoP            
            print('proStack7 1[',i+1,']', proStack7.position)                
        if 47 <= atomicNumber < 50:
            buildProtonStack(2,i)
            proStack7.rotateX(-piG/2)
            proStack7.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*orthoP]
            grpBn.add(proStack7)
            print('proStack7 2[',i+1,']', proStack7.position)  
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*orthoP
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*orthoP
        if 50 == atomicNumber:
            buildProtonStack(1,i)
            proStack7.rotateX(piG/2)
            proStack7.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*orthoP]      
            grpBn.add(proStack7)
            print('proStack7 1[',i+1,']', proStack7.position)  
        if 51 <= atomicNumber < 54:
            buildProtonStack(2,i)
            proStack7.rotateX(-piG/2)
            proStack7.position = [0,0,-3*p1p2/2-6*pP1pP2/2-6*orthoP]
            grpBn.add(proStack7)
            print('proStack7 2[',i+1,']', proStack7.position)  
        if 56 == atomicNumber < 57:
            buildProtonStack(1,i)
            proStack7.rotateX(piG/2)
            proStack7.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*orthoP]      
            grpBn.add(proStack7)
            print('proStack7 1[',i+1,']', proStack7.position)            
            maxZNeg = -3*p1p2/2-6*pP1pP2/2-6*orthoP # needed
            maxZPos = 3*p1p2/2+6*pP1pP2/2+6*orthoP
        if 57 <= atomicNumber < 63:
            buildProtonStack(2,i)
            proStack7.rotateX(-piG/2)
            proStack7.position = [0, 0,-3*p2p3-3*pP1pP2-6*orthoP]
            grpBn.add(proStack7)
            print('proStack7 2[',i+1,']', proStack7.position)
        if 63 <= atomicNumber < 66 :
            buildProtonStack(3,i)
            proStack7.rotateX(-piG/2)
            proStack7.position = [0, 0,-3*p2p3-3*pP1pP2-6*orthoP]
            grpBn.add(proStack7)
            print('proStack7 3[',i+1,']', proStack7.position)          
        if 66 == atomicNumber :
            buildProtonStack(4,i)
            proStack7.rotateX(-piG/2)
            proStack7.position = [0, 0,-3*p2p3-3*pP1pP2-6*orthoP]
            grpBn.add(proStack7)            
            print('proStack7 4[',i+1,']', proStack7.position)            
        if 67 == atomicNumber :
            buildProtonStack(3,i)
            proStack7.rotateX(-piG/2)
            proStack7.position = [0, 0,-3*p2p3-3*pP1pP2-6*orthoP]
            grpBn.add(proStack7)
            print('proStack7 3[',i+1,']', proStack7.position)
        if 68 <= atomicNumber < 71 :
            buildProtonStack(4,i)
            proStack7.rotateX(-piG/2)
            proStack7.position = [0, 0,-3*p2p3-3*pP1pP2-6*orthoP]
            grpBn.add(proStack7)            
            print('proStack7 4[',i+1,']', proStack7.position)            
        if 71 <= atomicNumber < 78 :
            buildProtonStack(3,i)
            proStack7.rotateX(-piG/2)
            proStack7.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*orthoP]
            grpBn.add(proStack7)
            print('proStack7 3[',i+1,']', proStack7.position)  
        if 78 <= atomicNumber < 82 :
            buildProtonStack(4,i)
            proStack7.rotateX(-piG/2)
            proStack7.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*orthoP]
            grpBn.add(proStack7)            
            print('proStack7 4[',i+1,']', proStack7.position)    
        if 82 <= atomicNumber :
            buildProtonStack(5,i)
            proStack7.rotateX(-piG/2)  
            proStack7.position = [0, 0,-3*p2p3-4.5*pP1pP2-6*orthoP]
            grpBn.add(proStack7)
            print('proStack7 5[',i+1,']', proStack7.position)            
            
    if i == 7: # Slot 8
        proStack8 = Group()
        if 13 == atomicNumber :
            buildProtonStack(1,i)
            proStack8.rotateX(piG/2)
            proStack8.position = [0, 2*orthoP, 0]
            grpAn.add(proStack8)
            print('proStack8 1[',i+1,']', proStack8.position)              
        if 14 == atomicNumber :
            buildProtonStack(2,i)
            proStack8.rotateX(piG/2)
            proStack8.position = [0,pP1pP2/2+2*orthoP, 0]
            grpAn.add(proStack8)
            print('proStack8 2[',i+1,']', proStack8.position)                  
        if 15 == atomicNumber :
            buildProtonStack(1,i)
            proStack8.rotateX(piG/2)
            proStack8.position = [0, 2*orthoP, 0]
            grpAn.add(proStack8)
            print('proStack8 1[',i+1,']', proStack8.position)              
        if 16 <= atomicNumber < 36:
            buildProtonStack(2,i)
            proStack8.rotateX(piG/2)
            proStack8.position = [0,pP1pP2/2+2*orthoP, 0]
            grpAn.add(proStack8)
            print('proStack8 2[',i+1,']', proStack8.position)
        if 36 <= atomicNumber < 54:
            buildProtonStack(4,i)
            proStack8.rotateX(piG/2)
            proStack8.position = [0,p1p2/2+pP1pP2+2*orthoP,0]
            grpAn.add(proStack8)            
            print('proStack8 4[',i+1,']', proStack8.position)            
        if 54 <= atomicNumber < 57 :
            buildProtonStack(6,i)
            proStack8.rotateX(piG/2)
            proStack8.position = [0,p2p3+3*pP1pP2/2+2*orthoP, 0]
            grpAn.add(proStack8)            
            print('proStack8 6[',i+1,']', proStack8.position)            
        if 57 <= atomicNumber < 71:
            buildProtonStack(5,i)
            proStack8.rotateX(piG/2)  
            proStack8.position = [0,p2p3+pP1pP2+2*orthoP,0]
            grpAn.add(proStack8)
            print('proStack8 5[',i+1,']', proStack8.position)
        if 71 <= atomicNumber :
            buildProtonStack(6,i)
            proStack8.rotateX(piG/2)
            proStack8.position = [0,p2p3+3*pP1pP2/2+2*orthoP, 0]
            grpAn.add(proStack8)            
            print('proStack8 6[',i+1,']', proStack8.position)              
            
    if i == 8: # Slot 9
        proStack9 = Group()
        if 13 == atomicNumber :
            buildProtonStack(1,i)
            proStack9.rotateX(piG/2)
            proStack9.position = [0, -2*orthoP, 0]
            grpAn.add(proStack9)
            print('proStack9 1[',i+1,']', proStack9.position)  
            maxZNeg = -pP1pP2/2-4*orthoP
            maxZPos = 3*pP1pP2/2+6*orthoP
        if 14 == atomicNumber :
            buildProtonStack(2,i)
            proStack9.rotateX(piG/2)
            proStack9.position = [0,-pP1pP2/2-2*orthoP, 0]
            grpAn.add(proStack9)
            print('proStack9 2[',i+1,']', proStack9.position)
        if 15 == atomicNumber :
            buildProtonStack(1,i)
            proStack9.rotateX(piG/2)
            proStack9.position = [0, -2*orthoP, 0]
            grpAn.add(proStack9)
            print('proStack9 1[',i+1,']', proStack9.position)            
        if 16 <= atomicNumber < 36:
            buildProtonStack(2,i)
            proStack9.rotateX(piG/2)
            proStack9.position = [0,-pP1pP2/2-2*orthoP, 0]
            grpAn.add(proStack9)
            print('proStack9 2[',i+1,']', proStack9.position)
        if 36 <= atomicNumber < 54:
            buildProtonStack(4,i)
            proStack9.rotateX(piG/2)
            proStack9.position = [0,-2*orthoP-p1p2/2-pP1pP2,0]
            grpAn.add(proStack9)            
            print('proStack9 4[',i+1,']', proStack9.position)        
        if 54 <= atomicNumber < 57:
            buildProtonStack(6,i)
            proStack9.rotateX(piG/2)
            proStack9.position = [0,-p2p3-3*pP1pP2/2-2*orthoP, 0]
            grpAn.add(proStack9)            
            print('proStack9 6[',i+1,']', proStack9.position)                
        if 57 <= atomicNumber < 71:
            buildProtonStack(5,i)
            proStack9.rotateX(piG/2)  
            proStack9.position = [0,-p2p3-pP1pP2-2*orthoP,0]
            grpAn.add(proStack9)
            print('proStack9 5[',i+1,']', proStack9.position)
        if 71 <= atomicNumber :
            buildProtonStack(6,i)
            proStack9.rotateX(piG/2)
            proStack9.position = [0,-p2p3-3*pP1pP2/2-2*orthoP, 0]
            grpAn.add(proStack9)            
            print('proStack9 6[',i+1,']', proStack9.position)            
 
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Mon Oct 18, 2021 5:58 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Titani10

Part 2 of 2.

A Python notebook project is about as simple as it gets, and I’ve been anxious to share the code all along. The problem is, while I’m usually optimistic about most things, I have zero confidence in uploading anything to github. What I recall from working the Pi = 4 sim on Nevyn’s bitbucket repository brings back big screaming hebe-gebees and thoughts of going down in flames. That’s too much to ask of Serendipity. I’ll need to view tutorials, study the subject and write a list of instructions before making an attempt. You’ll need more patience.

Teamwork. If you or any of our readers has the experience or knows how to upload this thing, please do, give directions or point the way. I for one would be extremely grateful. I’ll still need to study up in order to get git and key running, or whatever the necessary working routine is.  

Lines 966 - 1908 end.
Code:

    if i == 9: # Slot 10
        proStack10 = Group()
        if 14 == atomicNumber:
            buildProtonStack(2,i)
            proStack10.rotateX(-piG/2)
            proStack10.rotateY(piG/2)
            proStack10.position = [pP1pP2/2+2*orthoP, 0, 0]
            grpAn.add(proStack10)
            print('proStack10 2[',i+1,']', proStack10.position)                  
        if 15 == atomicNumber :
            buildProtonStack(2,i)
            proStack10.rotateX(-piG/2)
            proStack10.rotateY(piG/2)
            proStack10.position = [2*orthoP, 0, 0]
            grpAn.add(proStack10)
            print('proStack10 2[',i+1,']', proStack10.position)            
        if 16 == atomicNumber:
            buildProtonStack(2,i)
            proStack10.rotateX(-piG/2)
            proStack10.rotateY(piG/2)
            proStack10.position = [pP1pP2/2+2*orthoP, 0, 0]
            grpAn.add(proStack10)
            print('proStack10 2[',i+1,']', proStack10.position)
        if 18 <= atomicNumber < 21 :
            buildProtonStack(2,i)
            proStack10.rotateX(-piG/2)
            proStack10.rotateY(piG/2)
            proStack10.position = [pP1pP2/2+2*orthoP, 0, 0]
            grpAn.add(proStack10)
            print('proStack10 2[',i+1,']', proStack10.position)
        if 21 == atomicNumber :
            buildProtonStack(2,i)
            neutronGi.position = [0, 0, pP1pP2/2 + p1n2]
            proStack10.add(neutronGi)  
            proStack10.rotateX(-piG/2)
            proStack10.rotateY(piG/2)
            proStack10.position = [pP1pP2/2+2*orthoP, 0, 0]
            grpAn.add(proStack10)
            print('proStack10 2 w neutron[',i+1,']', proStack10.position)            
        if 22 <= atomicNumber < 36 :
            buildProtonStack(2,i)
            proStack10.rotateX(-piG/2)
            proStack10.rotateY(piG/2)
            proStack10.position = [pP1pP2/2+2*orthoP, 0, 0]
            grpAn.add(proStack10)
            print('proStack10 2[',i+1,']', proStack10.position)
        if 36 <= atomicNumber < 54:
            buildProtonStack(4,i)
            proStack10.rotateY(piG/2)
            proStack10.position = [2*orthoP+p1p2/2+pP1pP2,0,0]
            grpAn.add(proStack10)            
            print('proStack10 4[',i+1,']', proStack10.position)                    
        if 54 <= atomicNumber < 57 :
            buildProtonStack(6,i)
            proStack10.rotateY(piG/2)
            proStack10.position = [p2p3+3*pP1pP2/2+2*orthoP,0,0]
            grpAn.add(proStack10)            
            print('proStack10 6[',i+1,']', proStack10.position)            
        if 57 <= atomicNumber < 71:
            buildProtonStack(5,i)
            proStack10.rotateY(piG/2)  
            proStack10.position = [p2p3+pP1pP2+2*orthoP,0,0]
            grpAn.add(proStack10)
            print('proStack10 5[',i+1,']', proStack10.position)
        if 71 <= atomicNumber :
            buildProtonStack(6,i)
            proStack10.rotateY(piG/2)
            proStack10.position = [p2p3+3*pP1pP2/2+2*orthoP,0,0]
            grpAn.add(proStack10)            
            print('proStack10 6[',i+1,']', proStack10.position)            
            
    if i == 10: # Slot 11
        proStack11 = Group()
        if 14 == atomicNumber: # Silicon, the carousal level
            buildProtonStack(2,i)
            proStack11.rotateX(-piG/2)
            proStack11.rotateY(piG/2)
            proStack11.position = [-pP1pP2/2-2*orthoP, 0, 0]
            grpAn.add(proStack11)
            print('proStack11 2[',i+1,']', proStack11.position)
        if 15 == atomicNumber:
            buildProtonStack(2,i)
            proStack11.rotateX(-piG/2)
            proStack11.rotateY(piG/2)
            proStack11.position = [-2*orthoP, 0, 0]
            grpAn.add(proStack11)
            print('proStack11 2[',i+1,']', proStack11.position)            
        if 16 == atomicNumber:
            buildProtonStack(2,i)
            proStack11.rotateX(-piG/2)
            proStack11.rotateY(piG/2)
            proStack11.position = [-pP1pP2/2-2*orthoP, 0, 0]
            grpAn.add(proStack11)
            print('proStack11 2[',i+1,']', proStack11.position)
        if 18 <= atomicNumber < 21 :
            buildProtonStack(2,i)
            proStack11.rotateX(-piG/2)
            proStack11.rotateY(piG/2)
            proStack11.position = [-pP1pP2/2-2*orthoP, 0, 0]
            grpAn.add(proStack11)
            print('proStack11 2[',i+1,']', proStack11.position)
        if 21 == atomicNumber :
            buildProtonStack(2,i)
            neutronGi.position = [0, 0, -pP1pP2/2 - p1n2]
            proStack11.add(neutronGi)
            proStack11.rotateX(-piG/2)
            proStack11.rotateY(piG/2)
            proStack11.position = [-pP1pP2/2-2*orthoP, 0, 0]
            grpAn.add(proStack11)
            print('proStack11 2 w neutron[',i+1,']', proStack11.position)            
        if 22 <= atomicNumber < 36 :
            buildProtonStack(2,i)
            proStack11.rotateX(-piG/2)
            proStack11.rotateY(piG/2)
            proStack11.position = [-pP1pP2/2-2*orthoP, 0, 0]
            grpAn.add(proStack11)
            print('proStack11 2[',i+1,']', proStack11.position)            
        if 36 <= atomicNumber < 54:
            buildProtonStack(4,i)
            proStack11.rotateY(piG/2)
            proStack11.position = [-2*orthoP-p1p2/2-pP1pP2,0,0]
            grpAn.add(proStack11)            
            print('proStack11 4[',i+1,']', proStack11.position)                      
        if 54 <= atomicNumber < 57:
            buildProtonStack(6,i)
            proStack11.rotateY(piG/2)
            proStack11.position = [-p2p3-3*pP1pP2/2-2*orthoP,0,0]
            grpAn.add(proStack11)            
            print('proStack11 6[',i+1,']', proStack11.position)            
        if 57 <= atomicNumber < 71 :
            buildProtonStack(5,i)
            proStack11.rotateY(piG/2)  
            proStack11.position = [-p2p3-pP1pP2-2*orthoP,0,0]
            grpAn.add(proStack11)
            print('proStack11 5[',i+1,']', proStack11.position)
        if 71 <= atomicNumber :
            buildProtonStack(6,i)
            proStack11.rotateY(piG/2)
            proStack11.position = [-p2p3-3*pP1pP2/2-2*orthoP,0,0]
            grpAn.add(proStack11)            
            print('proStack11 6[',i+1,']', proStack11.position)              
            
    if i == 11: # Slot 12
        proStack12 = Group()
        if 21 <= atomicNumber < 27:
            buildProtonStack(1,i)
            neutronGi.position = [0,0,-p1n2]
            proStack12.add(neutronGi)
            proStack12.rotateZ(piG/2)
            proStack12.position = [0, pP1pP2 + 4*orthoP, 0]
            grpAn.add(proStack12)            
            print('proStack12 w neutron 1[',i+1,']', proStack12.position)      
        if 27 == atomicNumber:
            neutronGi.position = [0,0,0]
            proStack12.add(neutronGi)
            proStack12.position = [0,p1n2+pP1pP2+2*orthoP,0]            
            grpAn.add( proStack12 )
            print('proStack12 neutron[',i+1,']', proStack12.position)
        if 28 == atomicNumber :
            buildProtonStack(1,i)
            neutronGi.position = [0,0,-p1n2]            
            proStack12.add(neutronGi)
            proStack12.rotateZ(piG/2)            
            proStack12.position = [0, pP1pP2+4*orthoP,0]            
            grpAn.add(proStack12)
            print('proStack12 w neutron 1[',i+1,']', proStack12.position)            
        if 29 <= atomicNumber < 36 :
            buildProtonStack(2,i)
            proStack12.rotateZ(piG/2)
            proStack12.position = [0,pP1pP2+4*orthoP,0]
            grpAn.add(proStack12)
            print('proStack12 2[',i+1,']', proStack12.position)      
        if 42 <= atomicNumber < 47:
            buildProtonStack(1,i)
            proStack12.position = [0,4*pP1pP2/2+p1p2+4*orthoP,0]
            grpAn.add(proStack12)
            print('proStack12 1[',i+1,']', proStack12.position)
        if 47 <= atomicNumber < 54 :
            buildProtonStack(2,i)
            proStack12.position = [0,4*pP1pP2/2+p1p2+4*orthoP,0]
            grpAn.add(proStack12)
            print('proStack12 2[',i+1,']', proStack12.position)
        if 57 <= atomicNumber < 61:
            buildProtonStack(1,i)
            proStack12.position = [0,2*p2p3+2*pP1pP2+4*orthoP, 0]
            grpAn.add(proStack12)
            print('proStack12 1[',i+1,']', proStack12.position)            
        if 61 <= atomicNumber < 67:
            buildProtonStack(2,i)
            proStack12.position = [0, 2*p2p3+2*pP1pP2+4*orthoP, 0]
            grpAn.add(proStack12)
            print('proStack12 2[',i+1,']', proStack12.position)
        if 67 == atomicNumber :
            buildProtonStack(3,i)
            proStack12.position = [0, 2*p2p3+2*pP1pP2+4*orthoP, 0]
            grpAn.add(proStack12)
            print('proStack12 3[',i+1,']', proStack12.position)
        if 68 <= atomicNumber < 71 :
            buildProtonStack(4,i)
            proStack12.position = [0, 2*p2p3+2*pP1pP2+4*orthoP, 0]
            grpAn.add(proStack12)            
            print('proStack12 4[',i+1,']', proStack12.position)            
        if 71 == atomicNumber :
            buildProtonStack(2,i)
            proStack12.position = [0, 2*p2p3+3*pP1pP2+4*orthoP, 0]
            grpAn.add(proStack12)
            print('proStack12 2[',i+1,']', proStack12.position)
        if 72 <= atomicNumber < 79:
            buildProtonStack(3,i)
            proStack12.position = [0, 2*p2p3+3*pP1pP2+4*orthoP, 0]
            grpAn.add(proStack12)
            print('proStack12 3[',i+1,']', proStack12.position)
        if 79 <= atomicNumber < 82 :
            buildProtonStack(4,i)
            proStack12.position = [0, 2*p2p3+3*pP1pP2+4*orthoP, 0]
            grpAn.add(proStack12)            
            print('proStack12 4[',i+1,']', proStack12.position)            
        if 82 <= atomicNumber < 86:
            buildProtonStack(3,i)
            proStack12.position = [0, 2*p2p3+3*pP1pP2+4*orthoP, 0]
            grpAn.add(proStack12)
            print('proStack12 3[',i+1,']', proStack12.position)
        if 86 <= atomicNumber :
            buildProtonStack(5,i)
            proStack12.position = [0, 2*p2p3+3*pP1pP2+4*orthoP, 0]
            grpAn.add(proStack12)
            print('proStack12 5[',i+1,']', proStack12.position)
            
    if i == 12: # Slot 13
        proStack13 = Group()
        if 21 <= atomicNumber < 29:
            buildProtonStack(1,i)
            neutronGi.position = [0,0,-p1n2]
            proStack13.add(neutronGi)
            proStack13.rotateZ(piG/2)
            proStack13.position = [0, -pP1pP2 - 4*orthoP, 0]
            grpAn.add(proStack13)            
            print('proStack13 w neutron 1[',i+1,']', proStack13.position)      
        if 29 <= atomicNumber < 36:
            buildProtonStack(2,i)
            proStack13.rotateZ(piG/2)
            proStack13.position = [0,-pP1pP2-4*orthoP,0]
            grpAn.add(proStack13)
            print('proStack13 2[',i+1,']', proStack13.position)
        if 41 <= atomicNumber < 47:
            buildProtonStack(1,i)
            proStack13.rotateZ(piG/2)
            proStack13.position = [0,-4*pP1pP2/2-p1p2-4*orthoP,0]
            grpAn.add(proStack13)            
            print('proStack13 1[',i+1,']', proStack13.position)  
        if 47 <= atomicNumber < 54:
            buildProtonStack(2,i)
            proStack13.position = [0,-4*pP1pP2/2-p1p2-4*orthoP,0]
            grpAn.add(proStack13)
            print('proStack13 2[',i+1,']', proStack13.position)
        if 57 <= atomicNumber < 61:
            buildProtonStack(1,i)
            proStack13.rotateZ(piG/2)
            proStack13.position = [0, -2*p2p3-2*pP1pP2-4*orthoP, 0]
            grpAn.add(proStack13)            
            print('proStack13 1[',i+1,']', proStack13.position)  
        if 61 <= atomicNumber < 67:
            buildProtonStack(2,i)
            proStack13.position = [0, -2*p2p3-2*pP1pP2-4*orthoP, 0]
            grpAn.add(proStack13)
            print('proStack13 2[',i+1,']', proStack13.position)
        if 67 <= atomicNumber < 68:
            buildProtonStack(3,i)
            proStack13.position = [0, -2*p2p3-2*pP1pP2-4*orthoP, 0]
            grpAn.add(proStack13)
            print('proStack13 3[',i+1,']', proStack13.position)
        if 68 <= atomicNumber < 71 :
            buildProtonStack(4,i)
            proStack13.position = [0, -2*p2p3-2*pP1pP2-4*orthoP, 0]
            grpAn.add(proStack13)            
            print('proStack13 4[',i+1,']', proStack13.position)            
        if 71 <= atomicNumber < 79:
            buildProtonStack(3,i)
            proStack13.position = [0, -2*p2p3-3*pP1pP2-4*orthoP, 0]
            grpAn.add(proStack13)
            print('proStack13 3[',i+1,']', proStack13.position)
        if 79 <= atomicNumber < 82 :
            buildProtonStack(4,i)
            proStack13.position = [0, -2*p2p3-3*pP1pP2-4*orthoP, 0]
            grpAn.add(proStack13)            
            print('proStack13 4[',i+1,']', proStack13.position)            
        if 82 <= atomicNumber < 86:
            buildProtonStack(3,i)
            proStack13.position = [0, -2*p2p3-3*pP1pP2-4*orthoP, 0]
            grpAn.add(proStack13)
            print('proStack13 3[',i+1,']', proStack13.position)
        if 86 <= atomicNumber :
            buildProtonStack(5,i)
            proStack13.position = [0, -2*p2p3-3*pP1pP2-4*orthoP, 0]
            grpAn.add(proStack13)
            print('proStack13 5[',i+1,']', proStack13.position)
            
    if i == 13: # Slot 14
        proStack14 = Group()
        if 22 <= atomicNumber < 27:
            buildProtonStack(1,i)
            neutronGi.position = [0,0,-p1n2]
            proStack14.add(neutronGi)
            proStack14.rotateZ(-piG/2)
            proStack14.position = [4*orthoP+pP1pP2,0,0]
            grpAn.add(proStack14)
            print('proStack14 1 w neutron[',i+1,']', proStack14.position)            
        if 27 <= atomicNumber < 36:
            buildProtonStack(2,i)
            proStack14.rotateZ(-piG/2)
            proStack14.position = [4*orthoP+pP1pP2,0,0]
            grpAn.add(proStack14)
            print('proStack14 2[',i+1,']', proStack14.position)
        if 39 <= atomicNumber < 48:
            buildProtonStack(1,i)
            proStack14.position = [4*pP1pP2/2+p1p2+4*orthoP,0,0]
            grpAn.add(proStack14)
            print('proStack14 1[',i+1,']', proStack14.position)            
        if 48 <= atomicNumber < 54:
            buildProtonStack(2,i)
            proStack14.position = [4*pP1pP2/2+p1p2+4*orthoP,0,0]
            grpAn.add(proStack14)
            print('proStack14 2[',i+1,']', proStack14.position)
        if 57 <= atomicNumber < 63:
            buildProtonStack(2,i)
            proStack14.position = [2*p2p3+2*pP1pP2+4*orthoP,0,0]
            grpAn.add(proStack14)
            print('proStack14 2[',i+1,']', proStack14.position)
        if 63 <= atomicNumber < 71:
            buildProtonStack(3,i)
            proStack14.position = [2*p2p3+2*pP1pP2+4*orthoP,0,0]
            grpAn.add(proStack14)
            print('proStack14 3[',i+1,']', proStack14.position)
        if 71 <= atomicNumber < 74:
            buildProtonStack(2,i)
            proStack14.position = [2*p2p3+3*pP1pP2+4*orthoP,0,0]
            grpAn.add(proStack14)
            print('proStack14 2[',i+1,']', proStack14.position)
        if 74 <= atomicNumber < 80:
            buildProtonStack(3,i)
            proStack14.position = [2*p2p3+3*pP1pP2+4*orthoP,0,0]
            grpAn.add(proStack14)
            print('proStack14 3[',i+1,']', proStack14.position)
        if 80 <= atomicNumber < 82:
            buildProtonStack(4,i)
            proStack14.position = [2*p2p3+3*pP1pP2+4*orthoP,0,0]
            grpAn.add(proStack14)            
            print('proStack14 4[',i+1,']', proStack14.position)
        if 82 <= atomicNumber :
            buildProtonStack(5,i)
            proStack14.position = [2*p2p3+3*pP1pP2+4*orthoP,0,0]
            grpAn.add(proStack14)
            print('proStack14 5[',i+1,']', proStack14.position)

    if i == 14: # Slot 15
        proStack15 = Group()
        if 22 <= atomicNumber < 27 :
            buildProtonStack(1,i)
            neutronGi.position = [0,0,-p1n2]
            proStack15.add(neutronGi)
            proStack15.rotateZ(-piG/2)
            proStack15.position = [-4*orthoP-pP1pP2,0,0]
            grpAn.add(proStack15)
            print('proStack15 1 w neutron[',i+1,']', proStack15.position)            
        if 27 <= atomicNumber < 36 :
            buildProtonStack(2,i)
            proStack15.rotateZ(-piG/2)
            proStack15.position = [-4*orthoP-pP1pP2,0,0]
            grpAn.add(proStack15)
            print('proStack15 2[',i+1,']', proStack15.position)
        if 39 <= atomicNumber < 48:
            buildProtonStack(1,i)
            proStack15.position = [-4*pP1pP2/2-p1p2-4*orthoP,0,0]
            grpAn.add(proStack15)
            print('proStack15 1[',i+1,']', proStack15.position)            
        if 48 <= atomicNumber < 54:
            buildProtonStack(2,i)
            proStack15.position = [-4*pP1pP2/2-p1p2-4*orthoP,0,0]
            grpAn.add(proStack15)
            print('proStack15 2[',i+1,']', proStack15.position)    
        if 57 <= atomicNumber < 63 :
            buildProtonStack(2,i)
            proStack15.position = [-2*p2p3-2*pP1pP2-4*orthoP,0,0]
            grpAn.add(proStack15)
            print('proStack15 2[',i+1,']', proStack15.position)
        if 63 <= atomicNumber < 71 :
            buildProtonStack(3,i)
            proStack15.position = [-2*p2p3-2*pP1pP2-4*orthoP,0,0]
            grpAn.add(proStack15)
            print('proStack15 3[',i+1,']', proStack15.position)
        if 71 == atomicNumber :
            buildProtonStack(3,i)
            proStack15.position = [-2*p2p3-3*pP1pP2-4*orthoP, 0, 0]
            grpAn.add(proStack15)
            print('proStack15 3[',i+1,']', proStack15.position)
        if 72 <= atomicNumber < 74 :
            buildProtonStack(2,i)
            proStack15.position = [-2*p2p3-3*pP1pP2-4*orthoP,0,0]
            grpAn.add(proStack15)
            print('proStack15 2[',i+1,']', proStack15.position)
        if 74 == atomicNumber :
            buildProtonStack(3,i)
            proStack15.position = [-2*p2p3-3*pP1pP2-4*orthoP,0,0]
            grpAn.add(proStack15)
            print('proStack15 3[',i+1,']', proStack15.position)
        if 75 == atomicNumber :
            buildProtonStack(2,i)
            proStack15.position = [-2*p2p3-3*pP1pP2-4*orthoP,0,0]
            grpAn.add(proStack15)
            print('proStack15 2[',i+1,']', proStack15.position)
        if 76 <= atomicNumber < 80 :
            buildProtonStack(3,i)
            proStack15.position = [-2*p2p3-3*pP1pP2-4*orthoP,0,0]
            grpAn.add(proStack15)
            print('proStack15 3[',i+1,']', proStack15.position)
        if 80 <= atomicNumber < 82:
            buildProtonStack(4,i)
            proStack15.position = [-2*p2p3-3*pP1pP2-4*orthoP,0,0]
            grpAn.add(proStack15)            
            print('proStack15 4[',i+1,']', proStack15.position)              
        if 82 <= atomicNumber :
            buildProtonStack(5,i)
            proStack15.position = [-2*p2p3-3*pP1pP2-4*orthoP,0,0]
            grpAn.add(proStack15)
            print('proStack15 5[',i+1,']', proStack15.position)
            
    if i == 15: # Slot 16
        proStack16 = Group()
        if 27 <= atomicNumber < 30:
            proStack16.add(neutronGi)
            proStack16.position = [0,pP1pP2/2+p1n2,pP1pP2/2 + 2*orthoP]
            grpBn.add(proStack16)
            print('proStack16 hook neutron[',i+1,']', proStack16.position)            
        if 33 <= atomicNumber < 36:
            buildProtonStack(1,i)
            proStack16.position = [0, pP1pP2/2+2*orthoP, pP1pP2/2+2*orthoP]
            grpBn.add(proStack16)
            print('proStack16 hook 1[',i+1,']', proStack16.position)            
        if 46 <= atomicNumber < 48:
            buildProtonStack(1,i)
            proStack16.position = [0,p1p2/2+pP1pP2+2*orthoP,p1p2/2+pP1pP2+2*orthoP]
            grpBn.add(proStack16)
            print('proStack16 hook 1[',i+1,']', proStack16.position)          
        if 49 == atomicNumber:
            buildProtonStack(1,i)
            proStack16.position = [0,p1p2/2+pP1pP2+2*orthoP,p1p2/2+pP1pP2+2*orthoP]
            grpBn.add(proStack16)
            print('proStack16 hook 1[',i+1,']', proStack16.position)                        
        if 53 == atomicNumber:
            buildProtonStack(2,i)
            proStack16.position = [0,p1p2/2+pP1pP2+2*orthoP,p1p2/2+pP1pP2+2*orthoP]
            grpBn.add(proStack16)
            print('proStack16 hook 2[',i+1,']', proStack16.position)          
        if 60 <= atomicNumber < 62:
            buildProtonStack(1,i)
            proStack16.position = [0,p2p3+pP1pP2+2*orthoP,p2p3+pP1pP2+2*orthoP]
            grpBn.add(proStack16)
            print('proStack16 hook 1[',i+1,']', proStack16.position)              
        if 64 <= atomicNumber < 66:
            buildProtonStack(2,i)
            proStack16.position = [0,p2p3+pP1pP2+2*orthoP,p2p3+pP1pP2+2*orthoP]
            grpBn.add(proStack16)
            print('proStack16 hook 2[',i+1,']', proStack16.position)  
        if 70 == atomicNumber :
            buildProtonStack(1,i)
            proStack16.position = [0,p2p3+pP1pP2+2*orthoP,p2p3+pP1pP2+2*orthoP]
            grpBn.add(proStack16)
            print('proStack16 hook 1[',i+1,']', proStack16.position)            
        if 72 <= atomicNumber < 74:
            buildProtonStack(1,i)
            proStack16.position = [0,p2p3+3*pP1pP2/2+2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(proStack16)
            print('proStack16 hook 1[',i+1,']', proStack16.position)
        if 75 == atomicNumber :
            buildProtonStack(2,i)
            proStack16.position = [0,p2p3+3*pP1pP2/2+2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(proStack16)
            print('proStack16 hook 2[',i+1,']', proStack16.position)
        if 77 <= atomicNumber < 80:
            buildProtonStack(2,i)
            proStack16.position = [0,p2p3+3*pP1pP2/2+2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(proStack16)
            print('proStack16 hook 2[',i+1,']', proStack16.position)          
        if 81 == atomicNumber :
            buildProtonStack(2,i)
            proStack16.position = [0,p2p3+3*pP1pP2/2+2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(proStack16)
            print('proStack16 hook 2[',i+1,']', proStack16.position)        
        if 82 == atomicNumber :
            buildProtonStack(1,i)
            proStack16.position = [0,p2p3+3*pP1pP2/2+2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(proStack16)
            print('proStack16 hook 1[',i+1,']', proStack16.position)
        if 83 <= atomicNumber < 86 :
            buildProtonStack(2,i)
            proStack16.position = [0,p2p3+3*pP1pP2/2+2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(proStack16)
            print('proStack16 hook 2[',i+1,']', proStack16.position)
        if 87 <= atomicNumber < 89 :
            buildProtonStack(1,i)
            proStack16.position = [0,p2p3+3*pP1pP2/2+2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(proStack16)
            print('proStack16 hook 1[',i+1,']', proStack16.position)
        if 89 <= atomicNumber :
            buildProtonStack(2,i)
            proStack16.position = [0,p2p3+3*pP1pP2/2+2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(proStack16)
            print('proStack16 hook 2[',i+1,']', proStack16.position)
        
    if i == 16: # Slot 17
        proStack17 = Group()
        if 26 <= atomicNumber < 30:        
            proStack17.add(neutronGi)
            proStack17.position = [0,-pP1pP2/2-p1n2,-pP1pP2/2 - 2*orthoP]
            grpBn.add( proStack17 )
            print('proStack17 hook neutron[',i+1,']', proStack17.position)            
        if 34 <= atomicNumber < 36:
            buildProtonStack(1,i)
            proStack17.position = [0,-pP1pP2/2- 2*orthoP,-pP1pP2/2 - 2*orthoP]
            grpBn.add(proStack17)
            print('proStack17 hook 1[',i+1,']', proStack17.position)              
        if 45 <= atomicNumber < 48:
            buildProtonStack(1,i)
            proStack17.position = [0,-p1p2/2-pP1pP2-2*orthoP,-p1p2/2-pP1pP2-2*orthoP]
            grpBn.add(proStack17)
            print('proStack17 hook 1[',i+1,']', proStack17.position)            
        if 51 == atomicNumber:
            buildProtonStack(1,i)
            proStack17.position = [0,-p1p2/2-pP1pP2-2*orthoP,-p1p2/2-pP1pP2-2*orthoP]
            grpBn.add(proStack17)
            print('proStack17 hook 1[',i+1,']', proStack17.position)
        if 53 == atomicNumber :
            buildProtonStack(1,i)
            proStack17.position = [0,-p1p2/2-pP1pP2-2*orthoP,-p1p2/2-pP1pP2-2*orthoP]
            grpBn.add(proStack17)
            print('proStack17 hook 1[',i+1,']', proStack17.position)            
        if 59 <= atomicNumber < 63 :
            buildProtonStack(1,i)
            proStack17.position = [0,-p2p3-pP1pP2-2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(proStack17)
            print('proStack17 hook 1[',i+1,']', proStack17.position)
        if 65 <= atomicNumber < 66 :
            buildProtonStack(1,i)
            proStack17.position = [0,-p2p3-pP1pP2-2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(proStack17)
            print('proStack17 hook 1[',i+1,']', proStack17.position)            
        if 68 == atomicNumber :
            buildProtonStack(1,i)
            proStack17.position = [0,-p2p3-pP1pP2-2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(proStack17)
            print('proStack17 hook 1[',i+1,']', proStack17.position)
        if 69 == atomicNumber :
            buildProtonStack(2,i)
            proStack17.position = [0,-p2p3-pP1pP2-2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(proStack17)
            print('proStack17 hook 2[',i+1,']', proStack17.position)
        if 70 == atomicNumber :
            buildProtonStack(1,i)
            proStack17.position = [0,-p2p3-pP1pP2-2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(proStack17)
            print('proStack17 hook 1[',i+1,']', proStack17.position)            
        if 72 == atomicNumber :
            buildProtonStack(1,i)
            proStack17.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack17)
            print('proStack17 hook 1[',i+1,']', proStack17.position)  
        if 73 == atomicNumber :
            buildProtonStack(2,i)
            proStack17.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack17)
            print('proStack17 hook 2[',i+1,']', proStack17.position)
        if 74 == atomicNumber :
            buildProtonStack(1,i)
            proStack17.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack17)
            print('proStack17 hook 1[',i+1,']', proStack17.position)  
        if 75 == atomicNumber :
            buildProtonStack(2,i)
            proStack17.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack17)
            print('proStack17 hook 2[',i+1,']', proStack17.position)
        if 77 <= atomicNumber < 80 :
            buildProtonStack(2,i)
            proStack17.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack17)
            print('proStack17 hook 2[',i+1,']', proStack17.position)
        if 81 <= atomicNumber < 84:
            buildProtonStack(1,i)
            proStack17.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack17)
            print('proStack17 hook 1[',i+1,']', proStack17.position)
        if 84 <= atomicNumber < 86 :
            buildProtonStack(2,i)
            proStack17.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack17)
            print('proStack17 hook 2[',i+1,']', proStack17.position)
        if 87 <= atomicNumber < 90 :
            buildProtonStack(1,i)
            proStack17.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack17)
            print('proStack17 hook 1[',i+1,']', proStack17.position)
        if 90 <= atomicNumber :
            buildProtonStack(2,i)
            proStack17.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack17)
            print('proStack17 hook 2[',i+1,']', proStack17.position)
        
    if i == 17: # Slot 18
        proStack18 = Group()
        if 25 == atomicNumber:
            buildProtonStack(1,i)
            proStack18.position = [0,-pP1pP2/2-2*orthoP, pP1pP2/2+2*orthoP]
            grpBn.add(proStack18)
            print('proStack18 hook 1[',i+1,']', proStack18.position)
        if 26 <= atomicNumber < 29:            
            proStack18.add(neutronGi)
            proStack18.position = [0,-pP1pP2/2-p1n2,pP1pP2/2 + 2*orthoP]          
            grpBn.add( proStack18 )            
            print('proStack18 hook neutron[',i+1,']', proStack18.position)
        if 29 <= atomicNumber < 30:
            neutronGi.position = [0,-n1n2/2,0]
            proStack18.add(neutronGi)
            neutronKi.position = [0,n1n2/2,0]
            proStack18.add(neutronKi)
            proStack18.rotateX(piG/2)            
            proStack18.position = [0,-pP1pP2/2-p1n2,+pP1pP2/2+2*orthoP]
            grpBn.add( proStack18 )            
            print('proStack18 w 2 hook neutrons[',i+1,']', proStack18.position)            
        if 30 <= atomicNumber < 36:
            buildProtonStack(1,i)
            proStack18.position = [0,-pP1pP2/2-2*orthoP,pP1pP2/2+2*orthoP]
            grpBn.add(proStack18)
            print('proStack18 hook 1[',i+1,']', proStack18.position)            
        if 44 <= atomicNumber < 47:
            buildProtonStack(1,i)
            proStack18.position = [0,-p1p2/2-pP1pP2-2*orthoP,p1p2/2+pP1pP2+2*orthoP]
            grpBn.add(proStack18)
            print('proStack18 hook 1[',i+1,']', proStack18.position)
        if 50 == atomicNumber:
            buildProtonStack(2,i)
            proStack18.position = [0,-p1p2/2-pP1pP2-2*orthoP,p1p2/2+pP1pP2+2*orthoP]
            grpBn.add(proStack18)
            print('proStack18 hook 2[',i+1,']', proStack18.position)
        if 51 == atomicNumber:
            buildProtonStack(1,i)
            proStack18.position = [0,-p1p2/2-pP1pP2-2*orthoP,p1p2/2+pP1pP2+2*orthoP]
            grpBn.add(proStack18)
            print('proStack18 hook 1[',i+1,']', proStack18.position)
        if 52 == atomicNumber :
            buildProtonStack(2,i)
            proStack18.position = [0,-p1p2/2-pP1pP2-2*orthoP,p1p2/2+pP1pP2+2*orthoP]
            grpBn.add(proStack18)
            print('proStack18 hook 2[',i+1,']', proStack18.position)
        if 53 == atomicNumber :
            buildProtonStack(1,i)
            proStack18.position = [0,-p1p2/2-pP1pP2-2*orthoP,p1p2/2+pP1pP2+2*orthoP]
            grpBn.add(proStack18)
            print('proStack18 hook 1[',i+1,']', proStack18.position)
        if 57 <= atomicNumber < 68 :
            buildProtonStack(2,i)
            proStack18.position = [0,-p2p3-pP1pP2-2*orthoP,p2p3+pP1pP2+2*orthoP]
            grpBn.add(proStack18)
            print('proStack18 hook 2[',i+1,']', proStack18.position)
        if 70 == atomicNumber :
            buildProtonStack(1,i)
            proStack18.position = [0,-p2p3-pP1pP2-2*orthoP,p2p3+pP1pP2+2*orthoP]
            grpBn.add(proStack18)
            print('proStack18 hook 1[',i+1,']', proStack18.position)
        if 71 == atomicNumber :
            buildProtonStack(1,i)
            proStack18.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(proStack18)
            print('proStack18 hook 1[',i+1,']', proStack18.position)
        if 76 == atomicNumber:
            buildProtonStack(2,i)
            proStack18.position = [0,-p2p3-pP1pP2-2*orthoP,p2p3+pP1pP2+2*orthoP]
            grpBn.add(proStack18)
            print('proStack18 hook 2[',i+1,']', proStack18.position)
        if 77 == atomicNumber :
            buildProtonStack(1,i)
            proStack18.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(proStack18)
            print('proStack18 hook 1[',i+1,']', proStack18.position)
        if 80 <= atomicNumber < 81 :
            buildProtonStack(1,i)
            proStack18.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(proStack18)
            print('proStack18 hook 1[',i+1,']', proStack18.position)
        if 85 <= atomicNumber :
            buildProtonStack(1,i)
            proStack18.position = [0,-p2p3-3*pP1pP2/2-2*orthoP,p2p3+3*pP1pP2/2+2*orthoP]
            grpBn.add(proStack18)
            print('proStack18 hook 1[',i+1,']', proStack18.position)
            
    if i == 18: # Slot 1
        proStack19 = Group()
        if 26 <= atomicNumber < 29:
            proStack19.add(neutronGi)          
            proStack19.position = [0,pP1pP2/2+p1n2,-pP1pP2/2 - 2*orthoP]
            grpBn.add(proStack19)            
            print('proStack19 hook neutron[',i+1,']', proStack19.position)
        if 29 <= atomicNumber < 30:
            neutronGi.position = [0,-n1n2/2,0]
            proStack19.add(neutronGi)
            neutronKi.position = [0,n1n2/2,0]
            proStack19.add(neutronKi)
            proStack19.rotateX(piG/2)            
            proStack19.position = [0,pP1pP2/2+p1n2,-pP1pP2/2-2*orthoP]
            grpBn.add( proStack19 )            
            print('proStack19 w 2 hook neutrons[',i+1,']', proStack19.position)                  
        if 30 == atomicNumber :
            buildProtonStack(1,i)
            proStack19.position = [0,pP1pP2/2+2*orthoP,-pP1pP2/2-2*orthoP]
            grpBn.add(proStack19)
            print('proStack19 hook 1[',i+1,']', proStack19.position)
        if 32 <= atomicNumber < 35 :
            buildProtonStack(1,i)
            proStack19.position = [0,pP1pP2/2+2*orthoP,-pP1pP2/2-2*orthoP]
            grpBn.add(proStack19)
            print('proStack19 hook 1[',i+1,']', proStack19.position)
        if 35 == atomicNumber :
            buildProtonStack(2,i)
            proStack19.position = [0,pP1pP2/2+2*orthoP,-pP1pP2/2-2*orthoP]
            grpBn.add(proStack19)
            print('proStack19 hook 2[',i+1,']', proStack19.position)
        if 43 <= atomicNumber < 47:
            buildProtonStack(1,i)
            proStack19.position = [0,p1p2/2+pP1pP2+2*orthoP,-p1p2/2-pP1pP2-2*orthoP]
            grpBn.add(proStack19)
            print('proStack19 hook 1[',i+1,']', proStack19.position)            
        if 50 == atomicNumber:
            buildProtonStack(2,i)
            proStack19.position = [0,p1p2/2+pP1pP2+2*orthoP,-p1p2/2-pP1pP2-2*orthoP]
            grpBn.add(proStack19)
            print('proStack19 hook 2[',i+1,']', proStack19.position)
        if 51 == atomicNumber:
            buildProtonStack(1,i)
            proStack19.position = [0,p1p2/2+pP1pP2+2*orthoP,-p1p2/2-pP1pP2-2*orthoP]
            grpBn.add(proStack19)
            print('proStack19 hook 1[',i+1,']', proStack19.position)
        if 52 == atomicNumber:
            buildProtonStack(2,i)
            proStack19.position = [0,p1p2/2+pP1pP2+2*orthoP,-p1p2/2-pP1pP2-2*orthoP]
            grpBn.add(proStack19)
            print('proStack19 hook 2[',i+1,']', proStack19.position)
        if 53 == atomicNumber:
            buildProtonStack(1,i)
            proStack19.position = [0,p1p2/2+pP1pP2+2*orthoP,-p1p2/2-pP1pP2-2*orthoP]
            grpBn.add(proStack19)
            print('proStack19 hook 1[',i+1,']', proStack19.position)
        if 57 == atomicNumber < 58:
            buildProtonStack(1,i)
            proStack19.position = [0,p2p3+pP1pP2+2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(proStack19)
            print('proStack19 hook 1[',i+1,']', proStack19.position)
        if 58 <= atomicNumber < 63:
            buildProtonStack(2,i)
            proStack19.position = [0,p2p3+pP1pP2+2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(proStack19)
            print('proStack19 hook 2[',i+1,']', proStack19.position)
        if 63 == atomicNumber :
            buildProtonStack(1,i)
            proStack19.position = [0,p2p3+pP1pP2+2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(proStack19)
            print('proStack19 hook 1[',i+1,']', proStack19.position)
        if 66 <= atomicNumber < 68 :
            buildProtonStack(2,i)
            proStack19.position = [0,p2p3+pP1pP2+2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(proStack19)
            print('proStack19 hook 2[',i+1,']', proStack19.position)
        if 68 <= atomicNumber < 71:
            buildProtonStack(1,i)
            proStack19.position = [0,p2p3+pP1pP2+2*orthoP,-p2p3-pP1pP2-2*orthoP]
            grpBn.add(proStack19)
            print('proStack19 hook 1[',i+1,']', proStack19.position)
        if 71 == atomicNumber :
            buildProtonStack(1,i)
            proStack19.position = [0,p2p3+3*pP1pP2/2+2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack19)
            print('proStack19 hook 1[',i+1,']', proStack19.position)
        if 74 == atomicNumber :
            buildProtonStack(1,i)
            proStack19.position = [0,p2p3+3*pP1pP2/2+2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack19)
            print('proStack19 hook 1[',i+1,']', proStack19.position)
        if 76 == atomicNumber :
            buildProtonStack(2,i)
            proStack19.position = [0,p2p3+3*pP1pP2/2+2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack19)
            print('proStack19 hook 2[',i+1,']', proStack19.position)
        if 80 <= atomicNumber < 81:
            buildProtonStack(1,i)
            proStack19.position = [0,p2p3+3*pP1pP2/2+2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack19)
            print('proStack19 hook 1[',i+1,']', proStack19.position)
        if 86 == atomicNumber :
            buildProtonStack(1,i)
            proStack19.position = [0,p2p3+3*pP1pP2/2+2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack19)
            print('proStack19 hook 1[',i+1,']', proStack19.position)
        if 88 <= atomicNumber :
            buildProtonStack(1,i)
            proStack19.position = [0,p2p3+3*pP1pP2/2+2*orthoP,-p2p3-3*pP1pP2/2-2*orthoP]
            grpBn.add(proStack19)
            print('proStack19 hook 1[',i+1,']', proStack19.position)  

grpAn.position = [0,0,(-maxZNeg + maxZPos)/2 - maxZPos]
grpBn.position = [0,0,(-maxZNeg + maxZPos)/2 - maxZPos]

print(emissionType.value)
print(number)

In[8]
if atomsLabel.value == True:
    scene = Scene(children=[grpAn, grpBn, camera, key_light, ambient_light,
        make_text(atomicLabel,
                  height=0.25,
                  position = [-1,1,number*0.025 + 1.5])]) # move the label +z as the atom grows
else:
    scene = Scene(children=[grpAn, grpBn, camera, key_light, ambient_light])
controller = OrbitControls(controlling=camera, screenSpacePanning=True)

In[9]
renderer = Renderer(camera=camera, scene=scene, controls=[controller],
                    width=view_width, height=view_height)
scene = Scene()  # initialising the scene

In[10]
spinC_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, caroSecs], values=[0, 2*piG])
spinC_clip = AnimationClip(tracks=[spinC_track])
spinC_action = AnimationAction(AnimationMixer(grpAn), spinC_clip, grpAn)
spinC_action

In[11]
renderer

In[12]
spinB2_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 2], values=[0, 6.28])
spinB2_clip = AnimationClip(tracks=[spinB2_track])
spinB2_action = AnimationAction(AnimationMixer(proStack2), spinB2_clip, proStack2)
spinB2_action

In[13]
spinB3_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 2], values=[0, 6.28])
spinB3_clip = AnimationClip(tracks=[spinB3_track])
spinB3_action = AnimationAction(AnimationMixer(proStack3), spinB3_clip, proStack3)
spinB3_action

In[14]
spinB4_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 2], values=[0, 6.28])
spinB4_clip = AnimationClip(tracks=[spinB4_track])
spinB4_action = AnimationAction(AnimationMixer(proStack4), spinB4_clip, proStack4)
spinB4_action

In[15]
spinB5_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 2], values=[0, 6.28])
spinB5_clip = AnimationClip(tracks=[spinB5_track])
spinB5_action = AnimationAction(AnimationMixer(proStack5), spinB5_clip, proStack5)
spinB5_action

In[16]
spinB6_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 2], values=[0, 6.28])
spinB6_clip = AnimationClip(tracks=[spinB6_track])
spinB6_action = AnimationAction(AnimationMixer(proStack6), spinB6_clip, proStack6)
spinB6_action

In[17]
spinB7_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 2], values=[0, 6.28])
spinB7_clip = AnimationClip(tracks=[spinB7_track])
spinB7_action = AnimationAction(AnimationMixer(proStack7), spinB7_clip, proStack7)
spinB7_action

In[18]
spinB8_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 2], values=[0, 6.28])
spinB8_clip = AnimationClip(tracks=[spinB8_track])
spinB8_action = AnimationAction(AnimationMixer(proStack8), spinB8_clip, proStack8)
spinB8_action

In[19]
spinB9_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 2], values=[0, 6.28])
spinB9_clip = AnimationClip(tracks=[spinB9_track])
spinB9_action = AnimationAction(AnimationMixer(proStack9), spinB9_clip, proStack9)
spinB9_action

In[20]
spinB10_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 2], values=[0, 6.28])
spinB10_clip = AnimationClip(tracks=[spinB10_track])
spinB10_action = AnimationAction(AnimationMixer(proStack10), spinB10_clip, proStack10)
spinB10_action

In[21]
spinB11_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 2], values=[0, 6.28])
spinB11_clip = AnimationClip(tracks=[spinB11_track])
spinB11_action = AnimationAction(AnimationMixer(proStack11), spinB11_clip, proStack11)
spinB11_action

In[22]
spinB12_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 2], values=[0, 6.28])
spinB12_clip = AnimationClip(tracks=[spinB12_track])
spinB12_action = AnimationAction(AnimationMixer(proStack12), spinB12_clip, proStack12)
spinB12_action

In[23]
spinB13_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 2], values=[0, 6.28])
spinB13_clip = AnimationClip(tracks=[spinB13_track])
spinB13_action = AnimationAction(AnimationMixer(proStack13), spinB13_clip, proStack13)
spinB13_action

In[24]
spinB14_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 2], values=[0, 6.28])
spinB14_clip = AnimationClip(tracks=[spinB14_track])
spinB14_action = AnimationAction(AnimationMixer(proStack14), spinB14_clip, proStack14)
spinB14_action

In[25]
spinB15_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 2], values=[0, 6.28])
spinB15_clip = AnimationClip(tracks=[spinB15_track])
spinB15_action = AnimationAction(AnimationMixer(proStack15), spinB15_clip, proStack15)
spinB15_action

In[26]
spinB16_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 2], values=[0, 6.28])
spinB16_clip = AnimationClip(tracks=[spinB16_track])
spinB16_action = AnimationAction(AnimationMixer(proStack16), spinB16_clip, proStack16)
spinB16_action

In[27]
spinB17_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 2], values=[0, 6.28])
spinB17_clip = AnimationClip(tracks=[spinB17_track])
spinB17_action = AnimationAction(AnimationMixer(proStack17), spinB17_clip, proStack17)
spinB17_action

In[28]
spinB18_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 2], values=[0, 6.28])
spinB18_clip = AnimationClip(tracks=[spinB18_track])
spinB18_action = AnimationAction(AnimationMixer(proStack18), spinB18_clip, proStack18)
spinB18_action

In[29]
spinB19_track = NumberKeyframeTrack(name='.rotation[z]', times=[0, 2], values=[0, 6.28])
spinB19_clip = AnimationClip(tracks=[spinB19_track])
spinB19_action = AnimationAction(AnimationMixer(proStack19), spinB19_clip, proStack19)
spinB19_action
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Fri Oct 22, 2021 4:44 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Helium11

Progress report. In the tutorials this whole process takes less than five minutes. Please pardon my exceeding slow going and excruciating details.

1. I updated my copy of SourceTree and used it to create a ChargeField project repository on my machine – i.e. SourceTree added the Git software to the ChargeField folder. I’ve since used SourceTree to make change commits after adding project files, and again after adding some content to the README file.

2. ChargeField contains the following files and docs.
a. AtomBuilder.ipynb, The jupyter notebook file containing the In[] cells I posted last time.
b. README.md The explanatory document I’ve included in the code section of this post - for review. README is in markdown code, .md file, that I’ve edited with Jupyter Notebook. I understand it will appear as a propely readable Readme file at GitHub, so I don’t really know how it actually looks. Nevertheless, as recommended by various sources, I’m trying to make a fine README file, my only remaining excuse for not yet having uploaded to GitHub.
README file.
Code:

# Charge Field topics on Jupyter Notebook
***
The goal of this project is to introduce Jupyter Notebook users
to Charge Field physics and the Unified Field theory, etc.
developed by Miles Mathis. See,
***THE GREATEST STANDING ERRORS IN PHYSICS AND MATHEMATICS***
http://milesmathis.com/index.html

The only true particles in nature are photons, real spinning
objects with mass and radii as small as 10^(-27)m. Photons travel
with both forward and angular momentum (c^2) due to both the
photon's forward and spin tangential light speed velocities, i.e.
real spinning photons create both electric (linear photon momentum)
and magnetic (angular photon momentum) fields. All matter larger
than photons such as electrons, protons, planets, suns or galaxies
are comprised of and constantly recycle photons, creating the
charge field.

<img src="images/Helium2.png" width="330">

# Atom Builder.
***
The Atom Builder (AB) is, I believe, the first such Notebook
charge field topic. It creates a 3D model of the atomic element
(1-90) selected by the user. AB is still new and needs plenty of
work. I imagine it will eventually include a Periodic Table from
which one might select the desired element. Or not, given the
atomic output, a new periodic table shape may be in order. For
the time being, its good enough to share on GitHub. Collaborative
efforts are welcome.  

Run each cell in turn. Once the control widgets are visible,
select the desired atom with the drop-down widget, then continue
running the following cells allowing time for the atom to build.
Other control options include: type of proton emissions displayed,
color coding of the specific number of protons in each proton
stack, proton separation distances, and including an atomic label
or not.

After the atom is built, the atom can be spun with up to 19
different rotation controls which spin each of the atoms' 'slots'
(this needs to be consolidated). Each slot may contain a neutron
or a proton, or both, or a single stack of up to 6 protons, 6
neutrons and 6 electrons. Each atom has up to 19 occupied slots
and only a few of the larger atoms have all 19 slots occupied.
Each object within each slot spins about the slot center at the
same rate, which is not correct, yet it provides a good idea how
the atom spins. Eventually, all protons, neutrons and electrons
should spin at their own rates.

The first rotation control, grpAn, spins the 'Carousel', which
includes the front/back and left/right objects (neutrons or
protons) connected to the center slot but not in the up/down
directions on the atom's main vertical column. The output
displays the up/down atomic dimension sideways to save space,
the orbital camera allows views from most angles. The rest of
the rotation controls spin each of the slots. If a slot is
unoccupied, the corresponding slot rotation control has
nothing to spin and will not work erroring just that control.
  
The reference's ***SECTION 9: THE NUCLEUS*** contains
descriptions and diagrams of charge channeling and charge
recycling by the elements. See,
***How to Build the Elements***.
>Explaining the periodic table, with nuclear diagrams".
http://milesmathis.com/nuclear.pdfhttp://milesmathis.com/nuclear.pdf

<img src="images/chromium24.png" width="400">

#### Files
***
AtomBuilder.ipynb was created using Jupyter Notebook 6.4.0.
The code needs to import: pythreejs for the graphics, IPython
for the display and ipywidget for the controls.

As I understand it. The .ipynb_checkpoints folder/directory
amounts to a temporary backup file generated by notebook user's
manual save commands; allowing the user to revert to the
previous saved command. It's not needed, I tried including it in
the gitignore file but its still in the repository.

This README file was also written with Jupyter notebook.

#### For discussion, visit "Miles Mathis' Charge Field - Portal"
***
at https://milesmathis.forumotion.com/
This particular project is described in the
***Miles Periodic Table with Standard Periodic Table reference***
thread,
https://milesmathis.forumotion.com/t634p75-miles-periodic-table-with-standard-periodic-table-reference#6702

#### Contributing
***
Miles Mathis' Charge Field ideas are free. This project is
intended to be a Public Domain free and open source, Jupyter
Notebook application example
https://jupyter.org/
developed from graphics examples found at pythreejs  
https://pythreejs.readthedocs.io/en/stable/examples/index.html
and widgets found at
https://ipywidgets.readthedocs.io/en/latest/examples/Widget%20Basics.html
following Miles Mathis' ideas.
http://milesmathis.com/index.html

This was Cr6's idea. Pardon my interpretations. I'm trying
to learn. Plenty of mistakes to call my own.

Pull requests are welcome. For major changes, please open an
issue first to discuss what you'd like to change.

c. images. A folder containing two png files: Helium2, seen above; and chromium24 which I posted on 10 October.
d. .git, installed by SourceTree, required for repository version control.
e. .ipynb_checkpoints, a usually hidden jupyter notebook temporary backup file folder which really isn’t necessary.
f. .gitignore, a text file which tells the git software what files or docs to ignore. It currently contains the following text:
.ipynb_checkpoints/
It doesn’t work, so it can’t be right but that’s not a show-stopper.

3. I’ve registered at GitHub as LtAirman, indicated my intent to upload a repository and let the bots walk me through some tutorial issues/steps. For example, they stress the importance of .gitignore and a good README file. I now have the URL for a remote, origin repository at GitHub but haven’t uploaded any files yet. FYI, GitHub is trying to move away from requiring usernames and passwords to complete repository actions, switching to more secure time-limited personal access tokens instead.

Any comments or suggested changes to the README?

Do I need a public domain license?

I don’t suppose anyone knows how I might change the .gitignore file to exclude the .ipynb_checkpoints file directory?

I mentioned needing a list of instructions in order to proceed. Down to the less than one minute mark, here are the remaining steps.
1. At GitHub. maybe change the target GitHub repository name from github-upload to ChargeField, making sure it’s public, then copy the target URL.
2. Go to SourceTree and enter the GitHub remote repository name and URL.
3. Try Pushing the local repository from SourceTree. Select which branches, there is only the Master, then PUSH. Verify SourceTree shows the GitHub origin/master and master are in sync.
4. Back at GitHub, refresh the screen to see if the GitHub ChargeField repository exists.

What’s the worst that can happen? I’m beginning to feel less overwhelmed, ... .
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Sun Oct 24, 2021 3:43 pm

I think as long as the Readme.md file has a link to Miles' Periodic paper. It should be good from the looks of it. A lot of projects get an expanded Readme.md later as people provide feedback. Just hope that it creates a good buzz there and people branch and fork with their inputs as well.

Chromium6

Posts : 727
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Mon Oct 25, 2021 12:51 am

.
The project is uploaded onto GitHub.
https://github.com/LtAirman/ChargeFieldTopics
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Mon Oct 25, 2021 9:08 pm

Looks real nice LTAM. I don't know if there's a way to "tag" terms on github for "Periodic Table" but it might help people find it?

Chromium6

Posts : 727
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Tue Oct 26, 2021 5:58 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Silico10

Uploading this project’s been my first experience with GitHub. Sure, I’ve landed at many GH individual projects in the past, there are readme files but little code is visible, the end of the line rather than finding any answers. Now it feels like I have to school there, or at least take up custodial responsibilities. The ChargeFieldTopics project page feels like a cloistered cell, a “perfect” place to work. They don’t make anything too obvious. There’s notice of a conference coming up tomorrow, HactoberFest (of course), and a Game Making Contest start-off on the first, when the topic is announced. I don’t see any view counts like at the forum. There are a couple of discussion amenities available, such as - Start a discussion, (“Hi! My name is … ”), I suppose I should consider it. I might also consider personalizing some settings. I’ve started trying to learn how to use Spyder, an integrated development environment (IDE) editor, console, etc., that showed me all the trailing whitespaces yesterday that I cleaned up and committed shortly after.

Still looking for a license – pull requests for what? Where? How? GH’s user rules may have that covered. The whole concept of requiring a pull-request to proceed without instructions is a bit beyond my understanding.  

There doesn't seem any reason to post code changes here at the site anymore.

I’m on the hook for a few things. Starting with finishing Atom Builder, including corrections and improvements. Project development since I don’t consider AB a finished product yet. I may be stuck, you’re the boss.

1. Rotation controls consolidation. I don’t know. How does one control a battery of rotation widgets? I suppose I might start a new local branch and see about adding a boolean object (is the slot filled or not) identifying which of the 19 slots are occupied and maybe using that to control whether the appropriate rotation controls are made available or not. That can replace all those print commands I was using as a poor man’s console, with a variable list, visible on an IDE. I’d have to try before committing anything. If it works, it may add about 250 lines – at each slot’s object addition. That’s where my thoughts are, no guarantees.

2. Other improvements as needed or desired. Such as adding more neutrons or charge channel objects. One possible AB improvement, an alternative to plane or cone emissions, the protons should be emitting visible photons. I need to see if I can learn how to code some particle system jupyter can work with.
 
3. a. The periodic table. In my view, this an open item. I’d argue that AB needs a periodic table before it can be complete. At minimum, another jupyter notebook cell, a 2D image of the standard periodic table. Just point and click on an atom would be better than selecting the atom with the drop-down widget. A new periodic table branch on the project might draw a little more attention.

b. Your 2 October post included code and indicated your wish to import the excel doc as a text file, MilesPeriodicTable.txt. Is that still your intent? Did you have any specific ideas in mind? Do you need help? I didn’t ask as I didn’t want to obligate you. There may be some advantages, like converting the current 19 slot object additions to table lookups. I believe an atomic dataset would offer any number of simplifying possibilities beyond my coding experience.
 
c. I’ve hinted, hemmed and hawed at this a few times, even with Nevyn over his copy of the well known threejs example, the Periodic Table with rearrangement animations of table entries forming either the standard table, or spiral, spherical surface or 3D block of elements in row, column and rank positions. This time with emphasis, I believed then, and I believe now we need a new charge field periodic table shape. At least now I know it should be based on the 19 atomic slots in the up/down, left/right, in/out directions. Your periodic table – with small changes like identifying all vertical column slot positions first - should form the basis of a new and improved periodic table. Either 2D as in the excel document or 3D rendered structure. A six sided star with 4 hook position data and meta structure we can use to build any element and answer the same sorts of questions the standard table “does”.

4. And most code cells should come with additional information cells in some markdown code.

5. Charge Field topics implies more than one topic. Do you have any others in mind? Our readers might. I believe Lloyd wanted some electric or antenna animation. More reason to learn particle systems. Not wanting to scare anybody I would place a Pi=4 Jupyter project as a fourth or fifth. Any other suggestions out there?

Miles Periodic Table with Standard Periodic Table reference - Page 2 Iodine10

P.S. made a few small changes.
.


Last edited by LongtimeAirman on Tue Oct 26, 2021 6:57 pm; edited 1 time in total (Reason for editing : Added P.S.)

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Fri Oct 29, 2021 2:31 am

Hi LTAM,

Notes are below.

LongtimeAirman wrote:.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Silico10

Uploading this project’s been my first experience with GitHub. Sure, I’ve landed at many GH individual projects in the past, there are readme files but little code is visible, the end of the line rather than finding any answers. Now it feels like I have to school there, or at least take up custodial responsibilities. The ChargeFieldTopics project page feels like a cloistered cell, a “perfect” place to work. They don’t make anything too obvious. There’s notice of a conference coming up tomorrow, HactoberFest (of course), and a Game Making Contest start-off on the first, when the topic is announced. I don’t see any view counts like at the forum. There are a couple of discussion amenities available, such as - Start a discussion, (“Hi! My name is … ”), I suppose I should consider it. I might also consider personalizing some settings. I’ve started trying to learn how to use Spyder, an integrated development environment (IDE) editor, console, etc., that showed me all the trailing whitespaces yesterday that I cleaned up and committed shortly after.

Still looking for a license – pull requests for what? Where? How? GH’s user rules may have that covered. The whole concept of requiring a pull-request to proceed without instructions is a bit beyond my understanding.  

There doesn't seem any reason to post code changes here at the site anymore.

I’m on the hook for a few things. Starting with finishing Atom Builder, including corrections and improvements. Project development since I don’t consider AB a finished product yet. I may be stuck, you’re the boss.

1. Rotation controls consolidation. I don’t know. How does one control a battery of rotation widgets? I suppose I might start a new local branch and see about adding a boolean object (is the slot filled or not) identifying which of the 19 slots are occupied and maybe using that to control whether the appropriate rotation controls are made available or not. That can replace all those print commands I was using as a poor man’s console, with a variable list, visible on an IDE. I’d have to try before committing anything. If it works, it may add about 250 lines – at each slot’s object addition. That’s where my thoughts are, no guarantees.

I would just add a check box to the master control widget screen for "Rotate?" this would then turn on all "rotations" instead of a rotation for each "slot"?

2. Other improvements as needed or desired. Such as adding more neutrons or charge channel objects. One possible AB improvement, an alternative to plane or cone emissions, the protons should be emitting visible photons. I need to see if I can learn how to code some particle system jupyter can work with.

Looks like a good but tricky feature.
 
3. a. The periodic table. In my view, this an open item. I’d argue that AB needs a periodic table before it can be complete. At minimum, another jupyter notebook cell, a 2D image of the standard periodic table. Just point and click on an atom would be better than selecting the atom with the drop-down widget. A new periodic table branch on the project might draw a little more attention.

With Jupyter Notebooks...they usually don't allow cell to cell interactions.  Looks challenging unless the Periodic Table is put up as web page per element on a Webserver...the Periodic table is lifted from available sources and links put in it to link to the static exported pages per element.

b. Your 2 October post included code and indicated your wish to import the excel doc as a text file, MilesPeriodicTable.txt. Is that still your intent? Did you have any specific ideas in mind? Do you need help? I didn’t ask as I didn’t want to obligate you. There may be some advantages, like converting the current 19 slot object additions to table lookups. I believe an atomic dataset would offer any number of simplifying possibilities beyond my coding experience.

I was hoping to create more attributes that can be shown. Especially "color"...still looking for a clear explanation of when photons hit a source element...how do the colors "reflect" in the human eye? Why is gold "gold" and silver "silver" under light?
 
c. I’ve hinted, hemmed and hawed at this a few times, even with Nevyn over his copy of the well known threejs example, the Periodic Table with rearrangement animations of table entries forming either the standard table, or spiral, spherical surface or 3D block of elements in row, column and rank positions. This time with emphasis, I believed then, and I believe now we need a new charge field periodic table shape. At least now I know it should be based on the 19 atomic slots in the up/down, left/right, in/out directions. Your periodic table – with small changes like identifying all vertical column slot positions first - should form the basis of a new and improved periodic table. Either 2D as in the excel document or 3D rendered structure. A six sided star with 4 hook position data and meta structure we can use to build any element and answer the same sorts of questions the standard table “does”.

Sounds good to me.

4. And most code cells should come with additional information cells in some markdown code.

Also sounds good. Might help explain things a bit more.

5. Charge Field topics implies more than one topic. Do you have any others in mind? Our readers might. I believe Lloyd wanted some electric or antenna animation. More reason to learn particle systems. Not wanting to scare anybody I would place a Pi=4 Jupyter project as a fourth or fifth. Any other suggestions out there?

Miles Periodic Table with Standard Periodic Table reference - Page 2 Iodine10

P.S. made a few small changes.
.

Per #3 above....one thing I was thinking about was creating a Periodic Table type dataset with all "slots" calculated out in new columns. Basically, every calc is "pre-calculated" in the dataset. When an element was looked up/selected, the pre-calculated columns would be ready for dropping into more condensed functions.  New functions could be added between atoms for "linking" with single slots (basically repositioning each atom). I know with the central N-S axis this might be challenging to have multiple instances-objects especially with a notebook which is usually a single pass.  Might look at how to instance multiple elements-atoms using threejs examples?

For release version 1, it is impressive!!! Smile

Chromium6

Posts : 727
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Mon Nov 01, 2021 6:46 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Atombp10
The start of a clickable Periodic Table .

For release version 1, it is impressive!!! 
Thank you Sir. I don’t usually stop to enjoy something when faced with a series of problems, but I agree, I like it.
   
Spent several hours searching for a mouse/cursor position notebook package/module allowing clicking on a periodic table image idea. That capability may be included in cv2 or tkinder. The next morning I realized that ipywidgets (again) probably has the better alternative.

I downloaded the SciPy 2020 (worst lectures but best notes) JupyterLab repository tutorial materials from GitHub and spent the next couple of days studying it all, concentrating on the second half, the CSS based Layout and Styling sections. I worked all the examples shown and read (far from understanding most) of all the references.

Long story short, positive progress. A good start on a clickable Periodic Table. In atom builder that image is actually a set of 90 buttons that resizes itself to fit the available display width. I have an output cell (from one of the examples), that prints a message whenever the Hydrogen button is clicked. Next, I’ll try to wire up the rest of the buttons and somehow link them with the existing controls. Like everything else, it needs a title and information.
 
Over 400 new code lines so far. I need a way to simplify it, a dataset is probably a good answer.

I haven’t spent any time thinking about a single rotation button since last time.

I pushed my initial table progress yesterday, but I haven't been able to push my latest progress, source tree is supposed to ask for a password when I push to the remote origin, but it doesn’t, and instead shows several errors including failing to provide a password (actually the personal access token). Tried to revert and am now two pushes behind. Oh well, more to worry about.

Miles Periodic Table with Standard Periodic Table reference - Page 2 Antimo10
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Fri Nov 05, 2021 5:32 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Grid10
This image is larger than I expected.

Status. I’m able to Push to GitHub again. Lost a couple of days, it was not a pleasant break. The corrective action included requesting GitHub support. They replied soon after, suggesting I update my Git version (that did the trick) or clean up my Credential Manager (it was clean but now its updated too). Don’t ask me how I was able to push a dozen commits before I absolutely needed to update my git.

Project progress involved some periodic table button work. I created four lists: clrs[] the ten alternative colors used above (alkali metal, alkaline earth, transition metal, basic metal, metalloid, nonmetal, halogen, noble gas, lanthanide, actinide *); clist[] the 10 colors in their 90 button order; dlist[] the 90 atomic symbols in 1-90 order; and abttns[] a list of the 90 buttons.

The lists are more robust, enabling loops which allowed me to eliminate about 200 code lines from last week. Now it should be easier to add elements, or to make changes. Such as selecting between different element type/color schemes including the 10 element/types shown, or possibly a three element type scheme: solid, liquid and gas.

*See https://sciencenotes.org/periodic-table-for-kids-118-elements/ for a free print ready pdf.

Here's the code that lays out the buttons in periodic table form.
Code:

grid = GridspecLayout(10, 18)
      
grid[0,0] = abttns[0]
grid[0,17] = abttns[1]
grid[1,0] = abttns[2]
grid[1,1] = abttns[3]
p=12
while p < 18:
    grid[1,p] = abttns[p-8]
    p += 1
grid[2,0] = abttns[10]
grid[2,1] = abttns[11]
n=12
while n < 18:
    grid[2,n] = abttns[n]
    n += 1
m=0
while m < 18:
    grid[3,m] = abttns[18+m]
    m += 1
k=0
while k < 18:
    grid[4,k] = abttns[36+k]
    k += 1
grid[5,0] = abttns[54]
grid[5,1] = abttns[55]
# grid[5,2] = the Lanthanide series hole
i=3
while i < 18:
    grid[5,i] = abttns[68+i]
    i += 1
grid[6,0] = abttns[86]
grid[6,1] = abttns[87]
# grid[6,2] = the Actinide series hole
j=2
while j < 17:
    # Lanthanide series
    grid[7,j] = abttns[54+j]
    j += 1
#Actinide series
grid[8,2] = abttns[88]
grid[8,3] = abttns[89]

grid # display the grid

Miles Periodic Table with Standard Periodic Table reference - Page 2 Cadmiu10
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Mon Nov 08, 2021 7:58 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Ptthou10
Just fill in the elements, one per 6 unit row or column rectangle, 6 elements per square.

On the subject of a possible new charge field periodic table. Yes, I’ve gone on about the need for a new charge field periodic table, and pointed to the 19 slots as the basis. I tried playing with the idea. My ideas may not be deep but I should explain my reasoning. Caveat, one of the pros/cons of building models is the opportunity to explore new ideas, whether one wants to or not, such as when missing details that make assumptions necessary. Sometimes they work, other times not. Your critical review is welcome.

Many times while reading one of Miles’ papers I’ve needed to stop and find a periodic table for immediate reference. I mainly use an oversized NIST table I printed out on a large printer years ago, it’s around here somewhere. Last time I should have pointed out that beside the two free pdf ready periodic tables, the sciencenotes.org link https://sciencenotes.org/printable-periodic-table/ shows 25 different themed periodic tables including:
Electronegativity Periodic Table
Element Charges Periodic Table
Atomic Radius Periodic Table
Periodic Table with Electron Shells
Density Periodic Table
Element Abundance in Seawater
Element Abundance in the Earth’s Crust
Melting Point Periodic Table
Boiling Point Periodic Table
Electron Orbital Periodic Table
​ Metals, Metalloids, and Nonmetals Periodic Tables
and more, Year Discovered, With Circular Tiles, in Klingon. They’ll even custom built one for ya.

When completely filled, the standard table allows 118 elements. Why a full table would indicate there are only 118 different elements in the universe - captured in a few simple rules - seems a bit presumptuous to me.

I understand the periodic table was created and developed by conventional science,  a huge number of intelligent and well-intentioned individuals who worked to the best of their ability to make that table what it is today. In other words, Miles can certainly point out any periodic table’s shortcomings, I believe we can accept most of the data the table provides as “accurate”. The data may be “real”, but the periodic table is otherwise an oddly shaped table, organized to aid our current understanding of the elements.
 
I’m sure there are many possibilities here. It may be my imagination that by studying the so-called orbitals table I might be able to include the charge field charge channels’ up/down, left/right, to/from directions.

Many of the tables contain eye-opening facts I never noticed on my NIST table. I had no idea Cesium Cs, has the largest radius, is that true? How is the atomic radius determined? Can we reconcile that with the charge field atomic theory?
With respect to the charge field, the first atom is a single proton, Hydrogen. Like the 19 slots, Hydrogen - and Helium, will begin at the center of the Charge Field Periodic Table.

Another important physical “fact”, we know each slot can be filled with up to 6 protons.

19*6 = 60+54 = 114 elements. That’s close to 118. Ok, it seems we might possibly create a charge field periodic table by breaking up each of the 19 slots into 6 representative atoms according to our as of yet undetermined rules.

Miles Periodic Table with Standard Periodic Table reference - Page 2 Ptthou11
The first problem, a 1 unit square doesn’t divide by six very nicely 1/6 = 0.166... . Six, as demonstrated by the 19 slots, also represents the up/down, left/right, and front /back directions.

Anyway, I was trying to logically fill in the up to 6 elements per slot in the above image like some new sort of crossword puzzle. No matter how I tried, right from the start, there’s no direct sequence of proton additions like building alphas along the central column or not, that didn’t require moving some number of previously positioned protons or alphas in order to follow the slot diagrams. The charge field periodic table must be somewhat fluid. That just may not work out.

Miles Periodic Table with Standard Periodic Table reference - Page 2 Calciu10
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Thu Nov 11, 2021 5:31 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Ptadde10
Working Periodic table buttons.

The Periodic table buttons are working properly. Run each cell. The ninth cell (currently) makes the widget controls visible, the tenth cell displays the periodic table. The 11th cell displays a second copy of the widget controls below the periodic table as indicated in the image shown. As previously mentioned with the carousel rotation control, more than one instance of a widget can be open at the same time, try to be as visibly convenient as possible, the widgets will all track observed changes simultaneously. Click a table button and see the corresponding change in both drop-down atom selected widget views. Make any other changes you’d like, then run that cell and the rest till the atom becomes visible.

Slot Layout. Since I’m unable to come up with a complete charge field periodic table per se, I’ll do the next best thing and, along with each atom, also output its slot layout diagram - an output display plot. I suppose another option would be to make a gridspec button (slot) layout in which the 19 button descriptions would be the number (and color) of protons that slot contains (0-6). Of course the buttons won't be interactive. I’ll need to think about it more before starting.  

Atomic symbol font size. It would be nice to be able to specify a smaller periodic table font in order to see two letter atomic symbols at smaller table sizes, but no joy. After another ipywidgets search I see no button style font options except weight – bold or not. The only way to change the font size seems involve possible html hacks which I have no idea how to implement or importing another package like latex. I’ll let the “problem” rest for the time being.
 
Rotation controls. I’ve also spent additional hours trying to only make rotation controls for occupied slots - without success. I’ll keep trying.

Miles Periodic Table with Standard Periodic Table reference - Page 2 German10
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Sat Nov 13, 2021 11:53 am

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Slotla12
The slot layout diagram for 84, Polonium Po.

Atom Builder now includes a 10 row by 9 column Slot layout (SL) diagram. I’ve taken a few liberties with your original SL diagram Cr6, please feel free to direct me to make any changes you’d like.

1. The 1-19 SL sequence order number is indicated by the left side number in both the atomic configuration and in the left and right side vertical columns.
2. The proton count for a given slot is indicated by the number on the right in both the atomic and side columns.
3. Instead of counting top down (1-19) on the left, the sequence shown is top left, then top right, then down one on the left, then down one on the right, … , odd slot numbers on the left and even slots on the right.
4. The seven center buttons in the bottom row contains the total protons per slot color legend.
5. The bottom right corner contains the selected atom’s symbol and atomic number.

The readme file is updated to include the latest Periodic table and Slotlayout additions.

Miles Periodic Table with Standard Periodic Table reference - Page 2 Poloni10
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Sun Nov 14, 2021 5:32 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Rotcon10
19 Slot rotation widgets in Slotlayout configuration.

Changes since Friday:

1. The slotlayout diagram is moved to after the main calculate/build atom cell. The user will see the diagram after the periodic table and atomic choices as the first charge field atomic model output.

2. A markdown cell follows the diagram which describes it in detail.

3. All the rotation controls are “consolidated” into a third ipywidget gridspec layout, slot rotation controls in the atomic slotlayout configuration as shown. Those slot rotation controls are output above and below the rendered atom for the user's convenience. Press any button for that slot to start spinning. Center slot1 spins the carousel. If an atom’s slot is empty, playing with that slot’s rotation controls does nothing, I’m sure there’s an error under the hood somewhere but it doesn’t affect anything aside from a quick pause in the animation.

4. Readme file is updated

Things have gone much better than I expected. The slotlayout diagram really brings things together into a nice package, for the user too. The ipywidgets have worked perfectly. I’ll try to pretty up the rotation controls a bit by including borders matching the current slot colors, and maybe creating that single on/off rotation switch.

We’re close to a possible version 1 completion date. Please let me know if you want any changes. I believe a data file containing all the atom’s build information, possibly enabling multiple atom outputs would be the logical starting point for version 2.
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Sun Nov 14, 2021 10:17 pm

Sorry I haven't posted more on your work LTAM. It is really splendid! The carousel update is perfect for the purpose. Looks good! 

Nice attempts with the "grid". Was thinking if positive-negative numbers depending on direction were included....it could give a 3-d style algorithmic bonding methodology... alas...not that clean with the division unfortunately. Was thinking of shortcuts to "bonding" with the SL model. Btw..good work on the periodic table as well. Your notebooks are something to be humbly proud of. Was looking at a Atom class in python eventually. Static values for each atom would be pushed in from a larger dataset for rendering.

Do you know if Miles has ever mentioned the 19 x 6 for the periodic table as you point out?

Chromium6

Posts : 727
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Wed Nov 17, 2021 4:51 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Lantha10

Thanks for the praise Cr6, I’ve reached the point where I can accept it; many thanks, you can stop now.

Yes, I’m humbly proud and most grateful you repeatedly suggested I do it, clearly I would not have done it without you. Furthermore, unless I’m mistaken, you seem intent on reminding me to work on the Molecule Builder next. If so, it sounds like a good idea to me.

Some latest finalizing progress and late-breaking problems to report.
1. Replaced a lost 5 proton stack from atoms 57-71, slot 11, correctly this time. I should remember Git’s main advantage is that it makes back-up files unnecessary.
2. Surprised and mildly alarmed when the rotation controls started failing with proStackx “not defined” errors. No idea why this error might wait this long to occur. Cleared the error by moving the 19 proStackx = Group(); declarations to before the i-loop.
3. No joy adding a colored border to the rotation control buttons. The border color added alright, but the SL gridspec configuration of 19 play widgets was lost, displaying an unbroken string of play controls, which will require additional thought and effort, and will likely not happen after what I’ve learned thus far. Also made another unsuccessful attempt at tying the rotation controls to a conditional statement, again, a non-critical item.
4. Added explanatory markdown cells to the beginning and end of the notebook, and added further content to the existing cells.
5. I might make a few more text additions, or not. I hesitate because that increases the number of run commands the user must make. I’m wondering whether I might start combining and eliminating cells to reduce the run commands.

Atom Builder is a bit oversimplified, obviously slot1 is not the carousel, I’m glad you agree the rotations are “perfect for the purpose”.  I hope the average jupyter notebook data scientist or world hacker at github doesn’t find it too-cool middle-school radical.

Do you know if Miles has ever mentioned the 19 x 6 for the periodic table as you point out?
I don’t think so and I’ve thought about it before. Depicting a 3D atom with the 2D excel grid required some originality; plus doing all the study and work filling in the blanks and putting it together. The Slotlayout is my goto atomic compendium where if not an image, at least an SL diagram for the atom can be found. As such it’s an essential reference document.

Given your “excel doc releases” and the years since, I‘m sure someone would have congratulated you had we seen Miles mention you or the SL.
 
You probably know that Nevyn’s “Atomic Viewer” project folder includes two SL files, Cr6-Elements.csv and Cr6-Elements.json. Datasets. I believe Nevyn corresponded with Miles to ensure accuracy on the subject.
 
Doing a quick word search for “layout” across my electronic copies of Miles Mathis’  papers returned nothing, while “periodic” – which would probably be mentioned in the context returns over 50 hits. It would take quite some time to examine each one, especially since I immediately got stuck re-reading “nuclear” (or “How the Elements are Built”). Dang – for balance sake - the neutrons! *

Miles has certainly described at length the atomic form containing 19 individual color-coded, proton stack positions, why and how they connect and energy-level dependent form variations, etc. Miles discusses charge field atoms while pointing out the problems with periodic table. A new charge field periodic table is one of the first things I thought about and I would have noticed. I don’t recall Miles ever coining or formalizing a word or phrase or suggesting that the 19 slots be the basis for a new periodic table. I’m sure he’s considered it and knows there’s no clean-cut one-to-one correspondence between the actual vs. standard periodic table elements.

A charge field periodic table would need to allow proton position changes, which the SL does. I wonder what an SL atomic sequence animation might look like? 
 
If its any consolation, I’ve added to my mention of you in both the notebook and readme files:
“This project was Cr6's idea. He's also responsible for following Miles Mathis' atomic model and creating the Slotlayout diagram on which this project greatly relies.”

I may as well add, it continues:

“There's at least one 10 year old charge field "Atom Viewer" out there, Nevyn's object oriented, way sophisticated javaScript code. I think I'm ready to try and figure it out.”


Note. The * footnote below was written before the end quote above.

* After version 1 is officially said and done, any day now, one significant oversimplification remains, a shortage of neutrons. All I might need to do is add 19 new neutron Groups and 19 new electron Groups and 38 new rotation controls. On the other hand, I see the Atomic Viewer project files contain neutrons and electrons. I guess I should study it if there’s to be a charge field Molecule Builder.
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Sat Nov 20, 2021 8:55 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 2 Brone10

https://github.com/LtAirman/ChargeFieldTopics

Well Cr6, it could sure use plenty of improvements, nevertheless, I declare Atom Builder Version 1 well started.

I racked my brains and came up with what I believe is a suitable finishing touch. Just before the notebook’s final reference cell, another widget containing: the rendered atom, its slotlayout diagram, the rotation controls, and a periodic table (with non-functioning buttons – to prevent changing the selected values). All in a single location selectable by tab, as shown in these four images.

I'm spending some time appreciating it.

Miles Periodic Table with Standard Periodic Table reference - Page 2 Brtwo10
.

LongtimeAirman
Admin

Posts : 2027
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 2 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Sponsored content


Sponsored content


Back to top Go down

Page 2 of 12 Previous  1, 2, 3, ... 10, 11, 12  Next

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum