ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

this

2022-08-01 00:04:11  阅读:129  来源: 互联网

标签: set al20 sp msm animate al1


s1

        t1 = mt('醇的化学反应', font='STZhongsong')
        al1 = msm('general')
        al20 = msm('general2').scale(2)
        xs(al1, 0, al20, 0)
        xm(al1, 0, al20, 0)
        al1.save_state()
        al20.save_state()
        vgfo1 = mvg(al20[0], al20[2], al20[7], al20[8])
        vgcen1 = mvg(al20[1], al20[3:7], al20[9:])
        vgcen1.save_state()
        vd1 = al20[9:11]
        vd2 = al20[11:13]
        hyp = msm('hyp').scale(0.95)
        hyp1 = xcc(hyp, '#00c1ff')
        hyp2 = xcc(hyp, '#4792a9')
        hyp1.set_color([BLUE_C, BLUE_E]).set_sheen(0.3).set_opacity(0.8)
        hyp2.set_color([BLUE_C, BLUE_E]).set_sheen(0.3).set_opacity(0.8)
        p0 = xcc(msm('p0'), '#323dc0').scale(0.45).set_color([BLUE_C, BLUE_E]).set_sheen(0.3).set_opacity(0.8)
        p00 = xcc(msm('p0'), '#323dc0').scale(0.45).set_color([RED_C, RED_E]).set_sheen(0.3).set_opacity(0.8).rotate(PI)
        p1 = xcc(msm('p1'), '#d55656').scale(0.8).set_color([BLUE_C, BLUE_E]).set_sheen(0.3).set_opacity(0.8)
        sorb = msm('sorb').scale(1.7).set_color([RED_C, RED_E]).set_sheen(0.3).set_opacity(0.8)
        al2 = mvg(al20, hyp)
        t2 = xun('醇的结构特点')
        t3 = xn('饱和醇羟基的氧为sp³杂化')
        t3[8:11].set_color([BLUE_C, BLUE_E]).set_sheen(0.3).set_opacity(0.8)

        
#         xc([al20])
        sp(adb(t1))
        sp(afo(t1))
        sp(agf(al1))
        sp(adb(t2))
        sp(adb(t3))
        sp(xt(al1, al20, [0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12]))
        sc()
        al1.restore()
        sa(t2, t3, al20)
        sp(afo(vgfo1))
        sp(vgcen1.animate.move_to(ORIGIN).scale(1.6))
        p0.move_to(al20[3]).shift(1.4*LEFT)
        p0.move_to(al20[3]).shift(1.4*LEFT)
        p00.move_to(al20[1]).shift(1.4*RIGHT)
        hyp.move_to(al20[3]).shift(1.2*UR)
        p1.move_to(al20[3]).shift(1.05*DR)
        sorb.move_to(al20[5])
        sp(al20[4].animate.set_sheen(0.3).set_opacity(0.8), al20[6].animate.set_sheen(0.3).set_opacity(0.8), al20[9:13].animate.set_sheen(0.3).set_opacity(0.8), run_time=0.5)
        sp(al20[4].animate.set_color(BLUE_C), al20[6].animate.set_color(BLUE_C), al20[9:13].animate.set_color(BLUE_C))
        sw()
        al20[6].set_z_index(-1)
        sp(at(al20[4], VGroup(p0, p00)), at(al20[6], VGroup(p1, sorb)))
        sw()
        sp(al20[9:11].animate.move_to(hyp1), al20[11:13].animate.move_to(hyp2))
        sp(at(al20[9:11], hyp1), at(al20[11:13], hyp2))
        sw(2)
        sp(ar(vgcen1), afo(t3))
        sp(afi(vgfo1))
        sc()
        sa(t2, al20)
        sp(xt(al20, al1, [0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12]))
        sc()
        sa(t2, al1)
        sw(0.5)
View Code

 s2

        al1 = msm('general')
        al20 = msm('general2').scale(2)
        ohdot = msm('ohdot')
        xms(al1, 0, al20, 0)
        xms(ohdot, 0, al1, 3)
        al1.save_state()
        al20.save_state()
        t2 = xun('醇的结构特点')
        t3 = xn('在醇羟基中,氧的电负性比氢大,它们的公用电子对偏向氧')
        xf(t3, '公用电子对').set_color(RED).set_sheen(0.3)
        t4 = xn('氢表现出一定的活性,所以醇具有酸性')
        acid = xf(t4, '酸性').copy()
        acidt = xtb('酸性', RED)
        
