From 26d5c51066cc6a4f833138783d77c0889b273f28 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 6 Aug 2016 22:38:49 +0000 Subject: mcf2graph (6aug16) git-svn-id: svn://tug.org/texlive/trunk@41814 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf | 35 +++++++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'Master/texmf-dist/metapost') diff --git a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf index 06e221df212..a778a1da880 100644 --- a/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf +++ b/Master/texmf-dist/metapost/mcf2graph/mcf2graph.mf @@ -1,5 +1,5 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% mcf2graph ver 3.95 Copyright (c) 2013-2016 Akira Yamaji +% mcf2graph ver 3.96 Copyright (c) 2013-2016 Akira Yamaji % % Permission is hereby granted, free of charge, to any person obtaining a copy of this software % and associated documentation files (the "Software"), to deal in the Software without restriction, @@ -30,7 +30,7 @@ % Set output checklist : mpost -s ahlength=2 FILENAME %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% tracingstats:=1; -message " This is mcf2graph ver 3.9 2016.7"; +message " This is mcf2graph ver 3.9 2016.8"; %------------------------------------------------------------------------------------------------- pair posB[],posA[],pairT,Ls,Le,pairA; numeric angB[],angA[],br_ang[],sB[],eB[],f_FON[],atom_w[],atom_h[],atom_d[],strA[],stkB[],stkA[], @@ -252,6 +252,29 @@ def !!?(expr a)(expr b)(expr c) = PB(_pop,0) if ypart(a)<=0:: PB(_cyc_eB,ypart(a)-c+1) else:: PB(_cyc_eB,ypart(a)) fi enddef; %------------------------------------------------------------------------------------------------- +def fuse_large(expr a)(expr b)(expr c) = + if b==5:: + PB(_jp_bond,a) PB(_push,0) PB(_chg_len,c DIV 10) PB(_mk_bond,72-((c-9) MUL 1.5)) + PB(_mk_bond,72+(c-9)) PB(_mk_bond,72+(c-9)) PB(_pop,0) + if a>=1:: PB(_cyc_eB,0) else:: PB(_cyc_eB,list) fi + elseif b==6:: + PB(_jp_bond,a) PB(_push,0) PB(_chg_len,c DIV 10) PB(_mk_bond,60-(c-8)) + PB(_mk_bond,60+((c-8) DIV 2)) PB(_mk_bond,60+((c-8) DIV 2)) PB(_mk_bond,60+((c-8) DIV 2)) + PB(_pop,0) if a>=1:: PB(_cyc_eB,0) else:: PB(_cyc_eB,list) fi + elseif b==7:: + PB(_jp_bond,a) PB(_push,0) PB(_chg_len,c DIV 10) PB(_mk_bond,(360 DIV 7)-(c-8)) + PB(_mk_bond,360 DIV 7+((c-8) DIV 2.5)) PB(_mk_bond,360 DIV 7+((c-8) DIV 2.5)) + PB(_mk_bond,360 DIV 7+((c-8) DIV 2.5)) PB(_mk_bond,360 DIV 7+((c-8) DIV 2.5)) + PB(_pop,0) if a>=1:: PB(_cyc_eB,0) else:: PB(_cyc_eB,list) fi + elseif b==8:: + PB(_jp_bond,a) PB(_push,0) PB(_chg_len,c DIV 10) PB(_mk_bond,(360 DIV 8)-(c-8)) + PB(_mk_bond,(360 DIV 8)+((c-8) DIV 3)) PB(_mk_bond,(360 DIV 8)+((c-8) DIV 3)) + PB(_mk_bond,(360 DIV 8)+((c-8) DIV 3)) PB(_mk_bond,(360 DIV 8)+((c-8) DIV 3)) + PB(_mk_bond,(360 DIV 8)+((c-8) DIV 3)) + PB(_pop,0) if a>=1:: PB(_cyc_eB,0) else:: PB(_cyc_eB,list) fi + fi +enddef; +%------------------------------------------------------------------------------------------------- def PB(expr a,b)= cntBS:=cntBS+1; comMC[ab_num][cntBS]:=a; parMC[ab_num][cntBS]:=b; enddef; def $$(text t)(expr e) = begingroup save cntBS; cntBS:=0; ab_num:=ab_num+1; @@ -261,7 +284,12 @@ def $$(text t)(expr e) = elseif (e>=?3)and(e<=?20):: for list==t:: !?(list)(e-?3+3) endfor elseif e==Ph1:: !?(t)(6) PB(_dl,-2) PB(_dl,-4) elseif e==Ph2:: !?(t)(6) PB(_dl,-1) PB(_dl,-3) PB(_dl,-5) - elseif comMC[e][1]==_fuse:: for list==t:: !!?(list)(parMC[e][1])(comMC[e][2]) endfor fi + elseif comMC[e][1]==_fuse:: + if comMC[e][2]<=6:: for list==t:: !!?(list)(parMC[e][1])(comMC[e][2]) endfor + elseif (comMC[e][2]>=11)and(comMC[e][2]<=15):: + for list==t:: fuse_large(list)(parMC[e][1])(comMC[e][2]) endfor + fi + fi elseif color e:: color_list[incr cntC]:=e; for list==t:: PB(_set_adr,list) PB(_set_colorB,cntC) endfor fi fi cntMC[ab_num]:=cntBS; @@ -614,6 +642,7 @@ Ph:=Ph1:='(?6,(_dl,-2),(_dl,-4),(_dl,-6)); Ph2:='(?6,(_dl,-1),(_dl,-3),(_dl,-5)) for i=1 upto 20: ![i]:='({{,(_get_len,0),! for j==2 upto i::,! endfor,}}); endfor Me:='(); Et:=!; Pr:='(!2); Bu:='(!3); for i=4,5,6: for j=2 upto i-2: ?[i][j]:='((_fuse,i),(j,0)); endfor endfor +for i=5,6,7,8: for j=11 upto 15: ?[i][j]:='((_fuse,i),(j,0)); endfor endfor %------------------------------------------------------------------------------------------------- H :='("H");C:='("C");N:='("N");O:='("O");F:='("F");S:='("S");P:='("P");I:='("I"); Si:='("{Si}");Al:='("{Al}");Mg:='("{Mg}");Zn:='("{Zn}");As:='("{As}");Cu:='("{Cu}"); -- cgit v1.2.3