In[]:=
​
In[]:=
OrbitalDataNames={{"ao's involved","orbitals involved","molecular geometry","examples"}};
In[]:=
OrbitalData={Row[{"2",Style["s",Italic],", 2",Subscript[Style["p",Italic],"z"]}],2,"linear",Row[{
"C"
2
,
"H"
2
,", ","Be",
"Cl"
2
}]},Row["2",Style["s",Italic],", 2",Style[
"p"
"x"
,Italic],", 2",Style[
"p"
"y"
,Italic]],3,"angular trigonal",Row[{
"C"
2
,
"H"
4
,", ","B",
"Cl"
3
}],Row["2",Style["s",Italic],", 2",Style[
"p"
"x"
,Italic],", 2",Style[
"p"
"y"
,Italic],", 2",Style[
"p"
"z"
,Italic]],4,"tetrahedral",Row[{"C",
"H"
4
,", ","C",
"Cl"
4
}],Row"4",Style["s",Italic],", 4",Style[
"p"
"x"
,Italic],", 4",Style[
"p"
"y"
,Italic],", 3",
Style["d",Italic]
2
Style["z",Italic]
,", 3",
Style["d",Italic]
Row
2
Style["x",Italic]
," - ",
2
Style["y",Italic]

,4,"square planar",Row[{"Xe",
"F"
4
,", ","[",
"PtCl"
2
,"(",
"NH"
3
,
")"
2
,"]"}]},Row"4",Style["s",Italic],", 4",Style[
"p"
"x"
,Italic],", 4",Style[
"p"
"y"
,Italic],", 4",Style[
"p"
"z"
,Italic],", 3",
Style["d",Italic]
2
Style["z",Italic]
,5,"trigonal bipyramidal",Row[{"P",
"Cl"
5
,", ","Sb",
"F"
5
}],Row"4",Style["s",Italic],", 4",Style[
"p"
"x"
,Italic],", 4",Style[
"p"
"y"
,Italic],", 4",Style[
"p"
"z"
,Italic],", 3",
Style["d",Italic]
2
Style["z",Italic]
,", 3",
Style["d",Italic]
Row
2
Style["x",Italic]
," - ",
2
Style["y",Italic]

