diff options
author | Norbert Preining <norbert@preining.info> | 2022-01-23 03:01:14 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-01-23 03:01:14 +0000 |
commit | 47551fbf494bf778f45c78692a0ff17d771b96d7 (patch) | |
tree | 1f44a26e32c56c992ec9a362455a7cc1dff71091 /graphics/mcf2graph/mcf2graph.mp | |
parent | 26bfc07f2b7829213356de43cf5b81c3ba99e338 (diff) |
CTAN sync 202201230301
Diffstat (limited to 'graphics/mcf2graph/mcf2graph.mp')
-rw-r--r-- | graphics/mcf2graph/mcf2graph.mp | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/graphics/mcf2graph/mcf2graph.mp b/graphics/mcf2graph/mcf2graph.mp index 107606aae4..0ddf0b3c22 100644 --- a/graphics/mcf2graph/mcf2graph.mp +++ b/graphics/mcf2graph/mcf2graph.mp @@ -1,5 +1,5 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% mcf2graph ver 4.78 Copyright (c) 2013-2022 Akira Yamaji +% mcf2graph ver 4.79 Copyright (c) 2013-2022 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, @@ -35,7 +35,7 @@ % Set output report : mpost -s ahlength=7 FILENAME %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% tracingstats:=1; -message "* This is mcf2graph ver 4.78 2022.01.16"; +message "* This is mcf2graph ver 4.79 2022.01.22"; %------------------------------------------------------------------------------------------------- newinternal cntA,cntB,cntM,minX,minY,maxX,maxY,sftX,sftY,com,par,envT,envB,lenT,lineT,angT,rotT, crR,nA,nB,nC,nD,nE,nF,nS,nL,nR,nU,nP,xpos,ypos,markA,markB,saveA,saveB,bondL; @@ -56,8 +56,7 @@ sw_abbreviate:=sw_numbering:=sw_output:=0; numbering_start:=1; numbering_end:=40 aux_max:=max_inf_num:=20; aux_delimiter:=";"; blank_str:= " "; dum:=(-4091,0); for i=1 upto aux_max: tag[i]:=""; endfor Fig:=1; Mcode:=2; Calc:=4; Info:=8; Table:=16; Report:=32; MOL2k:=64; MOL3k:=128; -Atom:=8; Bond:=16; Brock:=32; Inverse:=64; Group:=32; Mol:=64; -Outside:=1; Inside:=2; Bothside:=Outside+Inside; +Atom:=8; Bond:=16; Group:=32; Mol:=64; Outside:=1; Inside:=2; Bothside:=Outside+Inside; %------------------------------------------------------------------------------------------------- a_prn_s:=ASCII("("); a_prn_e:=ASCII(")"); a_brc_s:=ASCII("{"); a_brc_e:=ASCII("}"); a_brk_s:=ASCII("["); a_brk_e:=ASCII("]"); a_cmm:=ASCII(","); a_equ:=ASCII("="); @@ -816,11 +815,10 @@ enddef; def MC(text TXT)= begingroup save f_bra,strAT,cnt_group,temp_lenE,temp_lenF,temp_cntB,f_term,f_at,f_lineT,f_rotT, - f_lenT,f_envT,temp_c,factor,m_wd,m_ht,temp_p,defaultsize,defaultscale; + f_lenT,f_envT,temp_c,factor,m_wd,m_ht,temp_p,nH,nW; string temp_c; pair temp_p; %----------------------------------------------------------------------------------------------- - if sw_numbering>=1: ratio_atom_bond:=0.20; fi if (sw_expand=1)or(scan_bit(sw_output,MOL2k))or(scan_bit(sw_output,MOL3k)): expand_set; crR:=1; else: crR:=-ratio_chain_ring; fi @@ -836,7 +834,7 @@ def MC(text TXT)= if (cnt_group>0)and(not scan_bit(sw_abbreviate,Group)): read_group(0)(1); fi char_use_check; %-scaling--------------------------------------------------------------------------------------- - if blength>1: blen:=blength; proc_size_setup; proc_skeleton(0); proc_scaling; + if blength>1: blen:=blength; proc_size_setup; proc_skeleton(0); proc_scaling; elseif blength>0: blen:=fig_wd*blength; proc_size_setup; proc_skeleton(0); proc_scaling; else: blen:=3mm; @@ -890,15 +888,12 @@ def MC(text TXT)= if scan_bit(sw_numbering,Atom): for i=1 upto cntA: if (i>=numbering_start)and(i<=numbering_end): - if scan_bit(sw_numbering,Brock): nA:=i-numbering_start+1; - elseif scan_bit(sw_numbering,Inverse): - nA:=iif(numbering_end<cntA,numbering_end-i+1,cntA-i+1); - else: nA:=i; - fi - erase fill unitsquare xscaled (.8atom_wd*length(decimal(nA))) - yscaled atom_wd shifted (posA[i]-(.5atom_wd,.5atom_wd)); - defaultsize:=.6atom_wd; defaultscale:=.6; - puts(posA[i]-(.5atom_wd,.5atom_wd))(decimal(nA)); + defaultscale:=.18blen/defaultsize; + nH:=1.2defaultsize*defaultscale; + if i<=9: nW:=nH; ef i<=99: nW:=1.3nH; else: nW:=1.9nH; fi + erase fill unitsquare xscaled nW yscaled nH shifted (posA[i]-(nW/2,nH/2)); + draw unitsquare xscaled nW yscaled nH shifted (posA[i]-(nW/2,nH/2)) wpcs 0.1; + label(decimal(i),posA[i]); fi endfor fi @@ -906,15 +901,13 @@ def MC(text TXT)= if scan_bit(sw_numbering,Bond): for i=1 upto cntB: if (i>=numbering_start)and(i<=numbering_end): - if scan_bit(sw_numbering,Brock): nB:=i-numbering_start+1; - elseif scan_bit(sw_numbering,Inverse): - nB:=iif(numbering_end<cntB,numbering_end-i+1,cntB-i+1); - else: nB:=i; - fi - erase fill unitsquare yscaled atom_wd xscaled (.8atom_wd*length(decimal(nB))) - shifted (.5[posA[sB[i]],posA[eB[i]]]-(.5atom_wd,.5atom_wd)); - defaultsize:=.6atom_wd; defaultscale:=.6; - puts(0.5[posA[sB[i]],posA[eB[i]]]-(.5atom_wd,.5atom_wd))(decimal(nB)); + defaultscale:=.18blen/defaultsize; + nH:=1.2defaultsize*defaultscale; + if i<=9: nW:=nH; ef i<=99: nW:=1.3nH; else: nW:=1.9nH; fi + nH:=defaultsize*defaultscale; temp_p:=.5[posA[sB[i]],posA[eB[i]]]; + erase fill unitsquare xscaled nW yscaled nH shifted (temp_p-(nW/2,nH/2)); + draw unitsquare xscaled nW yscaled nH shifted (temp_p-(nW/2,nH/2)) wpcs 0.1; + label(decimal(i),temp_p); fi endfor fi @@ -1222,7 +1215,7 @@ def draw_atom(expr NUM)= if dir_str=-1: pos_a:=pos_a-(f_wd,0); fi draw_char(temp_c,pos_a+pos_c,atom_wd,bond_pen_wd*ratio_char_bond,NUM); if scan_bit(sw_frame,Atom): draw_frame(pos_a+pos_c,f_wd,atom_wd,thickness_frame); fi - if dir_str=1: pos_a:=pos_a+(f_wd,0); fi + if dir_str=1: pos_a:=pos_a+(f_wd,0); fi else: atom_picture:=temp_c infont atomfont; f_wd:=(xpart(lrcorner atom_picture)-xpart(llcorner atom_picture))*r_ff; |