import math P,K='#f5f5f0','#0d0d0d' HEAD=''' ''' TAIL='' def robot(x,y,s,fg,bg,op=1): """配膳ロボット(正面)。x,y=足元の中心。s=倍率(1で高さ約400)""" g=f'' g+=f'' g+=f'' g+=f'' g+=f'' for ty,dish in [(150,'bowl'),(225,'cup'),(300,'plate')]: g+=f'' if dish=='bowl': g+=f'' if dish=='cup': g+=f'' if dish=='plate': g+=f'' g+=f'' g+=f'' return g+'' def person(x,y,s,fg,op=1,tray=False): """スタッフ(正面)。x,y=足元。高さ約560*s""" g=f'' g+=f'' g+=f'' g+=f'' if tray: g+=f'' g+=f'' return g+'' # ── X 導入の前と後(左:人3人/右:人2人+ロボット2台) x=HEAD%P+f'' x+=f'' x+=f'' for px in [210,385,560]: x+=person(px,800,0.9,K) x+=person(870,800,0.9,P)+person(1030,800,0.9,P) x+=robot(1200,800,0.82,P,K)+robot(1355,800,0.82,P,K) # 床の下:入店待ちの列(丸の数) for i in range(3): x+=f'' for i in range(6): x+=f'' # 真ん中の矢印 x+=f'' open('X_before_after.html','w').write(x+TAIL) # ── Y ワイヤーフレームの床(アイソメ)に置いたロボットと卓 def iso(gx,gy,ox=750,oy=250,u=72): return ox+(gx-gy)*u, oy+(gx+gy)*u*0.5 y=HEAD%K+f'' N=10 for i in range(N+1): a=iso(i,0);b=iso(i,N);y+=f'' a=iso(0,i);b=iso(N,i);y+=f'' def box(gx,gy,w,d,h,fill=False): pts=[iso(gx,gy),iso(gx+w,gy),iso(gx+w,gy+d),iso(gx,gy+d)] top=[(px,py-h) for px,py in pts] s='' # 側面 for a,b in [(1,2),(2,3)]: poly=[pts[a],pts[b],top[b],top[a]] s+='' s+='' return s # 厨房(奥の壁) y+=box(0,0,4,1,90,True) tables=[(6,1),(8,1),(1,4),(4,4),(7,4),(1,7),(4,7),(7,7)] # 通り道(点線) path=[iso(2,1.5),iso(2,3.2),iso(6.2,3.2),iso(6.2,6.2),iso(8.6,6.2)] y+='' for (tx,ty) in sorted(tables,key=lambda t:t[0]+t[1]): y+=box(tx,ty,1.4,1.4,34) # ロボット(手前寄り・正面の絵を床に立てる) rx,ry=iso(6.3,3.3); y+=robot(rx,ry,0.55,P,K) # スタッフ sx,sy=iso(2.6,6.0); y+=person(sx,sy,0.34,P) open('Y_wireframe.html','w').write(y+TAIL) # ── Z コマ送り(ロボットの残像が卓へ向かう) z=HEAD%P+f'' z+=f'' # 卓とお客さん(右) z+=f'' z+=f'' for i,(px,op) in enumerate([(190,.1),(390,.18),(590,.3),(790,.5),(1000,1)]): z+=robot(px,760,1.0,K,P,op) # コマの目盛り(時間) z+=f'' for i,px in enumerate([190,390,590,790,1000]): z+=f'' z+=f'' open('Z_frames.html','w').write(z+TAIL)