,6,"octahedral",Row[{"S",
"F"
6
,", ","Te",
"F"
6
}];
In[]:=
OrbitalDataTable=Table[{OrbitalDataNames[[j]],OrbitalData[[i]]},{j,1,Length[OrbitalDataNames]},{i,1,Length[OrbitalData]}];
In[]:=
OrbitalModel[n_]:=Block[{pairs,fun,fun1,fun2,fun3,fun4,a,b,i,l,m,y1,y2,y3,θ,ϕ},pairs=Flatten[Table[{i,j},{i,0,5},{j,0,i}],1];​​fun={};​​Do[l=pairs[[i,1]];​​m=pairs[[i,2]];​​a=SphericalHarmonicY[l,-m,θ,ϕ];​​b=SphericalHarmonicY[l,m,θ,ϕ];​​y1=b;​​y2=ExpToTrig[(a-b)/Sqrt[2]];​​y3=ExpToTrig[(a+b)/Sqrt[2]/I];​​If[m0,AppendTo[fun,y1],AppendTo[fun,{y2,y3}]];​​fun1=Flatten[fun,1],{i,1,Length[pairs]}];​​fun2=Take[fun1,16];​​fun3=Table[If[i4||i7||i12||i14||i16,-fun2[[i]],fun2[[i]]],{i,1,16}];​​fun4=Table[If[i8||i9||i13||i14,fun3[[i]]*I,fun3[[i]]],{i,1,16}];​​fun4[[n]]]
HybridSP[view_]:=Block[{hybridFuns,scalingVecs,len,pos,i,hybOrbs1r,hybOrbs1b,hybOrbs1rScaled,hybOrbs1bScaled,hybOrbs1rScaledP,hybOrbs1bScaledP,hybOrbs1rOne,hybOrbs1bOne,hybOrbs1rTwo,hybOrbs1bTwo,hybOrbs1rNew,hybOrbs1bNew,sampleSize},sampleSize=500;​​hybridFuns={1./Sqrt[2](OrbitalModel[1]+OrbitalModel[2]),1./Sqrt[2](OrbitalModel[1]-OrbitalModel[2])};​​scalingVecs={{0,0,-1},{0,0,1}};​​len=Length[hybridFuns];​​pos[x_]:=If[x≥0,x,Null];​​hybOrbs1r=Table[SphericalPlot3D[Evaluate[{pos[hybridFuns[[i]]]}],{θ,0.0,π},{ϕ,0.0,2.0π},PlotRangeAll,PlotStyleNone,MeshStyleLighter[Red]][[1,1]],{i,1,len}];​​hybOrbs1b=Table[SphericalPlot3D[Evaluate[{pos[-hybridFuns[[i]]]}],{θ,0.0,π},{ϕ,0.0,2.0π},PlotRangeAll,PlotStyleNone,MeshStyleLighter[Blue]][[1,1]],{i,1,len}];​​hybOrbs1rOne=ListSurfacePlot3D[RandomSample[hybOrbs1r[[1]],sampleSize],MeshFunctions(#3&),MeshShading{None,Lighter[Red]}];​​hybOrbs1rTwo=ListSurfacePlot3D[RandomSample[hybOrbs1r[[2]],sampleSize],MeshFunctions(-#3&),MeshShading{None,Lighter[Red]}];​​hybOrbs1rNew={hybOrbs1rOne,hybOrbs1rTwo};​​hybOrbs1bOne=ListSurfacePlot3D[RandomSample[hybOrbs1b[[1]],sampleSize],MeshFunctions(-#3&),MeshShading{None,Lighter[Blue]}];​​hybOrbs1bTwo=ListSurfacePlot3D[RandomSample[hybOrbs1b[[2]],sampleSize],MeshFunctions(#3&),MeshShading{None,Lighter[Blue]}];​​hybOrbs1bNew={hybOrbs1bOne,hybOrbs1bTwo};​​hybOrbs1rScaled=Table[Graphics3D[GeometricTransformation[hybOrbs1rNew[[i,1]],ScalingTransform[3,scalingVecs[[i]]]]],{i,1,Length[hybOrbs1rNew]}];​​hybOrbs1bScaled=Table[Graphics3D[GeometricTransformation[hybOrbs1bNew[[i,1]],ScalingTransform[3,scalingVecs[[i]]]]],{i,1,Length[hybOrbs1bNew]}];​​hybOrbs1rScaledP=Graphics3D[{Lighter[Red],Point@Flatten[Cases[Normal[hybOrbs1rScaled],Line[x__]x,∞],1]}];​​hybOrbs1bScaledP=Graphics3D[{Lighter[Blue],Point@Flatten[Cases[Normal[hybOrbs1bScaled],Line[x__]x,∞],1]}];​​If[view"s",{hybOrbs1rScaled,hybOrbs1bScaled},{hybOrbs1rScaledP,hybOrbs1bScaledP}]]​​​​output=Show[HybridSP["p"]]​​Export["hybOrb.stl",output]
RandomSample
:RandomSample cannot generate a sample of length 500​, which is greater than the length of the sample set GraphicsComplex1.2229×
-7
10
,5.48836×
-14
10
,0.544965,0.119339,5.35591×
-8
10
,0.522857,0.221606,9.94567×
-8
10
,0.46017,5,0.119518,5.36395×
-8
10
,-0.0272792,0.0446582,2.00426×
-8
10
,-0.0215063,2368,{{1},1},1,VertexTextureCoordinates{{0.,0.},9,2368},1. If you want a choice of possibly repeated elements from the set, use RandomChoice.
RandomSample
:RandomSample cannot generate a sample of length 500​, which is greater than the length of the sample set GraphicsComplex1.2229×
-7
10
,5.48836×
-14
10
,0.544965,0.119339,5.35591×
-8
10
,0.522857,0.221606,9.94567×
-8
10
,0.46017,5,0.119518,5.36395×
-8
10
,-0.0272792,0.0446582,2.00426×
-8
10
,-0.0215063,2368,{{1},1},1,VertexTextureCoordinates{{0.,0.},9,2368},1. If you want a choice of possibly repeated elements from the set, use RandomChoice.
RandomSample
:RandomSample cannot generate a sample of length 500​, which is greater than the length of the sample set GraphicsComplex1.2229×
-7
10
,5.48836×
-14
10
,0.544965,0.119339,5.35591×
-8
10
,0.522857,0.221606,9.94567×
-8
10
,0.46017,5,0.119518,5.36395×
-8
10
,-0.0272792,0.0446582,2.00426×
-8
10
,-0.0215063,2368,{{1},1},1,VertexTextureCoordinates{{0.,0.},9,2368},1. If you want a choice of possibly repeated elements from the set, use RandomChoice.
General
:Further output of RandomSample::smplen will be suppressed during this calculation.
Export
:STL contains no data that can be exported to the STL format.
Out[]=
$Failed
RandomSample
:RandomSample cannot generate a sample of length 500​, which is greater than the length of the sample set {{},{},{},{},{}},Directive
,Line0.0305261,1.37001×
-8
10
,0.543565,1.2229×
-7
10
,5.48836×
-14
10
,0.544965,1.21521×
-7
10
,1.36922×
-8
10
,0.544965,1.19224×
-7
10
,2.72121×
-8
10
,0.544965,1.12981×
-7
10
,4.67984×
-8
10
,0.544965,42,0.0720677,-3.23439×
-8
10
,0.537083,0.119339,-5.35591×
-8
10
,0.522857,0.140442,-6.30303×
-8
10
,0.513899,190,4,{}. If you want a choice of possibly repeated elements from the set, use RandomChoice.
RandomSample
:RandomSample cannot generate a sample of length 500​, which is greater than the length of the sample set {{},{},{},{},{}},Directive
,Line0.0501238,2.24955×
-8
10
,0.0230417,0.0446582,2.00426×
-8
10
,0.0215063,0.0283127,1.27067×
-8
10
,0.0156479,0.0132573,5.94987×
-9
10
,0.00833013,0.0132253,5.9355×
-9
10
,0.00831232,42,{-0.00670017,0.0106632,0.00795876},{-0.0077753,0.00986035,0.00793827},{-0.00782883,0.00981705,0.0079379},190,3,
,14,1,1. If you want a choice of possibly repeated elements from the set, use RandomChoice.
RandomSample
:RandomSample cannot generate a sample of length 500​, which is greater than the length of the sample set 1. If you want a choice of possibly repeated elements from the set, use RandomChoice.
General
:Further output of RandomSample::smplen will be suppressed during this calculation.
Export
:Graphics3D cannot be exported to the STL format.
Out[]=
$Failed