diff options
Diffstat (limited to 'Master/texmf-dist/metapost/context/base')
-rw-r--r-- | Master/texmf-dist/metapost/context/base/mp-back.mp | 232 | ||||
-rw-r--r-- | Master/texmf-dist/metapost/context/base/mp-chem.mp | 104 | ||||
-rw-r--r-- | Master/texmf-dist/metapost/context/base/mp-page.mp | 27 | ||||
-rw-r--r-- | Master/texmf-dist/metapost/context/base/mp-text.mp | 3 | ||||
-rw-r--r-- | Master/texmf-dist/metapost/context/base/mp-tool.mp | 2 |
5 files changed, 216 insertions, 152 deletions
diff --git a/Master/texmf-dist/metapost/context/base/mp-back.mp b/Master/texmf-dist/metapost/context/base/mp-back.mp index 99e88554b62..f49474cf77f 100644 --- a/Master/texmf-dist/metapost/context/base/mp-back.mp +++ b/Master/texmf-dist/metapost/context/base/mp-back.mp @@ -1,6 +1,6 @@ %D \module %D [ file=mp-back.mp, -%D version=2000.05.31, +%D version=2000.05.31, %D title=\CONTEXT\ \METAPOST\ graphics, %D subtitle=backgrounds, %D author=Hans Hagen, @@ -8,199 +8,199 @@ %D copyright={PRAGMA / Hans Hagen \& Ton Otten}] %C %C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See licen-en.pdf for -%C details. +%C therefore copyrighted by \PRAGMA. See licen-en.pdf for +%C details. -if unknown context_tool : input mp-tool ; fi ; -if known context_back : endinput ; fi ; +if unknown context_tool : input mp-tool ; fi ; +if known context_back : endinput ; fi ; -boolean context_back ; context_back := true ; +boolean context_back ; context_back := true ; -def some_hash ( expr hash_width , - hash_height , - hash_linewidth , - hash_linecolor , - hash_angle , - hash_gap ) = +def some_hash ( expr hash_width , + hash_height , + hash_linewidth , + hash_linecolor , + hash_angle , + hash_gap ) = stripe_gap := hash_gap ; stripe_angle := hash_angle ; - drawoptions (withpen pencircle scaled hash_linewidth + drawoptions (withpen pencircle scaled hash_linewidth withcolor hash_linecolor) ; path p ; p := unitsquare xscaled hash_width yscaled hash_height ; stripe_path_a () (draw) p ; % next we move it all to quadrant 1 - currentpicture := currentpicture shifted urcorner currentpicture ; + currentpicture := currentpicture shifted urcorner currentpicture ; -enddef ; +enddef ; -def some_double_back (expr back_type , +def some_double_back (expr back_type , back_width , back_height , - back_delta , - back_linewidth , - back_linecolor , - back_fillcolor , - back_topcolor , + back_delta , + back_linewidth , + back_linecolor , + back_fillcolor , + back_topcolor , back_bottomcolor , - back_leftcolor , - back_rightcolor ) = + back_leftcolor , + back_rightcolor ) = - numeric ww ; ww := back_width ; - numeric hh ; hh := back_height ; - numeric dd ; dd := back_delta ; + numeric ww ; ww := back_width ; + numeric hh ; hh := back_height ; + numeric dd ; dd := back_delta ; - color back_nillcolor ; back_nillcolor := back_topcolor ; + color back_nillcolor ; back_nillcolor := back_topcolor ; - path p ; p := fullsquare xscaled ww yscaled hh ; - path q ; q := fullsquare xscaled (ww-2dd) yscaled (hh-2dd) ; - path r ; r := llcorner p -- - lrcorner p shifted (-3dd,0) .. controls lrcorner p .. - lrcorner p shifted (0, 3dd) -- - urcorner p shifted (0,-3dd) .. controls urcorner p .. + path p ; p := fullsquare xscaled ww yscaled hh ; + path q ; q := fullsquare xscaled (ww-2dd) yscaled (hh-2dd) ; + path r ; r := llcorner p -- + lrcorner p shifted (-3dd,0) .. controls lrcorner p .. + lrcorner p shifted (0, 3dd) -- + urcorner p shifted (0,-3dd) .. controls urcorner p .. urcorner p shifted (-3dd,0) -- ulcorner p -- cycle ; path s ; s := r xscaled ((ww-2dd)/ww) yscaled ((hh-2dd)/hh) ; - path t ; t := llcorner p -- - lrcorner p -- - urcorner p shifted (0,-3dd) .. controls urcorner p .. - urcorner p shifted (-3dd,0) -- - ulcorner p shifted ( 3dd,0) .. controls ulcorner p .. + path t ; t := llcorner p -- + lrcorner p -- + urcorner p shifted (0,-3dd) .. controls urcorner p .. + urcorner p shifted (-3dd,0) -- + ulcorner p shifted ( 3dd,0) .. controls ulcorner p .. ulcorner p shifted (0,-3dd) -- llcorner p -- cycle ; path u ; u := t xscaled ((ww-2dd)/ww) yscaled ((hh-2dd)/hh) ; - path v ; v := llcorner p shifted ( 3dd,0) -- - lrcorner p shifted (-3dd,0) .. controls lrcorner p .. - lrcorner p shifted (0, 3dd) -- - urcorner p shifted (0,-3dd) .. controls urcorner p .. + path v ; v := llcorner p shifted ( 3dd,0) -- + lrcorner p shifted (-3dd,0) .. controls lrcorner p .. + lrcorner p shifted (0, 3dd) -- + urcorner p shifted (0,-3dd) .. controls urcorner p .. urcorner p shifted (-3dd,0) -- - ulcorner p shifted ( 3dd,0) .. controls ulcorner p .. + ulcorner p shifted ( 3dd,0) .. controls ulcorner p .. ulcorner p shifted (0,-3dd) .. llcorner p shifted (0, 3dd) .. controls llcorner p .. cycle ; % {down} .. cycle ; path w ; w := t xscaled ((ww-2dd)/ww) yscaled ((hh-2dd)/hh) ; - path a ; a := llcorner p -- ulcorner p -- + path a ; a := llcorner p -- ulcorner p -- ulcorner q -- llcorner q -- cycle ; - path b ; b := llcorner p -- lrcorner p -- + path b ; b := llcorner p -- lrcorner p -- lrcorner q -- llcorner q -- cycle ; - path c ; c := lrcorner p -- urcorner p -- + path c ; c := lrcorner p -- urcorner p -- urcorner q -- lrcorner q -- cycle ; - path d ; d := ulcorner p -- urcorner p -- + path d ; d := ulcorner p -- urcorner p -- urcorner q -- ulcorner q -- cycle ; - path e ; e := llcorner p -- lrcorner p -- - urcorner p -- urcorner q -- + path e ; e := llcorner p -- lrcorner p -- + urcorner p -- urcorner q -- lrcorner q -- llcorner q -- cycle ; - path f ; f := llcorner p -- ulcorner p -- - urcorner p -- urcorner q -- + path f ; f := llcorner p -- ulcorner p -- + urcorner p -- urcorner q -- ulcorner q -- llcorner q -- cycle ; - linecap := butt ; pickup pencircle scaled back_linewidth ; + linecap := butt ; pickup pencircle scaled back_linewidth ; - if back_type=1 : + if back_type=1 : - fill p withcolor back_fillcolor ; - fill a withcolor back_leftcolor ; - fill b withcolor back_bottomcolor ; - fill c withcolor back_rightcolor ; - fill d withcolor back_topcolor ; - draw a withcolor back_linecolor ; - draw d withcolor back_linecolor ; - draw b withcolor back_linecolor ; - draw c withcolor back_linecolor ; + fill p withcolor back_fillcolor ; + fill a withcolor back_leftcolor ; + fill b withcolor back_bottomcolor ; + fill c withcolor back_rightcolor ; + fill d withcolor back_topcolor ; + draw a withcolor back_linecolor ; + draw d withcolor back_linecolor ; + draw b withcolor back_linecolor ; + draw c withcolor back_linecolor ; - elseif back_type=2 : + elseif back_type=2 : - fill p withcolor back_fillcolor ; - fill e withcolor back_bottomcolor ; - fill f withcolor back_topcolor ; - draw e withcolor back_linecolor ; - draw f withcolor back_linecolor ; + fill p withcolor back_fillcolor ; + fill e withcolor back_bottomcolor ; + fill f withcolor back_topcolor ; + draw e withcolor back_linecolor ; + draw f withcolor back_linecolor ; - elseif back_type=3 : + elseif back_type=3 : - fill v withcolor back_nillcolor ; - fill w withcolor back_fillcolor ; - draw v withcolor back_linecolor ; - draw w withcolor back_linecolor ; + fill v withcolor back_nillcolor ; + fill w withcolor back_fillcolor ; + draw v withcolor back_linecolor ; + draw w withcolor back_linecolor ; - elseif back_type=4 : + elseif back_type=4 : - fill t withcolor back_nillcolor ; - fill u withcolor back_fillcolor ; - draw t withcolor back_linecolor ; - draw u withcolor back_linecolor ; + fill t withcolor back_nillcolor ; + fill u withcolor back_fillcolor ; + draw t withcolor back_linecolor ; + draw u withcolor back_linecolor ; - elseif back_type=5 : + elseif back_type=5 : - t := t rotatedaround(center t,180) ; - u := u rotatedaround(center u,180) ; + t := t rotatedaround(center t,180) ; + u := u rotatedaround(center u,180) ; - fill t withcolor back_nillcolor ; - fill u withcolor back_fillcolor ; - draw t withcolor back_linecolor ; - draw u withcolor back_linecolor ; + fill t withcolor back_nillcolor ; + fill u withcolor back_fillcolor ; + draw t withcolor back_linecolor ; + draw u withcolor back_linecolor ; - elseif back_type=6 : + elseif back_type=6 : - r := r rotatedaround(center r,180) ; - s := s rotatedaround(center s,180) ; + r := r rotatedaround(center r,180) ; + s := s rotatedaround(center s,180) ; - fill r withcolor back_nillcolor ; - fill s withcolor back_fillcolor ; - draw r withcolor back_linecolor ; - draw s withcolor back_linecolor ; + fill r withcolor back_nillcolor ; + fill s withcolor back_fillcolor ; + draw r withcolor back_linecolor ; + draw s withcolor back_linecolor ; - elseif back_type=7 : + elseif back_type=7 : - fill r withcolor back_nillcolor ; - fill s withcolor back_fillcolor ; - draw r withcolor back_linecolor ; - draw s withcolor back_linecolor ; + fill r withcolor back_nillcolor ; + fill s withcolor back_fillcolor ; + draw r withcolor back_linecolor ; + draw s withcolor back_linecolor ; -fi ; +fi ; -enddef ; +enddef ; endinput ; -beginfig (1) ; +beginfig (1) ; -some_double_back (1, 4.5cm, 1.5cm, .25cm, 1mm, +some_double_back (1, 4.5cm, 1.5cm, .25cm, 1mm, .5white, .8white, .7white, .6white, .7white, .6white) -currentpicture := currentpicture shifted (0,-3cm) ; +currentpicture := currentpicture shifted (0,-3cm) ; -some_double_back (2, 4.5cm, 1.5cm, .25cm, 1mm, +some_double_back (2, 4.5cm, 1.5cm, .25cm, 1mm, .5white, .8white, .7white, .6white, white, white) -currentpicture := currentpicture shifted (0,-3cm) ; +currentpicture := currentpicture shifted (0,-3cm) ; -some_double_back (3, 4.5cm, 1.5cm, .25cm, 1mm, +some_double_back (3, 4.5cm, 1.5cm, .25cm, 1mm, .5white, .8white, .7white, white, white, white) -currentpicture := currentpicture shifted (0,-3cm) ; +currentpicture := currentpicture shifted (0,-3cm) ; -some_double_back (4, 4.5cm, 1.5cm, .25cm, 1mm, +some_double_back (4, 4.5cm, 1.5cm, .25cm, 1mm, .5white, .8white, .7white, white, white, white) -currentpicture := currentpicture shifted (0,-3cm) ; +currentpicture := currentpicture shifted (0,-3cm) ; -some_double_back (5, 4.5cm, 1.5cm, .25cm, 1mm, +some_double_back (5, 4.5cm, 1.5cm, .25cm, 1mm, .5white, .8white, .7white, white, white, white) -currentpicture := currentpicture shifted (0,-3cm) ; +currentpicture := currentpicture shifted (0,-3cm) ; -some_double_back (6, 4.5cm, 1.5cm, .25cm, 1mm, +some_double_back (6, 4.5cm, 1.5cm, .25cm, 1mm, .5white, .8white, .7white, white, white, white) -currentpicture := currentpicture shifted (0,-3cm) ; +currentpicture := currentpicture shifted (0,-3cm) ; -some_double_back (7, 4.5cm, 1.5cm, .25cm, 1mm, +some_double_back (7, 4.5cm, 1.5cm, .25cm, 1mm, .5white, .8white, .7white, white, white, white) -currentpicture := currentpicture shifted (0,-3cm) ; +currentpicture := currentpicture shifted (0,-3cm) ; -some_double_back (8, 4.5cm, 1.5cm, .25cm, 1mm, +some_double_back (8, 4.5cm, 1.5cm, .25cm, 1mm, .5white, .8white, .7white, white, white, white) -endfig ; +endfig ; end . diff --git a/Master/texmf-dist/metapost/context/base/mp-chem.mp b/Master/texmf-dist/metapost/context/base/mp-chem.mp index 1a5be841633..c70dafd85cd 100644 --- a/Master/texmf-dist/metapost/context/base/mp-chem.mp +++ b/Master/texmf-dist/metapost/context/base/mp-chem.mp @@ -51,6 +51,7 @@ path chem_sb_path[], chem_msb_path[], chem_psb_path[], chem_s_path[], chem_ss_path[], chem_mss_path[], chem_pss_path[], chem_e_path[], chem_sd_path[], chem_bb_path[], chem_oe_path[], + chem_bd_path[], chem_bw_path[], chem_ddt_path[], chem_ddb_path[], chem_ldt_path[], chem_ldb_path[], chem_rdt_path[], chem_rdb_path[], chem_dbl_path[], chem_dbr_path[], chem_ad_path[], chem_au_path[], @@ -73,6 +74,7 @@ chem_radical_max := 1.50 ; chem_text_min := 0.75 ; chem_text_max := 1.75 ; chem_circle_radius := 0.80 ; +chem_circle_radius := 1.10 ; chem_rotation := 1 ; chem_adjacent := 0 ; chem_substituent := 0 ; @@ -82,6 +84,10 @@ chem_doing_pb := false ; chem_shift := origin ; chem_dot_factor := 4 ; chem_text_trace := false ; +chem_bd_n := 4 ; +chem_bw_n := 4 ; +chem_bd_angle := 4 ; +chem_bb_angle := 4 ; vardef chem_start_structure(expr n, l, r, t, b, scale, axis, fixedwidth, fixedheight, offset) = chem_setting_axis := axis ; @@ -347,6 +353,14 @@ enddef ; vardef chem_oe (expr n, f, t, r, c) = % one chem_draw (n, chem_oe_path[n], f, t, r, c) ; enddef ; +vardef chem_bd (expr n, f, t, r, c) = % one + for i=0 upto 5 : + chem_draw (n, subpath (2i,2i+1) of chem_bd_path[n], f, t, r, c) ; + endfor ; +enddef ; +vardef chem_bw (expr n, f, t, r, c) = % one + chem_draw (n, chem_bw_path[n], f, t, r, c) ; +enddef ; vardef chem_z_zero@#(text t) = chem_text@#(t, chem_do(origin)) ; @@ -600,37 +614,37 @@ vardef chem_restore = fi ; enddef ; -def chem_init_some(expr n, ratio, angle, start, initialrot, initialmov) = +def chem_init_some(expr n, ratio, start, initialrot, initialmov) = chem_width [n] := ratio * chem_base_width * chem_setting_scale ; - chem_angle [n] := angle ; + chem_angle [n] := 360/abs(n) ; chem_start [n] := start ; chem_initialrot[n] := initialrot ; chem_initialmov[n] := initialmov ; - chem_b_zero [n] := (chem_width[n],0) rotated (angle/2) ; - chem_n_zero [n] := (chem_text_min*chem_width[n],0) rotated (angle/2) ; + chem_b_zero [n] := (chem_width[n],0) rotated (chem_angle[n]/2) ; + chem_n_zero [n] := (chem_text_min*chem_width[n],0) rotated (chem_angle[n]/2) ; chem_r_max [n] := chem_radical_max*chem_b_zero[n] ; chem_r_path [n] := chem_b_zero[n] -- chem_r_max[n] ; - chem_mr_path [n] := chem_r_path [n] rotatedaround(chem_b_zero[n], (180-angle)/2) ; - chem_pr_path [n] := chem_r_path [n] rotatedaround(chem_b_zero[n],-(180-angle)/2) ; + chem_mr_path [n] := chem_r_path [n] rotatedaround(chem_b_zero[n], (180-chem_angle[n])/2) ; + chem_pr_path [n] := chem_r_path [n] rotatedaround(chem_b_zero[n],-(180-chem_angle[n])/2) ; chem_r_zero [n] := point 1 of chem_r_path [n] ; chem_mr_zero [n] := point 1 of chem_mr_path[n] ; chem_pr_zero [n] := point 1 of chem_pr_path[n] ; chem_crz_zero [n] := point 1 of (chem_r_path[n] enlonged chem_center_offset) ; - chem_au_path [n] := subpath (0.2,0.8) of (chem_r_max[n] -- (chem_r_max[n] rotated angle)) ; + chem_au_path [n] := subpath (0.2,0.8) of (chem_r_max[n] -- (chem_r_max[n] rotated chem_angle[n])) ; chem_ad_path [n] := reverse(chem_au_path[n]) ; - chem_rt_zero [n] := (((chem_radical_max+chem_radical_min)/2)*chem_width[n],0) rotated (angle/2) ; + chem_rt_zero [n] := (((chem_radical_max+chem_radical_min)/2)*chem_width[n],0) rotated (chem_angle[n]/2) ; chem_rtt_zero [n] := chem_rt_zero[n] rotated + 10 ; chem_rbt_zero [n] := chem_rt_zero[n] rotated - 10 ; - chem_b_path [n] := reverse(chem_b_zero[n] -- (chem_b_zero[n] rotated -angle)) ; - chem_bx_path [n] := reverse(chem_b_zero[n] -- (chem_b_zero[n] rotated -angle)) ; % ? + chem_b_path [n] := reverse(chem_b_zero[n] -- (chem_b_zero[n] rotated -chem_angle[n])) ; + chem_bx_path [n] := reverse(chem_b_zero[n] -- (chem_b_zero[n] rotated -chem_angle[n])) ; % ? chem_sb_path [n] := subpath (0.25,0.75) of chem_b_path[n] ; - chem_s_path [n] := point 0 of chem_b_path[n] -- point 0 of (chem_b_path[n] rotated (2angle)) ; + chem_s_path [n] := point 0 of chem_b_path[n] -- point 0 of (chem_b_path[n] rotated (2chem_angle[n])) ; chem_ss_path [n] := subpath (0.25,0.75) of (chem_s_path[n]) ; chem_pss_path [n] := subpath (0.00,0.75) of (chem_s_path[n]) ; chem_mss_path [n] := subpath (0.25,1.00) of (chem_s_path[n]) ; chem_mid_zero [n] := origin shifted (-.25chem_width[n],0) ; - chem_midst_path[n] := chem_mid_zero[n] -- (chem_width[n],0) rotated ( angle + angle/2) ; - chem_midsb_path[n] := chem_mid_zero[n] -- (chem_width[n],0) rotated (-angle - angle/2) ; + chem_midst_path[n] := chem_mid_zero[n] -- (chem_width[n],0) rotated ( chem_angle[n] + chem_angle[n]/2) ; + chem_midsb_path[n] := chem_mid_zero[n] -- (chem_width[n],0) rotated (-chem_angle[n] - chem_angle[n]/2) ; chem_midt_path [n] := subpath (0.25,1.00) of chem_midst_path [n] ; chem_midb_path [n] := subpath (0.25,1.00) of chem_midsb_path [n] ; chem_msb_path [n] := subpath (0.00,0.75) of chem_b_path[n] ; @@ -647,26 +661,28 @@ def chem_init_some(expr n, ratio, angle, start, initialrot, initialmov) = point 0 of chem_sb_path[n] rotatedaround(point 1 of chem_sb_path[n], -4) -- point 0 of chem_sb_path[n] rotatedaround(point 1 of chem_sb_path[n], 4) -- cycle ; chem_rb_path [n] := chem_b_zero[n] -- chem_r_max[n] rotated -2 -- chem_r_max[n] -- chem_r_max[n] rotated 2 -- cycle ; - chem_mrb_path [n] := chem_rb_path[n] rotatedaround(chem_b_zero[n], (180-angle)/2) ; - chem_prb_path [n] := chem_rb_path[n] rotatedaround(chem_b_zero[n],-(180-angle)/2) ; - chem_msr_path [n] := chem_sr_path[n] rotatedaround(chem_b_zero[n], (180-angle)/2) ; - chem_psr_path [n] := chem_sr_path[n] rotatedaround(chem_b_zero[n],-(180-angle)/2) ; + chem_mrb_path [n] := chem_rb_path[n] rotatedaround(chem_b_zero[n], (180-chem_angle[n])/2) ; + chem_prb_path [n] := chem_rb_path[n] rotatedaround(chem_b_zero[n],-(180-chem_angle[n])/2) ; + chem_msr_path [n] := chem_sr_path[n] rotatedaround(chem_b_zero[n], (180-chem_angle[n])/2) ; + chem_psr_path [n] := chem_sr_path[n] rotatedaround(chem_b_zero[n],-(180-chem_angle[n])/2) ; % not yet ok: - chem_c_path [n] := subpath (30/45, -30/45) of (fullcircle scaled (1.25*chem_circle_radius*chem_width[n])); - chem_cc_path [n] := subpath (30/45,8-30/45) of (fullcircle rotated 90 scaled (1.25*chem_circle_radius*chem_width[n])); +% chem_c_path [n] := subpath (30/45, -30/45) of (fullcircle scaled (1.25*chem_circle_radius*chem_width[n])); +% chem_cc_path [n] := subpath (30/45,8-30/45) of (fullcircle rotated 90 scaled (1.25*chem_circle_radius*chem_width[n])); + chem_c_path [n] := subpath (30/45, -30/45) of (fullcircle scaled (chem_width[n])); + chem_cc_path [n] := subpath (30/45,8-30/45) of (fullcircle rotated 90 scaled (chem_width[n])); enddef ; -def chem_init_three = chem_init_some(3,30/52 ,120,-60,1,2) ; enddef ; % 60 -def chem_init_four = chem_init_some(4,30/42.5, 90, 0,1,0) ; enddef ; % 45 -def chem_init_five = chem_init_some(5,30/35 , 72, 0,1,0) ; enddef ; % 36 -def chem_init_six = chem_init_some(6, 1 , 60, 0,1,0) ; enddef ; % 30 -def chem_init_eight = chem_init_some(8,30/22.5, 45, 0,1,0) ; enddef ; % 22.5 +def chem_init_three = chem_init_some(3,30/52 ,-60,1,2) ; enddef ; % 60 +def chem_init_four = chem_init_some(4,30/42.5, 0,1,0) ; enddef ; % 45 +def chem_init_five = chem_init_some(5,30/35 , 0,1,0) ; enddef ; % 36 +def chem_init_six = chem_init_some(6, 1 , 0,1,0) ; enddef ; % 30 +def chem_init_eight = chem_init_some(8,30/22.5, 0,1,0) ; enddef ; % 22.5 % bb R -R R Z -RZ +RZ -def chem_init_some_front(expr n, ratio, angle, start, initialrot, initialmov) = - chem_init_some(n, ratio, angle, start, initialrot, initialmov) ; - chem_bb_path [n] := chem_b_path[n] rotated -angle -- chem_b_path[n] -- chem_b_path[n] rotated angle -- +def chem_init_some_front(expr n, ratio, start, initialrot, initialmov) = + chem_init_some(n, ratio, start, initialrot, initialmov) ; + chem_bb_path [n] := chem_b_path[n] rotated -chem_angle[n] -- chem_b_path[n] -- chem_b_path[n] rotated chem_angle[n] -- (reverse(chem_b_path[n] shortened (chem_base_width/20))) paralleled (chem_base_width/20) -- cycle ; chem_r_max [n] := chem_radical_max*chem_b_zero[n] ; @@ -677,12 +693,12 @@ def chem_init_some_front(expr n, ratio, angle, start, initialrot, initialmov) = chem_pr_zero [n] := point 1 of chem_pr_path[n] ; enddef ; -def chem_init_five_front = chem_init_some_front(-5,30/35,72,0,2,0) ; enddef ; % 36 -def chem_init_six_front = chem_init_some_front(-6, 1 ,60,0,2,0) ; enddef ; % 30 +def chem_init_five_front = chem_init_some_front(-5,30/35,0,2,0) ; enddef ; % 36 +def chem_init_six_front = chem_init_some_front(-6, 1 ,0,2,0) ; enddef ; % 30 -def chem_init_one = +vardef chem_init_one = chem_width [1] := .75 * chem_base_width * chem_setting_scale ; - chem_angle [1] := 45 ; + chem_angle [1] := 360/8 ; chem_start [1] := 0 ; chem_initialrot[1] := 1 ; chem_initialmov[1] := 1 ; @@ -704,14 +720,31 @@ def chem_init_one = chem_ldb_path [1] := chem_ddb_path [1] shifted (0,-.1chem_width[1]) ; chem_rdt_path [1] := chem_ddt_path [1] shifted (0, .1chem_width[1]) ; chem_rdb_path [1] := chem_ddb_path [1] shifted (0, .1chem_width[1]) ; - chem_bb_path [1] := point 0 of chem_r_path[1] -- - point 1 of chem_r_path[1] rotatedaround(point 0 of chem_r_path[1], -4) -- - point 1 of chem_r_path[1] rotatedaround(point 0 of chem_r_path[1], 4) -- cycle ; + save pr ; pair pr[] ; + pr0 := point 0 of chem_r_path[1] ; + pr1 := point 1 of chem_r_path[1] ; + chem_bb_path [1] := pr0 -- (pr1 rotatedaround(pr0,-chem_bb_angle)) -- (pr1 rotatedaround(pr0,chem_bb_angle)) -- cycle ; chem_oe_path [1] := ((-20,0)--(10,0){up}..(20,10)..(30,0)..(40,-10)..(50.0,0)..(60,10)..(70,0)..(80,-10)..{up}(90,0)--(120,0)) - xsized (.75*chem_width[1]) shifted point 0 of chem_r_path[1] ; + xsized (.75*chem_width[1]) shifted pr0 ; chem_rt_zero [1] := point .5 of chem_r_path[1] ; chem_rtt_zero [1] := chem_rt_zero[1] rotated + (chem_angle[1]/2) ; chem_rbt_zero [1] := chem_rt_zero[1] rotated - (chem_angle[1]/2) ; + % added by Alan Braslau (adapted to use shared variables): + save p ; pair p[] ; + p0 := pr1 rotatedaround(pr0, -chem_bd_angle) ; + p1 := pr1 rotatedaround(pr0, +chem_bd_angle) ; + p2 := p0 shifted - pr1 ; + p3 := p1 shifted - pr1 ; + chem_bd_path [1] := + p0 -- p1 for i=chem_bd_n downto 0 : + -- p2 shifted (i/chem_bd_n)[pr1,pr0] + -- p3 shifted (i/chem_bd_n)[pr1,pr0] + endfor ; + chem_bw_path [1] := + for i=0 upto chem_bw_n - 1 : + ((i) /chem_bw_n)[pr0,pr1] .. ((i+.25)/chem_bw_n)[pr0,pr1] shifted p2 .. + ((i+.50)/chem_bw_n)[pr0,pr1] .. ((i+.75)/chem_bw_n)[pr0,pr1] shifted -p2 .. + endfor pr1 ; enddef ; def chem_init_all = @@ -726,4 +759,3 @@ def chem_init_all = enddef ; chem_init_all ; - diff --git a/Master/texmf-dist/metapost/context/base/mp-page.mp b/Master/texmf-dist/metapost/context/base/mp-page.mp index 71ca12aa021..60bfb141754 100644 --- a/Master/texmf-dist/metapost/context/base/mp-page.mp +++ b/Master/texmf-dist/metapost/context/base/mp-page.mp @@ -444,4 +444,31 @@ def Enlarged (expr p, d) = ulEnlarged (p,d) -- cycle) enddef ; +% New: + +def position_anchor_bar(expr p_b_self, p_e_self, y_b_self, y_e_self, h_b_self, d_e_self, + distance, linewidth, linecolor) = + StartPage ; + path p ; p := + if p_b_self=p_e_self : + (xpart ulcorner Field[Text][Text],y_b_self+h_b_self) -- + (xpart llcorner Field[Text][Text],y_e_self-d_e_self) ; + elseif RealPageNumber=p_b_self : + (xpart ulcorner Field[Text][Text],y_b_self+h_b_self) -- + (llcorner Field[Text][Text]) ; + elseif RealPageNumber=p_e_self : + (ulcorner Field[Text][Text]) -- + (xpart llcorner Field[Text][Text],y_e_self-d_e_self) ; + else : + (ulcorner Field[Text][Text]) -- + (llcorner Field[Text][Text]) ; + fi ; + p := p shifted (-llcorner Field[Text][Text]-(distance,0)) ; + interim linecap := butt ; + draw p + withpen pencircle scaled linewidth + withcolor linecolor ; + StopPage ; +enddef ; + endinput ; diff --git a/Master/texmf-dist/metapost/context/base/mp-text.mp b/Master/texmf-dist/metapost/context/base/mp-text.mp index efba39d7d1f..60e16c09bbb 100644 --- a/Master/texmf-dist/metapost/context/base/mp-text.mp +++ b/Master/texmf-dist/metapost/context/base/mp-text.mp @@ -107,6 +107,9 @@ enddef ; pair laboff.origin ; laboff.origin = (0,0) ; % (infinity,infinity) ; pair laboff.raw ; laboff.raw = (0,0) ; % (infinity,infinity) ; +laboff.origin = (0,0) ; labxf.origin := 0 ; labyf.origin := 0 ; +laboff.raw = (0,0) ; labxf.raw := 0 ; labyf.raw := 0 ; + vardef thelabel@#(expr s, z) = save p ; picture p ; p = s if not picture s : infont defaultfont scaled defaultscale fi ; diff --git a/Master/texmf-dist/metapost/context/base/mp-tool.mp b/Master/texmf-dist/metapost/context/base/mp-tool.mp index aa3d77f263b..1a748baf9ea 100644 --- a/Master/texmf-dist/metapost/context/base/mp-tool.mp +++ b/Master/texmf-dist/metapost/context/base/mp-tool.mp @@ -21,6 +21,8 @@ if known context_tool : endinput ; fi ; boolean context_tool ; context_tool := true ; +let @## = @# ; + %D New, version number testing: %D %D \starttyping |