#         sa(xx)
#         sw()
        
        
        sa(t2, al1)
        sw(0.5)
        sp(adb(t3))
        sw()
        sp(xt(al1, ohdot, [3,0,6,'1.3',5,3]))
        sp(al1[6].animate.set_sheen(0.3), run_time=0.3)
        sp(al1[6].animate.set_color(RED))
        sp(al1[6].animate.shift(0.2*LEFT))
        sp(at(t3,t4))
        sw()
        sp(al1[5].animate.rotate(about_point=al1[1].get_center(), angle=10*DEGREES), run_time=0.6)
        sp(al1[5].animate.rotate(about_point=al1[1].get_center(), angle=-20*DEGREES), run_time=0.6)
        sp(al1[5].animate.rotate(about_point=al1[1].get_center(), angle=10*DEGREES), run_time=0.6)
        sp(adb(acidt), afo(t3, t2, al1))
        sw(0.5)
View Code

 s3

        acidt = xtf('酸性')
        baset = xtf('碱性')
        table = xtf('亲核性')
        t1 = xn('由于醇羟基具有酸性,因此醇可以和金属钠反应')
        t2 = xn('醇的酸性比水弱,醇和钠的反应要温和得多')
        t3 = xn('醇也可以和其他活泼金属发生反应,例如K、Mg和Al')
        eq1 = msm('eqa').scale(0.27)
        mo1 = eq1[1:7].copy().scale(1.5)
        mo2 = eq1[9:11].copy().scale(1.5)
        vgmo = VGroup(mo1, mo2).move_to(ORIGIN).arrange(buff=2)
        mo3 = eq1[12:19].copy()
        xms(mo3,0,mo1,0)
        mo4 = eq1[20:22].copy().move_to(mo2)
        xs(mo4,0,mo1,5)
        mo11 = mo1.copy().set_opacity(0)
        mo22 = mo2.copy().set_opacity(0)
        no1 = xn('醇').scale(1.3)
        no2 = xn('水').scale(1.3)
        novg = mvg(no1,no2).arrange(buff=3).shift(1.3*DOWN)
        n1 = Text('16~18').scale(0.8)
        n2 = Text('15.7').scale(0.8)
        nvg = mvg(n1,n2).shift(2*DOWN)
        xa(nvg, novg)
        mno = mmt('pK_a').next_to(n1, 3*LEFT).shift(0.05*DOWN)
        vgaci = mvg(no1,no2,n1,n2,mno)
        t4 = xn('不同类型的醇的酸性强弱顺序为:')
        t5 = xn('这是因为体积较小的烷氧负离子的溶剂化程度较大,稳定性较高')
        t6 = xn('那么其对应的共轭酸(醇)的酸性就越强')
        k1 = xn('酸性强弱顺序').shift(6*UP).scale(1.3)
        k2 = xn('溶剂化大小顺序').shift(6*UP).scale(1.3)
        l1 = msm('yi').scale(0.25)
        l2 = msm('bin')
        l3 = msm('ding')
        xms(l2,0,l1,0)
        xms(l3,0,l1,3)
        l2.shift(0.7*LEFT)
        l1.shift(5*LEFT)
        l3.shift(4.5*RIGHT)
        j1 = Text('>').shift(2.8*LEFT)
        j2 = Text('>').shift(1.5*RIGHT)
        o1 = msm('yi2')
        o2 = msm('bin2')
        o3 = msm('ding2')
        xms(o1,0,l1,0)
        xms(o2,0,l2,0)
        xms(o3,0,l3,0)
        l1.save_state()
        l2.save_state()
        l3.save_state()
        al1 = msm('general')
        al20 = msm('general2').scale(2)
        xms(al1, 0, al20, 0)
        t7 = xn('醇羟基上的氧可利用孤对电子与氢结合形成氧鎓盐')
        t9 = xn('氧的孤对电子也可以进攻带正电荷的离子或基团')
        xf(t7, '孤对电子').set_color(RED).set_sheen(0.3)
        xf(t9, '孤对电子').set_color(RED).set_sheen(0.3)
        t8 = xn('故醇具有碱性')
        t10 = xn('故醇具有亲核性')
        ywy = msm('ywy')
        oz = msm('oz')
        xms(ywy, 0, al1, 3)
        xms(oz, 0, al1, 3)
        ywh = ywy[5:].copy().shift(UP)

        
