from onepic import *
F_='font-family="Inter, Helvetica, Arial, sans-serif"'
W,HG,HL=1150,1180,470; H=HG+HL+70
VIEW=(-35,22); r,u,v=camera(VIEW)
pts=[CORN[k] for k in CORN]+[np.array([0,0,HTOP+1.5])]
xs=[p@r for p in pts]; ys=[p@u for p in pts]
SC=0.80*min(W/(max(xs)-min(xs)+4),HG/(max(ys)-min(ys)+3)); cx=(max(xs)+min(xs))/2; cy=(max(ys)+min(ys))/2
def P(p): p=np.asarray(p,float); return (W/2+SC*(p@r-cx), 70+HG/2-SC*(p@u-cy))
def ax(eV,dx=0): return np.array([dx,0,hgt(eV)])
def txt(x,y,s,sz=15,c="#1f2a33",w=400,a="start",halo=True):
h=' paint-order="stroke" stroke="#f4f7fa" stroke-width="4"' if halo else ''
return f'{s}'
def line(a,b,st): (x1,y1),(x2,y2)=P(a),P(b); return f''
def frame(st_near,st_far,axis_st):
o=[]
for a,b in EDGES:
far=(sum(a)+sum(b))>=3; o.append(line(CORN[a],CORN[b],st_far if far else st_near))
o.append(line(np.zeros(3),np.array([0,0,HTOP]),axis_st)); return o
def head(title,sub):
return [f''); open("things.svg","w").write("\n".join(o))
# ================= IMAGE 2: CONCEPTS =================
o=head("Image 2. Concepts: the relationship chart","Nothing here can be met on its own. These are the relationships and rules that say how the things in Image 1 behave.")
o+=frame('stroke="#3b4650" stroke-width="2"','stroke="#8e3b8e" stroke-width="1.4" stroke-dasharray="6 4"','stroke="#715800" stroke-width="1.8" stroke-dasharray="3 5"')
T=[CORN[(0,0,0)],CORN[(1,1,0)],CORN[(1,0,1)],CORN[(0,1,1)]]; TM=[CORN[(1,1,1)],CORN[(1,0,0)],CORN[(0,1,0)],CORN[(0,0,1)]]
for TT,fill,st in ((TM,"#5aa0c8",'stroke="#2b7bb9" stroke-width="1.4" stroke-dasharray="7 4"'),(T,"#F5C518",'stroke="#b08900" stroke-width="1.4"')):
for f in [(0,1,2),(0,1,3),(0,2,3),(1,2,3)]:
Q=[P(TT[i]) for i in f]; o.append(f'')
hc=6.0
for name,col,_ in LAD:
rr=hc*math.tan(OPEN[name]*D2R)
ring=[np.array([rr*math.cos(t),rr*math.sin(t),hc]) for t in np.linspace(0,2*math.pi,73)]
o.append(f'')
for t in np.linspace(0,2*math.pi,7)[:-1]:
o.append(line(np.zeros(3),np.array([rr*math.cos(t),rr*math.sin(t),hc]),f'stroke="{col}" stroke-width="0.8" stroke-opacity="0.35"'))
for name,col,it in LAD:
P3=[ppos(name,k,m) for k,(_,m) in enumerate(it)]
o.append(f'')
for p in P3:
x,y=P(p); o.append(f'')
# meeting X
xm,ym=P(ax(4.62e22))
for dxx,c in ((-70,"#c0392b"),(0,"#2b7bb9"),(70,"#2e8b57")):
o.append(f'')
# centre
xc,yc=P(np.array([0,0,HTOP/2])); o.append(f'')
lr=hc*math.tan(45*D2R)
def badge(p,n,dx=0,dy=0):
x,y=P(p); x+=dx; y+=dy
return f'{n}'
up=[ppos("up-type",k,m) for k,(_,m) in enumerate(LAD[3][2])]; dn=[ppos("down-type",k,m) for k,(_,m) in enumerate(LAD[2][2])]
lp=[ppos("charged leptons",k,m) for k,(_,m) in enumerate(LAD[1][2])]; nu=[ppos("neutrinos",k,m) for k,m in enumerate(NU)]
B=[(1,CORN[(1,0,0)],-22,0),(2,np.array([0,0,21.5]),-20,0),(3,(CORN[(1,1,0)]+CORN[(0,1,1)]+CORN[(1,0,1)])/3,60,-40),(4,np.array([0,0,HTOP/2]),24,0),
(5,np.array([hc*math.tan(52.147*D2R)*math.cos(0.3),hc*math.tan(52.147*D2R)*math.sin(0.3),hc]),22,0),(6,np.array([lr*math.cos(3.6),lr*math.sin(3.6),hc]),-22,0),
(7,np.array([lr*math.cos(1.57),lr*math.sin(1.57),hc]),0,-20),(8,(lp[1]+lp[2])/2,22,-6),(9,up[2],22,0),(10,nu[1],26,0),(11,(up[1]+dn[1])/2,0,26),
(12,ax(4.62e22),-24,0),(13,np.zeros(3),-24,6)]
o+=[badge(p,n,dx,dy) for n,p,dx,dy in B]
# twist arc arrow
xa,ya=P(np.array([lr*math.cos(1.57),lr*math.sin(1.57),hc]))
o.append(f'')
y0=70+HG+10
o.append(f'')
LST=[("1","The cube and its edges: the frame, and the resting lines"),("2","Height: the scale. It orders things, it is not a place in space"),
("3","The two pyramids: our side and the far side"),("4","The mirror point at the centre (matter swapped with antimatter)"),
("5","Openings: how wide each family's cone is"),("6","The 45° equilibrium (lepton cone, drawn thick)"),
("7","The twist: the turn around the axis"),("8","Family ladders: the lines that tie three members together"),
("9","Places and link ratios: how far a family sits from equilibrium"),("10","Pure neutrino rungs 1, 2, 3 (only their mixes are ever met)"),
("11","The family turn: the tilt between the up and down ladders"),("12","The meeting of the three force lines (traced, never visited)"),
("13","The spot and its facing: the perspective")]
for i,(n,t) in enumerate(LST):
col=i//7; row=i%7; x=44+col*545; yy=y0+38+row*40
o.append(f'{n}')
o.append(txt(x+32,yy,t,14.8,halo=False))
o.append(txt(44+545+32,y0+38+6*40,"Not drawn, also concepts: the relationship matrix itself, the wave",14.8,"#3b4650",halo=False))
o.append(txt(44,y0+38+7*40+12,"(only landings are met), colour and charge labels, the forces' rules, time's direction, and the 28 measured numbers.",14.8,"#3b4650",halo=False))
o.append(txt(44,y0+38+8*40+22,"A concept is not unreal. It is a relationship. The things in Image 1 are what these relationships produce at their balance points.",15.5,"#1f2a33",700,halo=False))
o.append(''); open("concepts.svg","w").write("\n".join(o))