diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3experimental/l3draw/l3draw.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3experimental/l3draw/l3draw.sty | 1347 |
1 files changed, 1347 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3draw/l3draw.sty b/Master/texmf-dist/tex/latex/l3experimental/l3draw/l3draw.sty new file mode 100644 index 00000000000..d485673b419 --- /dev/null +++ b/Master/texmf-dist/tex/latex/l3experimental/l3draw/l3draw.sty @@ -0,0 +1,1347 @@ +%% +%% This is file `l3draw.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3draw.dtx (with options: `package') +%% l3draw-paths.dtx (with options: `package') +%% l3draw-points.dtx (with options: `package') +%% l3draw-scopes.dtx (with options: `package') +%% l3draw-softpath.dtx (with options: `package') +%% l3draw-state.dtx (with options: `package') +%% l3draw-transforms.dtx (with options: `package') +%% +%% Copyright (C) 2018 The LaTeX3 Project +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the "l3experimental bundle" (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% File: l3draw.dtx Copyright(C) 2018 The LaTeX3 Project +\RequirePackage{expl3} +\ProvidesExplPackage{l3draw}{2018/02/21}{} + {L3 Experimental core drawing support} +\RequirePackage { l3color } +%% File: l3draw-paths.dtx Copyright(C) 2018 The LaTeX3 Project +\tl_new:N \l__draw_path_tmp_tl +\fp_new:N \l__draw_path_tmpa_fp +\fp_new:N \l__draw_path_tmpb_fp +\dim_new:N \g__draw_path_lastx_dim +\dim_new:N \g__draw_path_lasty_dim +\dim_new:N \g__draw_path_xmax_dim +\dim_new:N \g__draw_path_xmin_dim +\dim_new:N \g__draw_path_ymax_dim +\dim_new:N \g__draw_path_ymin_dim +\cs_new_protected:Npn \__draw_path_update_limits:nn #1#2 + { + \dim_gset:Nn \g__draw_path_xmax_dim + { \dim_max:nn \g__draw_path_xmax_dim {#1} } + \dim_gset:Nn \g__draw_path_xmin_dim + { \dim_min:nn \g__draw_path_xmin_dim {#1} } + \dim_gset:Nn \g__draw_path_ymax_dim + { \dim_max:nn \g__draw_path_ymax_dim {#2} } + \dim_gset:Nn \g__draw_path_ymin_dim + { \dim_min:nn \g__draw_path_ymin_dim {#2} } + \bool_if:NT \l__draw_update_bb_bool + { + \dim_gset:Nn \g__draw_xmax_dim + { \dim_max:nn \g__draw_xmax_dim {#1} } + \dim_gset:Nn \g__draw_xmin_dim + { \dim_min:nn \g__draw_xmin_dim {#1} } + \dim_gset:Nn \g__draw_ymax_dim + { \dim_max:nn \g__draw_ymax_dim {#2} } + \dim_gset:Nn \g__draw_ymin_dim + { \dim_min:nn \g__draw_ymin_dim {#2} } + } + } +\cs_new_protected:Npn \__draw_path_reset_limits: + { + \dim_gset:Nn \g__draw_path_xmax_dim { -\c_max_dim } + \dim_gset:Nn \g__draw_path_xmin_dim { \c_max_dim } + \dim_gset:Nn \g__draw_path_ymax_dim { -\c_max_dim } + \dim_gset:Nn \g__draw_path_ymin_dim { \c_max_dim } + } +\cs_new_protected:Npn \__draw_path_update_last:nn #1#2 + { + \dim_gset:Nn \g__draw_path_lastx_dim {#1} + \dim_gset:Nn \g__draw_path_lasty_dim {#2} + } +\dim_new:N \l__draw_corner_xarc_dim +\dim_new:N \l__draw_corner_yarc_dim +\bool_new:N \l__draw_corner_arc_bool +\cs_new_protected:Npn \draw_path_corner_arc:n #1 + { + \__draw_point_process:nn { \__draw_path_corner_arc:nn } {#1} + } +\cs_new_protected:Npn \__draw_path_corner_arc:nn #1#2 + { + \dim_set:Nn \l__draw_corner_xarc_dim {#1} + \dim_set:Nn \l__draw_corner_yarc_dim {#2} + \bool_lazy_and:nnTF + { \dim_compare_p:nNn \l__draw_corner_xarc_dim = { 0pt } } + { \dim_compare_p:nNn \l__draw_corner_yarc_dim = { 0pt } } + { \bool_set_false:N \l__draw_corner_arc_bool } + { \bool_set_true:N \l__draw_corner_arc_bool } + } +\cs_new_protected:Npn \__draw_path_mark_corner: + { + \bool_if:NT \l__draw_corner_arc_bool + { + \__draw_softpath_roundpoint:VV + \l__draw_corner_xarc_dim + \l__draw_corner_yarc_dim + } + } +\cs_new_protected:Npn \draw_path_moveto:n #1 + { + \__draw_point_process:nn + { \__draw_path_moveto:nn } + { \draw_point_transform:n {#1} } + } +\cs_new_protected:Npn \__draw_path_moveto:nn #1#2 + { + \__draw_path_update_limits:nn {#1} {#2} + \__draw_softpath_moveto:nn {#1} {#2} + \__draw_path_update_last:nn {#1} {#2} + } +\cs_new_protected:Npn \draw_path_lineto:n #1 + { + \__draw_point_process:nn + { \__draw_path_lineto:nn } + { \draw_point_transform:n {#1} } + } +\cs_new_protected:Npn \__draw_path_lineto:nn #1#2 + { + \__draw_path_mark_corner: + \__draw_path_update_limits:nn {#1} {#2} + \__draw_softpath_lineto:nn {#1} {#2} + \__draw_path_update_last:nn {#1} {#2} + } +\cs_new_protected:Npn \draw_path_curveto:nnn #1#2#3 + { + \__draw_point_process:nnn + { + \__draw_point_process:nn + { + \__draw_path_mark_corner: + \__draw_path_curveto:nnnnnn + } + { \draw_point_transform:n {#1} } + } + { \draw_point_transform:n {#2} } + { \draw_point_transform:n {#3} } + } +\cs_new_protected:Npn \__draw_path_curveto:nnnnnn #1#2#3#4#5#6 + { + \__draw_path_update_limits:nn {#1} {#2} + \__draw_path_update_limits:nn {#3} {#4} + \__draw_path_update_limits:nn {#5} {#6} + \__draw_softpath_curveto:nnnnnn {#1} {#2} {#3} {#4} {#5} {#6} + \__draw_path_update_last:nn {#5} {#6} + } +\cs_new_protected:Npn \draw_path_close: + { + \__draw_path_mark_corner: + \__draw_softpath_closepath: + } +\cs_new_protected:Npn \draw_path_curveto:nn #1#2 + { + \__draw_point_process:nnn + { \__draw_path_curveto:nnnn } + { \draw_point_transform:n {#1} } + { \draw_point_transform:n {#2} } + } +\cs_new_protected:Npn \__draw_path_curveto:nnnn #1#2#3#4 + { + \fp_set:Nn \l__draw_path_tmpa_fp { \c__draw_path_curveto_b_fp * #1 } + \fp_set:Nn \l__draw_path_tmpb_fp { \c__draw_path_curveto_b_fp * #2 } + \use:x + { + \__draw_path_mark_corner: + \__draw_path_curveto:nnnnnn + { + \fp_to_dim:n + { + \c__draw_path_curveto_a_fp * \g__draw_path_lastx_dim + + \l__draw_path_tmpa_fp + } + } + { + \fp_to_dim:n + { + \c__draw_path_curveto_a_fp * \g__draw_path_lasty_dim + + \l__draw_path_tmpb_fp + } + } + { + \fp_to_dim:n + { \c__draw_path_curveto_a_fp * #3 + \l__draw_path_tmpa_fp } + } + { + \fp_to_dim:n + { \c__draw_path_curveto_a_fp * #4 + \l__draw_path_tmpb_fp } + } + {#3} + {#4} + } + } +\fp_const:Nn \c__draw_path_curveto_a_fp { 1 / 3 } +\fp_const:Nn \c__draw_path_curveto_b_fp { 2 / 3 } +\cs_new_protected:Npn \draw_path_arc:nnn #1#2#3 + { \draw_path_arc:nnnn {#1} {#2} {#3} {#3} } +\cs_new_protected:Npn \draw_path_arc:nnnn #1#2#3#4 + { + \use:x + { + \__draw_path_arc:nnnn + { \fp_eval:n {#1} } + { \fp_eval:n {#2} } + { \fp_to_dim:n {#3} } + { \fp_to_dim:n {#4} } + } + } +\cs_new_protected:Npn \__draw_path_arc:nnnn #1#2#3#4 + { + \fp_compare:nNnTF {#1} > {#2} + { \__draw_path_arc:nnNnn {#1} {#2} - {#3} {#4} } + { \__draw_path_arc:nnNnn {#1} {#2} + {#3} {#4} } + } +\cs_new_protected:Npn \__draw_path_arc:nnNnn #1#2#3#4#5 + { + \fp_set:Nn \l__draw_path_arc_start_fp {#1} + \fp_set:Nn \l__draw_path_arc_delta_fp { abs( #1 - #2 ) } + \fp_while_do:nNnn { \l__draw_path_arc_delta_fp } > { 90 } + { + \fp_compare:nNnTF \l__draw_path_arc_delta_fp > { 115 } + { + \__draw_path_arc_auxi:ffnnNnn + { \fp_to_decimal:N \l__draw_path_arc_start_fp } + { \fp_eval:n { \l__draw_path_arc_start_fp #3 90 } } + { 90 } {#2} + #3 {#4} {#5} + } + { + \__draw_path_arc_auxi:ffnnNnn + { \fp_to_decimal:N \l__draw_path_arc_start_fp } + { \fp_eval:n { \l__draw_path_arc_start_fp #3 60 } } + { 60 } {#2} + #3 {#4} {#5} + } + } + \__draw_path_mark_corner: + \__draw_path_arc_auxi:fnfnNnn + { \fp_to_decimal:N \l__draw_path_arc_start_fp } + {#2} + { \fp_eval:n { abs( \l__draw_path_arc_start_fp - #2 ) } } + {#2} + #3 {#4} {#5} + } +\cs_new_protected:Npn \__draw_path_arc_auxi:nnnnNnn #1#2#3#4#5#6#7 + { + \use:x + { + \__draw_path_arc_auxii:nnnNnnnn + {#1} {#2} {#4} #5 {#6} {#7} + { + \fp_to_dim:n + { + \cs_if_exist_use:cF + { c__draw_path_arc_ #3 _fp } + { 4/3 * tand( 0.25 * #3 ) } + * #6 + } + } + { + \fp_to_dim:n + { + \cs_if_exist_use:cF + { c__draw_path_arc_ #3 _fp } + { 4/3 * tand( 0.25 * #3 ) } + * #7 + } + } + } + } +\cs_generate_variant:Nn \__draw_path_arc_auxi:nnnnNnn { fnf , ff } +\cs_new_protected:Npn \__draw_path_arc_auxii:nnnNnnnn #1#2#3#4#5#6#7#8 + { + \tl_clear:N \l__draw_path_tmp_tl + \__draw_point_process:nn + { \__draw_path_arc_auxiii:nn } + { + \__draw_point_transform_noshift:n + { \draw_point_polar:nnn { #1 #4 90 } {#7} {#8} } + } + \__draw_point_process:nn + { + \__draw_point_process:nn + { \__draw_path_arc_auxiv:nnnn } + { + \draw_point_transform:n + { \draw_point_polar:nnn {#1} {#5} {#6} } + } + } + { + \draw_point_transform:n + { \draw_point_polar:nnn {#2} {#5} {#6} } + } + \__draw_point_process:nn + { \__draw_path_arc_auxv:nn } + { + \__draw_point_transform_noshift:n + { \draw_point_polar:nnn { #2 #4 -90 } {#7} {#8} } + } + \exp_after:wN \__draw_path_curveto:nnnnnn \l__draw_path_tmp_tl + \fp_set:Nn \l__draw_path_arc_delta_fp { abs ( #2 - #3 ) } + \fp_set:Nn \l__draw_path_arc_start_fp {#2} + } +\cs_new_protected:Npn \__draw_path_arc_auxiii:nn #1#2 + { + \__draw_path_arc_aux_add:nn + { \g__draw_path_lastx_dim + #1 } + { \g__draw_path_lasty_dim + #2 } + } +\cs_new_protected:Npn \__draw_path_arc_auxiv:nnnn #1#2#3#4 + { + \__draw_path_arc_aux_add:nn + { \g__draw_path_lastx_dim - #1 + #3 } + { \g__draw_path_lasty_dim - #2 + #4 } + } +\cs_new_protected:Npn \__draw_path_arc_auxv:nn #1#2 + { + \exp_after:wN \__draw_path_arc_auxvi:nn + \l__draw_path_tmp_tl {#1} {#2} + } +\cs_new_protected:Npn \__draw_path_arc_auxvi:nn #1#2#3#4#5#6 + { + \tl_set:Nn \l__draw_path_tmp_tl { {#1} {#2} } + \__draw_path_arc_aux_add:nn + { #5 + #3 } + { #6 + #4 } + \tl_put_right:Nn \l__draw_path_tmp_tl { {#3} {#4} } + } +\cs_new_protected:Npn \__draw_path_arc_aux_add:nn #1#2 + { + \tl_put_right:Nx \l__draw_path_tmp_tl + { { \fp_to_dim:n {#1} } { \fp_to_dim:n {#2} } } + } +\fp_new:N \l__draw_path_arc_delta_fp +\fp_new:N \l__draw_path_arc_start_fp +\fp_const:cn { c__draw_path_arc_90_fp } { 4/3 * (sqrt(2) - 1) } +\fp_const:cn { c__draw_path_arc_60_fp } { 4/3 * tand(15) } +\cs_new_protected:Npn \draw_path_arc_axes:nnnn #1#2#3#4 + { + \draw_transform_triangle:nnn { 0cm , 0cm } {#3} {#4} + \draw_path_arc:nnn {#1} {#2} { 1pt } + } +\cs_new_protected:Npn \draw_path_ellipse:nnn #1#2#3 + { + \__draw_point_process:nnn + { + \__draw_point_process:nn + { \__draw_path_ellipse:nnnnnn } + { \draw_point_transform:n {#1} } + } + { \__draw_point_transform_noshift:n {#2} } + { \__draw_point_transform_noshift:n {#3} } + } +\cs_new_protected:Npn \__draw_path_ellipse:nnnnnn #1#2#3#4#5#6 + { + \use:x + { + \__draw_path_moveto:nn + { \fp_to_dim:n { #1 + #3 } } { \fp_to_dim:n { #2 + #4 } } + \__draw_path_ellipse_arci:nnnnnn {#1} {#2} {#3} {#4} {#5} {#6} + \__draw_path_ellipse_arcii:nnnnnn {#1} {#2} {#3} {#4} {#5} {#6} + \__draw_path_ellipse_arciii:nnnnnn {#1} {#2} {#3} {#4} {#5} {#6} + \__draw_path_ellipse_arciv:nnnnnn {#1} {#2} {#3} {#4} {#5} {#6} + } + \__draw_softpath_closepath: + \__draw_path_moveto:nn {#1} {#2} + } +\cs_new:Npn \__draw_path_ellipse_arci:nnnnnn #1#2#3#4#5#6 + { + \__draw_path_curveto:nnnnnn + { \fp_to_dim:n { #1 + #3 + #5 * \c__draw_path_ellipse_fp } } + { \fp_to_dim:n { #2 + #4 + #6 * \c__draw_path_ellipse_fp } } + { \fp_to_dim:n { #1 + #3 * \c__draw_path_ellipse_fp + #5 } } + { \fp_to_dim:n { #2 + #4 * \c__draw_path_ellipse_fp + #6 } } + { \fp_to_dim:n { #1 + #5 } } + { \fp_to_dim:n { #2 + #6 } } + } +\cs_new:Npn \__draw_path_ellipse_arcii:nnnnnn #1#2#3#4#5#6 + { + \__draw_path_curveto:nnnnnn + { \fp_to_dim:n { #1 - #3 * \c__draw_path_ellipse_fp + #5 } } + { \fp_to_dim:n { #2 - #4 * \c__draw_path_ellipse_fp + #6 } } + { \fp_to_dim:n { #1 - #3 + #5 * \c__draw_path_ellipse_fp } } + { \fp_to_dim:n { #2 - #4 + #6 * \c__draw_path_ellipse_fp } } + { \fp_to_dim:n { #1 - #3 } } + { \fp_to_dim:n { #2 - #4 } } + } +\cs_new:Npn \__draw_path_ellipse_arciii:nnnnnn #1#2#3#4#5#6 + { + \__draw_path_curveto:nnnnnn + { \fp_to_dim:n { #1 - #3 - #5 * \c__draw_path_ellipse_fp } } + { \fp_to_dim:n { #2 - #4 - #6 * \c__draw_path_ellipse_fp } } + { \fp_to_dim:n { #1 - #3 * \c__draw_path_ellipse_fp - #5 } } + { \fp_to_dim:n { #2 - #4 * \c__draw_path_ellipse_fp - #6 } } + { \fp_to_dim:n { #1 - #5 } } + { \fp_to_dim:n { #2 - #6 } } + } +\cs_new:Npn \__draw_path_ellipse_arciv:nnnnnn #1#2#3#4#5#6 + { + \__draw_path_curveto:nnnnnn + { \fp_to_dim:n { #1 + #3 * \c__draw_path_ellipse_fp - #5 } } + { \fp_to_dim:n { #2 + #4 * \c__draw_path_ellipse_fp - #6 } } + { \fp_to_dim:n { #1 + #3 - #5 * \c__draw_path_ellipse_fp } } + { \fp_to_dim:n { #2 + #4 - #6 * \c__draw_path_ellipse_fp } } + { \fp_to_dim:n { #1 + #3 } } + { \fp_to_dim:n { #2 + #4 } } + } +\fp_const:Nn \c__draw_path_ellipse_fp { \fp_use:c { c__draw_path_arc_90_fp } } +\cs_new_protected:Npn \draw_path_circle:nn #1#2 + { \draw_path_ellipse:nnn {#1} { #2 , 0pt } { 0pt , #2 } } +\cs_new_protected:Npn \draw_path_rectangle:nn #1#2 + { + \__draw_point_process:nnn + { + \bool_if:NTF \l__draw_corner_arc_bool + { \__draw_path_rectangle_rounded:nnnn } + { \__draw_path_rectangle:nnnn } + } + { \draw_point_transform:n {#1} } + {#2} + } +\cs_new_protected:Npn \__draw_path_rectangle:nnnn #1#2#3#4 + { + \__draw_path_update_limits:nn {#1} {#2} + \__draw_path_update_limits:nn { #1 + #3 } { #2 + #4 } + \__draw_softpath_rectangle:nnnn {#1} {#2} {#3} {#4} + \__draw_path_update_last:nn {#1} {#2} + } +\cs_new_protected:Npn \__draw_path_rectangle_rounded:nnnn #1#2#3#4 + { + \draw_path_moveto:n { #1 + #3 , #2 + #4 } + \draw_path_lineto:n { #1 , #2 + #4 } + \draw_path_lineto:n { #1 , #2 } + \draw_path_lineto:n { #1 + #3 , #2 } + \draw_path_close: + \draw_path_moveto:n { #1 , #2 } + } +\cs_new_protected:Npn \draw_path_rectangle_corners:nn #1#2 + { + \__draw_point_process:nnn + { \__draw_path_rectangle_corners:nnnnn {#1} } + {#1} {#2} + } +\cs_new_protected:Npn \__draw_path_rectangle_corners:nnnnn #1#2#3#4#5 + { \draw_path_rectangle:nn {#1} { #4 - #2 , #5 - #3 } } +\cs_new_protected:Npn \draw_path_grid:nnnn #1#2#3#4 + { + \__draw_point_process:nnn + { \__draw_path_grid:nnnnnn {#1} {#2} } + {#3} {#4} + } +\cs_new_protected:Npn \__draw_path_grid:nnnnnn #1#2#3#4#5#6 + { + \dim_step_inline:nnnn + {#3} { \dim_compare:nNnF {#3} < {#5} { - } \dim_abs:n {#1} } {#5} + { + \draw_path_moveto:n { ##1 , #4 } + \draw_path_lineto:n { ##1 , #6 } + } + \dim_step_inline:nnnn + {#4} { \dim_compare:nNnF {#4} < {#6} { - } \dim_abs:n {#2} } {#6} + { + \draw_path_moveto:n { #3 , ##1 } + \draw_path_lineto:n { #5 , ##1 } + } + } +\bool_new:N \l__draw_path_use_clip_bool +\bool_new:N \l__draw_path_use_fill_bool +\bool_new:N \l__draw_path_use_stroke_bool +\bool_new:N \l__draw_path_use_bb_bool +\bool_new:N \l__draw_path_use_clear_bool +\cs_new_protected:Npn \draw_path_use:n #1 + { + \tl_if_blank:nF {#1} + { \__draw_path_use:n {#1} } + } +\cs_new_protected:Npn \draw_path_use_clear:n #1 + { + \bool_lazy_or:nnTF + { \tl_if_blank_p:n {#1} } + { \str_if_eq_p:nn {#1} { clear } } + { + \__draw_softpath_clear: + \__draw_path_reset_limits: + } + { \__draw_path_use:n { #1 , clear } } + } +\cs_new_protected:Npn \__draw_path_use:n #1 + { + \bool_set_false:N \l__draw_path_use_clip_bool + \bool_set_false:N \l__draw_path_use_fill_bool + \bool_set_false:N \l__draw_path_use_stroke_bool + \clist_map_inline:nn {#1} + { + \cs_if_exist:cTF { l__draw_path_use_ ##1 _ bool } + { \bool_set_true:c { l__draw_path_use_ ##1 _ bool } } + { + \cs_if_exist_use:cF { __draw_path_use_action_ ##1 : } + { \ERROR } + } + } + \bool_lazy_and:nnT + { \l__draw_update_bb_bool } + { \l__draw_path_use_stroke_bool } + { \__draw_path_use_stroke_bb: } + \bool_if:NTF \l__draw_path_use_clear_bool + { \__draw_softpath_use_clear: } + { \__draw_softpath_use: } + \bool_if:NT \l__draw_path_use_clip_bool + { \driver_draw_clip: } + \bool_lazy_or:nnT + { \l__draw_path_use_fill_bool } + { \l__draw_path_use_stroke_bool } + { + \use:c + { + driver_draw_ + \bool_if:NT \l__draw_path_use_fill_bool { fill } + \bool_if:NT \l__draw_path_use_stroke_bool { stroke } + : + } + } + } +\cs_new_protected:Npn \__draw_path_use_action_draw: + { + \bool_set_true:N \l__draw_path_use_stroke_bool + } +\cs_new_protected:Npn \__draw_path_use_stroke_bb: + { + \__draw_path_use_stroke_bb_aux:NnN x { max } + + \__draw_path_use_stroke_bb_aux:NnN y { max } + + \__draw_path_use_stroke_bb_aux:NnN x { min } - + \__draw_path_use_stroke_bb_aux:NnN y { min } - + } +\cs_new_protected:Npn \__draw_path_use_stroke_bb_aux:NnN #1#2#3 + { + \dim_compare:nNnF { \dim_use:c { g__draw_ #1#2 _dim } } = { #3 -\c_max_dim } + { + \dim_gset:cn { g__draw_ #1#2 _dim } + { + \use:c { dim_ #2 :nn } + { \dim_use:c { g__draw_ #1#2 _dim } } + { + \dim_use:c { g__draw_path_ #1#2 _dim } + #3 0.5 \g__draw_linewidth_dim + } + } + } + } +%% File: l3draw-points.dtx Copyright(C) 2018 The LaTeX3 Project +\cs_new:Npn \__draw_point_process:nn #1#2 + { + \__draw_point_process_auxi:fn + { \__draw_point_to_dim:n {#2} } + {#1} + } +\cs_new:Npn \__draw_point_process_auxi:nn #1#2 + { \__draw_point_process_auxii:nw {#2} #1 \q_stop } +\cs_generate_variant:Nn \__draw_point_process_auxi:nn { f } +\cs_new:Npn \__draw_point_process_auxii:nw #1 #2 , #3 \q_stop + { #1 {#2} {#3} } +\cs_new:Npn \__draw_point_process:nnn #1#2#3 + { + \__draw_point_process_auxiii:ffn + { \__draw_point_to_dim:n {#2} } + { \__draw_point_to_dim:n {#3} } + {#1} + } +\cs_new:Npn \__draw_point_process_auxiii:nnn #1#2#3 + { \__draw_point_process_auxiv:nw {#3} #1 \q_mark #2 \q_stop } +\cs_generate_variant:Nn \__draw_point_process_auxiii:nnn { ff } +\cs_new:Npn \__draw_point_process_auxiv:nw #1 #2 , #3 \q_mark #4 , #5 \q_stop + { #1 {#2} {#3} {#4} {#5} } +\cs_new:Npn \__draw_point_to_dim:n #1 + { \__draw_point_to_dim_aux:f { \fp_eval:n {#1} } } +\cs_new:Npn \__draw_point_to_dim_aux:n #1 + { \__draw_point_to_dim_aux:w #1 } +\cs_generate_variant:Nn \__draw_point_to_dim_aux:n { f } +\cs_new:Npn \__draw_point_to_dim_aux:w ( #1 , ~ #2 ) { #1pt , #2pt } +\cs_new:Npn \draw_point:nn #1#2 + { \__draw_point_to_dim:n { #1 , #2 } } +\cs_new:Npn \draw_point_polar:nn #1#2 + { \draw_point_polar:nnn {#1} {#2} {#2} } +\cs_new:Npn \draw_point_polar:nnn #1#2#3 + { \__draw_draw_polar:fnn { \fp_eval:n {#1} } {#2} {#3} } +\cs_new:Npn \__draw_draw_polar:nnn #1#2#3 + { \__draw_point_to_dim:n { cosd(#1) * (#2) , sind(#1) * (#3) } } +\cs_generate_variant:Nn \__draw_draw_polar:nnn { f } +\cs_new:Npn \draw_point_add:nn #1#2 + { \__draw_point_to_dim:n { (#1) + (#2) } } +\cs_new:Npn \draw_point_diff:nn #1#2 + { \__draw_point_to_dim:n { (#2) - (#1) } } +\cs_new:Npn \draw_point_scale:nn #1#2 + { \__draw_point_to_dim:n { #1 * (#2) } } +\cs_new:Npn \draw_point_unit_vector:n #1 + { \__draw_point_process:nn { \__draw_point_unit_vector:nn } {#1} } +\cs_new:Npn \__draw_point_unit_vector:nn #1#2 + { + \__draw_point_to_dim:n + { ( #1 , #2 ) / (sqrt(#1 * #1 + #2 * #2)) } + } +\cs_new:Npn \draw_point_intersect_lines:nnnn #1#2#3#4 + { + \__draw_point_process:nnn + { + \__draw_point_process:nnn + { \__draw_point_intersect_lines:nnnnnnnn } {#3} {#4} + } + {#1} {#2} + } +\cs_new:Npn \__draw_point_intersect_lines:nnnnnnnn #1#2#3#4#5#6#7#8 + { + \__draw_point_intersect_lines_aux:ffffff + { \fp_eval:n { #1 * #4 - #2 * #3 } } + { \fp_eval:n { #5 * #8 - #6 * #7 } } + { \fp_eval:n { #1 - #3 } } + { \fp_eval:n { #5 - #7 } } + { \fp_eval:n { #2 - #4 } } + { \fp_eval:n { #6 - #8 } } + } +\cs_new:Npn \__draw_point_intersect_lines_aux:nnnnnn #1#2#3#4#5#6 + { + \__draw_point_to_dim:n + { + ( #2 * #3 - #1 * #4 , #2 * #5 - #1 * #6 ) + / ( #4 * #5 - #6 * #3 ) + } + } +\cs_generate_variant:Nn \__draw_point_intersect_lines_aux:nnnnnn { ffffff } +\cs_new:Npn \draw_point_intersect_circles:nnnnn #1#2#3#4#5 + { + \__draw_point_process:nnn + { \__draw_point_intersect_circles_auxi:nnnnnnn {#2} {#4} {#5} } + {#1} {#3} + } +\cs_new:Npn \__draw_point_intersect_circles_auxi:nnnnnnn #1#2#3#4#5#6#7 + { + \__draw_point_intersect_circles_auxii:ffnnnnn + { \fp_eval:n {#1} } { \fp_eval:n {#2} } {#4} {#5} {#6} {#7} {#3} + } +\cs_new:Npn \__draw_point_intersect_circles_auxii:nnnnnnn #1#2#3#4#5#6#7 + { + \__draw_point_intersect_circles_auxiii:ffnnnnn + { \fp_eval:n { #5 - #3 } } + { \fp_eval:n { #6 - #4 } } + {#1} {#2} {#3} {#4} {#7} + } +\cs_generate_variant:Nn \__draw_point_intersect_circles_auxii:nnnnnnn { ff } +\cs_new:Npn \__draw_point_intersect_circles_auxiii:nnnnnnn #1#2#3#4#5#6#7 + { + \__draw_point_intersect_circles_auxiv:fnnnnnnn + { \fp_eval:n { sqrt( #1 * #1 + #2 * #2 ) } } + {#1} {#2} {#3} {#4} {#5} {#6} {#7} + } +\cs_generate_variant:Nn \__draw_point_intersect_circles_auxiii:nnnnnnn { ff } +\cs_new:Npn \__draw_point_intersect_circles_auxiv:nnnnnnnn #1#2#3#4#5#6#7#8 + { + \__draw_point_intersect_circles_auxv:ffnnnnnnn + { \fp_eval:n { 1 / #1 } } + { \fp_eval:n { #4 * #4 } } + {#1} {#2} {#3} {#5} {#6} {#7} {#8} + } +\cs_generate_variant:Nn \__draw_point_intersect_circles_auxiv:nnnnnnnn { f } +\cs_new:Npn \__draw_point_intersect_circles_auxv:nnnnnnnnn #1#2#3#4#5#6#7#8#9 + { + \__draw_point_intersect_circles_auxvi:fnnnnnnn + { \fp_eval:n { 0.5 * #1 * ( #2 + #3 * #3 - #6 * #6 ) } } + {#1} {#2} {#4} {#5} {#7} {#8} {#9} + } +\cs_generate_variant:Nn \__draw_point_intersect_circles_auxv:nnnnnnnnn { ff } +\cs_new:Npn \__draw_point_intersect_circles_auxvi:nnnnnnnn #1#2#3#4#5#6#7#8 + { + \__draw_point_intersect_circles_auxvii:fffnnnn + { \fp_eval:n { #1 * #2 } } + { \int_if_odd:nTF {#8} { 1 } { -1 } } + { \fp_eval:n { sqrt ( #3 - #1 * #1 ) * #2 } } + {#4} {#5} {#6} {#7} + } +\cs_generate_variant:Nn \__draw_point_intersect_circles_auxvi:nnnnnnnn { f } +\cs_new:Npn \__draw_point_intersect_circles_auxvii:nnnnnnn #1#2#3#4#5#6#7 + { + \__draw_point_to_dim:n + { #6 + #4 * #1 + #2 * #3 * #5 , #7 + #5 * #1 + -1 * #2 * #3 * #4 } + } +\cs_generate_variant:Nn \__draw_point_intersect_circles_auxvii:nnnnnnn { fff } +\cs_new:Npn \draw_point_interpolate_line:nnn #1#2#3 + { + \__draw_point_process:nnn + { \__draw_point_interpolate_line_aux:fnnnn { \fp_eval:n {#1} } } + {#2} {#3} + } +\cs_new:Npn \__draw_point_interpolate_line_aux:nnnnn #1#2#3#4#5 + { + \__draw_point_interpolate_line_aux:fnnnnn { \fp_eval:n { 1 - #1 } } + {#1} {#2} {#3} {#4} {#5} + } +\cs_generate_variant:Nn \__draw_point_interpolate_line_aux:nnnnn { f } +\cs_new:Npn \__draw_point_interpolate_line_aux:nnnnnn #1#2#3#4#5#6 + { \__draw_point_to_dim:n { #2 * #3 + #1 * #5 , #2 * #4 + #1 * #6 } } +\cs_generate_variant:Nn \__draw_point_interpolate_line_aux:nnnnnn { f } +\cs_new:Npn \draw_point_interpolate_distance:nnn #1#2#3 + { + \__draw_point_process:nnn + { \__draw_point_interpolate_distance:nnnnn {#1} } + {#2} {#3} + } +\cs_new:Npn \__draw_point_interpolate_distance:nnnnn #1#2#3#4#5 + { + \__draw_point_interpolate_distance_aux:nnnnnnn + { \fp_eval:n { #4 - #2 } } + { \fp_eval:n { #5 - #3 } } + {#2} {#3} {#4} {#5} {#1} + } +\cs_new:Npn \__draw_point_interpolate_distance_aux:nnnnnnn #1#2#3#4#5#6#7 + { + \__draw_point_interpolate_distance_aux:fnnnn + { \fp_eval:n { (#7) / (sqrt ( #1 * #1 + #2 * #2 )) } } + {#3} {#4} {#5} {#6} + } +\cs_generate_variant:Nn \__draw_point_interpolate_distance_aux:nnnnnnn { ff } +\cs_new:Npn \__draw_point_interpolate_distance_aux:nnnnn #1#2#3#4#5 + { \__draw_point_to_dim:n { #2 + #1 * #4 , #3 + #1 * #5 } } +\cs_generate_variant:Nn \__draw_point_interpolate_distance_aux:nnnnn { f } +\cs_new:Npn \draw_point_interpolate_arcaxes:nnnnnn #1#2#3#4#5#6 + { + \__draw_point_process:nnn + { + \__draw_point_process:nn + { \__draw_point_interpolate_arcaxes_auxi:nnnnnnnnn {#1} {#5} {#6} } + {#4} + } + {#2} {#3} + } +\cs_new:Npn \__draw_point_interpolate_arcaxes_auxi:nnnnnnnnn #1#2#3#4#5#6#7#8#9 + { + \__draw_point_interpolate_arcaxes_auxii:fnnnnnnnn + { \fp_eval:n {#1} } {#2} {#3} {#6} {#7} {#8} {#9} {#4} {#5} + } +\cs_new:Npn \__draw_point_interpolate_arcaxes_auxii:nnnnnnnnn #1#2#3#4#5#6#7#8#9 + { + \__draw_point_interpolate_arcaxes_auxiii:fnnnnnn + { \fp_eval:n { #1 * (#3) + ( 1 - #1 ) * (#2) } } + {#4} {#5} {#6} {#7} {#8} {#9} + } +\cs_generate_variant:Nn \__draw_point_interpolate_arcaxes_auxii:nnnnnnnnn { f } +\cs_new:Npn \__draw_point_interpolate_arcaxes_auxiii:nnnnnnn #1#2#3#4#5#6#7 + { + \__draw_point_interpolate_arcaxes_auxiv:ffnnnnnn + { \fp_eval:n { cosd (#1) } } + { \fp_eval:n { sind (#1) } } + {#2} {#3} {#4} {#5} {#6} {#7} + } +\cs_generate_variant:Nn \__draw_point_interpolate_arcaxes_auxiii:nnnnnnn { f } +\cs_new:Npn \__draw_point_interpolate_arcaxes_auxiv:nnnnnnnn #1#2#3#4#5#6#7#8 + { + \__draw_point_to_dim:n + { #3 + #1 * #5 + #2 * #7 , #4 + #1 * #6 + #2 * #8 } + } +\cs_generate_variant:Nn \__draw_point_interpolate_arcaxes_auxiv:nnnnnnnn { ff } +\cs_new:Npn \draw_point_interpolate_curve:nnnnnn #1#2#3#4#5 + { + \__draw_point_process:nnn + { + \__draw_point_process:nnn + { \__draw_point_interpolate_curve_auxi:nnnnnnnnn {#1} } + {#4} {#5} + } + {#2} {#3} + } +\cs_new:Npn \__draw_point_interpolate_curve_auxi:nnnnnnnnn #1#2#3#4#5#6#7#8#9 + { + \__draw_point_interpolate_curve_auxii:fnnnnnnnn + { \fp_eval:n {#1} } + {#6} {#7} {#8} {#9} {#2} {#3} {#4} {#5} + } +\cs_new:Npn \__draw_point_interpolate_curve_auxii:nnnnnnnnn + #1#2#3#4#5#6#7#8#9 + { + \__draw_point_interpolate_curve_auxiii:fnnnnn + { \fp_eval:n { 1 - #1 } } + {#1} + { {#2} {#3} } { {#4} {#5} } { {#6} {#7} } { {#8} {#9} } + } +\cs_generate_variant:Nn \__draw_point_interpolate_curve_auxii:nnnnnnnnn { f } +\cs_new:Npn \__draw_point_interpolate_curve_auxiii:nnnnnn #1#2#3#4#5#6 + { + \__draw_point_interpolate_curve_auxiv:nnnnnn {#1} {#2} #3 #4 + \__draw_point_interpolate_curve_auxiv:nnnnnn {#1} {#2} #4 #5 + \__draw_point_interpolate_curve_auxiv:nnnnnn {#1} {#2} #5 #6 + \prg_do_nothing: + \__draw_point_interpolate_curve_auxvi:n { {#1} {#2} } + } +\cs_generate_variant:Nn \__draw_point_interpolate_curve_auxiii:nnnnnn { f } +\cs_new:Npn \__draw_point_interpolate_curve_auxiv:nnnnnn #1#2#3#4#5#6 + { + \__draw_point_interpolate_curve_auxv:ffw + { \fp_eval:n { #1 * #3 + #2 * #5 } } + { \fp_eval:n { #1 * #4 + #2 * #6 } } + } +\cs_new:Npn \__draw_point_interpolate_curve_auxv:nnw + #1#2#3 \prg_do_nothing: #4#5 + { + #3 + \prg_do_nothing: + #4 { #5 {#1} {#2} } + } +\cs_generate_variant:Nn \__draw_point_interpolate_curve_auxv:nnw { ff } +\cs_new:Npn \__draw_point_interpolate_curve_auxvi:n #1 + { \__draw_point_interpolate_curve_auxvii:nnnnnnnn #1 } +\cs_new:Npn \__draw_point_interpolate_curve_auxvii:nnnnnnnn #1#2#3#4#5#6#7#8 + { + \__draw_point_interpolate_curve_auxviii:ffffnn + { \fp_eval:n { #1 * #5 + #2 * #3 } } + { \fp_eval:n { #1 * #6 + #2 * #4 } } + { \fp_eval:n { #1 * #7 + #2 * #5 } } + { \fp_eval:n { #1 * #8 + #2 * #6 } } + {#1} {#2} + } +\cs_new:Npn \__draw_point_interpolate_curve_auxviii:nnnnnn #1#2#3#4#5#6 + { + \__draw_point_to_dim:n + { #5 * #3 + #6 * #1 , #5 * #4 + #6 * #2 } + } +\cs_generate_variant:Nn \__draw_point_interpolate_curve_auxviii:nnnnnn { ffff } +\dim_new:N \l__draw_xvec_x_dim +\dim_new:N \l__draw_xvec_y_dim +\dim_new:N \l__draw_yvec_x_dim +\dim_new:N \l__draw_yvec_y_dim +\dim_new:N \l__draw_zvec_x_dim +\dim_new:N \l__draw_zvec_y_dim +\cs_new_protected:Npn \draw_xvec:n #1 + { \__draw_vec:nn { x } {#1} } +\cs_new_protected:Npn \draw_yvec:n #1 + { \__draw_vec:nn { y } {#1} } +\cs_new_protected:Npn \draw_zvec:n #1 + { \__draw_vec:nn { z } {#1} } +\cs_new_protected:Npn \__draw_vec:nn #1#2 + { + \__draw_point_process:nn { \__draw_vec:nnn {#1} } {#2} + } +\cs_new_protected:Npn \__draw_vec:nnn #1#2#3 + { + \dim_set:cn { l__draw_ #1 vec_x_dim } {#2} + \dim_set:cn { l__draw_ #1 vec_y_dim } {#3} + } +\draw_xvec:n { 1cm , 0cm } +\draw_yvec:n { 0cm , 1cm } +\draw_zvec:n { -0.385cm , -0.385cm } +\cs_new:Npn \draw_point_vec:nn #1#2 + { \__draw_point_vec:ff { \fp_eval:n {#1} } { \fp_eval:n {#2} } } +\cs_new:Npn \__draw_point_vec:nn #1#2 + { + \__draw_point_to_dim:n + { + #1 * \l__draw_xvec_x_dim + #2 * \l__draw_yvec_x_dim , + #1 * \l__draw_xvec_y_dim + #2 * \l__draw_yvec_y_dim + } + } +\cs_generate_variant:Nn \__draw_point_vec:nn { ff } +\cs_new:Npn \draw_point_vec:nnn #1#2#3 + { + \__draw_point_vec:fff + { \fp_eval:n {#1} } { \fp_eval:n {#2} } { \fp_eval:n {#3} } + } +\cs_new:Npn \__draw_point_vec:nnn #1#2#3 + { + \__draw_point_to_dim:n + { + #1 * \l__draw_xvec_x_dim + + #2 * \l__draw_yvec_x_dim + + #3 * \l__draw_zvec_x_dim + , + #1 * \l__draw_xvec_y_dim + + #2 * \l__draw_yvec_y_dim + + #3 * \l__draw_zvec_y_dim + } + } +\cs_generate_variant:Nn \__draw_point_vec:nnn { fff } +\cs_new:Npn \draw_point_vec_polar:nn #1#2 + { \draw_point_vec_polar:nnn {#1} {#2} {#2} } +\cs_new:Npn \draw_point_vec_polar:nnn #1#2#3 + { \__draw_draw_vec_polar:fnn { \fp_eval:n {#1} } {#2} {#3} } +\cs_new:Npn \__draw_draw_vec_polar:nnn #1#2#3 + { + \__draw_point_to_dim:n + { + cosd(#1) * (#2) * \l__draw_xvec_x_dim , + sind(#1) * (#3) * \l__draw_yvec_y_dim + } + } +\cs_generate_variant:Nn \__draw_draw_vec_polar:nnn { f } +\cs_new:Npn \draw_point_transform:n #1 + { + \__draw_point_process:nn + { \__draw_point_transform:nn } {#1} + } +\cs_new:Npn \__draw_point_transform:nn #1#2 + { + \bool_if:NTF \l__draw_transformcm_active_bool + { + \__draw_point_to_dim:n + { + ( + \l__draw_transformcm_aa_fp * #1 + + \l__draw_transformcm_ba_fp * #2 + + \l__draw_transformcm_xshift_dim + ) + , + ( + \l__draw_transformcm_ab_fp * #1 + + \l__draw_transformcm_bb_fp * #2 + + \l__draw_transformcm_yshift_dim + ) + } + } + { + \__draw_point_to_dim:n + { + (#1, #2) + + ( \l__draw_transformcm_xshift_dim , + \l__draw_transformcm_yshift_dim ) + } + } + } +\cs_new:Npn \__draw_point_transform_noshift:n #1 + { + \__draw_point_process:nn + { \__draw_point_transform_noshift:nn } {#1} + } +\cs_new:Npn \__draw_point_transform_noshift:nn #1#2 + { + \bool_if:NTF \l__draw_transformcm_active_bool + { + \__draw_point_to_dim:n + { + ( + \l__draw_transformcm_aa_fp * #1 + + \l__draw_transformcm_ba_fp * #2 + ) + , + ( + \l__draw_transformcm_ab_fp * #1 + + \l__draw_transformcm_bb_fp * #2 + ) + } + } + { \__draw_point_to_dim:n { (#1, #2) } } + } +%% File: l3draw-scopes.dtx Copyright(C) 2018 The LaTeX3 Project +\dim_new:N \g__draw_xmax_dim +\dim_new:N \g__draw_xmin_dim +\dim_new:N \g__draw_ymax_dim +\dim_new:N \g__draw_ymin_dim +\bool_new:N \l__draw_update_bb_bool +\box_new:N \l__draw_main_box +\cs_new_protected:Npn \draw_begin: + { + \vbox_set:Nw \l__draw_main_box + \driver_draw_begin: + \dim_gset:Nn \g__draw_xmax_dim { -\c_max_dim } + \dim_gset:Nn \g__draw_xmin_dim { \c_max_dim } + \dim_gset:Nn \g__draw_ymax_dim { -\c_max_dim } + \dim_gset:Nn \g__draw_ymin_dim { \c_max_dim } + \bool_set_true:N \l__draw_update_bb_bool + \draw_transform_reset: + \draw_linewidth:n { \l_draw_default_linewidth_dim } + } +\cs_new_protected:Npn \draw_end: + { + \driver_draw_end: + \vbox_set_end: + \hbox_set:Nn \l__draw_main_box + { + \skip_horizontal:n { -\g__draw_xmin_dim } + \box_move_down:nn { \g__draw_ymin_dim } + { \box_use_drop:N \l__draw_main_box } + } + \box_set_ht:Nn \l__draw_main_box + { \g__draw_ymax_dim - \g__draw_ymin_dim } + \box_set_dp:Nn \l__draw_main_box { 0pt } + \box_set_wd:Nn \l__draw_main_box + { \g__draw_xmax_dim - \g__draw_xmin_dim } + \mode_leave_vertical: + \box_use_drop:N \l__draw_main_box + } +%% File: l3draw-softpath.dtx Copyright(C) 2018 The LaTeX3 Project +\tl_new:N \g__draw_softpath_main_tl +\tl_new:N \g__draw_softpath_buffer_a_tl +\tl_new:N \g__draw_softpath_buffer_b_tl +\int_new:N \g__draw_softpath_buffer_a_int +\int_new:N \g__draw_softpath_buffer_b_int +\cs_new_protected:Npn \__draw_softpath_add:n #1 + { + \int_compare:nNnTF \g__draw_softpath_buffer_a_int < { 40 } + { + \int_gincr:N \g__draw_softpath_buffer_a_int + \tl_gput_right:Nn \g__draw_softpath_buffer_a_tl {#1} + } + { + \int_compare:nNnTF \g__draw_softpath_buffer_b_int < { 40 } + { + \int_gincr:N \g__draw_softpath_buffer_b_int + \tl_gset:Nx \g__draw_softpath_buffer_b_tl + { + \exp_not:V \g__draw_softpath_buffer_b_tl + \exp_not:V \g__draw_softpath_buffer_a_tl + \exp_not:n {#1} + } + \int_gzero:N \g__draw_softpath_buffer_a_int + \tl_gclear:N \g__draw_softpath_buffer_a_tl + } + { \__draw_softpath_concat:n {#1} } + } + } +\cs_generate_variant:Nn \__draw_softpath_add:n { x } +\cs_new_protected:Npn \__draw_softpath_concat:n #1 + { + \tl_gset:Nx \g__draw_softpath_main_tl + { + \exp_not:V \g__draw_softpath_main_tl + \exp_not:V \g__draw_softpath_buffer_b_tl + \exp_not:V \g__draw_softpath_buffer_a_tl + \exp_not:n {#1} + } + \__draw_softpath_reset_buffers: + } +\cs_new_protected:Npn \__draw_softpath_reset_buffers: + { + \int_gzero:N \g__draw_softpath_buffer_a_int + \tl_gclear:N \g__draw_softpath_buffer_a_tl + \int_gzero:N \g__draw_softpath_buffer_b_int + \tl_gclear:N \g__draw_softpath_buffer_b_tl + } +\cs_new_protected:Npn \__draw_softpath_get:N #1 + { + \__draw_softpath_concat:n { } + \tl_set_eq:NN #1 \g__draw_softpath_main_tl + } +\cs_new_protected:Npn \__draw_softpath_set_eq:N #1 + { + \tl_gset_eq:NN \g__draw_softpath_main_tl #1 + \__draw_softpath_reset_buffers: + } +\cs_new_protected:Npn \__draw_softpath_use: + { + \g__draw_softpath_main_tl + \g__draw_softpath_buffer_b_tl + \g__draw_softpath_buffer_a_tl + } +\cs_new_protected:Npn \__draw_softpath_clear: + { + \tl_gclear:N \g__draw_softpath_main_tl + \tl_gclear:N \g__draw_softpath_buffer_a_tl + \tl_gclear:N \g__draw_softpath_buffer_b_tl + } +\cs_new_protected:Npn \__draw_softpath_use_clear: + { + \__draw_softpath_use: + \__draw_softpath_clear: + } +\dim_new:N \g__draw_softpath_lastx_dim +\dim_new:N \g__draw_softpath_lasty_dim +\bool_new:N \g__draw_softpath_move_bool +\bool_gset_true:N \g__draw_softpath_move_bool +\cs_new_protected:Npn \__draw_softpath_closepath: + { + \__draw_softpath_add:x + { + \__draw_softpath_close_op:nn + { \dim_use:N \g__draw_softpath_lastx_dim } + { \dim_use:N \g__draw_softpath_lasty_dim } + } + } +\cs_new_protected:Npn \__draw_softpath_curveto:nnnnnn #1#2#3#4#5#6 + { + \__draw_softpath_add:n + { + \__draw_softpath_curveto_opi:nn {#1} {#2} + \__draw_softpath_curveto_opii:nn {#3} {#4} + \__draw_softpath_curveto_opiii:nn {#5} {#6} + } + } +\cs_new_protected:Npn \__draw_softpath_lineto:nn #1#2 + { + \__draw_softpath_add:n + { \__draw_softpath_lineto_op:nn {#1} {#2} } + } +\cs_new_protected:Npn \__draw_softpath_moveto:nn #1#2 + { + \__draw_softpath_add:n + { \__draw_softpath_moveto_op:nn {#1} {#2} } + \bool_if:NT \g__draw_softpath_move_bool + { + \dim_gset:Nn \g__draw_softpath_lastx_dim {#1} + \dim_gset:Nn \g__draw_softpath_lasty_dim {#2} + } + } +\cs_new_protected:Npn \__draw_softpath_rectangle:nnnn #1#2#3#4 + { + \__draw_softpath_add:n + { + \__draw_softpath_rectangle_opi:nn {#1} {#2} + \__draw_softpath_rectangle_opii:nn {#3} {#4} + } + } +\cs_new_protected:Npn \__draw_softpath_roundpoint:nn #1#2 + { + \__draw_softpath_add:n + { \__draw_softpath_roundpoint_op:nn {#1} {#2} } + } +\cs_generate_variant:Nn \__draw_softpath_roundpoint:nn { VV } +\cs_new_protected:Npn \__draw_softpath_close_op:nn #1#2 + { \driver_draw_closepath: } +\cs_new_protected:Npn \__draw_softpath_curveto_opi:nn #1#2 + { \__draw_softpath_curveto_opi:nnNnnNnn {#1} {#2} } +\cs_new_protected:Npn \__draw_softpath_curveto_opi:nnNnnNnn #1#2#3#4#5#6#7#8 + { \driver_draw_curveto:nnnnnn {#1} {#2} {#4} {#5} {#7} {#8} } +\cs_new_protected:Npn \__draw_softpath_curveto_opii:nn #1#2 { } +\cs_new_protected:Npn \__draw_softpath_curveto_opiii:nn #1#2 { } +\cs_new_protected:Npn \__draw_softpath_lineto_op:nn #1#2 + { \driver_draw_lineto:nn {#1} {#2} } +\cs_new_protected:Npn \__draw_softpath_moveto_op:nn #1#2 + { \driver_draw_moveto:nn {#1} {#2} } +\cs_new_protected:Npn \__draw_softpath_roundpoint_op:nn #1#2 { } +\cs_new_protected:Npn \__draw_softpath_rectangle_opi:nn #1#2 + { \__draw_softpath_rectangle_opi:nnNnn {#1} {#2} } +\cs_new_protected:Npn \__draw_softpath_rectangle_opi:nnNnn #1#2#3#4#5 + { \driver_draw_rectangle:nnnn {#1} {#2} {#4} {#5} } + \cs_new_protected:Npn \__draw_softpath_rectangle_opii:nn #1#2 { } +%% File: l3draw-state.dtx Copyright(C) 2018 The LaTeX3 Project +\dim_new:N \g__draw_linewidth_dim +\dim_new:N \g__draw_inner_linewidth_dim +\dim_new:N \l_draw_default_linewidth_dim +\dim_set:Nn \l_draw_default_linewidth_dim { 0.4pt } +\cs_new_protected:Npn \draw_linewidth:n #1 + { + \dim_gset:Nn \g__draw_linewidth_dim { \fp_to_dim:n {#1} } + \driver_draw_linewidth:n \g__draw_linewidth_dim + } +\cs_new_protected:Npn \draw_inner_linewidth:n #1 + { \dim_gset:Nn \g__draw_inner_linewidth_dim { \fp_to_dim:n {#1} } } +\cs_new_protected:Npn \draw_miterlimit:n #1 + { \driver_draw_miterlimit:n { \fp_to_dim:n {#1} } } +\cs_new_protected:Npn \draw_cap_butt: { \driver_draw_cap_butt: } +\cs_new_protected:Npn \draw_cap_rectangle: { \driver_draw_cap_rectangle: } +\cs_new_protected:Npn \draw_cap_round: { \driver_draw_cap_round: } +\cs_new_protected:Npn \draw_evenodd_rule: { \driver_draw_evenodd_rule: } +\cs_new_protected:Npn \draw_nonzero_rule: { \driver_draw_nonzero_rule: } +\cs_new_protected:Npn \draw_join_bevel: { \driver_draw_join_bevel: } +\cs_new_protected:Npn \draw_join_miter: { \driver_draw_join_miter: } +\cs_new_protected:Npn \draw_join_round: { \driver_draw_join_round: } +\tl_new:N \l__draw_color_tmp_tl +\tl_new:N \g__draw_fill_color_tl +\tl_new:N \g__draw_stroke_color_tl +\cs_new_protected:Npn \draw_color:n #1 + { \__draw_color:nn { } {#1} } +\cs_new_protected:Npn \draw_color_fill:n #1 + { \__draw_color:nn { fill } {#1} } +\cs_new_protected:Npn \draw_color_stroke:n #1 + { \__draw_color:nn { stroke } {#1} } +\cs_new_protected:Npn \__draw_color:nn #1#2 + { + \color_parse:nN {#2} \l__draw_color_tmp_tl + \tl_if_blank:nTF {#1} + { + \tl_gset_eq:NN \g__draw_fill_color_tl \l__draw_color_tmp_tl + \tl_gset_eq:NN \g__draw_stroke_color_tl \l__draw_color_tmp_tl + \__draw_color_aux:Vn \l__draw_color_tmp_tl { color } + } + { + \tl_gset_eq:cN { g__draw_ #1 _color_tl } \l__draw_color_tmp_tl + \__draw_color_aux:Vn \l__draw_color_tmp_tl { #1 } + } + } +\cs_new_protected:Npn \__draw_color_aux:nn #1#2 + { \__draw_color:nw {#2} #1 \q_stop } +\cs_generate_variant:Nn \__draw_color_aux:nn { V } +\cs_new_protected:Npn \__draw_color:nw #1#2 ~ #3 \q_stop + { \use:c { __draw_color_ #2 :nw } {#1} #3 \q_stop } +\cs_new_protected:Npn \__draw_color_cmyk:nw #1#2 ~ #3 ~ #4 ~ #5 \q_stop + { \use:c { driver_draw_ #1 _cmyk:nnnn } {#2} {#3} {#4} {#5} } +\cs_new_protected:Npn \__draw_color_gray:nw #1#2 \q_stop + { \use:c { driver_draw_ #1 _gray:n } {#2} } +\cs_new_protected:Npn \__draw_color_rgb:nw #1#2 ~ #3 ~ #4 \q_stop + { \use:c { driver_draw_ #1 _rgb:nnn } {#2} {#3} {#4} } +\cs_new_protected:Npn \__draw_color_spot:nw #1#2 ~ #3 \q_stop + { \use:c { driver_draw_ #1 _spot:nn } {#2} {#3} } +%% File: l3draw-transforms.dtx Copyright(C) 2018 The LaTeX3 Project +\bool_new:N \l__draw_transformcm_active_bool +\fp_new:N \l__draw_transformcm_aa_fp +\fp_new:N \l__draw_transformcm_ab_fp +\fp_new:N \l__draw_transformcm_ba_fp +\fp_new:N \l__draw_transformcm_bb_fp +\dim_new:N \l__draw_transformcm_xshift_dim +\dim_new:N \l__draw_transformcm_yshift_dim +\cs_new_protected:Npn \draw_transform_reset: + { + \fp_set:Nn \l__draw_transformcm_aa_fp { 1} + \fp_zero:N \l__draw_transformcm_ab_fp + \fp_zero:N \l__draw_transformcm_ba_fp + \fp_set:Nn \l__draw_transformcm_bb_fp { 1 } + \dim_zero:N \l__draw_transformcm_xshift_dim + \dim_zero:N \l__draw_transformcm_yshift_dim + } +\draw_transform_reset: +\cs_new_protected:Npn \draw_transform:nnnnn #1#2#3#4#5 + { + \__draw_point_process:nn + { \__draw_transform:nnnnnnn {#1} {#2} {#3} {#4} } + {#5} + } +\cs_new_protected:Npn \__draw_transform:nnnnnnn #1#2#3#4#5#6 + { + \fp_set:Nn \l__draw_transformcm_aa_fp {#1} + \fp_set:Nn \l__draw_transformcm_ab_fp {#2} + \fp_set:Nn \l__draw_transformcm_ba_fp {#3} + \fp_set:Nn \l__draw_transformcm_bb_fp {#4} + \dim_set:Nn \l__draw_transformcm_xshift_dim {#5} + \dim_set:Nn \l__draw_transformcm_yshift_dim {#6} + \bool_lazy_all:nTF + { + { \fp_compare_p:nNn \l__draw_transformcm_aa_fp = \c_one_fp } + { \fp_compare_p:nNn \l__draw_transformcm_ab_fp = \c_zero_fp } + { \fp_compare_p:nNn \l__draw_transformcm_ba_fp = \c_zero_fp } + { \fp_compare_p:nNn \l__draw_transformcm_bb_fp = \c_one_fp } + } + { \bool_set_false:N \l__draw_transformcm_active_bool } + { \bool_set_true:N \l__draw_transformcm_active_bool } + } +\cs_new_protected:Npn \draw_transform_concat:nnnnn #1#2#3#4#5 + { + \__draw_point_process:nn + { \__draw_transform_concat:nnnnnn {#1} {#2} {#3} {#4} } + {#5} + } +\cs_new_protected:Npn \__draw_transform_concat:nnnnnn #1#2#3#4#5#6 + { + \use:x + { + \__draw_transform_concat_aux:nnnnnn + { \fp_eval:n {#1} } + { \fp_eval:n {#2} } + { \fp_eval:n {#3} } + { \fp_eval:n {#4} } + {#5} + {#6} + } + } +\cs_new_protected:Npn \__draw_transform_concat_aux:nnnnnn #1#2#3#4#5#6 + { + \use:x + { + \__draw_transform:nnnnnnn + { #1 * \l__draw_transformcm_aa_fp + #2 * \l__draw_transformcm_ba_fp } + { #1 * \l__draw_transformcm_ab_fp + #2 * \l__draw_transformcm_bb_fp } + { #3 * \l__draw_transformcm_aa_fp + #4 * \l__draw_transformcm_ba_fp } + { #3 * \l__draw_transformcm_ab_fp + #4 * \l__draw_transformcm_bb_fp } + { + \fp_to_dim:n + { + \l__draw_transformcm_xshift_dim + + \l__draw_transformcm_aa_fp * #5 + + \l__draw_transformcm_ba_fp * #6 + } + } + { + \fp_to_dim:n + { + \l__draw_transformcm_yshift_dim + + \l__draw_transformcm_ab_fp * #5 + + \l__draw_transformcm_bb_fp * #6 + } + } + } + } +\cs_new_protected:Npn \draw_transform_invert: + { + \bool_if:NT \l__draw_transformcm_active_bool + { + \__draw_transform_invert:f + { + \fp_eval:n + { + 1 / + ( + \l__draw_transformcm_aa_fp * \l__draw_transformcm_bb_fp + - \l__draw_transformcm_ab_fp * \l__draw_transformcm_ba_fp + ) + } + } + } + \dim_set:Nn \l__draw_transformcm_xshift_dim + { + \fp_to_dim:n + { + -\l__draw_transformcm_xshift_dim * \l__draw_transformcm_aa_fp + -\l__draw_transformcm_yshift_dim * \l__draw_transformcm_ba_fp + } + } + \dim_set:Nn \l__draw_transformcm_yshift_dim + { + \fp_to_dim:n + { + -\l__draw_transformcm_xshift_dim * \l__draw_transformcm_ab_fp + -\l__draw_transformcm_yshift_dim * \l__draw_transformcm_bb_fp + } + } + } +\cs_new_protected:Npn \__draw_transform_invert:n #1 + { + \fp_set:Nn \l__draw_transformcm_aa_fp + { \l__draw_transformcm_bb_fp * #1 } + \fp_set:Nn \l__draw_transformcm_ab_fp + { -\l__draw_transformcm_ab_fp * #1 } + \fp_set:Nn \l__draw_transformcm_ba_fp + { -\l__draw_transformcm_ba_fp * #1 } + \fp_set:Nn \l__draw_transformcm_bb_fp + { \l__draw_transformcm_aa_fp * #1 } + } +\cs_generate_variant:Nn \__draw_transform_invert:n { f } +\cs_new_protected:Npn \draw_transform_triangle:nnn #1#2#3 + { + \__draw_point_process:nnn + { + \__draw_point_process:nn + { \__draw_tranform_triangle:nnnnnn } + {#1} + } + {#2} {#3} + } +\cs_new_protected:Npn \__draw_tranform_triangle:nnnnnn #1#2#3#4#5#6 + { + \use:x + { + \__draw_transform:nnnnnnn + { #3 - #1 } + { #4 - #2 } + { #5 - #1 } + { #6 - #2 } + {#1} + {#2} + } + } +%% +%% +%% End of file `l3draw.sty'. |