#         xc([ywh, al1, oz])
#         sw()
        
        sa(acidt)
        sw(0.5)
        sp(adb(t1), adb(mo1), adb(mo2))
        sw()
        sp(act(mo1[5], mo4), acct(mo2, mo3[5:7]), run_time=2)
        sw()
        sr(mo1,mo2)
        sa(mo3,mo4)
        sp(at(mo11,eq1[1:7]), at(mo22, eq1[9:11]), at(mo3, eq1[12:19]), at(mo4, eq1[20:22]))
        sp(agf(eq1[0]), agf(eq1[7]), agf(eq1[8]), agf(eq1[22:]), agf(eq1[11]), agf(eq1[19]))
        sw(2)
        sc()
        sa(acidt, t1, eq1)
        sp(at(t1, t2))
        sp(aw(vgaci))
        sw(1.5)
        sp(at(t1, t3))
        sw(2)
        sp(afo(vgaci, eq1))
        sp(at(t1, t4))
        sp(adb(l1), adb(l2), adb(l3))
        sp(agf(j1), agf(j2), agf(k1))
        sw(2)
        sp(at(t1, t5))
        sp(at(l1, o1), at(l2[9], o2[10]), at(l3[14], o3[15]))
        sp(FadeOut(k1), run_time=0.7)
        sp(FadeIn(k2), run_time=0.7)
        sw(2)
        sp(at(t1, t6))
        sp(FadeOut(k2), run_time=0.7)
        sp(FadeIn(k1), run_time=0.7)
        sp(ar(l1), ar(l2), ar(l3))
        sw(2)
        sp(afo(k1,t1,l1,l2,l3,j1,j2))
        sp(afi(al1))
        sp(acidt.animate.move_to([-5.4,2,0]).scale(1.3))
        sp(adb(t7))
        sp(agf(ywh))
        sp(al1[9:11].animate.set_sheen(0.3), run_time=0.5)
        sp(al1[9:11].animate.set_color(RED))
        al1.save_state()
        sp(ywh.animate.shift(DOWN))
        sw()
        al1[5].save_state()
        sp(afo(al1[9:13], al1[6]), al1[5].animate.move_to(oz[1]), at(ywh[0], oz[2]), ywh[1:].animate.move_to(oz[3:]))
        sw()
        sp(at(t7,t8))
        sp(adb(baset))
        sw()
        sp(baset.animate.move_to([-5.4,0,0]).scale(1.3))
        sp(at(t7, t9), afi(al1[9:13], al1[6]), afo(ywh), ar(al1[5]))
        sw(1.5)
        sp(adb(table))
        sp(at(t7,t10), afo(al1, baset, acidt))
        sw(0.5)
View Code

 s4

        acidt = xtf('酸性').move_to([-5.4,2,0]).scale(1.3)
        baset = xtf('碱性').move_to([-5.4,0,0]).scale(1.3)
        nut = xtf('亲核性')
        t1 = xn('故醇具有亲核性')
        t2 = xn('例如甲醇和硝酸的反应过程如下:')
        jia0 = msm('jia0')
        jia1 = msm('jia1')
        xiao0 = msm('xiao0')
        xiao1 = msm('xiao1')
        tran1 = msm('tran1')
        tran2 = msm('tran2')
        tran3 = msm('tran3')
        tran4 = msm('tran4')
        condi = msm('condi').to_edge(UP).shift(0.5*UP + 2*LEFT)
        n = mt('N', font='Times New Roman')
        xms(xiao0, 2, n, 0)
        xms(xiao1, 0, n, 0)
        xms(tran1, 0, n, 0)
        xms(tran2, 0, n, 0)
        xms(tran3, 0, n, 0)
        xms(tran4, 0, n, 0)
        xs(jia0, 3, n, 0)
        xs(condi, 0, tran2, 2)
        condi.scale(0.8)
        jia0.shift(4*LEFT)
        xms(jia1, 0, jia0, 3)
        tran1[4].set_color(BLUE).set_sheen(0.3)
        tran1[16].set_color(RED).set_sheen(0.3)
        u1 = xun('H转移')
        h2o = msm('h2o').shift(2*DOWN + 4*RIGHT).set_color(BLUE).set_sheen(0.3)
        h = msm('h+').shift(2*UP + 4*RIGHT).set_color(RED).set_sheen(0.3)
        xs(h2o, 0, tran4, 3)
        xs(h, 0, tran4, 3)
        tran4[11].set_color(GREEN).set_sheen(0.3)
        name = xn('硝酸甲酯').shift(1.5*UP)
        p1 = xn('利用醇羟基氧的亲核性,醇可以和含氧无机酸、有机酸成酯')
        al1 = msm('general')
        al20 = msm('general2').scale(2)
        xms(al1, 0, al20, 0)
        


