| 1 |
%% |
| 2 |
%% This is file `l3draw.sty', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% l3draw.dtx (with options: `package') |
| 8 |
%% l3draw-boxes.dtx (with options: `package') |
| 9 |
%% l3draw-layers.dtx (with options: `package') |
| 10 |
%% l3draw-paths.dtx (with options: `package') |
| 11 |
%% l3draw-points.dtx (with options: `package') |
| 12 |
%% l3draw-scopes.dtx (with options: `package') |
| 13 |
%% l3draw-softpath.dtx (with options: `package') |
| 14 |
%% l3draw-state.dtx (with options: `package') |
| 15 |
%% l3draw-transforms.dtx (with options: `package') |
| 16 |
%% |
| 17 |
%% Copyright (C) 2018-2026 The LaTeX Project |
| 18 |
%% |
| 19 |
%% It may be distributed and/or modified under the conditions of |
| 20 |
%% the LaTeX Project Public License (LPPL), either version 1.3c of |
| 21 |
%% this license or (at your option) any later version. The latest |
| 22 |
%% version of this license is in the file: |
| 23 |
%% |
| 24 |
%% http://www.latex-project.org/lppl.txt |
| 25 |
%% |
| 26 |
%% This file is part of the "l3experimental bundle" (The Work in LPPL) |
| 27 |
%% and all files in that bundle must be distributed together. |
| 28 |
%% |
| 29 |
%% File: l3draw.dtx |
| 30 |
\RequirePackage{expl3} |
| 31 |
\ProvidesExplPackage{l3draw}{2026-05-26}{} |
| 32 |
{L3 Experimental core drawing support} |
| 33 |
\scan_new:N \s__draw_mark |
| 34 |
\scan_new:N \s__draw_stop |
| 35 |
\quark_new:N \q__draw_recursion_tail |
| 36 |
\quark_new:N \q__draw_recursion_stop |
| 37 |
\__kernel_quark_new_test:N \__draw_if_recursion_tail_stop_do:Nn |
| 38 |
%% File: l3draw-boxes.dtx |
| 39 |
\box_new:N \l__draw_tmp_box |
| 40 |
\cs_new_protected:Npn \draw_box_use:N #1 |
| 41 |
{ |
| 42 |
\__draw_box_use:Nnnnnnn #1 |
| 43 |
{ 0pt } { -\box_dp:N #1 } { \box_wd:N #1 } { \box_ht:N #1 } |
| 44 |
} |
| 45 |
\cs_new_protected:Npn \draw_box_use:Nn #1#2 |
| 46 |
{ |
| 47 |
\__draw_box_use:nNnnnn {#2} #1 |
| 48 |
{ 0pt } { -\box_dp:N #1 } { \box_wd:N #1 } { \box_ht:N #1 } |
| 49 |
} |
| 50 |
\cs_new_protected:Npn \__draw_box_use:nNnnnn #1#2#3#4#5#6 |
| 51 |
{ |
| 52 |
\draw_scope_begin: |
| 53 |
\draw_transform_shift:n {#1} |
| 54 |
\__draw_box_use:Nnnnnnn #2 {#3} {#4} {#5} {#6} |
| 55 |
\draw_scope_end: |
| 56 |
} |
| 57 |
\cs_new_protected:Npn \__draw_box_use:Nnnnnnn #1#2#3#4#5 |
| 58 |
{ |
| 59 |
\bool_if:NT \l_draw_bb_update_bool |
| 60 |
{ |
| 61 |
\__draw_point_process:nn |
| 62 |
{ \__draw_path_update_limits:nn } |
| 63 |
{ \draw_point_transform:n { #2 , #3 } } |
| 64 |
\__draw_point_process:nn |
| 65 |
{ \__draw_path_update_limits:nn } |
| 66 |
{ \draw_point_transform:n { #4 , #3 } } |
| 67 |
\__draw_point_process:nn |
| 68 |
{ \__draw_path_update_limits:nn } |
| 69 |
{ \draw_point_transform:n { #4 , #5 } } |
| 70 |
\__draw_point_process:nn |
| 71 |
{ \__draw_path_update_limits:nn } |
| 72 |
{ \draw_point_transform:n { #2 , #5 } } |
| 73 |
} |
| 74 |
\group_begin: |
| 75 |
\hbox_set:Nn \l__draw_tmp_box |
| 76 |
{ |
| 77 |
\use:e |
| 78 |
{ |
| 79 |
\__draw_backend_box_use:Nnnnn #1 |
| 80 |
{ \fp_use:N \l__draw_matrix_a_fp } |
| 81 |
{ \fp_use:N \l__draw_matrix_b_fp } |
| 82 |
{ \fp_use:N \l__draw_matrix_c_fp } |
| 83 |
{ \fp_use:N \l__draw_matrix_d_fp } |
| 84 |
} |
| 85 |
} |
| 86 |
\hbox_set:Nn \l__draw_tmp_box |
| 87 |
{ |
| 88 |
\dim_horizontal:N \l__draw_xshift_dim |
| 89 |
\box_move_up:nn { \l__draw_yshift_dim } |
| 90 |
{ \box_use_drop:N \l__draw_tmp_box } |
| 91 |
} |
| 92 |
\box_set_ht:Nn \l__draw_tmp_box { 0pt } |
| 93 |
\box_set_dp:Nn \l__draw_tmp_box { 0pt } |
| 94 |
\box_set_wd:Nn \l__draw_tmp_box { 0pt } |
| 95 |
\box_use_drop:N \l__draw_tmp_box |
| 96 |
\group_end: |
| 97 |
} |
| 98 |
\cs_new_protected:Npn \draw_coffin_use:Nnn #1#2#3 |
| 99 |
{ |
| 100 |
\__draw_coffin_use:nNnn { \__draw_box_use:Nnnnnnn } |
| 101 |
#1 {#2} {#3} |
| 102 |
} |
| 103 |
\cs_new_protected:Npn \draw_coffin_use:Nnnn #1#2#3#4 |
| 104 |
{ |
| 105 |
\__draw_coffin_use:nNnn { \__draw_box_use:nNnnnn {#4} } |
| 106 |
#1 {#2} {#3} |
| 107 |
} |
| 108 |
\cs_new_protected:Npn \__draw_coffin_use:nNnn #1#2#3#4 |
| 109 |
{ |
| 110 |
\group_begin: |
| 111 |
\hbox_set:Nn \l__draw_tmp_box |
| 112 |
{ \coffin_typeset:Nnnnn #2 {#3} {#4} { 0pt } { 0pt } } |
| 113 |
#1 \l__draw_tmp_box |
| 114 |
{ \box_wd:N \l__draw_tmp_box - \coffin_wd:N #2 } |
| 115 |
{ -\box_dp:N \l__draw_tmp_box } |
| 116 |
{ \box_wd:N \l__draw_tmp_box } |
| 117 |
{ \box_ht:N \l__draw_tmp_box } |
| 118 |
\group_end: |
| 119 |
} |
| 120 |
%% File: l3draw-layers.dtx |
| 121 |
\tl_new:N \l__draw_layer_tl |
| 122 |
\tl_set:Nn \l__draw_layer_tl { main } |
| 123 |
\bool_new:N \l__draw_layer_close_bool |
| 124 |
\clist_new:N \l_draw_layers_clist |
| 125 |
\clist_set:Nn \l_draw_layers_clist { main } |
| 126 |
\clist_new:N \g__draw_layers_clist |
| 127 |
\cs_new_protected:Npn \draw_layer_begin:n #1 |
| 128 |
{ |
| 129 |
\clist_if_in:NnTF \l_draw_layers_clist {#1} |
| 130 |
{ |
| 131 |
\bool_lazy_or:nnF |
| 132 |
{ \str_if_eq_p:nn {#1} { main } } |
| 133 |
{ \box_if_exist_p:c { g__draw_layer_ #1 _box } } |
| 134 |
{ |
| 135 |
\box_new:c { g__draw_layer_ #1 _box } |
| 136 |
\box_new:c { l__draw_layer_ #1 _box } |
| 137 |
} |
| 138 |
\str_if_eq:nnTF {#1} { main } |
| 139 |
{ \msg_error:nnn { draw } { main-layer } } |
| 140 |
{ \__draw_layer_begin:n {#1} } |
| 141 |
} |
| 142 |
{ |
| 143 |
\bool_lazy_any:nF |
| 144 |
{ |
| 145 |
{ \str_if_eq_p:nn {#1} { main } } |
| 146 |
{ \str_if_eq_p:nn {#1} { discard } } |
| 147 |
{ \box_if_exist_p:c { g__draw_layer_ #1 _box } } |
| 148 |
} |
| 149 |
{ \msg_error:nnn { draw } { unknown-layer } {#1} } |
| 150 |
} |
| 151 |
} |
| 152 |
\cs_new_protected:Npn \__draw_layer_begin:n #1 |
| 153 |
{ |
| 154 |
\group_begin: |
| 155 |
\str_if_eq:VnTF \l__draw_layer_tl {#1} |
| 156 |
{ \bool_set_false:N \l__draw_layer_close_bool } |
| 157 |
{ |
| 158 |
\bool_set_true:N \l__draw_layer_close_bool |
| 159 |
\tl_set:Nn \l__draw_layer_tl {#1} |
| 160 |
\box_gset_wd:cn { g__draw_layer_ #1 _box } { 0pt } |
| 161 |
\hbox_gset:cw { g__draw_layer_ #1 _box } |
| 162 |
\box_use_drop:c { g__draw_layer_ #1 _box } |
| 163 |
\group_begin: |
| 164 |
} |
| 165 |
\draw_set_linewidth:n { \l_draw_default_linewidth_dim } |
| 166 |
} |
| 167 |
\cs_new_protected:Npn \draw_layer_end: |
| 168 |
{ |
| 169 |
\bool_if:NT \l__draw_layer_close_bool |
| 170 |
{ |
| 171 |
\group_end: |
| 172 |
\hbox_gset_end: |
| 173 |
} |
| 174 |
\group_end: |
| 175 |
} |
| 176 |
\cs_new_protected:Npn \__draw_layers_insert: |
| 177 |
{ |
| 178 |
\clist_map_inline:Nn \l_draw_layers_clist |
| 179 |
{ |
| 180 |
\str_if_eq:nnTF {##1} { main } |
| 181 |
{ |
| 182 |
\box_set_wd:Nn \l__draw_layer_main_box { 0pt } |
| 183 |
\box_use_drop:N \l__draw_layer_main_box |
| 184 |
} |
| 185 |
{ |
| 186 |
\__draw_backend_scope_begin: |
| 187 |
\box_gset_wd:cn { g__draw_layer_ ##1 _box } { 0pt } |
| 188 |
\box_use_drop:c { g__draw_layer_ ##1 _box } |
| 189 |
\__draw_backend_scope_end: |
| 190 |
} |
| 191 |
} |
| 192 |
} |
| 193 |
\cs_new_protected:Npn \__draw_layers_save: |
| 194 |
{ |
| 195 |
\clist_map_inline:Nn \l_draw_layers_clist |
| 196 |
{ |
| 197 |
\str_if_eq:nnF {##1} { main } |
| 198 |
{ |
| 199 |
\box_set_eq:cc { l__draw_layer_ ##1 _box } |
| 200 |
{ g__draw_layer_ ##1 _box } |
| 201 |
\box_gclear:c { g__draw_layer_ ##1 _box } |
| 202 |
} |
| 203 |
} |
| 204 |
} |
| 205 |
\cs_new_protected:Npn \__draw_layers_restore: |
| 206 |
{ |
| 207 |
\clist_map_inline:Nn \l_draw_layers_clist |
| 208 |
{ |
| 209 |
\str_if_eq:nnF {##1} { main } |
| 210 |
{ |
| 211 |
\box_gset_eq:cc { g__draw_layer_ ##1 _box } |
| 212 |
{ l__draw_layer_ ##1 _box } |
| 213 |
} |
| 214 |
} |
| 215 |
} |
| 216 |
\msg_new:nnnn { draw } { main-layer } |
| 217 |
{ Material~cannot~be~added~to~'main'~layer. } |
| 218 |
{ The~main~layer~may~only~be~accessed~at~the~top~level. } |
| 219 |
\msg_new:nnn { draw } { main-reserved } |
| 220 |
{ The~'main'~layer~is~reserved. } |
| 221 |
\msg_new:nnnn { draw } { unknown-layer } |
| 222 |
{ Layer~'#1'~has~not~been~created. } |
| 223 |
{ You~have~tried~to~use~layer~'#1',~but~it~was~never~set~up. } |
| 224 |
%% File: l3draw-paths.dtx |
| 225 |
\tl_new:N \l__draw_path_tmp_tl |
| 226 |
\fp_new:N \l__draw_path_tmpa_fp |
| 227 |
\fp_new:N \l__draw_path_tmpb_fp |
| 228 |
\dim_new:N \g__draw_path_lastx_dim |
| 229 |
\dim_new:N \g__draw_path_lasty_dim |
| 230 |
\dim_new:N \g__draw_path_xmax_dim |
| 231 |
\dim_new:N \g__draw_path_xmin_dim |
| 232 |
\dim_new:N \g__draw_path_ymax_dim |
| 233 |
\dim_new:N \g__draw_path_ymin_dim |
| 234 |
\cs_new_protected:Npn \__draw_path_update_limits:nn #1#2 |
| 235 |
{ |
| 236 |
\dim_gset:Nn \g__draw_path_xmax_dim |
| 237 |
{ \dim_max:nn \g__draw_path_xmax_dim {#1} } |
| 238 |
\dim_gset:Nn \g__draw_path_xmin_dim |
| 239 |
{ \dim_min:nn \g__draw_path_xmin_dim {#1} } |
| 240 |
\dim_gset:Nn \g__draw_path_ymax_dim |
| 241 |
{ \dim_max:nn \g__draw_path_ymax_dim {#2} } |
| 242 |
\dim_gset:Nn \g__draw_path_ymin_dim |
| 243 |
{ \dim_min:nn \g__draw_path_ymin_dim {#2} } |
| 244 |
\bool_if:NT \l_draw_bb_update_bool |
| 245 |
{ |
| 246 |
\dim_gset:Nn \g_draw_bb_xmax_dim |
| 247 |
{ \dim_max:nn \g_draw_bb_xmax_dim {#1} } |
| 248 |
\dim_gset:Nn \g_draw_bb_xmin_dim |
| 249 |
{ \dim_min:nn \g_draw_bb_xmin_dim {#1} } |
| 250 |
\dim_gset:Nn \g_draw_bb_ymax_dim |
| 251 |
{ \dim_max:nn \g_draw_bb_ymax_dim {#2} } |
| 252 |
\dim_gset:Nn \g_draw_bb_ymin_dim |
| 253 |
{ \dim_min:nn \g_draw_bb_ymin_dim {#2} } |
| 254 |
} |
| 255 |
} |
| 256 |
\cs_new_protected:Npn \__draw_path_reset_limits: |
| 257 |
{ |
| 258 |
\dim_gset:Nn \g__draw_path_xmax_dim { -\c_max_dim } |
| 259 |
\dim_gset:Nn \g__draw_path_xmin_dim { \c_max_dim } |
| 260 |
\dim_gset:Nn \g__draw_path_ymax_dim { -\c_max_dim } |
| 261 |
\dim_gset:Nn \g__draw_path_ymin_dim { \c_max_dim } |
| 262 |
} |
| 263 |
\cs_new_protected:Npn \__draw_path_update_last:nn #1#2 |
| 264 |
{ |
| 265 |
\dim_gset:Nn \g__draw_path_lastx_dim {#1} |
| 266 |
\dim_gset:Nn \g__draw_path_lasty_dim {#2} |
| 267 |
} |
| 268 |
\dim_new:N \l__draw_corner_xarc_dim |
| 269 |
\dim_new:N \l__draw_corner_yarc_dim |
| 270 |
\bool_new:N \l__draw_corner_arc_bool |
| 271 |
\cs_new_protected:Npn \draw_path_corner_arc:nn #1#2 |
| 272 |
{ |
| 273 |
\dim_set:Nn \l__draw_corner_xarc_dim { \fp_to_dim:n {#1} } |
| 274 |
\dim_set:Nn \l__draw_corner_yarc_dim { \fp_to_dim:n {#2} } |
| 275 |
\bool_lazy_and:nnTF |
| 276 |
{ \dim_compare_p:nNn \l__draw_corner_xarc_dim = { 0pt } } |
| 277 |
{ \dim_compare_p:nNn \l__draw_corner_yarc_dim = { 0pt } } |
| 278 |
{ \bool_set_false:N \l__draw_corner_arc_bool } |
| 279 |
{ \bool_set_true:N \l__draw_corner_arc_bool } |
| 280 |
} |
| 281 |
\cs_new_protected:Npn \__draw_path_mark_corner: |
| 282 |
{ |
| 283 |
\bool_if:NT \l__draw_corner_arc_bool |
| 284 |
{ |
| 285 |
\__draw_softpath_roundpoint:VV |
| 286 |
\l__draw_corner_xarc_dim |
| 287 |
\l__draw_corner_yarc_dim |
| 288 |
} |
| 289 |
} |
| 290 |
\cs_new_protected:Npn \draw_path_moveto:n #1 |
| 291 |
{ |
| 292 |
\__draw_point_process:nn |
| 293 |
{ \__draw_path_moveto:nn } |
| 294 |
{ \draw_point_transform:n {#1} } |
| 295 |
} |
| 296 |
\cs_new_protected:Npn \__draw_path_moveto:nn #1#2 |
| 297 |
{ |
| 298 |
\__draw_path_update_limits:nn {#1} {#2} |
| 299 |
\__draw_softpath_moveto:nn {#1} {#2} |
| 300 |
\__draw_path_update_last:nn {#1} {#2} |
| 301 |
} |
| 302 |
\cs_new_protected:Npn \draw_path_lineto:n #1 |
| 303 |
{ |
| 304 |
\__draw_point_process:nn |
| 305 |
{ \__draw_path_lineto:nn } |
| 306 |
{ \draw_point_transform:n {#1} } |
| 307 |
} |
| 308 |
\cs_new_protected:Npn \__draw_path_lineto:nn #1#2 |
| 309 |
{ |
| 310 |
\__draw_path_mark_corner: |
| 311 |
\__draw_path_update_limits:nn {#1} {#2} |
| 312 |
\__draw_softpath_lineto:nn {#1} {#2} |
| 313 |
\__draw_path_update_last:nn {#1} {#2} |
| 314 |
} |
| 315 |
\cs_new_protected:Npn \draw_path_curveto:nnn #1#2#3 |
| 316 |
{ |
| 317 |
\__draw_point_process:nnnn |
| 318 |
{ |
| 319 |
\__draw_path_mark_corner: |
| 320 |
\__draw_path_curveto:nnnnnn |
| 321 |
} |
| 322 |
{ \draw_point_transform:n {#1} } |
| 323 |
{ \draw_point_transform:n {#2} } |
| 324 |
{ \draw_point_transform:n {#3} } |
| 325 |
} |
| 326 |
\cs_new_protected:Npn \__draw_path_curveto:nnnnnn #1#2#3#4#5#6 |
| 327 |
{ |
| 328 |
\__draw_path_update_limits:nn {#1} {#2} |
| 329 |
\__draw_path_update_limits:nn {#3} {#4} |
| 330 |
\__draw_path_update_limits:nn {#5} {#6} |
| 331 |
\__draw_softpath_curveto:nnnnnn {#1} {#2} {#3} {#4} {#5} {#6} |
| 332 |
\__draw_path_update_last:nn {#5} {#6} |
| 333 |
} |
| 334 |
\cs_new_protected:Npn \draw_path_close: |
| 335 |
{ |
| 336 |
\__draw_path_mark_corner: |
| 337 |
\__draw_softpath_closepath: |
| 338 |
} |
| 339 |
\cs_new:Npn \draw_path_lastx: { \dim_use:N \g__draw_path_lastx_dim } |
| 340 |
\cs_new:Npn \draw_path_lasty: { \dim_use:N \g__draw_path_lasty_dim } |
| 341 |
\cs_new_protected:Npn \draw_path_canvas_moveto:n #1 |
| 342 |
{ \__draw_point_process:nn { \__draw_path_moveto:nn } { \draw_point:n {#1} } } |
| 343 |
\cs_new_protected:Npn \draw_path_canvas_lineto:n #1 |
| 344 |
{ \__draw_point_process:nn { \__draw_path_lineto:nn } { \draw_point:n {#1} } } |
| 345 |
\cs_new_protected:Npn \draw_path_canvas_curveto:nnn #1#2#3 |
| 346 |
{ |
| 347 |
\__draw_point_process:nnnn |
| 348 |
{ |
| 349 |
\__draw_path_mark_corner: |
| 350 |
\__draw_path_curveto:nnnnnn |
| 351 |
} |
| 352 |
{ \draw_point:n {#1} } |
| 353 |
{ \draw_point:n {#2} } |
| 354 |
{ \draw_point:n {#3} } |
| 355 |
} |
| 356 |
\cs_new_protected:Npn \draw_path_curveto:nn #1#2 |
| 357 |
{ |
| 358 |
\__draw_point_process:nnn |
| 359 |
{ \__draw_path_curveto:nnnn } |
| 360 |
{ \draw_point_transform:n {#1} } |
| 361 |
{ \draw_point_transform:n {#2} } |
| 362 |
} |
| 363 |
\cs_new_protected:Npn \__draw_path_curveto:nnnn #1#2#3#4 |
| 364 |
{ |
| 365 |
\fp_set:Nn \l__draw_path_tmpa_fp { \c__draw_path_curveto_b_fp * #1 } |
| 366 |
\fp_set:Nn \l__draw_path_tmpb_fp { \c__draw_path_curveto_b_fp * #2 } |
| 367 |
\use:e |
| 368 |
{ |
| 369 |
\__draw_path_mark_corner: |
| 370 |
\__draw_path_curveto:nnnnnn |
| 371 |
{ |
| 372 |
\fp_to_dim:n |
| 373 |
{ |
| 374 |
\c__draw_path_curveto_a_fp * \g__draw_path_lastx_dim |
| 375 |
+ \l__draw_path_tmpa_fp |
| 376 |
} |
| 377 |
} |
| 378 |
{ |
| 379 |
\fp_to_dim:n |
| 380 |
{ |
| 381 |
\c__draw_path_curveto_a_fp * \g__draw_path_lasty_dim |
| 382 |
+ \l__draw_path_tmpb_fp |
| 383 |
} |
| 384 |
} |
| 385 |
{ |
| 386 |
\fp_to_dim:n |
| 387 |
{ \c__draw_path_curveto_a_fp * #3 + \l__draw_path_tmpa_fp } |
| 388 |
} |
| 389 |
{ |
| 390 |
\fp_to_dim:n |
| 391 |
{ \c__draw_path_curveto_a_fp * #4 + \l__draw_path_tmpb_fp } |
| 392 |
} |
| 393 |
{#3} |
| 394 |
{#4} |
| 395 |
} |
| 396 |
} |
| 397 |
\fp_const:Nn \c__draw_path_curveto_a_fp { 1 / 3 } |
| 398 |
\fp_const:Nn \c__draw_path_curveto_b_fp { 2 / 3 } |
| 399 |
\cs_new_protected:Npn \draw_path_arc:nnn #1#2#3 |
| 400 |
{ \draw_path_arc:nnnn {#1} {#1} {#2} {#3} } |
| 401 |
\cs_new_protected:Npn \draw_path_arc:nnnn #1#2#3#4 |
| 402 |
{ |
| 403 |
\use:e |
| 404 |
{ |
| 405 |
\__draw_path_arc:nnnn |
| 406 |
{ \fp_eval:n {#3} } |
| 407 |
{ \fp_eval:n {#4} } |
| 408 |
{ \fp_to_dim:n {#1} } |
| 409 |
{ \fp_to_dim:n {#2} } |
| 410 |
} |
| 411 |
} |
| 412 |
\cs_new_protected:Npn \__draw_path_arc:nnnn #1#2#3#4 |
| 413 |
{ |
| 414 |
\fp_compare:nNnTF {#1} > {#2} |
| 415 |
{ \__draw_path_arc:nnNnn {#1} {#2} - {#3} {#4} } |
| 416 |
{ \__draw_path_arc:nnNnn {#1} {#2} + {#3} {#4} } |
| 417 |
} |
| 418 |
\cs_new_protected:Npn \__draw_path_arc:nnNnn #1#2#3#4#5 |
| 419 |
{ |
| 420 |
\fp_set:Nn \l__draw_path_arc_start_fp {#1} |
| 421 |
\fp_set:Nn \l__draw_path_arc_delta_fp { abs( #1 - #2 ) } |
| 422 |
\fp_while_do:nNnn { \l__draw_path_arc_delta_fp } > { 90 } |
| 423 |
{ |
| 424 |
\fp_compare:nNnTF \l__draw_path_arc_delta_fp > { 115 } |
| 425 |
{ |
| 426 |
\__draw_path_arc_auxi:eennNnn |
| 427 |
{ \fp_to_decimal:N \l__draw_path_arc_start_fp } |
| 428 |
{ \fp_eval:n { \l__draw_path_arc_start_fp #3 90 } } |
| 429 |
{ 90 } {#2} |
| 430 |
#3 {#4} {#5} |
| 431 |
} |
| 432 |
{ |
| 433 |
\__draw_path_arc_auxi:eennNnn |
| 434 |
{ \fp_to_decimal:N \l__draw_path_arc_start_fp } |
| 435 |
{ \fp_eval:n { \l__draw_path_arc_start_fp #3 60 } } |
| 436 |
{ 60 } {#2} |
| 437 |
#3 {#4} {#5} |
| 438 |
} |
| 439 |
} |
| 440 |
\__draw_path_mark_corner: |
| 441 |
\__draw_path_arc_auxi:enenNnn |
| 442 |
{ \fp_to_decimal:N \l__draw_path_arc_start_fp } |
| 443 |
{#2} |
| 444 |
{ \fp_eval:n { abs( \l__draw_path_arc_start_fp - #2 ) } } |
| 445 |
{#2} |
| 446 |
#3 {#4} {#5} |
| 447 |
} |
| 448 |
\cs_new_protected:Npn \__draw_path_arc_auxi:nnnnNnn #1#2#3#4#5#6#7 |
| 449 |
{ |
| 450 |
\use:e |
| 451 |
{ |
| 452 |
\__draw_path_arc_auxii:nnnNnnnn |
| 453 |
{#1} {#2} {#4} #5 {#6} {#7} |
| 454 |
{ |
| 455 |
\fp_to_dim:n |
| 456 |
{ |
| 457 |
\cs_if_exist_use:cF |
| 458 |
{ c__draw_path_arc_ #3 _fp } |
| 459 |
{ 4/3 * tand( 0.25 * #3 ) } |
| 460 |
* #6 |
| 461 |
} |
| 462 |
} |
| 463 |
{ |
| 464 |
\fp_to_dim:n |
| 465 |
{ |
| 466 |
\cs_if_exist_use:cF |
| 467 |
{ c__draw_path_arc_ #3 _fp } |
| 468 |
{ 4/3 * tand( 0.25 * #3 ) } |
| 469 |
* #7 |
| 470 |
} |
| 471 |
} |
| 472 |
} |
| 473 |
} |
| 474 |
\cs_generate_variant:Nn \__draw_path_arc_auxi:nnnnNnn { ene , ee } |
| 475 |
\cs_new_protected:Npn \__draw_path_arc_auxii:nnnNnnnn #1#2#3#4#5#6#7#8 |
| 476 |
{ |
| 477 |
\tl_clear:N \l__draw_path_tmp_tl |
| 478 |
\__draw_point_process:nn |
| 479 |
{ \__draw_path_arc_auxiii:nn } |
| 480 |
{ |
| 481 |
\__draw_point_transform_noshift:n |
| 482 |
{ \draw_point_polar:nnn {#7} {#8} { #1 #4 90 } } |
| 483 |
} |
| 484 |
\__draw_point_process:nnn |
| 485 |
{ \__draw_path_arc_auxiv:nnnn } |
| 486 |
{ |
| 487 |
\draw_point_transform:n |
| 488 |
{ \draw_point_polar:nnn {#5} {#6} {#1} } |
| 489 |
} |
| 490 |
{ |
| 491 |
\draw_point_transform:n |
| 492 |
{ \draw_point_polar:nnn {#5} {#6} {#2} } |
| 493 |
} |
| 494 |
\__draw_point_process:nn |
| 495 |
{ \__draw_path_arc_auxv:nn } |
| 496 |
{ |
| 497 |
\__draw_point_transform_noshift:n |
| 498 |
{ \draw_point_polar:nnn {#7} {#8} { #2 #4 -90 } } |
| 499 |
} |
| 500 |
\exp_after:wN \__draw_path_curveto:nnnnnn \l__draw_path_tmp_tl |
| 501 |
\fp_set:Nn \l__draw_path_arc_delta_fp { abs ( #2 - #3 ) } |
| 502 |
\fp_set:Nn \l__draw_path_arc_start_fp {#2} |
| 503 |
} |
| 504 |
\cs_new_protected:Npn \__draw_path_arc_auxiii:nn #1#2 |
| 505 |
{ |
| 506 |
\__draw_path_arc_aux_add:nn |
| 507 |
{ \g__draw_path_lastx_dim + #1 } |
| 508 |
{ \g__draw_path_lasty_dim + #2 } |
| 509 |
} |
| 510 |
\cs_new_protected:Npn \__draw_path_arc_auxiv:nnnn #1#2#3#4 |
| 511 |
{ |
| 512 |
\__draw_path_arc_aux_add:nn |
| 513 |
{ \g__draw_path_lastx_dim - #1 + #3 } |
| 514 |
{ \g__draw_path_lasty_dim - #2 + #4 } |
| 515 |
} |
| 516 |
\cs_new_protected:Npn \__draw_path_arc_auxv:nn #1#2 |
| 517 |
{ |
| 518 |
\exp_after:wN \__draw_path_arc_auxvi:nn |
| 519 |
\l__draw_path_tmp_tl {#1} {#2} |
| 520 |
} |
| 521 |
\cs_new_protected:Npn \__draw_path_arc_auxvi:nn #1#2#3#4#5#6 |
| 522 |
{ |
| 523 |
\tl_set:Nn \l__draw_path_tmp_tl { {#1} {#2} } |
| 524 |
\__draw_path_arc_aux_add:nn |
| 525 |
{ #5 + #3 } |
| 526 |
{ #6 + #4 } |
| 527 |
\tl_put_right:Nn \l__draw_path_tmp_tl { {#3} {#4} } |
| 528 |
} |
| 529 |
\cs_new_protected:Npn \__draw_path_arc_aux_add:nn #1#2 |
| 530 |
{ |
| 531 |
\tl_put_right:Ne \l__draw_path_tmp_tl |
| 532 |
{ { \fp_to_dim:n {#1} } { \fp_to_dim:n {#2} } } |
| 533 |
} |
| 534 |
\fp_new:N \l__draw_path_arc_delta_fp |
| 535 |
\fp_new:N \l__draw_path_arc_start_fp |
| 536 |
\fp_const:cn { c__draw_path_arc_90_fp } { 4/3 * (sqrt(2) - 1) } |
| 537 |
\fp_const:cn { c__draw_path_arc_60_fp } { 4/3 * tand(15) } |
| 538 |
\cs_new_protected:Npn \draw_path_arc_axes:nnnn #1#2#3#4 |
| 539 |
{ |
| 540 |
\group_begin: |
| 541 |
\draw_transform_triangle:nnn { 0cm , 0cm } {#1} {#2} |
| 542 |
\draw_path_arc:nnn { 1pt } {#3} {#4} |
| 543 |
\group_end: |
| 544 |
} |
| 545 |
\cs_new_protected:Npn \draw_path_ellipse:nnn #1#2#3 |
| 546 |
{ |
| 547 |
\__draw_point_process:nnnn |
| 548 |
{ \__draw_path_ellipse:nnnnnn } |
| 549 |
{ \draw_point_transform:n {#1} } |
| 550 |
{ \__draw_point_transform_noshift:n {#2} } |
| 551 |
{ \__draw_point_transform_noshift:n {#3} } |
| 552 |
} |
| 553 |
\cs_new_protected:Npn \__draw_path_ellipse:nnnnnn #1#2#3#4#5#6 |
| 554 |
{ |
| 555 |
\use:e |
| 556 |
{ |
| 557 |
\__draw_path_moveto:nn |
| 558 |
{ \fp_to_dim:n { #1 + #3 } } { \fp_to_dim:n { #2 + #4 } } |
| 559 |
\__draw_path_ellipse_arci:nnnnnn {#1} {#2} {#3} {#4} {#5} {#6} |
| 560 |
\__draw_path_ellipse_arcii:nnnnnn {#1} {#2} {#3} {#4} {#5} {#6} |
| 561 |
\__draw_path_ellipse_arciii:nnnnnn {#1} {#2} {#3} {#4} {#5} {#6} |
| 562 |
\__draw_path_ellipse_arciv:nnnnnn {#1} {#2} {#3} {#4} {#5} {#6} |
| 563 |
} |
| 564 |
\__draw_softpath_closepath: |
| 565 |
\__draw_path_moveto:nn {#1} {#2} |
| 566 |
} |
| 567 |
\cs_new:Npn \__draw_path_ellipse_arci:nnnnnn #1#2#3#4#5#6 |
| 568 |
{ |
| 569 |
\__draw_path_curveto:nnnnnn |
| 570 |
{ \fp_to_dim:n { #1 + #3 + #5 * \c__draw_path_ellipse_fp } } |
| 571 |
{ \fp_to_dim:n { #2 + #4 + #6 * \c__draw_path_ellipse_fp } } |
| 572 |
{ \fp_to_dim:n { #1 + #3 * \c__draw_path_ellipse_fp + #5 } } |
| 573 |
{ \fp_to_dim:n { #2 + #4 * \c__draw_path_ellipse_fp + #6 } } |
| 574 |
{ \fp_to_dim:n { #1 + #5 } } |
| 575 |
{ \fp_to_dim:n { #2 + #6 } } |
| 576 |
} |
| 577 |
\cs_new:Npn \__draw_path_ellipse_arcii:nnnnnn #1#2#3#4#5#6 |
| 578 |
{ |
| 579 |
\__draw_path_curveto:nnnnnn |
| 580 |
{ \fp_to_dim:n { #1 - #3 * \c__draw_path_ellipse_fp + #5 } } |
| 581 |
{ \fp_to_dim:n { #2 - #4 * \c__draw_path_ellipse_fp + #6 } } |
| 582 |
{ \fp_to_dim:n { #1 - #3 + #5 * \c__draw_path_ellipse_fp } } |
| 583 |
{ \fp_to_dim:n { #2 - #4 + #6 * \c__draw_path_ellipse_fp } } |
| 584 |
{ \fp_to_dim:n { #1 - #3 } } |
| 585 |
{ \fp_to_dim:n { #2 - #4 } } |
| 586 |
} |
| 587 |
\cs_new:Npn \__draw_path_ellipse_arciii:nnnnnn #1#2#3#4#5#6 |
| 588 |
{ |
| 589 |
\__draw_path_curveto:nnnnnn |
| 590 |
{ \fp_to_dim:n { #1 - #3 - #5 * \c__draw_path_ellipse_fp } } |
| 591 |
{ \fp_to_dim:n { #2 - #4 - #6 * \c__draw_path_ellipse_fp } } |
| 592 |
{ \fp_to_dim:n { #1 - #3 * \c__draw_path_ellipse_fp - #5 } } |
| 593 |
{ \fp_to_dim:n { #2 - #4 * \c__draw_path_ellipse_fp - #6 } } |
| 594 |
{ \fp_to_dim:n { #1 - #5 } } |
| 595 |
{ \fp_to_dim:n { #2 - #6 } } |
| 596 |
} |
| 597 |
\cs_new:Npn \__draw_path_ellipse_arciv:nnnnnn #1#2#3#4#5#6 |
| 598 |
{ |
| 599 |
\__draw_path_curveto:nnnnnn |
| 600 |
{ \fp_to_dim:n { #1 + #3 * \c__draw_path_ellipse_fp - #5 } } |
| 601 |
{ \fp_to_dim:n { #2 + #4 * \c__draw_path_ellipse_fp - #6 } } |
| 602 |
{ \fp_to_dim:n { #1 + #3 - #5 * \c__draw_path_ellipse_fp } } |
| 603 |
{ \fp_to_dim:n { #2 + #4 - #6 * \c__draw_path_ellipse_fp } } |
| 604 |
{ \fp_to_dim:n { #1 + #3 } } |
| 605 |
{ \fp_to_dim:n { #2 + #4 } } |
| 606 |
} |
| 607 |
\fp_const:Nn \c__draw_path_ellipse_fp { \fp_use:c { c__draw_path_arc_90_fp } } |
| 608 |
\cs_new_protected:Npn \draw_path_circle:nn #1#2 |
| 609 |
{ \draw_path_ellipse:nnn {#1} { #2 , 0pt } { 0pt , #2 } } |
| 610 |
\cs_new_protected:Npn \draw_path_rectangle:nn #1#2 |
| 611 |
{ |
| 612 |
\bool_lazy_or:nnTF |
| 613 |
{ \l__draw_corner_arc_bool } |
| 614 |
{ \l__draw_matrix_active_bool } |
| 615 |
{ |
| 616 |
\__draw_point_process:nnn \__draw_path_rectangle_rounded:nnnn |
| 617 |
{ \draw_point:n {#1} } |
| 618 |
{ \draw_point:n {#2} } |
| 619 |
} |
| 620 |
{ |
| 621 |
\__draw_point_process:nnn \__draw_path_rectangle:nnnn |
| 622 |
{ \draw_point:n { (#1) + ( \l__draw_xshift_dim , \l__draw_yshift_dim ) } } |
| 623 |
{ \draw_point:n {#2} } |
| 624 |
} |
| 625 |
} |
| 626 |
\cs_new_protected:Npn \__draw_path_rectangle:nnnn #1#2#3#4 |
| 627 |
{ |
| 628 |
\__draw_path_update_limits:nn {#1} {#2} |
| 629 |
\__draw_path_update_limits:nn { #1 + #3 } { #2 + #4 } |
| 630 |
\__draw_softpath_rectangle:nnnn {#1} {#2} {#3} {#4} |
| 631 |
\__draw_path_update_last:nn {#1} {#2} |
| 632 |
} |
| 633 |
\cs_new_protected:Npn \__draw_path_rectangle_rounded:nnnn #1#2#3#4 |
| 634 |
{ |
| 635 |
\draw_path_moveto:n { #1 + #3 , #2 + #4 } |
| 636 |
\draw_path_lineto:n { #1 , #2 + #4 } |
| 637 |
\draw_path_lineto:n { #1 , #2 } |
| 638 |
\draw_path_lineto:n { #1 + #3 , #2 } |
| 639 |
\draw_path_close: |
| 640 |
\draw_path_moveto:n { #1 , #2 } |
| 641 |
} |
| 642 |
\cs_new_protected:Npn \draw_path_rectangle_corners:nn #1#2 |
| 643 |
{ |
| 644 |
\__draw_point_process:nnn |
| 645 |
{ \__draw_path_rectangle_corners:nnnnn {#1} } |
| 646 |
{ \draw_point:n {#1} } |
| 647 |
{ \draw_point:n {#2} } |
| 648 |
} |
| 649 |
\cs_new_protected:Npn \__draw_path_rectangle_corners:nnnnn #1#2#3#4#5 |
| 650 |
{ \draw_path_rectangle:nn {#1} { #4 - #2 , #5 - #3 } } |
| 651 |
\cs_new_protected:Npn \draw_path_grid:nnnn #1#2#3#4 |
| 652 |
{ |
| 653 |
\__draw_point_process:nnn |
| 654 |
{ |
| 655 |
\__draw_path_grid_auxi:eennnn |
| 656 |
{ \dim_abs:n {#1} } |
| 657 |
{ \dim_abs:n {#2} } |
| 658 |
} |
| 659 |
{ \draw_point:n {#3} } |
| 660 |
{ \draw_point:n {#4} } |
| 661 |
} |
| 662 |
\cs_new_protected:Npn \__draw_path_grid_auxi:nnnnnn #1#2#3#4#5#6 |
| 663 |
{ |
| 664 |
\dim_compare:nNnTF {#3} > {#5} |
| 665 |
{ \__draw_path_grid_auxii:nnnnnn {#1} {#2} {#5} {#4} {#3} {#6} } |
| 666 |
{ \__draw_path_grid_auxii:nnnnnn {#1} {#2} {#3} {#4} {#5} {#6} } |
| 667 |
} |
| 668 |
\cs_generate_variant:Nn \__draw_path_grid_auxi:nnnnnn { ee } |
| 669 |
\cs_new_protected:Npn \__draw_path_grid_auxii:nnnnnn #1#2#3#4#5#6 |
| 670 |
{ |
| 671 |
\dim_compare:nNnTF {#4} > {#6} |
| 672 |
{ \__draw_path_grid_auxiii:nnnnnn {#1} {#2} {#3} {#6} {#5} {#4} } |
| 673 |
{ \__draw_path_grid_auxiii:nnnnnn {#1} {#2} {#3} {#4} {#5} {#6} } |
| 674 |
} |
| 675 |
\cs_new_protected:Npn \__draw_path_grid_auxiii:nnnnnn #1#2#3#4#5#6 |
| 676 |
{ |
| 677 |
\__draw_path_grid_auxiv:eennnnnn |
| 678 |
{ \fp_to_dim:n { #1 * ceil(#3/(#1)) } } |
| 679 |
{ \fp_to_dim:n { #2 * ceil(#4/(#2)) } } |
| 680 |
{#1} {#2} {#3} {#4} {#5} {#6} |
| 681 |
} |
| 682 |
\cs_new_protected:Npn \__draw_path_grid_auxiv:nnnnnnnn #1#2#3#4#5#6#7#8 |
| 683 |
{ |
| 684 |
\dim_step_inline:nnnn |
| 685 |
{#1} |
| 686 |
{#3} |
| 687 |
{#7} |
| 688 |
{ |
| 689 |
\draw_path_moveto:n { ##1 , #6 } |
| 690 |
\draw_path_lineto:n { ##1 , #8 } |
| 691 |
} |
| 692 |
\dim_step_inline:nnnn |
| 693 |
{#2} |
| 694 |
{#4} |
| 695 |
{#8} |
| 696 |
{ |
| 697 |
\draw_path_moveto:n { #5 , ##1 } |
| 698 |
\draw_path_lineto:n { #7 , ##1 } |
| 699 |
} |
| 700 |
} |
| 701 |
\cs_generate_variant:Nn \__draw_path_grid_auxiv:nnnnnnnn { ee } |
| 702 |
\bool_new:N \l__draw_path_use_clip_bool |
| 703 |
\bool_new:N \l__draw_path_use_fill_bool |
| 704 |
\bool_new:N \l__draw_path_use_stroke_bool |
| 705 |
\bool_new:N \l__draw_path_use_clear_bool |
| 706 |
\cs_new_protected:Npn \draw_path_use:n #1 |
| 707 |
{ |
| 708 |
\tl_if_blank:nF {#1} |
| 709 |
{ \__draw_path_use:n {#1} } |
| 710 |
} |
| 711 |
\cs_new_protected:Npn \draw_path_use_clear:n #1 |
| 712 |
{ |
| 713 |
\bool_lazy_or:nnTF |
| 714 |
{ \tl_if_blank_p:n {#1} } |
| 715 |
{ \str_if_eq_p:nn {#1} { clear } } |
| 716 |
{ |
| 717 |
\__draw_softpath_clear: |
| 718 |
\__draw_path_reset_limits: |
| 719 |
} |
| 720 |
{ \__draw_path_use:n { #1 , clear } } |
| 721 |
} |
| 722 |
\cs_new_protected:Npn \draw_path_replace_bb: |
| 723 |
{ |
| 724 |
\__draw_path_replace_bb:NnN x { max } + |
| 725 |
\__draw_path_replace_bb:NnN y { max } + |
| 726 |
\__draw_path_replace_bb:NnN x { min } - |
| 727 |
\__draw_path_replace_bb:NnN y { min } - |
| 728 |
\__draw_softpath_clear: |
| 729 |
\__draw_path_reset_limits: |
| 730 |
} |
| 731 |
\cs_new_protected:Npn \__draw_path_replace_bb:NnN #1#2#3 |
| 732 |
{ |
| 733 |
\dim_gset:cn { g_draw_bb_ #1#2 _dim } |
| 734 |
{ |
| 735 |
\dim_use:c { g__draw_path_ #1#2 _dim } |
| 736 |
#3 0.5 \g__draw_linewidth_dim |
| 737 |
} |
| 738 |
} |
| 739 |
\cs_new_protected:Npn \__draw_path_use:n #1 |
| 740 |
{ |
| 741 |
\bool_set_false:N \l__draw_path_use_clip_bool |
| 742 |
\bool_set_false:N \l__draw_path_use_fill_bool |
| 743 |
\bool_set_false:N \l__draw_path_use_stroke_bool |
| 744 |
\clist_map_inline:nn {#1} |
| 745 |
{ |
| 746 |
\cs_if_exist:cTF { l__draw_path_use_ ##1 _ bool } |
| 747 |
{ \bool_set_true:c { l__draw_path_use_ ##1 _ bool } } |
| 748 |
{ |
| 749 |
\cs_if_exist_use:cF { __draw_path_use_action_ ##1 : } |
| 750 |
{ \msg_error:nnn { draw } { invalid-path-action } {##1} } |
| 751 |
} |
| 752 |
} |
| 753 |
\__draw_softpath_round_corners: |
| 754 |
\bool_lazy_and:nnT |
| 755 |
{ \l_draw_bb_update_bool } |
| 756 |
{ \l__draw_path_use_stroke_bool } |
| 757 |
{ \__draw_path_use_stroke_bb: } |
| 758 |
\__draw_softpath_use: |
| 759 |
\bool_if:NT \l__draw_path_use_clip_bool |
| 760 |
{ |
| 761 |
\__draw_backend_clip: |
| 762 |
\bool_set_false:N \l_draw_bb_update_bool |
| 763 |
\bool_lazy_or:nnF |
| 764 |
{ \l__draw_path_use_fill_bool } |
| 765 |
{ \l__draw_path_use_stroke_bool } |
| 766 |
{ \__draw_backend_discardpath: } |
| 767 |
} |
| 768 |
\bool_lazy_or:nnT |
| 769 |
{ \l__draw_path_use_fill_bool } |
| 770 |
{ \l__draw_path_use_stroke_bool } |
| 771 |
{ |
| 772 |
\use:c |
| 773 |
{ |
| 774 |
__draw_backend_ |
| 775 |
\bool_if:NT \l__draw_path_use_fill_bool { fill } |
| 776 |
\bool_if:NT \l__draw_path_use_stroke_bool { stroke } |
| 777 |
: |
| 778 |
} |
| 779 |
} |
| 780 |
\bool_if:NT \l__draw_path_use_clear_bool |
| 781 |
{ |
| 782 |
\__draw_softpath_clear: |
| 783 |
\__draw_path_reset_limits: |
| 784 |
} |
| 785 |
} |
| 786 |
\cs_new_protected:Npn \__draw_path_use_action_draw: |
| 787 |
{ |
| 788 |
\bool_set_true:N \l__draw_path_use_stroke_bool |
| 789 |
} |
| 790 |
\cs_new_protected:Npn \__draw_path_use_action_fillstroke: |
| 791 |
{ |
| 792 |
\bool_set_true:N \l__draw_path_use_fill_bool |
| 793 |
\bool_set_true:N \l__draw_path_use_stroke_bool |
| 794 |
} |
| 795 |
\cs_new_protected:Npn \__draw_path_use_stroke_bb: |
| 796 |
{ |
| 797 |
\__draw_path_use_bb:NnN x { max } + |
| 798 |
\__draw_path_use_bb:NnN y { max } + |
| 799 |
\__draw_path_use_bb:NnN x { min } - |
| 800 |
\__draw_path_use_bb:NnN y { min } - |
| 801 |
} |
| 802 |
\cs_new_protected:Npn \__draw_path_use_bb:NnN #1#2#3 |
| 803 |
{ |
| 804 |
\dim_compare:nNnF { \dim_use:c { g_draw_bb_ #1#2 _dim } } = { #3 -\c_max_dim } |
| 805 |
{ |
| 806 |
\dim_gset:cn { g_draw_bb_ #1#2 _dim } |
| 807 |
{ |
| 808 |
\use:c { dim_ #2 :nn } |
| 809 |
{ \dim_use:c { g_draw_bb_ #1#2 _dim } } |
| 810 |
{ |
| 811 |
\dim_use:c { g__draw_path_ #1#2 _dim } |
| 812 |
#3 0.5 \g__draw_linewidth_dim |
| 813 |
} |
| 814 |
} |
| 815 |
} |
| 816 |
} |
| 817 |
\dim_new:N \l__draw_path_lastx_dim |
| 818 |
\dim_new:N \l__draw_path_lasty_dim |
| 819 |
\dim_new:N \l__draw_path_xmax_dim |
| 820 |
\dim_new:N \l__draw_path_xmin_dim |
| 821 |
\dim_new:N \l__draw_path_ymax_dim |
| 822 |
\dim_new:N \l__draw_path_ymin_dim |
| 823 |
\dim_new:N \l__draw_softpath_lastx_dim |
| 824 |
\dim_new:N \l__draw_softpath_lasty_dim |
| 825 |
\bool_new:N \l__draw_softpath_corners_bool |
| 826 |
\cs_new_protected:Npn \draw_path_scope_begin: |
| 827 |
{ |
| 828 |
\group_begin: |
| 829 |
\dim_set_eq:NN \l__draw_path_lastx_dim \g__draw_path_lastx_dim |
| 830 |
\dim_set_eq:NN \l__draw_path_lasty_dim \g__draw_path_lasty_dim |
| 831 |
\dim_set_eq:NN \l__draw_path_xmax_dim \g__draw_path_xmax_dim |
| 832 |
\dim_set_eq:NN \l__draw_path_xmin_dim \g__draw_path_xmin_dim |
| 833 |
\dim_set_eq:NN \l__draw_path_ymax_dim \g__draw_path_ymax_dim |
| 834 |
\dim_set_eq:NN \l__draw_path_ymin_dim \g__draw_path_ymin_dim |
| 835 |
\dim_set_eq:NN \l__draw_softpath_lastx_dim \g__draw_softpath_lastx_dim |
| 836 |
\dim_set_eq:NN \l__draw_softpath_lasty_dim \g__draw_softpath_lasty_dim |
| 837 |
\__draw_path_reset_limits: |
| 838 |
\__draw_softpath_save: |
| 839 |
} |
| 840 |
\cs_new_protected:Npn \draw_path_scope_end: |
| 841 |
{ |
| 842 |
\__draw_softpath_restore: |
| 843 |
\dim_gset_eq:NN \g__draw_softpath_lastx_dim \l__draw_softpath_lastx_dim |
| 844 |
\dim_gset_eq:NN \g__draw_softpath_lasty_dim \l__draw_softpath_lasty_dim |
| 845 |
\dim_gset_eq:NN \g__draw_path_xmax_dim \l__draw_path_xmax_dim |
| 846 |
\dim_gset_eq:NN \g__draw_path_xmin_dim \l__draw_path_xmin_dim |
| 847 |
\dim_gset_eq:NN \g__draw_path_ymax_dim \l__draw_path_ymax_dim |
| 848 |
\dim_gset_eq:NN \g__draw_path_ymin_dim \l__draw_path_ymin_dim |
| 849 |
\dim_gset_eq:NN \g__draw_path_lastx_dim \l__draw_path_lastx_dim |
| 850 |
\dim_gset_eq:NN \g__draw_path_lasty_dim \l__draw_path_lasty_dim |
| 851 |
\group_end: |
| 852 |
} |
| 853 |
\msg_new:nnnn { draw } { invalid-path-action } |
| 854 |
{ Invalid~action~'#1'~for~path. } |
| 855 |
{ Paths~can~be~used~with~actions~'draw',~'clip',~'fill'~or~'stroke'. } |
| 856 |
%% File: l3draw-points.dtx |
| 857 |
\cs_new:Npn \__draw_point_process:nn #1#2 |
| 858 |
{ \__draw_point_process_auxi:en {#2} {#1} } |
| 859 |
\cs_new:Npn \__draw_point_process_auxi:nn #1#2 |
| 860 |
{ \__draw_point_process_auxii:nw {#2} #1 \s__draw_stop } |
| 861 |
\cs_generate_variant:Nn \__draw_point_process_auxi:nn { e } |
| 862 |
\cs_new:Npn \__draw_point_process_auxii:nw #1 #2 , #3 \s__draw_stop |
| 863 |
{ #1 {#2} {#3} } |
| 864 |
\cs_new:Npn \__draw_point_process:nnn #1#2#3 |
| 865 |
{ \__draw_point_process_auxiii:een {#2} {#3} {#1} } |
| 866 |
\cs_new:Npn \__draw_point_process_auxiii:nnn #1#2#3 |
| 867 |
{ \__draw_point_process_auxiv:nw {#3} #1 \s__draw_mark #2 \s__draw_stop } |
| 868 |
\cs_generate_variant:Nn \__draw_point_process_auxiii:nnn { ee } |
| 869 |
\cs_new:Npn \__draw_point_process_auxiv:nw #1 #2 , #3 \s__draw_mark #4 , #5 \s__draw_stop |
| 870 |
{ #1 {#2} {#3} {#4} {#5} } |
| 871 |
\cs_new:Npn \__draw_point_process:nnnn #1#2#3#4 |
| 872 |
{ \__draw_point_process_auxv:eeen {#2} {#3} {#4} {#1} } |
| 873 |
\cs_new:Npn \__draw_point_process_auxv:nnnn #1#2#3#4 |
| 874 |
{ \__draw_point_process_auxvi:nw {#4} #1 \s__draw_mark #2 \s__draw_mark #3 \s__draw_stop } |
| 875 |
\cs_generate_variant:Nn \__draw_point_process_auxv:nnnn { eee } |
| 876 |
\cs_new:Npn \__draw_point_process_auxvi:nw |
| 877 |
#1 #2 , #3 \s__draw_mark #4 , #5 \s__draw_mark #6 , #7 \s__draw_stop |
| 878 |
{ #1 {#2} {#3} {#4} {#5} {#6} {#7} } |
| 879 |
\cs_new:Npn \__draw_point_process:nnnnn #1#2#3#4#5 |
| 880 |
{ \__draw_point_process_auxvii:eeeen {#2} {#3} {#4} {#5} {#1} } |
| 881 |
\cs_new:Npn \__draw_point_process_auxvii:nnnnn #1#2#3#4#5 |
| 882 |
{ |
| 883 |
\__draw_point_process_auxviii:nw |
| 884 |
{#5} #1 \s__draw_mark #2 \s__draw_mark #3 \s__draw_mark #4 \s__draw_stop |
| 885 |
} |
| 886 |
\cs_generate_variant:Nn \__draw_point_process_auxvii:nnnnn { eeee } |
| 887 |
\cs_new:Npn \__draw_point_process_auxviii:nw |
| 888 |
#1 #2 , #3 \s__draw_mark #4 , #5 \s__draw_mark #6 , #7 \s__draw_mark #8 , #9 \s__draw_stop |
| 889 |
{ #1 {#2} {#3} {#4} {#5} {#6} {#7} {#8} {#9} } |
| 890 |
\cs_new:Npn \draw_point:n #1 |
| 891 |
{ \__draw_point_to_dim:e { \fp_eval:n {#1} } } |
| 892 |
\cs_new:Npn \__draw_point_to_dim:n #1 |
| 893 |
{ \__draw_point_to_dim:w #1 } |
| 894 |
\cs_generate_variant:Nn \__draw_point_to_dim:n { e } |
| 895 |
\cs_new:Npn \__draw_point_to_dim:w ( #1 , ~ #2 ) { #1pt , #2pt } |
| 896 |
\cs_new:Npn \draw_point_polar:nn #1#2 |
| 897 |
{ \draw_point_polar:nnn {#1} {#1} {#2} } |
| 898 |
\cs_new:Npn \draw_point_polar:nnn #1#2#3 |
| 899 |
{ \__draw_draw_polar:enn { \fp_eval:n {#3} } {#1} {#2} } |
| 900 |
\cs_new:Npn \__draw_draw_polar:nnn #1#2#3 |
| 901 |
{ \draw_point:n { cosd(#1) * (#2) , sind(#1) * (#3) } } |
| 902 |
\cs_generate_variant:Nn \__draw_draw_polar:nnn { e } |
| 903 |
\cs_new:Npn \draw_point_unit_vector:n #1 |
| 904 |
{ \__draw_point_process:nn { \__draw_point_unit_vector:nn } { \draw_point:n {#1} } } |
| 905 |
\cs_new:Npn \__draw_point_unit_vector:nn #1#2 |
| 906 |
{ |
| 907 |
\__draw_point_unit_vector:nnn |
| 908 |
{ \fp_eval:n { (sqrt(#1 * #1 + #2 * #2)) } } |
| 909 |
{#1} {#2} |
| 910 |
} |
| 911 |
\cs_new:Npn \__draw_point_unit_vector:nnn #1#2#3 |
| 912 |
{ |
| 913 |
\fp_compare:nNnTF {#1} = \c_zero_fp |
| 914 |
{ 0pt, 1pt } |
| 915 |
{ |
| 916 |
\draw_point:n |
| 917 |
{ ( #2 , #3 ) / #1 } |
| 918 |
} |
| 919 |
} |
| 920 |
\cs_generate_variant:Nn \__draw_point_unit_vector:nnn { e } |
| 921 |
\cs_new:Npn \draw_point_intersect_lines:nnnn #1#2#3#4 |
| 922 |
{ |
| 923 |
\__draw_point_process:nnnnn |
| 924 |
{ \__draw_point_intersect_lines:nnnnnnnn } |
| 925 |
{ \draw_point:n {#1} } |
| 926 |
{ \draw_point:n {#2} } |
| 927 |
{ \draw_point:n {#3} } |
| 928 |
{ \draw_point:n {#4} } |
| 929 |
} |
| 930 |
\cs_new:Npn \__draw_point_intersect_lines:nnnnnnnn #1#2#3#4#5#6#7#8 |
| 931 |
{ |
| 932 |
\__draw_point_intersect_lines_aux:eeeeee |
| 933 |
{ \fp_eval:n { #1 * #4 - #2 * #3 } } |
| 934 |
{ \fp_eval:n { #5 * #8 - #6 * #7 } } |
| 935 |
{ \fp_eval:n { #1 - #3 } } |
| 936 |
{ \fp_eval:n { #5 - #7 } } |
| 937 |
{ \fp_eval:n { #2 - #4 } } |
| 938 |
{ \fp_eval:n { #6 - #8 } } |
| 939 |
} |
| 940 |
\cs_new:Npn \__draw_point_intersect_lines_aux:nnnnnn #1#2#3#4#5#6 |
| 941 |
{ |
| 942 |
\draw_point:n |
| 943 |
{ |
| 944 |
( #2 * #3 - #1 * #4 , #2 * #5 - #1 * #6 ) |
| 945 |
/ ( #4 * #5 - #6 * #3 ) |
| 946 |
} |
| 947 |
} |
| 948 |
\cs_generate_variant:Nn \__draw_point_intersect_lines_aux:nnnnnn { eeeeee } |
| 949 |
\cs_new:Npn \draw_point_intersect_circles:nnnnn #1#2#3#4#5 |
| 950 |
{ |
| 951 |
\__draw_point_process:nnn |
| 952 |
{ \__draw_point_intersect_circles_auxi:nnnnnnn {#2} {#4} {#5} } |
| 953 |
{ \draw_point:n {#1} } |
| 954 |
{ \draw_point:n {#3} } |
| 955 |
} |
| 956 |
\cs_new:Npn \__draw_point_intersect_circles_auxi:nnnnnnn #1#2#3#4#5#6#7 |
| 957 |
{ |
| 958 |
\__draw_point_intersect_circles_auxii:eennnnn |
| 959 |
{ \fp_eval:n {#1} } { \fp_eval:n {#2} } {#4} {#5} {#6} {#7} {#3} |
| 960 |
} |
| 961 |
\cs_new:Npn \__draw_point_intersect_circles_auxii:nnnnnnn #1#2#3#4#5#6#7 |
| 962 |
{ |
| 963 |
\__draw_point_intersect_circles_auxiii:eennnnn |
| 964 |
{ \fp_eval:n { #5 - #3 } } |
| 965 |
{ \fp_eval:n { #6 - #4 } } |
| 966 |
{#1} {#2} {#3} {#4} {#7} |
| 967 |
} |
| 968 |
\cs_generate_variant:Nn \__draw_point_intersect_circles_auxii:nnnnnnn { ee } |
| 969 |
\cs_new:Npn \__draw_point_intersect_circles_auxiii:nnnnnnn #1#2#3#4#5#6#7 |
| 970 |
{ |
| 971 |
\__draw_point_intersect_circles_auxiv:ennnnnnn |
| 972 |
{ \fp_eval:n { sqrt( #1 * #1 + #2 * #2 ) } } |
| 973 |
{#1} {#2} {#3} {#4} {#5} {#6} {#7} |
| 974 |
} |
| 975 |
\cs_generate_variant:Nn \__draw_point_intersect_circles_auxiii:nnnnnnn { ee } |
| 976 |
\cs_new:Npn \__draw_point_intersect_circles_auxiv:nnnnnnnn #1#2#3#4#5#6#7#8 |
| 977 |
{ |
| 978 |
\__draw_point_intersect_circles_auxv:eennnnnnn |
| 979 |
{ \fp_eval:n { 1 / #1 } } |
| 980 |
{ \fp_eval:n { #4 * #4 } } |
| 981 |
{#1} {#2} {#3} {#5} {#6} {#7} {#8} |
| 982 |
} |
| 983 |
\cs_generate_variant:Nn \__draw_point_intersect_circles_auxiv:nnnnnnnn { e } |
| 984 |
\cs_new:Npn \__draw_point_intersect_circles_auxv:nnnnnnnnn #1#2#3#4#5#6#7#8#9 |
| 985 |
{ |
| 986 |
\__draw_point_intersect_circles_auxvi:ennnnnnn |
| 987 |
{ \fp_eval:n { 0.5 * #1 * ( #2 + #3 * #3 - #6 * #6 ) } } |
| 988 |
{#1} {#2} {#4} {#5} {#7} {#8} {#9} |
| 989 |
} |
| 990 |
\cs_generate_variant:Nn \__draw_point_intersect_circles_auxv:nnnnnnnnn { ee } |
| 991 |
\cs_new:Npn \__draw_point_intersect_circles_auxvi:nnnnnnnn #1#2#3#4#5#6#7#8 |
| 992 |
{ |
| 993 |
\__draw_point_intersect_circles_auxvii:eeennnn |
| 994 |
{ \fp_eval:n { #1 * #2 } } |
| 995 |
{ \int_if_odd:nTF {#8} { 1 } { -1 } } |
| 996 |
{ \fp_eval:n { sqrt ( #3 - #1 * #1 ) * #2 } } |
| 997 |
{#4} {#5} {#6} {#7} |
| 998 |
} |
| 999 |
\cs_generate_variant:Nn \__draw_point_intersect_circles_auxvi:nnnnnnnn { e } |
| 1000 |
\cs_new:Npn \__draw_point_intersect_circles_auxvii:nnnnnnn #1#2#3#4#5#6#7 |
| 1001 |
{ |
| 1002 |
\draw_point:n |
| 1003 |
{ #6 + #4 * #1 + #2 * #3 * #5 , #7 + #5 * #1 + -1 * #2 * #3 * #4 } |
| 1004 |
} |
| 1005 |
\cs_generate_variant:Nn \__draw_point_intersect_circles_auxvii:nnnnnnn { eee } |
| 1006 |
\cs_new:Npn \draw_point_intersect_line_circle:nnnnn #1#2#3#4#5 |
| 1007 |
{ |
| 1008 |
\__draw_point_process:nnnn |
| 1009 |
{ \__draw_point_intersect_line_circle_auxi:nnnnnnnn {#4} {#5} } |
| 1010 |
{ \draw_point:n {#1} } |
| 1011 |
{ \draw_point:n {#2} } |
| 1012 |
{ \draw_point:n {#3} } |
| 1013 |
} |
| 1014 |
\cs_new:Npn \__draw_point_intersect_line_circle_auxi:nnnnnnnn #1#2#3#4#5#6#7#8 |
| 1015 |
{ |
| 1016 |
\__draw_point_intersect_line_circle_auxii:ennnnnnn |
| 1017 |
{ \fp_eval:n {#1} } {#3} {#4} {#5} {#6} {#7} {#8} {#2} |
| 1018 |
} |
| 1019 |
\cs_new:Npn \__draw_point_intersect_line_circle_auxii:nnnnnnnn #1#2#3#4#5#6#7#8 |
| 1020 |
{ |
| 1021 |
\__draw_point_intersect_line_circle_auxiii:eeennnnn |
| 1022 |
{ \fp_eval:n { (#4-#2)*(#4-#2)+(#5-#3)*(#5-#3) } } |
| 1023 |
{ \fp_eval:n { 2*((#4-#2)*(#2-#6)+(#5-#3)*(#3-#7)) } } |
| 1024 |
{ \fp_eval:n { (#6*#6+#7*#7)+(#2*#2+#3*#3)-(2*(#6*#2+#7*#3))-(#1*#1) } } |
| 1025 |
{#2} {#3} {#4} {#5} {#8} |
| 1026 |
} |
| 1027 |
\cs_generate_variant:Nn \__draw_point_intersect_line_circle_auxii:nnnnnnnn { e } |
| 1028 |
\cs_new:Npn \__draw_point_intersect_line_circle_auxiii:nnnnnnnn #1#2#3#4#5#6#7#8 |
| 1029 |
{ |
| 1030 |
\__draw_point_intersect_line_circle_auxiv:eennnnnn |
| 1031 |
{ \fp_eval:n { #2 * #2 - 4 * #1 * #3 } } |
| 1032 |
{ \int_if_odd:nTF {#8} { 1 } { -1 } } |
| 1033 |
{#1} {#2} {#4} {#5} {#6} {#7} |
| 1034 |
} |
| 1035 |
\cs_generate_variant:Nn \__draw_point_intersect_line_circle_auxiii:nnnnnnnn { eee } |
| 1036 |
\cs_new:Npn \__draw_point_intersect_line_circle_auxiv:nnnnnnnn #1#2#3#4#5#6#7#8 |
| 1037 |
{ |
| 1038 |
\__draw_point_intersect_line_circle_auxv:ennnn |
| 1039 |
{ \fp_eval:n { (-1 * #4 + #2 * sqrt(#1)) / (2 * #3) } } |
| 1040 |
{#5} {#6} {#7} {#8} |
| 1041 |
} |
| 1042 |
\cs_generate_variant:Nn \__draw_point_intersect_line_circle_auxiv:nnnnnnnn { ee } |
| 1043 |
\cs_new:Npn \__draw_point_intersect_line_circle_auxv:nnnnn #1#2#3#4#5 |
| 1044 |
{ |
| 1045 |
\draw_point:n |
| 1046 |
{ #2 + #1 * (#4 - #2), #3 + #1 * (#5 - #3) } |
| 1047 |
} |
| 1048 |
\cs_generate_variant:Nn \__draw_point_intersect_line_circle_auxv:nnnnn { e } |
| 1049 |
\cs_new:Npn \draw_point_interpolate_line:nnn #1#2#3 |
| 1050 |
{ |
| 1051 |
\__draw_point_process:nnn |
| 1052 |
{ \__draw_point_interpolate_line_aux:ennnn { \fp_eval:n {#1} } } |
| 1053 |
{ \draw_point:n {#2} } |
| 1054 |
{ \draw_point:n {#3} } |
| 1055 |
} |
| 1056 |
\cs_new:Npn \__draw_point_interpolate_line_aux:nnnnn #1#2#3#4#5 |
| 1057 |
{ |
| 1058 |
\__draw_point_interpolate_line_aux:ennnnn { \fp_eval:n { 1 - #1 } } |
| 1059 |
{#1} {#2} {#3} {#4} {#5} |
| 1060 |
} |
| 1061 |
\cs_generate_variant:Nn \__draw_point_interpolate_line_aux:nnnnn { e } |
| 1062 |
\cs_new:Npn \__draw_point_interpolate_line_aux:nnnnnn #1#2#3#4#5#6 |
| 1063 |
{ \draw_point:n { #1 * #3 + #2 * #5 , #1 * #4 + #2 * #6 } } |
| 1064 |
\cs_generate_variant:Nn \__draw_point_interpolate_line_aux:nnnnnn { e } |
| 1065 |
\cs_new:Npn \draw_point_interpolate_distance:nnn #1#2#3 |
| 1066 |
{ |
| 1067 |
\__draw_point_process:nn |
| 1068 |
{ \__draw_point_interpolate_distance:nnnn {#1} {#3} } |
| 1069 |
{#2} |
| 1070 |
} |
| 1071 |
\cs_new:Npn \__draw_point_interpolate_distance:nnnn #1#2#3#4 |
| 1072 |
{ |
| 1073 |
\__draw_point_process:nn |
| 1074 |
{ |
| 1075 |
\__draw_point_interpolate_distance:ennnn |
| 1076 |
{ \fp_eval:n {#1} } {#3} {#4} |
| 1077 |
} |
| 1078 |
{ \draw_point_unit_vector:n { ( #2 ) - ( #3 , #4 ) } } |
| 1079 |
} |
| 1080 |
\cs_new:Npn \__draw_point_interpolate_distance:nnnnn #1#2#3#4#5 |
| 1081 |
{ \draw_point:n { #2 + #1 * #4 , #3 + #1 * #5 } } |
| 1082 |
\cs_generate_variant:Nn \__draw_point_interpolate_distance:nnnnn { e } |
| 1083 |
\cs_new:Npn \draw_point_interpolate_arc_axes:nnnnnn #1#2#3#4#5#6 |
| 1084 |
{ |
| 1085 |
\__draw_point_process:nnnn |
| 1086 |
{ \__draw_point_interpolate_arcaxes_auxi:nnnnnnnnn {#1} {#5} {#6} } |
| 1087 |
{ \draw_point:n {#2} } |
| 1088 |
{ \draw_point:n {#3} } |
| 1089 |
{ \draw_point:n {#4} } |
| 1090 |
} |
| 1091 |
\cs_new:Npn \__draw_point_interpolate_arcaxes_auxi:nnnnnnnnn #1#2#3#4#5#6#7#8#9 |
| 1092 |
{ |
| 1093 |
\__draw_point_interpolate_arcaxes_auxii:ennnnnnnn |
| 1094 |
{ \fp_eval:n {#1} } {#2} {#3} {#4} {#5} {#6} {#7} {#8} {#9} |
| 1095 |
} |
| 1096 |
\cs_new:Npn \__draw_point_interpolate_arcaxes_auxii:nnnnnnnnn #1#2#3#4#5#6#7#8#9 |
| 1097 |
{ |
| 1098 |
\__draw_point_interpolate_arcaxes_auxiii:ennnnnn |
| 1099 |
{ \fp_eval:n { #1 * (#3) + ( 1 - #1 ) * (#2) } } |
| 1100 |
{#4} {#5} {#6} {#7} {#8} {#9} |
| 1101 |
} |
| 1102 |
\cs_generate_variant:Nn \__draw_point_interpolate_arcaxes_auxii:nnnnnnnnn { e } |
| 1103 |
\cs_new:Npn \__draw_point_interpolate_arcaxes_auxiii:nnnnnnn #1#2#3#4#5#6#7 |
| 1104 |
{ |
| 1105 |
\__draw_point_interpolate_arcaxes_auxiv:eennnnnn |
| 1106 |
{ \fp_eval:n { cosd (#1) } } |
| 1107 |
{ \fp_eval:n { sind (#1) } } |
| 1108 |
{#2} {#3} {#4} {#5} {#6} {#7} |
| 1109 |
} |
| 1110 |
\cs_generate_variant:Nn \__draw_point_interpolate_arcaxes_auxiii:nnnnnnn { e } |
| 1111 |
\cs_new:Npn \__draw_point_interpolate_arcaxes_auxiv:nnnnnnnn #1#2#3#4#5#6#7#8 |
| 1112 |
{ |
| 1113 |
\draw_point:n |
| 1114 |
{ #3 + #1 * #5 + #2 * #7 , #4 + #1 * #6 + #2 * #8 } |
| 1115 |
} |
| 1116 |
\cs_generate_variant:Nn \__draw_point_interpolate_arcaxes_auxiv:nnnnnnnn { ee } |
| 1117 |
\cs_new:Npn \draw_point_interpolate_curve:nnnn #1#2#3#4 |
| 1118 |
{ |
| 1119 |
\__draw_point_process:nnnn |
| 1120 |
{ \__draw_point_interpolate_curve_quad_auxi:nnnnnnn {#1} } |
| 1121 |
{ \draw_point:n {#2} } |
| 1122 |
{ \draw_point:n {#3} } |
| 1123 |
{ \draw_point:n {#4} } |
| 1124 |
} |
| 1125 |
\cs_new:Npn \__draw_point_interpolate_curve_quad_auxi:nnnnnnn #1#2#3#4#5#6#7 |
| 1126 |
{ |
| 1127 |
\__draw_point_interpolate_curve_quad_auxii:ennnnnn |
| 1128 |
{ \fp_eval:n {#1} } |
| 1129 |
{#2} {#3} {#4} {#5} {#6} {#7} |
| 1130 |
} |
| 1131 |
\cs_new:Npn \__draw_point_interpolate_curve_quad_auxii:nnnnnnn #1#2#3#4#5#6#7 |
| 1132 |
{ |
| 1133 |
\__draw_point_interpolate_curve_quad_auxiii:eeennnnnn |
| 1134 |
{ \fp_eval:n { (1 - #1)^2 } } |
| 1135 |
{ \fp_eval:n { 2 * (1 - #1) * #1 } } |
| 1136 |
{ \fp_eval:n { #1^2 } } |
| 1137 |
{#2} {#3} {#4} {#5} {#6} {#7} |
| 1138 |
} |
| 1139 |
\cs_generate_variant:Nn \__draw_point_interpolate_curve_quad_auxii:nnnnnnn { e } |
| 1140 |
\cs_new:Npn \__draw_point_interpolate_curve_quad_auxiii:nnnnnnnnn #1#2#3#4#5#6#7#8#9 |
| 1141 |
{ |
| 1142 |
\draw_point:n |
| 1143 |
{ |
| 1144 |
#1 * #4 + #2 * #6 + #3 * #8 , |
| 1145 |
#1 * #5 + #2 * #7 + #3 * #9 |
| 1146 |
} |
| 1147 |
} |
| 1148 |
\cs_generate_variant:Nn \__draw_point_interpolate_curve_quad_auxiii:nnnnnnnnn { eee } |
| 1149 |
\cs_new:Npn \draw_point_interpolate_curve:nnnnn #1#2#3#4#5 |
| 1150 |
{ |
| 1151 |
\__draw_point_process:nnnnn |
| 1152 |
{ \__draw_point_interpolate_curve_auxi:nnnnnnnnn {#1} } |
| 1153 |
{ \draw_point:n {#2} } |
| 1154 |
{ \draw_point:n {#3} } |
| 1155 |
{ \draw_point:n {#4} } |
| 1156 |
{ \draw_point:n {#5} } |
| 1157 |
} |
| 1158 |
\cs_new:Npn \__draw_point_interpolate_curve_auxi:nnnnnnnnn #1#2#3#4#5#6#7#8#9 |
| 1159 |
{ |
| 1160 |
\__draw_point_interpolate_curve_auxii:ennnnnnnn |
| 1161 |
{ \fp_eval:n {#1} } |
| 1162 |
{#2} {#3} {#4} {#5} {#6} {#7} {#8} {#9} |
| 1163 |
} |
| 1164 |
\cs_new:Npn \__draw_point_interpolate_curve_auxii:nnnnnnnnn |
| 1165 |
#1#2#3#4#5#6#7#8#9 |
| 1166 |
{ |
| 1167 |
\__draw_point_interpolate_curve_auxiii:ennnnn |
| 1168 |
{ \fp_eval:n { 1 - #1 } } |
| 1169 |
{#1} |
| 1170 |
{ {#2} {#3} } { {#4} {#5} } { {#6} {#7} } { {#8} {#9} } |
| 1171 |
} |
| 1172 |
\cs_generate_variant:Nn \__draw_point_interpolate_curve_auxii:nnnnnnnnn { e } |
| 1173 |
\cs_new:Npn \__draw_point_interpolate_curve_auxiii:nnnnnn #1#2#3#4#5#6 |
| 1174 |
{ |
| 1175 |
\__draw_point_interpolate_curve_auxiv:nnnnnn {#1} {#2} #3 #4 |
| 1176 |
\__draw_point_interpolate_curve_auxiv:nnnnnn {#1} {#2} #4 #5 |
| 1177 |
\__draw_point_interpolate_curve_auxiv:nnnnnn {#1} {#2} #5 #6 |
| 1178 |
\prg_do_nothing: |
| 1179 |
\__draw_point_interpolate_curve_auxvi:n { {#1} {#2} } |
| 1180 |
} |
| 1181 |
\cs_generate_variant:Nn \__draw_point_interpolate_curve_auxiii:nnnnnn { e } |
| 1182 |
\cs_new:Npn \__draw_point_interpolate_curve_auxiv:nnnnnn #1#2#3#4#5#6 |
| 1183 |
{ |
| 1184 |
\__draw_point_interpolate_curve_auxv:eew |
| 1185 |
{ \fp_eval:n { #1 * #3 + #2 * #5 } } |
| 1186 |
{ \fp_eval:n { #1 * #4 + #2 * #6 } } |
| 1187 |
} |
| 1188 |
\cs_new:Npn \__draw_point_interpolate_curve_auxv:nnw |
| 1189 |
#1#2#3 \prg_do_nothing: #4#5 |
| 1190 |
{ |
| 1191 |
#3 |
| 1192 |
\prg_do_nothing: |
| 1193 |
#4 { #5 {#1} {#2} } |
| 1194 |
} |
| 1195 |
\cs_generate_variant:Nn \__draw_point_interpolate_curve_auxv:nnw { ee } |
| 1196 |
\cs_new:Npn \__draw_point_interpolate_curve_auxvi:n #1 |
| 1197 |
{ \__draw_point_interpolate_curve_auxvii:nnnnnnnn #1 } |
| 1198 |
\cs_new:Npn \__draw_point_interpolate_curve_auxvii:nnnnnnnn #1#2#3#4#5#6#7#8 |
| 1199 |
{ |
| 1200 |
\__draw_point_interpolate_curve_auxviii:eeeenn |
| 1201 |
{ \fp_eval:n { #1 * #3 + #2 * #5 } } |
| 1202 |
{ \fp_eval:n { #1 * #4 + #2 * #6 } } |
| 1203 |
{ \fp_eval:n { #1 * #5 + #2 * #7 } } |
| 1204 |
{ \fp_eval:n { #1 * #6 + #2 * #8 } } |
| 1205 |
{#1} {#2} |
| 1206 |
} |
| 1207 |
\cs_new:Npn \__draw_point_interpolate_curve_auxviii:nnnnnn #1#2#3#4#5#6 |
| 1208 |
{ |
| 1209 |
\draw_point:n |
| 1210 |
{ #5 * #1 + #6 * #3 , #5 * #2 + #6 * #4 } |
| 1211 |
} |
| 1212 |
\cs_generate_variant:Nn \__draw_point_interpolate_curve_auxviii:nnnnnn { eeee } |
| 1213 |
\dim_new:N \l__draw_xvec_x_dim |
| 1214 |
\dim_new:N \l__draw_xvec_y_dim |
| 1215 |
\dim_new:N \l__draw_yvec_x_dim |
| 1216 |
\dim_new:N \l__draw_yvec_y_dim |
| 1217 |
\dim_new:N \l__draw_zvec_x_dim |
| 1218 |
\dim_new:N \l__draw_zvec_y_dim |
| 1219 |
\cs_new_protected:Npn \draw_xvec:n #1 |
| 1220 |
{ \__draw_vec:nn { x } {#1} } |
| 1221 |
\cs_new_protected:Npn \draw_yvec:n #1 |
| 1222 |
{ \__draw_vec:nn { y } {#1} } |
| 1223 |
\cs_new_protected:Npn \draw_zvec:n #1 |
| 1224 |
{ \__draw_vec:nn { z } {#1} } |
| 1225 |
\cs_new_protected:Npn \__draw_vec:nn #1#2 |
| 1226 |
{ \__draw_point_process:nn { \__draw_vec:nnn {#1} } { \draw_point:n {#2} } } |
| 1227 |
\cs_new_protected:Npn \__draw_vec:nnn #1#2#3 |
| 1228 |
{ |
| 1229 |
\dim_set:cn { l__draw_ #1 vec_x_dim } {#2} |
| 1230 |
\dim_set:cn { l__draw_ #1 vec_y_dim } {#3} |
| 1231 |
} |
| 1232 |
\draw_xvec:n { 1cm , 0cm } |
| 1233 |
\draw_yvec:n { 0cm , 1cm } |
| 1234 |
\draw_zvec:n { -0.385cm , -0.385cm } |
| 1235 |
\cs_new:Npn \draw_point_vec:nn #1#2 |
| 1236 |
{ \__draw_point_vec:ee { \fp_eval:n {#1} } { \fp_eval:n {#2} } } |
| 1237 |
\cs_new:Npn \__draw_point_vec:nn #1#2 |
| 1238 |
{ |
| 1239 |
\draw_point:n |
| 1240 |
{ |
| 1241 |
#1 * \l__draw_xvec_x_dim + #2 * \l__draw_yvec_x_dim , |
| 1242 |
#1 * \l__draw_xvec_y_dim + #2 * \l__draw_yvec_y_dim |
| 1243 |
} |
| 1244 |
} |
| 1245 |
\cs_generate_variant:Nn \__draw_point_vec:nn { ee } |
| 1246 |
\cs_new:Npn \draw_point_vec:nnn #1#2#3 |
| 1247 |
{ |
| 1248 |
\__draw_point_vec:eee |
| 1249 |
{ \fp_eval:n {#1} } { \fp_eval:n {#2} } { \fp_eval:n {#3} } |
| 1250 |
} |
| 1251 |
\cs_new:Npn \__draw_point_vec:nnn #1#2#3 |
| 1252 |
{ |
| 1253 |
\draw_point:n |
| 1254 |
{ |
| 1255 |
#1 * \l__draw_xvec_x_dim |
| 1256 |
+ #2 * \l__draw_yvec_x_dim |
| 1257 |
+ #3 * \l__draw_zvec_x_dim |
| 1258 |
, |
| 1259 |
#1 * \l__draw_xvec_y_dim |
| 1260 |
+ #2 * \l__draw_yvec_y_dim |
| 1261 |
+ #3 * \l__draw_zvec_y_dim |
| 1262 |
} |
| 1263 |
} |
| 1264 |
\cs_generate_variant:Nn \__draw_point_vec:nnn { eee } |
| 1265 |
\cs_new:Npn \draw_point_vec_polar:nn #1#2 |
| 1266 |
{ \draw_point_vec_polar:nnn {#1} {#1} {#2} } |
| 1267 |
\cs_new:Npn \draw_point_vec_polar:nnn #1#2#3 |
| 1268 |
{ \__draw_draw_vec_polar:enn { \fp_eval:n {#3} } {#1} {#2} } |
| 1269 |
\cs_new:Npn \__draw_draw_vec_polar:nnn #1#2#3 |
| 1270 |
{ |
| 1271 |
\draw_point:n |
| 1272 |
{ |
| 1273 |
cosd(#1) * (#2) * \l__draw_xvec_x_dim , |
| 1274 |
sind(#1) * (#3) * \l__draw_yvec_y_dim |
| 1275 |
} |
| 1276 |
} |
| 1277 |
\cs_generate_variant:Nn \__draw_draw_vec_polar:nnn { e } |
| 1278 |
\cs_new:Npn \draw_point_transform:n #1 |
| 1279 |
{ |
| 1280 |
\__draw_point_process:nn |
| 1281 |
{ \__draw_point_transform:nn } { \draw_point:n {#1} } |
| 1282 |
} |
| 1283 |
\cs_new:Npn \__draw_point_transform:nn #1#2 |
| 1284 |
{ |
| 1285 |
\bool_if:NTF \l__draw_matrix_active_bool |
| 1286 |
{ |
| 1287 |
\draw_point:n |
| 1288 |
{ |
| 1289 |
( |
| 1290 |
\l__draw_matrix_a_fp * #1 |
| 1291 |
+ \l__draw_matrix_c_fp * #2 |
| 1292 |
+ \l__draw_xshift_dim |
| 1293 |
) |
| 1294 |
, |
| 1295 |
( |
| 1296 |
\l__draw_matrix_b_fp * #1 |
| 1297 |
+ \l__draw_matrix_d_fp * #2 |
| 1298 |
+ \l__draw_yshift_dim |
| 1299 |
) |
| 1300 |
} |
| 1301 |
} |
| 1302 |
{ |
| 1303 |
\draw_point:n |
| 1304 |
{ |
| 1305 |
(#1, #2) |
| 1306 |
+ ( \l__draw_xshift_dim , \l__draw_yshift_dim ) |
| 1307 |
} |
| 1308 |
} |
| 1309 |
} |
| 1310 |
\cs_new:Npn \__draw_point_transform_noshift:n #1 |
| 1311 |
{ |
| 1312 |
\__draw_point_process:nn |
| 1313 |
{ \__draw_point_transform_noshift:nn } |
| 1314 |
{ \draw_point:n {#1} } |
| 1315 |
} |
| 1316 |
\cs_new:Npn \__draw_point_transform_noshift:nn #1#2 |
| 1317 |
{ |
| 1318 |
\bool_if:NTF \l__draw_matrix_active_bool |
| 1319 |
{ |
| 1320 |
\draw_point:n |
| 1321 |
{ |
| 1322 |
( |
| 1323 |
\l__draw_matrix_a_fp * #1 |
| 1324 |
+ \l__draw_matrix_c_fp * #2 |
| 1325 |
) |
| 1326 |
, |
| 1327 |
( |
| 1328 |
\l__draw_matrix_b_fp * #1 |
| 1329 |
+ \l__draw_matrix_d_fp * #2 |
| 1330 |
) |
| 1331 |
} |
| 1332 |
} |
| 1333 |
{ \draw_point:n { (#1, #2) } } |
| 1334 |
} |
| 1335 |
%% File: l3draw-scopes.dtx |
| 1336 |
\dim_new:N \g_draw_bb_xmax_dim |
| 1337 |
\dim_new:N \g_draw_bb_xmin_dim |
| 1338 |
\dim_new:N \g_draw_bb_ymax_dim |
| 1339 |
\dim_new:N \g_draw_bb_ymin_dim |
| 1340 |
\bool_new:N \l_draw_bb_update_bool |
| 1341 |
\box_new:N \l__draw_main_box |
| 1342 |
\box_new:N \l__draw_layer_main_box |
| 1343 |
\int_new:N \g_draw_id_int |
| 1344 |
\cs_new_protected:Npn \__draw_reset_bb: |
| 1345 |
{ |
| 1346 |
\dim_gset:Nn \g_draw_bb_xmax_dim { -\c_max_dim } |
| 1347 |
\dim_gset:Nn \g_draw_bb_xmin_dim { \c_max_dim } |
| 1348 |
\dim_gset:Nn \g_draw_bb_ymax_dim { -\c_max_dim } |
| 1349 |
\dim_gset:Nn \g_draw_bb_ymin_dim { \c_max_dim } |
| 1350 |
} |
| 1351 |
\cs_new_protected:Npn \draw_begin: |
| 1352 |
{ |
| 1353 |
\group_begin: |
| 1354 |
\int_gincr:N \g_draw_id_int |
| 1355 |
\hbox_set:Nw \l__draw_main_box |
| 1356 |
\__draw_backend_begin: |
| 1357 |
\__draw_reset_bb: |
| 1358 |
\__draw_path_reset_limits: |
| 1359 |
\bool_set_true:N \l_draw_bb_update_bool |
| 1360 |
\draw_transform_matrix_reset: |
| 1361 |
\draw_transform_shift_reset: |
| 1362 |
\__draw_softpath_clear: |
| 1363 |
\draw_set_linewidth:n { \l_draw_default_linewidth_dim } |
| 1364 |
\color_ensure_current: |
| 1365 |
\draw_set_nonzero_rule: |
| 1366 |
\draw_set_cap_butt: |
| 1367 |
\draw_set_join_miter: |
| 1368 |
\draw_set_miterlimit:n { 10 } |
| 1369 |
\draw_set_dash_pattern:nn { } { 0cm } |
| 1370 |
\hbox_set:Nw \l__draw_layer_main_box |
| 1371 |
\__draw_record_origin: |
| 1372 |
} |
| 1373 |
\cs_new_protected:Npn \draw_end: |
| 1374 |
{ |
| 1375 |
\__draw_baseline_finalize:w |
| 1376 |
\exp_args:NNNV \hbox_set_end: |
| 1377 |
\clist_set:Nn \l_draw_layers_clist \l_draw_layers_clist |
| 1378 |
\__draw_layers_insert: |
| 1379 |
\__draw_backend_end: |
| 1380 |
\hbox_set_end: |
| 1381 |
\dim_compare:nNnT \g_draw_bb_xmin_dim = \c_max_dim |
| 1382 |
{ |
| 1383 |
\dim_gzero:N \g_draw_bb_xmax_dim |
| 1384 |
\dim_gzero:N \g_draw_bb_xmin_dim |
| 1385 |
\dim_gzero:N \g_draw_bb_ymax_dim |
| 1386 |
\dim_gzero:N \g_draw_bb_ymin_dim |
| 1387 |
} |
| 1388 |
\__draw_finalize: |
| 1389 |
\box_set_wd:Nn \l__draw_main_box |
| 1390 |
{ \g_draw_bb_xmax_dim - \g_draw_bb_xmin_dim } |
| 1391 |
\mode_leave_vertical: |
| 1392 |
\box_use_drop:N \l__draw_main_box |
| 1393 |
\group_end: |
| 1394 |
} |
| 1395 |
\cs_new_protected:Npe \__draw_record_origin: |
| 1396 |
{ |
| 1397 |
\hbox_to_wd:nn { 0pt } |
| 1398 |
{ |
| 1399 |
\tex_savepos:D |
| 1400 |
\cs_if_exist:NT \@expl@finalise@setup@@ |
| 1401 |
{ |
| 1402 |
\exp_not:N \property_record:en |
| 1403 |
{ draw . \exp_not:N \int_use:N \exp_not:N \g_draw_id_int } |
| 1404 |
{ xpos , ypos , abspage } |
| 1405 |
} |
| 1406 |
\tex_savepos:D |
| 1407 |
} |
| 1408 |
} |
| 1409 |
\cs_generate_variant:Nn \property_record:nn { e } |
| 1410 |
\cs_new_protected:Npn \__draw_finalize: |
| 1411 |
{ |
| 1412 |
\hbox_set:Nn \l__draw_main_box |
| 1413 |
{ |
| 1414 |
\skip_horizontal:n { -\g_draw_bb_xmin_dim } |
| 1415 |
\box_move_down:nn |
| 1416 |
{ \g_draw_bb_ymin_dim } |
| 1417 |
{ \box_use_drop:N \l__draw_main_box } |
| 1418 |
} |
| 1419 |
\box_set_dp:Nn \l__draw_main_box { 0pt } |
| 1420 |
\box_set_ht:Nn \l__draw_main_box |
| 1421 |
{ \g_draw_bb_ymax_dim - \g_draw_bb_ymin_dim } |
| 1422 |
} |
| 1423 |
\cs_new_protected:Npn \__draw_finalize_baseline:n #1 |
| 1424 |
{ |
| 1425 |
\hbox_set:Nn \l__draw_main_box |
| 1426 |
{ |
| 1427 |
\skip_horizontal:n { -\g_draw_bb_xmin_dim } |
| 1428 |
\box_move_down:nn |
| 1429 |
{#1} |
| 1430 |
{ \box_use_drop:N \l__draw_main_box } |
| 1431 |
} |
| 1432 |
\box_set_dp:Nn \l__draw_main_box |
| 1433 |
{ |
| 1434 |
\dim_max:nn |
| 1435 |
{ #1 - \g_draw_bb_ymin_dim } |
| 1436 |
{ 0pt } |
| 1437 |
} |
| 1438 |
\box_set_ht:Nn \l__draw_main_box |
| 1439 |
{ \g_draw_bb_ymax_dim - #1 } |
| 1440 |
} |
| 1441 |
\bool_new:N \l__draw_baseline_bool |
| 1442 |
\dim_new:N \l__draw_baseline_dim |
| 1443 |
\cs_new_protected:Npn \draw_set_baseline:n #1 |
| 1444 |
{ |
| 1445 |
\bool_set_true:N \l__draw_baseline_bool |
| 1446 |
\dim_set:Nn \l__draw_baseline_dim { \fp_to_dim:n {#1} } |
| 1447 |
} |
| 1448 |
\cs_new_protected:Npn \__draw_baseline_finalize:w #1 \__draw_finalize: |
| 1449 |
{ |
| 1450 |
\bool_if:NTF \l__draw_baseline_bool |
| 1451 |
{ |
| 1452 |
\use:e |
| 1453 |
{ |
| 1454 |
\exp_not:n {#1} |
| 1455 |
\__draw_finalize_baseline:n { \dim_use:N \l__draw_baseline_dim } |
| 1456 |
} |
| 1457 |
} |
| 1458 |
{ #1 \__draw_finalize: } |
| 1459 |
} |
| 1460 |
\dim_new:N \l__draw_linewidth_dim |
| 1461 |
\tl_new:N \l__draw_fill_color_tl |
| 1462 |
\tl_new:N \l__draw_stroke_color_tl |
| 1463 |
\cs_new_protected:Npn \draw_scope_begin: |
| 1464 |
{ |
| 1465 |
\__draw_backend_scope_begin: |
| 1466 |
\group_begin: |
| 1467 |
\dim_set_eq:NN \l__draw_linewidth_dim \g__draw_linewidth_dim |
| 1468 |
\draw_path_scope_begin: |
| 1469 |
} |
| 1470 |
\cs_new_protected:Npn \draw_scope_end: |
| 1471 |
{ |
| 1472 |
\draw_path_scope_end: |
| 1473 |
\dim_gset_eq:NN \g__draw_linewidth_dim \l__draw_linewidth_dim |
| 1474 |
\group_end: |
| 1475 |
\__draw_backend_scope_end: |
| 1476 |
} |
| 1477 |
\dim_new:N \l__draw_xmax_dim |
| 1478 |
\dim_new:N \l__draw_xmin_dim |
| 1479 |
\dim_new:N \l__draw_ymax_dim |
| 1480 |
\dim_new:N \l__draw_ymin_dim |
| 1481 |
\cs_new_protected:Npn \__draw_scope_bb_begin: |
| 1482 |
{ |
| 1483 |
\group_begin: |
| 1484 |
\dim_set_eq:NN \l__draw_xmax_dim \g_draw_bb_xmax_dim |
| 1485 |
\dim_set_eq:NN \l__draw_xmin_dim \g_draw_bb_xmin_dim |
| 1486 |
\dim_set_eq:NN \l__draw_ymax_dim \g_draw_bb_ymax_dim |
| 1487 |
\dim_set_eq:NN \l__draw_ymin_dim \g_draw_bb_ymin_dim |
| 1488 |
\__draw_reset_bb: |
| 1489 |
} |
| 1490 |
\cs_new_protected:Npn \__draw_scope_bb_end: |
| 1491 |
{ |
| 1492 |
\dim_gset_eq:NN \g_draw_bb_xmax_dim \l__draw_xmax_dim |
| 1493 |
\dim_gset_eq:NN \g_draw_bb_xmin_dim \l__draw_xmin_dim |
| 1494 |
\dim_gset_eq:NN \g_draw_bb_ymax_dim \l__draw_ymax_dim |
| 1495 |
\dim_gset_eq:NN \g_draw_bb_ymin_dim \l__draw_ymin_dim |
| 1496 |
\group_end: |
| 1497 |
} |
| 1498 |
\cs_new_protected:Npn \draw_suspend_begin: |
| 1499 |
{ |
| 1500 |
\__draw_scope_bb_begin: |
| 1501 |
\draw_path_scope_begin: |
| 1502 |
\draw_transform_matrix_reset: |
| 1503 |
\draw_transform_shift_reset: |
| 1504 |
\__draw_layers_save: |
| 1505 |
} |
| 1506 |
\cs_new_protected:Npn \draw_suspend_end: |
| 1507 |
{ |
| 1508 |
\__draw_layers_restore: |
| 1509 |
\draw_path_scope_end: |
| 1510 |
\__draw_scope_bb_end: |
| 1511 |
} |
| 1512 |
%% File: l3draw-softpath.dtx |
| 1513 |
\tl_new:N \g__draw_softpath_main_tl |
| 1514 |
\tl_new:N \l__draw_softpath_tmp_tl |
| 1515 |
\bool_new:N \g__draw_softpath_corners_bool |
| 1516 |
\cs_new_protected:Npn \__draw_softpath_add:n |
| 1517 |
{ \tl_build_gput_right:Nn \g__draw_softpath_main_tl } |
| 1518 |
\cs_generate_variant:Nn \__draw_softpath_add:n { o, e } |
| 1519 |
\cs_new_protected:Npn \__draw_softpath_use: |
| 1520 |
{ |
| 1521 |
\tl_build_get_intermediate:NN |
| 1522 |
\g__draw_softpath_main_tl |
| 1523 |
\l__draw_softpath_tmp_tl |
| 1524 |
\l__draw_softpath_tmp_tl |
| 1525 |
} |
| 1526 |
\cs_new_protected:Npn \__draw_softpath_clear: |
| 1527 |
{ |
| 1528 |
\tl_build_gbegin:N \g__draw_softpath_main_tl |
| 1529 |
\bool_gset_false:N \g__draw_softpath_corners_bool |
| 1530 |
} |
| 1531 |
\cs_new_protected:Npn \__draw_softpath_save: |
| 1532 |
{ |
| 1533 |
\tl_build_gend:N \g__draw_softpath_main_tl |
| 1534 |
\tl_set_eq:NN |
| 1535 |
\l__draw_softpath_main_tl |
| 1536 |
\g__draw_softpath_main_tl |
| 1537 |
\bool_set_eq:NN |
| 1538 |
\l__draw_softpath_corners_bool |
| 1539 |
\g__draw_softpath_corners_bool |
| 1540 |
\__draw_softpath_clear: |
| 1541 |
} |
| 1542 |
\cs_new_protected:Npn \__draw_softpath_restore: |
| 1543 |
{ |
| 1544 |
\__draw_softpath_clear: |
| 1545 |
\__draw_softpath_add:o \l__draw_softpath_main_tl |
| 1546 |
\bool_gset_eq:NN |
| 1547 |
\g__draw_softpath_corners_bool |
| 1548 |
\l__draw_softpath_corners_bool |
| 1549 |
} |
| 1550 |
\dim_new:N \g__draw_softpath_lastx_dim |
| 1551 |
\dim_new:N \g__draw_softpath_lasty_dim |
| 1552 |
\bool_new:N \g__draw_softpath_move_bool |
| 1553 |
\bool_gset_true:N \g__draw_softpath_move_bool |
| 1554 |
\cs_new_protected:Npn \__draw_softpath_closepath: |
| 1555 |
{ |
| 1556 |
\__draw_softpath_add:e |
| 1557 |
{ |
| 1558 |
\__draw_softpath_close_op:nn |
| 1559 |
{ \dim_use:N \g__draw_softpath_lastx_dim } |
| 1560 |
{ \dim_use:N \g__draw_softpath_lasty_dim } |
| 1561 |
} |
| 1562 |
} |
| 1563 |
\cs_new_protected:Npn \__draw_softpath_curveto:nnnnnn #1#2#3#4#5#6 |
| 1564 |
{ |
| 1565 |
\__draw_softpath_add:n |
| 1566 |
{ |
| 1567 |
\__draw_softpath_curveto_opi:nn {#1} {#2} |
| 1568 |
\__draw_softpath_curveto_opii:nn {#3} {#4} |
| 1569 |
\__draw_softpath_curveto_opiii:nn {#5} {#6} |
| 1570 |
} |
| 1571 |
} |
| 1572 |
\cs_new_protected:Npn \__draw_softpath_lineto:nn #1#2 |
| 1573 |
{ |
| 1574 |
\__draw_softpath_add:n |
| 1575 |
{ \__draw_softpath_lineto_op:nn {#1} {#2} } |
| 1576 |
} |
| 1577 |
\cs_new_protected:Npn \__draw_softpath_moveto:nn #1#2 |
| 1578 |
{ |
| 1579 |
\__draw_softpath_add:n |
| 1580 |
{ \__draw_softpath_moveto_op:nn {#1} {#2} } |
| 1581 |
\bool_if:NT \g__draw_softpath_move_bool |
| 1582 |
{ |
| 1583 |
\dim_gset:Nn \g__draw_softpath_lastx_dim {#1} |
| 1584 |
\dim_gset:Nn \g__draw_softpath_lasty_dim {#2} |
| 1585 |
} |
| 1586 |
} |
| 1587 |
\cs_new_protected:Npn \__draw_softpath_rectangle:nnnn #1#2#3#4 |
| 1588 |
{ |
| 1589 |
\__draw_softpath_add:n |
| 1590 |
{ |
| 1591 |
\__draw_softpath_rectangle_opi:nn {#1} {#2} |
| 1592 |
\__draw_softpath_rectangle_opii:nn {#3} {#4} |
| 1593 |
} |
| 1594 |
} |
| 1595 |
\cs_new_protected:Npn \__draw_softpath_roundpoint:nn #1#2 |
| 1596 |
{ |
| 1597 |
\__draw_softpath_add:n |
| 1598 |
{ \__draw_softpath_roundpoint_op:nn {#1} {#2} } |
| 1599 |
\bool_gset_true:N \g__draw_softpath_corners_bool |
| 1600 |
} |
| 1601 |
\cs_generate_variant:Nn \__draw_softpath_roundpoint:nn { VV } |
| 1602 |
\cs_new_protected:Npn \__draw_softpath_close_op:nn #1#2 |
| 1603 |
{ \__draw_backend_closepath: } |
| 1604 |
\cs_new_protected:Npn \__draw_softpath_curveto_opi:nn #1#2 |
| 1605 |
{ \__draw_softpath_curveto_opi:nnNnnNnn {#1} {#2} } |
| 1606 |
\cs_new_protected:Npn \__draw_softpath_curveto_opi:nnNnnNnn #1#2#3#4#5#6#7#8 |
| 1607 |
{ \__draw_backend_curveto:nnnnnn {#1} {#2} {#4} {#5} {#7} {#8} } |
| 1608 |
\cs_new_protected:Npn \__draw_softpath_curveto_opii:nn #1#2 |
| 1609 |
{ \__draw_softpath_curveto_opii:nn } |
| 1610 |
\cs_new_protected:Npn \__draw_softpath_curveto_opiii:nn #1#2 |
| 1611 |
{ \__draw_softpath_curveto_opiii:nn } |
| 1612 |
\cs_new_protected:Npn \__draw_softpath_lineto_op:nn #1#2 |
| 1613 |
{ \__draw_backend_lineto:nn {#1} {#2} } |
| 1614 |
\cs_new_protected:Npn \__draw_softpath_moveto_op:nn #1#2 |
| 1615 |
{ \__draw_backend_moveto:nn {#1} {#2} } |
| 1616 |
\cs_new_protected:Npn \__draw_softpath_roundpoint_op:nn #1#2 |
| 1617 |
{ \__draw_softpath_roundpoint_op:nn } |
| 1618 |
\cs_new_protected:Npn \__draw_softpath_rectangle_opi:nn #1#2 |
| 1619 |
{ \__draw_softpath_rectangle_opi:nnNnn {#1} {#2} } |
| 1620 |
\cs_new_protected:Npn \__draw_softpath_rectangle_opi:nnNnn #1#2#3#4#5 |
| 1621 |
{ \__draw_backend_rectangle:nnnn {#1} {#2} {#4} {#5} } |
| 1622 |
\cs_new_protected:Npn \__draw_softpath_rectangle_opii:nn #1#2 |
| 1623 |
{ \__draw_softpath_rectangle_opii:nn } |
| 1624 |
\tl_new:N \l__draw_softpath_main_tl |
| 1625 |
\tl_new:N \l__draw_softpath_part_tl |
| 1626 |
\tl_new:N \l__draw_softpath_curve_end_tl |
| 1627 |
\fp_new:N \l__draw_softpath_lastx_fp |
| 1628 |
\fp_new:N \l__draw_softpath_lasty_fp |
| 1629 |
\dim_new:N \l__draw_softpath_corneri_dim |
| 1630 |
\dim_new:N \l__draw_softpath_cornerii_dim |
| 1631 |
\tl_new:N \l__draw_softpath_first_tl |
| 1632 |
\tl_new:N \l__draw_softpath_move_tl |
| 1633 |
\fp_const:Nn \c__draw_softpath_arc_fp { 4/3 * (sqrt(2) - 1) } |
| 1634 |
\cs_new_protected:Npn \__draw_softpath_round_corners: |
| 1635 |
{ |
| 1636 |
\bool_if:NT \g__draw_softpath_corners_bool |
| 1637 |
{ |
| 1638 |
\group_begin: |
| 1639 |
\tl_clear:N \l__draw_softpath_main_tl |
| 1640 |
\tl_clear:N \l__draw_softpath_part_tl |
| 1641 |
\fp_zero:N \l__draw_softpath_lastx_fp |
| 1642 |
\fp_zero:N \l__draw_softpath_lasty_fp |
| 1643 |
\tl_clear:N \l__draw_softpath_first_tl |
| 1644 |
\tl_clear:N \l__draw_softpath_move_tl |
| 1645 |
\tl_build_gend:N \g__draw_softpath_main_tl |
| 1646 |
\exp_after:wN \__draw_softpath_round_loop:Nnn |
| 1647 |
\g__draw_softpath_main_tl |
| 1648 |
\q__draw_recursion_tail ? ? |
| 1649 |
\q__draw_recursion_stop |
| 1650 |
\group_end: |
| 1651 |
} |
| 1652 |
\bool_gset_false:N \g__draw_softpath_corners_bool |
| 1653 |
} |
| 1654 |
\cs_new_protected:Npn \__draw_softpath_round_loop:Nnn #1#2#3 |
| 1655 |
{ |
| 1656 |
\__draw_if_recursion_tail_stop_do:Nn #1 { \__draw_softpath_round_end: } |
| 1657 |
\token_if_eq_meaning:NNTF #1 \__draw_softpath_roundpoint_op:nn |
| 1658 |
{ \__draw_softpath_round_action:nn {#2} {#3} } |
| 1659 |
{ |
| 1660 |
\tl_if_empty:NT \l__draw_softpath_first_tl |
| 1661 |
{ \tl_set:Nn \l__draw_softpath_first_tl { {#2} {#3} } } |
| 1662 |
\fp_set:Nn \l__draw_softpath_lastx_fp {#2} |
| 1663 |
\fp_set:Nn \l__draw_softpath_lasty_fp {#3} |
| 1664 |
\token_if_eq_meaning:NNTF #1 \__draw_softpath_moveto_op:nn |
| 1665 |
{ |
| 1666 |
\tl_put_right:No \l__draw_softpath_main_tl |
| 1667 |
\l__draw_softpath_move_tl |
| 1668 |
\tl_put_right:No \l__draw_softpath_main_tl |
| 1669 |
\l__draw_softpath_part_tl |
| 1670 |
\tl_set:Nn \l__draw_softpath_move_tl { #1 {#2} {#3} } |
| 1671 |
\tl_clear:N \l__draw_softpath_first_tl |
| 1672 |
\tl_clear:N \l__draw_softpath_part_tl |
| 1673 |
} |
| 1674 |
{ \tl_put_right:Nn \l__draw_softpath_part_tl { #1 {#2} {#3} } } |
| 1675 |
\__draw_softpath_round_loop:Nnn |
| 1676 |
} |
| 1677 |
} |
| 1678 |
\cs_new_protected:Npn \__draw_softpath_round_action:nn #1#2 |
| 1679 |
{ |
| 1680 |
\dim_set:Nn \l__draw_softpath_corneri_dim {#1} |
| 1681 |
\dim_set:Nn \l__draw_softpath_cornerii_dim {#2} |
| 1682 |
\bool_lazy_and:nnTF |
| 1683 |
{ \dim_compare_p:nNn \l__draw_softpath_corneri_dim = { 0pt } } |
| 1684 |
{ \dim_compare_p:nNn \l__draw_softpath_cornerii_dim = { 0pt } } |
| 1685 |
{ \__draw_softpath_round_loop:Nnn } |
| 1686 |
{ \__draw_softpath_round_action:Nnn } |
| 1687 |
} |
| 1688 |
\cs_new_protected:Npn \__draw_softpath_round_action:Nnn #1#2#3 |
| 1689 |
{ |
| 1690 |
\tl_if_empty:NT \l__draw_softpath_first_tl |
| 1691 |
{ \tl_set:Nn \l__draw_softpath_first_tl { {#2} {#3} } } |
| 1692 |
\token_if_eq_meaning:NNTF #1 \__draw_softpath_curveto_opi:nn |
| 1693 |
{ \__draw_softpath_round_action_curveto:NnnNnn } |
| 1694 |
{ |
| 1695 |
\token_if_eq_meaning:NNTF #1 \__draw_softpath_close_op:nn |
| 1696 |
{ \__draw_softpath_round_action_close: } |
| 1697 |
{ |
| 1698 |
\token_if_eq_meaning:NNTF #1 \__draw_softpath_lineto_op:nn |
| 1699 |
{ \__draw_softpath_round_lookahead:NnnNnn } |
| 1700 |
{ \__draw_softpath_round_loop:Nnn } |
| 1701 |
} |
| 1702 |
} |
| 1703 |
#1 {#2} {#3} |
| 1704 |
} |
| 1705 |
\cs_new_protected:Npn \__draw_softpath_round_action_curveto:NnnNnn |
| 1706 |
#1#2#3#4#5#6 |
| 1707 |
{ |
| 1708 |
\tl_put_right:Nn \l__draw_softpath_part_tl |
| 1709 |
{ #1 {#2} {#3} #4 {#5} {#6} } |
| 1710 |
\fp_set:Nn \l__draw_softpath_lastx_fp {#5} |
| 1711 |
\fp_set:Nn \l__draw_softpath_lasty_fp {#6} |
| 1712 |
\__draw_softpath_round_lookahead:NnnNnn |
| 1713 |
} |
| 1714 |
\cs_new_protected:Npn \__draw_softpath_round_action_close: |
| 1715 |
{ |
| 1716 |
\bool_lazy_and:nnTF |
| 1717 |
{ ! \tl_if_empty_p:N \l__draw_softpath_first_tl } |
| 1718 |
{ ! \tl_if_empty_p:N \l__draw_softpath_move_tl } |
| 1719 |
{ |
| 1720 |
\exp_after:wN \__draw_softpath_round_close:nn |
| 1721 |
\l__draw_softpath_first_tl |
| 1722 |
} |
| 1723 |
{ \__draw_softpath_round_loop:Nnn } |
| 1724 |
} |
| 1725 |
\cs_new_protected:Npn \__draw_softpath_round_lookahead:NnnNnn #1#2#3#4#5#6 |
| 1726 |
{ |
| 1727 |
\bool_lazy_any:nTF |
| 1728 |
{ |
| 1729 |
{ \token_if_eq_meaning_p:NN #4 \__draw_softpath_lineto_op:nn } |
| 1730 |
{ \token_if_eq_meaning_p:NN #4 \__draw_softpath_curveto_opi:nn } |
| 1731 |
{ \token_if_eq_meaning_p:NN #4 \__draw_softpath_close_op:nn } |
| 1732 |
} |
| 1733 |
{ |
| 1734 |
\__draw_softpath_round_calc:NnnNnn |
| 1735 |
\__draw_softpath_round_loop:Nnn |
| 1736 |
{#5} {#6} |
| 1737 |
} |
| 1738 |
{ |
| 1739 |
\token_if_eq_meaning:NNTF #4 \__draw_softpath_roundpoint_op:nn |
| 1740 |
{ \__draw_softpath_round_roundpoint:NnnNnnNnn } |
| 1741 |
{ \__draw_softpath_round_loop:Nnn } |
| 1742 |
} |
| 1743 |
#1 {#2} {#3} |
| 1744 |
#4 {#5} {#6} |
| 1745 |
} |
| 1746 |
\cs_new_protected:Npn \__draw_softpath_round_roundpoint:NnnNnnNnn |
| 1747 |
#1#2#3#4#5#6#7#8#9 |
| 1748 |
{ |
| 1749 |
\__draw_softpath_round_calc:NnnNnn |
| 1750 |
\__draw_softpath_round_loop:Nnn |
| 1751 |
{#8} {#9} |
| 1752 |
#1 {#2} {#3} |
| 1753 |
#4 {#5} {#6} #7 {#8} {#9} |
| 1754 |
} |
| 1755 |
\cs_new_protected:Npn \__draw_softpath_round_calc:NnnNnn #1#2#3#4#5#6 |
| 1756 |
{ |
| 1757 |
\tl_set:Ne \l__draw_softpath_curve_end_tl |
| 1758 |
{ |
| 1759 |
\draw_point_interpolate_distance:nnn |
| 1760 |
\l__draw_softpath_cornerii_dim |
| 1761 |
{ #5 , #6 } { #2 , #3 } |
| 1762 |
} |
| 1763 |
\tl_put_right:Ne \l__draw_softpath_part_tl |
| 1764 |
{ |
| 1765 |
\exp_not:N #4 |
| 1766 |
\__draw_softpath_round_calc:eVnnnn |
| 1767 |
{ |
| 1768 |
\draw_point_interpolate_distance:nnn |
| 1769 |
\l__draw_softpath_corneri_dim |
| 1770 |
{ #5 , #6 } |
| 1771 |
{ |
| 1772 |
\l__draw_softpath_lastx_fp , |
| 1773 |
\l__draw_softpath_lasty_fp |
| 1774 |
} |
| 1775 |
} |
| 1776 |
\l__draw_softpath_curve_end_tl |
| 1777 |
{#5} {#6} {#2} {#3} |
| 1778 |
} |
| 1779 |
\fp_set:Nn \l__draw_softpath_lastx_fp {#5} |
| 1780 |
\fp_set:Nn \l__draw_softpath_lasty_fp {#6} |
| 1781 |
#1 |
| 1782 |
} |
| 1783 |
\cs_new:Npn \__draw_softpath_round_calc:nnnnnn #1#2#3#4#5#6 |
| 1784 |
{ |
| 1785 |
\__draw_softpath_round_calc:nnnnw {#3} {#4} {#5} {#6} |
| 1786 |
#1 \s__draw_mark #2 \s__draw_stop |
| 1787 |
} |
| 1788 |
\cs_generate_variant:Nn \__draw_softpath_round_calc:nnnnnn { eV } |
| 1789 |
\cs_new:Npn \__draw_softpath_round_calc:nnnnw |
| 1790 |
#1#2#3#4 #5 , #6 \s__draw_mark #7 , #8 \s__draw_stop |
| 1791 |
{ |
| 1792 |
{#5} {#6} |
| 1793 |
\exp_not:N \__draw_softpath_curveto_opi:nn |
| 1794 |
{ |
| 1795 |
\fp_to_dim:n |
| 1796 |
{ #5 + \c__draw_softpath_arc_fp * ( #1 - #5 ) } |
| 1797 |
} |
| 1798 |
{ |
| 1799 |
\fp_to_dim:n |
| 1800 |
{ #6 + \c__draw_softpath_arc_fp * ( #2 - #6 ) } |
| 1801 |
} |
| 1802 |
\exp_not:N \__draw_softpath_curveto_opii:nn |
| 1803 |
{ |
| 1804 |
\fp_to_dim:n |
| 1805 |
{ #7 + \c__draw_softpath_arc_fp * ( #1 - #7 ) } |
| 1806 |
} |
| 1807 |
{ |
| 1808 |
\fp_to_dim:n |
| 1809 |
{ #8 + \c__draw_softpath_arc_fp* ( #2 - #8 ) } |
| 1810 |
} |
| 1811 |
\exp_not:N \__draw_softpath_curveto_opiii:nn |
| 1812 |
{#7} {#8} |
| 1813 |
} |
| 1814 |
\cs_new_protected:Npn \__draw_softpath_round_close:nn #1#2 |
| 1815 |
{ |
| 1816 |
\use:e |
| 1817 |
{ |
| 1818 |
\__draw_softpath_round_calc:NnnNnn |
| 1819 |
{ |
| 1820 |
\tl_set:Ne \exp_not:N \l__draw_softpath_move_tl |
| 1821 |
{ |
| 1822 |
\__draw_softpath_moveto_op:nn |
| 1823 |
\exp_not:N \exp_after:wN |
| 1824 |
\exp_not:N \__draw_softpath_round_close:w |
| 1825 |
\exp_not:N \l__draw_softpath_curve_end_tl |
| 1826 |
\s__draw_stop |
| 1827 |
} |
| 1828 |
\use:e |
| 1829 |
{ |
| 1830 |
\exp_not:N \exp_not:N \exp_not:N \use_i:nnnn |
| 1831 |
{ |
| 1832 |
\__draw_softpath_round_loop:Nnn |
| 1833 |
\__draw_softpath_close_op:nn |
| 1834 |
\exp_not:N \exp_after:wN |
| 1835 |
\exp_not:N \__draw_softpath_round_close:w |
| 1836 |
\exp_not:N \l__draw_softpath_curve_end_tl |
| 1837 |
\s__draw_stop |
| 1838 |
} |
| 1839 |
} |
| 1840 |
} |
| 1841 |
{#1} {#2} |
| 1842 |
\__draw_softpath_lineto_op:nn |
| 1843 |
\exp_after:wN \use_none:n \l__draw_softpath_move_tl |
| 1844 |
} |
| 1845 |
} |
| 1846 |
\cs_new:Npn \__draw_softpath_round_close:w #1 , #2 \s__draw_stop { {#1} {#2} } |
| 1847 |
\cs_new_protected:Npn \__draw_softpath_round_end: |
| 1848 |
{ |
| 1849 |
\tl_put_right:No \l__draw_softpath_main_tl |
| 1850 |
\l__draw_softpath_move_tl |
| 1851 |
\tl_put_right:No \l__draw_softpath_main_tl |
| 1852 |
\l__draw_softpath_part_tl |
| 1853 |
\tl_build_gbegin:N \g__draw_softpath_main_tl |
| 1854 |
\__draw_softpath_add:o \l__draw_softpath_main_tl |
| 1855 |
} |
| 1856 |
%% File: l3draw-state.dtx |
| 1857 |
\dim_new:N \g__draw_linewidth_dim |
| 1858 |
\dim_new:N \l_draw_default_linewidth_dim |
| 1859 |
\dim_set:Nn \l_draw_default_linewidth_dim { 0.4pt } |
| 1860 |
\cs_new_protected:Npn \draw_set_linewidth:n #1 |
| 1861 |
{ |
| 1862 |
\dim_gset:Nn \g__draw_linewidth_dim { \fp_to_dim:n {#1} } |
| 1863 |
\__draw_backend_linewidth:n \g__draw_linewidth_dim |
| 1864 |
} |
| 1865 |
\cs_new_protected:Npn \draw_set_dash_pattern:nn #1#2 |
| 1866 |
{ |
| 1867 |
\group_begin: |
| 1868 |
\seq_set_from_clist:Nn \l__draw_tmp_seq {#1} |
| 1869 |
\seq_set_map:NNn \l__draw_tmp_seq \l__draw_tmp_seq |
| 1870 |
{ \fp_to_dim:n {##1} } |
| 1871 |
\use:e |
| 1872 |
{ |
| 1873 |
\__draw_backend_dash_pattern:nn |
| 1874 |
{ \seq_use:Nn \l__draw_tmp_seq { , } } |
| 1875 |
{ \fp_to_dim:n {#2} } |
| 1876 |
} |
| 1877 |
\group_end: |
| 1878 |
} |
| 1879 |
\seq_new:N \l__draw_tmp_seq |
| 1880 |
\cs_new_protected:Npn \draw_set_miterlimit:n #1 |
| 1881 |
{ \exp_args:Ne \__draw_backend_miterlimit:n { \fp_eval:n {#1} } } |
| 1882 |
\cs_new_protected:Npn \draw_set_cap_butt: { \__draw_backend_cap_butt: } |
| 1883 |
\cs_new_protected:Npn \draw_set_cap_rectangle: { \__draw_backend_cap_rectangle: } |
| 1884 |
\cs_new_protected:Npn \draw_set_cap_round: { \__draw_backend_cap_round: } |
| 1885 |
\cs_new_protected:Npn \draw_set_evenodd_rule: { \__draw_backend_evenodd_rule: } |
| 1886 |
\cs_new_protected:Npn \draw_set_nonzero_rule: { \__draw_backend_nonzero_rule: } |
| 1887 |
\cs_new_protected:Npn \draw_set_join_bevel: { \__draw_backend_join_bevel: } |
| 1888 |
\cs_new_protected:Npn \draw_set_join_miter: { \__draw_backend_join_miter: } |
| 1889 |
\cs_new_protected:Npn \draw_set_join_round: { \__draw_backend_join_round: } |
| 1890 |
%% File: l3draw-transforms.dtx |
| 1891 |
\bool_new:N \l__draw_matrix_active_bool |
| 1892 |
\fp_new:N \l__draw_matrix_a_fp |
| 1893 |
\fp_new:N \l__draw_matrix_b_fp |
| 1894 |
\fp_new:N \l__draw_matrix_c_fp |
| 1895 |
\fp_new:N \l__draw_matrix_d_fp |
| 1896 |
\dim_new:N \l__draw_xshift_dim |
| 1897 |
\dim_new:N \l__draw_yshift_dim |
| 1898 |
\cs_new_protected:Npn \draw_transform_matrix_reset: |
| 1899 |
{ |
| 1900 |
\fp_set:Nn \l__draw_matrix_a_fp { 1 } |
| 1901 |
\fp_zero:N \l__draw_matrix_b_fp |
| 1902 |
\fp_zero:N \l__draw_matrix_c_fp |
| 1903 |
\fp_set:Nn \l__draw_matrix_d_fp { 1 } |
| 1904 |
\bool_set_false:N \l__draw_matrix_active_bool |
| 1905 |
} |
| 1906 |
\cs_new_protected:Npn \draw_transform_shift_reset: |
| 1907 |
{ |
| 1908 |
\dim_zero:N \l__draw_xshift_dim |
| 1909 |
\dim_zero:N \l__draw_yshift_dim |
| 1910 |
} |
| 1911 |
\draw_transform_matrix_reset: |
| 1912 |
\draw_transform_shift_reset: |
| 1913 |
\cs_new_protected:Npn \draw_transform_matrix_absolute:nnnn #1#2#3#4 |
| 1914 |
{ |
| 1915 |
\fp_set:Nn \l__draw_matrix_a_fp {#1} |
| 1916 |
\fp_set:Nn \l__draw_matrix_b_fp {#2} |
| 1917 |
\fp_set:Nn \l__draw_matrix_c_fp {#3} |
| 1918 |
\fp_set:Nn \l__draw_matrix_d_fp {#4} |
| 1919 |
\bool_lazy_all:nTF |
| 1920 |
{ |
| 1921 |
{ \fp_compare_p:nNn \l__draw_matrix_a_fp = \c_one_fp } |
| 1922 |
{ \fp_compare_p:nNn \l__draw_matrix_b_fp = \c_zero_fp } |
| 1923 |
{ \fp_compare_p:nNn \l__draw_matrix_c_fp = \c_zero_fp } |
| 1924 |
{ \fp_compare_p:nNn \l__draw_matrix_d_fp = \c_one_fp } |
| 1925 |
} |
| 1926 |
{ \bool_set_false:N \l__draw_matrix_active_bool } |
| 1927 |
{ \bool_set_true:N \l__draw_matrix_active_bool } |
| 1928 |
} |
| 1929 |
\cs_new_protected:Npn \draw_transform_shift_absolute:n #1 |
| 1930 |
{ |
| 1931 |
\__draw_point_process:nn |
| 1932 |
{ \__draw_transform_shift_absolute:nn } { \draw_point:n {#1} } |
| 1933 |
} |
| 1934 |
\cs_new_protected:Npn \__draw_transform_shift_absolute:nn #1#2 |
| 1935 |
{ |
| 1936 |
\dim_set:Nn \l__draw_xshift_dim {#1} |
| 1937 |
\dim_set:Nn \l__draw_yshift_dim {#2} |
| 1938 |
} |
| 1939 |
\cs_new_protected:Npn \draw_transform_matrix:nnnn #1#2#3#4 |
| 1940 |
{ |
| 1941 |
\use:e |
| 1942 |
{ |
| 1943 |
\__draw_transform:nnnn |
| 1944 |
{ \fp_eval:n {#1} } |
| 1945 |
{ \fp_eval:n {#2} } |
| 1946 |
{ \fp_eval:n {#3} } |
| 1947 |
{ \fp_eval:n {#4} } |
| 1948 |
} |
| 1949 |
} |
| 1950 |
\cs_new_protected:Npn \__draw_transform:nnnn #1#2#3#4 |
| 1951 |
{ |
| 1952 |
\use:e |
| 1953 |
{ |
| 1954 |
\draw_transform_matrix_absolute:nnnn |
| 1955 |
{ #1 * \l__draw_matrix_a_fp + #2 * \l__draw_matrix_c_fp } |
| 1956 |
{ #1 * \l__draw_matrix_b_fp + #2 * \l__draw_matrix_d_fp } |
| 1957 |
{ #3 * \l__draw_matrix_a_fp + #4 * \l__draw_matrix_c_fp } |
| 1958 |
{ #3 * \l__draw_matrix_b_fp + #4 * \l__draw_matrix_d_fp } |
| 1959 |
} |
| 1960 |
} |
| 1961 |
\cs_new_protected:Npn \draw_transform_shift:n #1 |
| 1962 |
{ |
| 1963 |
\__draw_point_process:nn |
| 1964 |
{ \__draw_transform_shift:nn } { \draw_point:n {#1} } |
| 1965 |
} |
| 1966 |
\cs_new_protected:Npn \__draw_transform_shift:nn #1#2 |
| 1967 |
{ |
| 1968 |
\__draw_transform_shift:nnnn |
| 1969 |
\l__draw_xshift_dim |
| 1970 |
\l__draw_yshift_dim |
| 1971 |
{#1} {#2} |
| 1972 |
} |
| 1973 |
\cs_new_protected:Npn \__draw_transform_shift:nnnn #1#2#3#4 |
| 1974 |
{ |
| 1975 |
\dim_set:Nn \l__draw_xshift_dim |
| 1976 |
{ |
| 1977 |
\fp_to_dim:n |
| 1978 |
{ |
| 1979 |
#1 + |
| 1980 |
( #3 * \l__draw_matrix_a_fp + #4 * \l__draw_matrix_c_fp ) |
| 1981 |
} |
| 1982 |
} |
| 1983 |
\dim_set:Nn \l__draw_yshift_dim |
| 1984 |
{ |
| 1985 |
\fp_to_dim:n |
| 1986 |
{ |
| 1987 |
#2 + |
| 1988 |
( #3 * \l__draw_matrix_b_fp + #4 * \l__draw_matrix_d_fp ) |
| 1989 |
} |
| 1990 |
} |
| 1991 |
} |
| 1992 |
\cs_new_protected:Npn \draw_transform_matrix_invert: |
| 1993 |
{ |
| 1994 |
\bool_if:NT \l__draw_matrix_active_bool |
| 1995 |
{ |
| 1996 |
\__draw_transform_invert:e |
| 1997 |
{ |
| 1998 |
\fp_eval:n |
| 1999 |
{ |
| 2000 |
1 / |
| 2001 |
( |
| 2002 |
\l__draw_matrix_a_fp * \l__draw_matrix_d_fp |
| 2003 |
- \l__draw_matrix_b_fp * \l__draw_matrix_c_fp |
| 2004 |
) |
| 2005 |
} |
| 2006 |
} |
| 2007 |
} |
| 2008 |
} |
| 2009 |
\cs_new_protected:Npn \__draw_transform_invert:n #1 |
| 2010 |
{ |
| 2011 |
\use:e |
| 2012 |
{ |
| 2013 |
\draw_transform_matrix_absolute:nnnn |
| 2014 |
{ \l__draw_matrix_d_fp * #1 } |
| 2015 |
{ -\l__draw_matrix_b_fp * #1 } |
| 2016 |
{ -\l__draw_matrix_c_fp * #1 } |
| 2017 |
{ \l__draw_matrix_a_fp * #1 } |
| 2018 |
} |
| 2019 |
} |
| 2020 |
\cs_generate_variant:Nn \__draw_transform_invert:n { e } |
| 2021 |
\cs_new_protected:Npn \draw_transform_shift_invert: |
| 2022 |
{ |
| 2023 |
\bool_if:NTF \l__draw_matrix_active_bool |
| 2024 |
{ |
| 2025 |
\__draw_transform_shift_invert:e |
| 2026 |
{ |
| 2027 |
\fp_eval:n |
| 2028 |
{ |
| 2029 |
1 / |
| 2030 |
( |
| 2031 |
\l__draw_matrix_a_fp * \l__draw_matrix_d_fp |
| 2032 |
- \l__draw_matrix_b_fp * \l__draw_matrix_c_fp |
| 2033 |
) |
| 2034 |
} |
| 2035 |
} |
| 2036 |
} |
| 2037 |
{ |
| 2038 |
\dim_set:Nn \l__draw_xshift_dim { -\l__draw_xshift_dim } |
| 2039 |
\dim_set:Nn \l__draw_yshift_dim { -\l__draw_yshift_dim } |
| 2040 |
} |
| 2041 |
} |
| 2042 |
\cs_new_protected:Npn \__draw_transform_shift_invert:n #1 |
| 2043 |
{ |
| 2044 |
\use:e |
| 2045 |
{ |
| 2046 |
\__draw_transform_shift:nn |
| 2047 |
{ |
| 2048 |
\fp_to_dim:n |
| 2049 |
{ |
| 2050 |
( |
| 2051 |
\l__draw_matrix_c_fp * \l__draw_yshift_dim |
| 2052 |
- \l__draw_matrix_d_fp * \l__draw_xshift_dim |
| 2053 |
) * #1 |
| 2054 |
} |
| 2055 |
} |
| 2056 |
{ |
| 2057 |
\fp_to_dim:n |
| 2058 |
{ |
| 2059 |
( |
| 2060 |
\l__draw_matrix_b_fp * \l__draw_xshift_dim |
| 2061 |
- \l__draw_matrix_a_fp * \l__draw_yshift_dim |
| 2062 |
) * #1 |
| 2063 |
} |
| 2064 |
} |
| 2065 |
} |
| 2066 |
} |
| 2067 |
\cs_generate_variant:Nn \__draw_transform_shift_invert:n { e } |
| 2068 |
\cs_new_protected:Npn \draw_transform_triangle:nnn #1#2#3 |
| 2069 |
{ |
| 2070 |
\__draw_point_process:nnnn |
| 2071 |
{ \__draw_transform_triangle:nnnnnn } |
| 2072 |
{ \draw_point:n {#1} } |
| 2073 |
{ \draw_point:n {#2} } |
| 2074 |
{ \draw_point:n {#3} } |
| 2075 |
} |
| 2076 |
\cs_new_protected:Npn \__draw_transform_triangle:nnnnnn #1#2#3#4#5#6 |
| 2077 |
{ |
| 2078 |
\use:e |
| 2079 |
{ |
| 2080 |
\draw_transform_matrix:nnnn |
| 2081 |
{ #3 - #1 } |
| 2082 |
{ #4 - #2 } |
| 2083 |
{ #5 - #1 } |
| 2084 |
{ #6 - #2 } |
| 2085 |
\draw_transform_shift:n { #1 , #2 } |
| 2086 |
} |
| 2087 |
} |
| 2088 |
\cs_new_protected:Npn \draw_transform_scale:n #1 |
| 2089 |
{ \draw_transform_matrix:nnnn { #1 } { 0 } { 0 } { #1 } } |
| 2090 |
\cs_new_protected:Npn \draw_transform_xscale:n #1 |
| 2091 |
{ \draw_transform_matrix:nnnn { #1 } { 0 } { 0 } { 1 } } |
| 2092 |
\cs_new_protected:Npn \draw_transform_yscale:n #1 |
| 2093 |
{ \draw_transform_matrix:nnnn { 1 } { 0 } { 0 } { #1 } } |
| 2094 |
\cs_new_protected:Npn \draw_transform_xshift:n #1 |
| 2095 |
{ \draw_transform_shift:n { #1 , 0pt } } |
| 2096 |
\cs_new_protected:Npn \draw_transform_yshift:n #1 |
| 2097 |
{ \draw_transform_shift:n { 0pt , #1 } } |
| 2098 |
\cs_new_protected:Npn \draw_transform_xslant:n #1 |
| 2099 |
{ \draw_transform_matrix:nnnn { 1 } { 0 } { #1 } { 1 } } |
| 2100 |
\cs_new_protected:Npn \draw_transform_yslant:n #1 |
| 2101 |
{ \draw_transform_matrix:nnnn { 1 } { #1 } { 0 } { 1 } } |
| 2102 |
\cs_new_protected:Npn \draw_transform_rotate:n #1 |
| 2103 |
{ \__draw_transform_rotate:e { \fp_eval:n {#1} } } |
| 2104 |
\cs_new_protected:Npn \__draw_transform_rotate:n #1 |
| 2105 |
{ |
| 2106 |
\__draw_transform_rotate:ee |
| 2107 |
{ \fp_eval:n { cosd(#1) } } |
| 2108 |
{ \fp_eval:n { sind(#1) } } |
| 2109 |
} |
| 2110 |
\cs_generate_variant:Nn \__draw_transform_rotate:n { e } |
| 2111 |
\cs_new_protected:Npn \__draw_transform_rotate:nn #1#2 |
| 2112 |
{ \draw_transform_matrix:nnnn {#1} {#2} { -#2 } { #1 } } |
| 2113 |
\cs_generate_variant:Nn \__draw_transform_rotate:nn { ee } |
| 2114 |
%% |
| 2115 |
%% |
| 2116 |
%% End of file `l3draw.sty'. |