#         xc([tran1, tran2])
#         sw()
        
        
        sa(nut, t1)
        sw(0.5)
        sp(at(t1,t2), adb(jia0), adb(xiao0))
        sp(xt(jia0, jia1, [0,5,1,3,2,4,3,0,4,1]), agf(jia1[6]), agf(jia1[2]), agf(jia1[7:]), xt(xiao0, xiao1, [0,8,1,6,2,0,3,1,4,4]),
          agf(xiao1[9]),agf(xiao1[7]),agf(xiao1[5]),agf(xiao1[10:12]),agf(xiao1[12]),agf(xiao1[2:4]))
        sc()
        sa(jia1, xiao1,nut,t1)
        sp(jia1[7:].animate.set_sheen(0.3), xiao1[2].animate.set_sheen(0.3), run_time=0.5)
        sp(jia1[7:].animate.set_color(BLUE), xiao1[2].animate.set_color(RED))
        sw(1.5)
        sp(xt(jia1, tran1, [3,12,4,13,5,14,6,15,0,3,2,11,1,10,'7.9',4]), xt(xiao1, tran1, [8,8,6,7,7,9,0,0,'10.12','18.20',2,16,3,2,1,1,5,6,4,5,12,17]),
           agf(xiao1[9], reverse_rate_function = True), agf(tran1[20:22]))
        sw(1.5)
        sp(jia1.animate.set_sheen(0), xiao1.animate.set_sheen(0), run_time=0.5)
        sp(jia1.animate.set_color(WHITE), xiao1.animate.set_color(WHITE))
        sr(jia1,xiao1)
        tran1.set_color(WHITE).set_sheen(0)
        sa(tran1)
        sp(afi(u1))
        sp(tran1[10].animate.set_sheen(0.3), run_time=0.5)
        sp(tran1[10].animate.set_color(BLUE))
        sw()
        tran2[2].set_color(BLUE).set_sheen(0.3)
        sp(xt(tran1,tran2,[10,2]), agf(tran1[11], reverse_rate_function = True), agf(tran1[20:22], reverse_rate_function = True), agf(tran1[16], reverse_rate_function = True))
        sw()
        sc()
        sa(tran2, nut, t2, u1)
        sp(tran2.animate.set_sheen(0), run_time=0.5)
        sp(tran2.animate.set_color(WHITE))
        sp(afo(u1))
        sw(0.5)
        sp(afi(condi))
        sp(xt(tran2, tran3, [9,20,2,16]), at(condi[0].copy(), tran3[18]), agf(tran3[21]), agf(tran3[17]), agf(tran3[19]), agf(tran3[22:24]))
        sc()
        sa(tran3, nut, t2)
        sp(afo(condi))
        sp(tran3[20].animate.set_sheen(0.3), tran3[1:3].animate.set_sheen(0.3), tran3[16:20].animate.set_sheen(0.3), tran3[22:24].animate.set_sheen(0.3), tran3[21].animate.set_sheen(0.3), run_time=0.5)
        sp(tran3[20].animate.set_color(RED), tran3[1:3].animate.set_color(BLUE), tran3[16:20].animate.set_color(BLUE), tran3[22:24].animate.set_color(BLUE), tran3[21].animate.set_color(GREEN))
        sw(1.5)
        sp(xt(tran3, tran4, ['14.16','12.14',7,9,8,10,6,8,5,7,13,14,21,11]), xt(tran3, h, [20,0]), agf(h[1:3]), xt(tran3, h2o, [16,0,18,1,1,2]),
          agf(tran3[17], reverse_rate_function = True), agf(tran3[19], reverse_rate_function = True), agf(tran3[2], reverse_rate_function = True), agf(tran3[22:24], reverse_rate_function = True))
        sp(adb(name))
        sp(at(t2, p1))
        sw(2)
        sp(afo(t2, tran3, name, h))
        sp(afi(al1, acidt, baset))
        sp(nut.animate.move_to([-5.4,-2,0]).scale(1.3))
        sw(0.5)
View Code

 

标签:,set,al20,sp,msm,animate,al1
来源: https://www.cnblogs.com/daxiangcai/p/16534792.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有