summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/spath3/tikzlibraryspath3.code.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-01-23 22:17:41 +0000
committerKarl Berry <karl@freefriends.org>2021-01-23 22:17:41 +0000
commit3fc4de03f2da103a96f5d0cc757300f8c7e311f1 (patch)
tree69271c9383f64bb9905fa1e00910cf2b18c96119 /Master/texmf-dist/tex/latex/spath3/tikzlibraryspath3.code.tex
parent03a1a8f6b693dc58a1840c8703af5c5399dc6117 (diff)
spath3 (23jan21)
git-svn-id: svn://tug.org/texlive/trunk@57504 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/spath3/tikzlibraryspath3.code.tex')
-rw-r--r--Master/texmf-dist/tex/latex/spath3/tikzlibraryspath3.code.tex595
1 files changed, 595 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/spath3/tikzlibraryspath3.code.tex b/Master/texmf-dist/tex/latex/spath3/tikzlibraryspath3.code.tex
new file mode 100644
index 00000000000..32d0d9fea08
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/spath3/tikzlibraryspath3.code.tex
@@ -0,0 +1,595 @@
+%%
+%% This is file `tikzlibraryspath3.code.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% spath3_code.dtx (with options: `tikzspath3')
+%% ----------------------------------------------------------------
+%% spath3 --- Functions for manipulating PGF soft paths
+%% E-mail: loopspace@mathforge.org
+%% Released under the LaTeX Project Public License v1.3c or later
+%% See http://www.latex-project.org/lppl.txt
+%% ----------------------------------------------------------------
+%%
+\RequirePackage{spath3}
+\RequirePackage{expl3}
+\ExplSyntaxOn
+
+\tl_new:N \l__spath_current_tl
+\tl_new:N \l__spath_reverse_tl
+\tl_new:N \l__spath_prefix_tl
+\tl_new:N \l__spath_suffix_tl
+\tl_new:N \g__spath_smuggle_tl
+\seq_new:N \g__spath_tmpa_seq
+\seq_new:N \g__spath_tmpb_seq
+\bool_new:N \l__spath_draft_bool
+\tl_set:Nn \l__spath_prefix_tl {tikz@intersect@path@name@}
+\tl_set:Nn \l__spath_suffix_tl {}
+\tl_new:N \g__spath_tikzfinish_tl
+\cs_new_protected_nopar:Npn \spath_at_end_of_path:
+{
+ \tl_use:N \g__spath_tikzfinish_tl
+ \tl_gclear:N \g__spath_tikzfinish_tl
+}
+\tl_put_right:Nn \tikz@finish {\spath_at_end_of_path:}
+
+\cs_new_protected_nopar:Npn \spath_save_path:Nn #1#2
+{
+ \tl_gput_right:Nn \g__spath_tikzfinish_tl
+ {
+ \tl_clear_new:N #1
+ \tl_set:Nn #1 {#2}
+ }
+}
+\cs_generate_variant:Nn \spath_save_path:Nn {cn, NV, cV}
+
+\cs_new_protected_nopar:Npn \spath_gsave_path:Nn #1#2
+{
+ \tl_gput_right:Nn \g__spath_tikzfinish_tl
+ {
+ \tl_gclear_new:N #1
+ \tl_gset:Nn #1 {#2}
+ }
+}
+\cs_generate_variant:Nn \spath_gsave_path:Nn {cn, NV, cV}
+\tikzset{
+ spath/.is~family,
+ spath/.cd,
+ set~ prefix/.store~ in=\l__spath_prefix_tl,
+ prefix/.is~choice,
+ prefix/default/.style={
+ /tikz/spath/set~ prefix=tikz@intersect@path@name@
+ },
+ set~ suffix/.store~ in=\l__spath_suffix_tl,
+ suffix/.is~choice,
+ suffix/default/.style={
+ /tikz/spath/set~ suffix={}
+ },
+ set~ name/.style={
+ /tikz/spath/prefix=#1,
+ /tikz/spath/suffix=#1
+ },
+ save/.code={
+ \tikz@addmode{
+ \spath_get_current_path:N \l__spath_tmpa_tl
+ \spath_bake_round:NV \l__spath_tmpa_tl \l__spath_tmpa_tl
+ \spath_save_path:cV {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} \l__spath_tmpa_tl
+ }
+ },
+ clone/.code~ 2~ args={
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl}
+ {
+ \tl_clear_new:c
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ \tl_set_eq:cc
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl}
+ }
+ },
+ clone~ global/.code~ 2~ args={
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl}
+ {
+ \tl_gclear_new:c
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ \tl_gset_eq:cc
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl}
+ }
+ },
+ save~ global/.code={
+ \tikz@addmode{
+ \spath_get_current_path:N \l__spath_tmpa_tl
+ \spath_bake_round:NV \l__spath_tmpa_tl \l__spath_tmpa_tl
+ \spath_gsave_path:cV
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ \l__spath_tmpa_tl
+ }
+ },
+ save~ to~ aux/.code={
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \spath_save_to_aux:c
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ }
+ },
+ restore/.code={
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \spath_set_current_path:c
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ \spath_set_tikz_coords:v
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ }
+ },
+ show~current~path/.code={
+ \tikz@addmode{
+ \pgfsyssoftpath@getcurrentpath\l__spath_tmpa_tl
+ \iow_term:n {---~ current~ soft~ path~ ---}
+ \spath_show:V \l__spath_tmpa_tl
+ }
+ },
+ show/.code={
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \iow_term:n {---~ soft~ path~ #1~ ---}
+ \spath_show:v {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ }
+ },
+ append/.code={
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \spath_get_current_path:N \l__spath_current_tl
+ \spath_weld:Nv
+ \l__spath_current_tl
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ \spath_set_current_path:N \l__spath_current_tl
+ \spath_set_tikz_coords:V \l__spath_current_tl
+ }
+ },
+ join~ with/.code~ 2~ args={
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl}
+ {
+ \spath_append:cv
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl}
+ }
+ }
+ },
+ spot~ weld/.code={
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \spath_spot_weld_components:c
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ }
+ },
+ reverse/.code={
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \spath_reverse:c
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ }
+ },
+ append~ reverse/.code={
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \spath_reverse:Nv
+ \l__spath_reverse_tl
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ \spath_get_current_path:N \l__spath_current_tl
+ \spath_weld:NV \l__spath_current_tl \l__spath_reverse_tl
+ \spath_set_current_path:N \l__spath_current_tl
+ \spath_set_tikz_coords:V \l__spath_current_tl
+ }
+ },
+ insert/.code={
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \spath_get_current_path:N \l__spath_current_tl
+ \spath_append:Nv
+ \l__spath_current_tl
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ \spath_set_current_path:N \l__spath_current_tl
+ \spath_set_tikz_coords:V \l__spath_current_tl
+ }
+ },
+ insert~ reverse/.code={
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \spath_reverse:Nv
+ \l__spath_reverse_tl
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ \spath_get_current_path:N \l__spath_current_tl
+ \spath_append:NV \l__spath_current_tl \l__spath_reverse_tl
+ \spath_set_current_path:N \l__spath_current_tl
+ \spath_set_tikz_coords:V \l__spath_current_tl
+ }
+ },
+ shorten~ at~ end/.code~ 2~ args={
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \spath_shorten_at_end:cn
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} {#2}
+ }
+ },
+ shorten~ at~ start/.code~ 2~ args ={
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \spath_shorten_at_start:cn
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} {#2}
+ }
+ },
+ shorten~ at~ both~ ends/.code~ 2~ args={
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \spath_shorten_at_end:cn
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} {#2}
+ \spath_shorten_at_start:cn
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl} {#2}
+ }
+ },
+ translate/.code~ n~ args={3}{
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \spath_translate:cnn
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}{#2}{#3}
+ }
+ },
+ export~ to~ svg/.code={
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \spath_export_to_svg:c
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ }
+ },
+ transform/.code~ 2~ args={
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \group_begin:
+ \pgftransformreset
+ \tikzset{#2}
+ \pgfgettransform \l__spath_tmpa_tl
+ \tl_gset:Nn \g__spath_smuggle_tl
+ {
+ \spath_transform:cnnnnnn
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ }
+ \tl_gput_right:NV \g__spath_smuggle_tl \l__spath_tmpa_tl
+ \group_end:
+ \tl_use:N \g__spath_smuggle_tl
+ }
+ },
+ transform~global/.code~ 2~ args={
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \group_begin:
+ \pgftransformreset
+ \tikzset{#2}
+ \pgfgettransform \l__spath_tmpa_tl
+ \tl_gset:Nn \g__spath_smuggle_tl
+ {
+ \spath_gtransform:cnnnnnn
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ }
+ \tl_gput_right:NV \g__spath_smuggle_tl \l__spath_tmpa_tl
+ \group_end:
+ \tl_use:N \g__spath_smuggle_tl
+ }
+ },
+ split~ at~ intersections/.code~ n~ args={2}{
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl}
+ {
+ \spath_split_at_intersections:cc
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {\tl_use:N \l__spath_prefix_tl #2 \tl_use:N \l__spath_suffix_tl}
+ }
+ }
+ },
+ split~ at~ self~ intersections/.code={
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \spath_split_at_self_intersections:c
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ }
+ },
+ get~ components~ of/.code~ 2~ args={
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \clist_clear_new:N #2
+ \spath_components_to_seq:Nv
+ \l__spath_tmpa_seq
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ \seq_map_inline:Nn \l__spath_tmpa_seq
+ {
+ \tl_new:c
+ {\tl_use:N \l__spath_prefix_tl anonymous_\int_use:N \g__spath_anon_int \tl_use:N \l__spath_suffix_tl}
+ \tl_set:cn
+ {\tl_use:N \l__spath_prefix_tl anonymous_\int_use:N \g__spath_anon_int \tl_use:N \l__spath_suffix_tl} {##1}
+ \clist_put_right:Nx #2 {anonymous_\int_use:N \g__spath_anon_int}
+ \int_gincr:N \g__spath_anon_int
+ }
+ }
+ },
+ render~ components/.code={
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \group_begin:
+ \spath_components_to_seq:Nv
+ \l__spath_tmpa_seq
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ \seq_map_indexed_inline:Nn \l__spath_tmpa_seq
+ {
+ \spath_tikz_path:nn
+ {
+ every~ spath~ component/.try,
+ spath ~component~ ##1/.try,
+ spath ~component/.try={##1},
+ every~ #1~ component/.try,
+ #1 ~component~ ##1/.try,
+ #1 ~component/.try={##1},
+ }
+ {
+ ##2
+ }
+ }
+ \group_end:
+ }
+ },
+ insert~ gaps~ after~ components/.code~ n~ args={3}{
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \group_begin:
+ \seq_gclear:N \g__spath_tmpa_seq
+ \seq_gclear:N \g__spath_tmpb_seq
+ \foreach \l__spath_tmpa_tl in {#3}
+ {
+ \seq_gput_right:NV \g__spath_tmpa_seq \l__spath_tmpa_tl
+ \seq_gput_right:Nx \g__spath_tmpb_seq {\int_eval:n { \l__spath_tmpa_tl + 1 }}
+ }
+ \spath_components_to_seq:Nv
+ \l__spath_tmpa_seq
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ \seq_clear:N \l__spath_tmpb_seq
+ \seq_map_indexed_inline:Nn \l__spath_tmpa_seq
+ {
+ \tl_set:Nn \l__spath_tmpa_tl {##2}
+ \seq_if_in:NnT \g__spath_tmpa_seq {##1}
+ {
+ \spath_shorten_at_end:Nn \l__spath_tmpa_tl {#2/2}
+ }
+ \seq_if_in:NnT \g__spath_tmpb_seq {##1}
+ {
+ \spath_shorten_at_start:Nn \l__spath_tmpa_tl {#2/2}
+ }
+ \seq_put_right:NV \l__spath_tmpb_seq \l__spath_tmpa_tl
+ }
+ \tl_gset:Nx \g__spath_output_tl {\seq_use:Nn \l__spath_tmpb_seq {} }
+ \group_end:
+ \tl_set_eq:cN
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ \g__spath_output_tl
+ \tl_gclear:N \g__spath_output_tl
+ }
+ },
+ join~ components/.code~ 2~ args={
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \seq_gclear:N \g__spath_tmpa_seq
+ \foreach \l__spath_tmpa_tl in {#2}
+ {
+ \seq_gput_right:NV \g__spath_tmpa_seq \l__spath_tmpa_tl
+ }
+ \seq_gsort:Nn \g__spath_tmpa_seq
+ {
+ \int_compare:nNnTF {##1} > {##2}
+ { \sort_return_same: }
+ { \sort_return_swapped: }
+ }
+ \seq_map_inline:Nn \g__spath_tmpa_seq
+ {
+ \spath_join_component:cn
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}{##1}
+ }
+ }
+ },
+ remove~ empty~ components/.code={
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \spath_remove_empty_components:c
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ }
+ },
+ draft~ mode/.is~ choice,
+ draft~ mode/true/.code={
+ \bool_set_true:N \l__spath_draft_bool
+ },
+ draft~ mode/false/.code={
+ \bool_set_false:N \l__spath_draft_bool
+ },
+ maybe~ spot~ weld/.code={
+ \bool_if:NF \l__spath_draft_bool
+ {
+ \tl_if_exist:cT {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ {
+ \spath_spot_weld_components:c
+ {\tl_use:N \l__spath_prefix_tl #1 \tl_use:N \l__spath_suffix_tl}
+ }
+ }
+ },
+ transform~ to/.code~ 2~ args={
+ \group_begin:
+ \tl_if_exist:cTF
+ {
+ \tl_use:N \l__spath_prefix_tl
+ #1
+ \tl_use:N \l__spath_suffix_tl
+ }
+ {
+ \spath_reallength:Nv
+ \l__spath_tmpa_int
+ {
+ \tl_use:N \l__spath_prefix_tl
+ #1
+ \tl_use:N \l__spath_suffix_tl
+ }
+
+ \tl_set:Nx \l__spath_tmpb_tl
+ {\fp_to_decimal:n {(#2) * (\l__spath_tmpa_int)}}
+ \spath_transformation_at:NvV \l__spath_tmpc_tl
+ {
+ \tl_use:N \l__spath_prefix_tl
+ #1
+ \tl_use:N \l__spath_suffix_tl
+ }
+ \l__spath_tmpb_tl
+ \tl_gset_eq:NN \g__spath_smuggle_tl \l__spath_tmpc_tl
+ }
+ {
+ \tl_gset_eq:NN \g__spath_smuggle_tl { {1}{0}{0}{1}{0pt}{0pt} }
+ }
+ \group_end:
+ \exp_last_unbraced:NV \pgfsettransformentries \g__spath_smuggle_tl
+ \tl_gclear:N \g__spath_smuggle_tl
+ },
+ upright~ transform~ to/.code~ 2~ args={
+ \group_begin:
+ \tl_if_exist:cTF
+ {
+ \tl_use:N \l__spath_prefix_tl
+ #1
+ \tl_use:N \l__spath_suffix_tl
+ }
+ {
+ \spath_reallength:Nv
+ \l__spath_tmpa_int
+ {
+ \tl_use:N \l__spath_prefix_tl
+ #1
+ \tl_use:N \l__spath_suffix_tl
+ }
+
+ \tl_set:Nx \l__spath_tmpb_tl
+ {\fp_to_decimal:n {(#2) * (\l__spath_tmpa_int)}}
+ \spath_transformation_at:NvV \l__spath_tmpc_tl
+ {
+ \tl_use:N \l__spath_prefix_tl
+ #1
+ \tl_use:N \l__spath_suffix_tl
+ }
+ \l__spath_tmpb_tl
+ \tl_gset_eq:NN \g__spath_smuggle_tl \l__spath_tmpc_tl
+ }
+ {
+ \tl_gset_eq:NN \g__spath_smuggle_tl { {1}{0}{0}{1}{0pt}{0pt} }
+ }
+ \fp_compare:nT { \tl_item:Nn \g__spath_smuggle_tl {4} < 0}
+ {
+ \tl_gset:Nx \g__spath_smuggle_tl
+ {
+ { \fp_eval:n { - (\tl_item:Nn \g__spath_smuggle_tl {1})} }
+ { \fp_eval:n { - (\tl_item:Nn \g__spath_smuggle_tl {2})} }
+ { \fp_eval:n { - (\tl_item:Nn \g__spath_smuggle_tl {3})} }
+ { \fp_eval:n { - (\tl_item:Nn \g__spath_smuggle_tl {4})} }
+ { \tl_item:Nn \g__spath_smuggle_tl {5} }
+ { \tl_item:Nn \g__spath_smuggle_tl {6} }
+ }
+ }
+ \group_end:
+ \exp_last_unbraced:NV \pgfsettransformentries \g__spath_smuggle_tl
+ \tl_gclear:N \g__spath_smuggle_tl
+ },
+ knot/.style~ n~ args={3}{
+ spath/.cd,
+ split~ at~ self~ intersections=#1,
+ insert~ gaps~ after~ components={#1}{#2}{#3},
+ maybe~ spot~ weld=#1,
+ render~ components=#1
+ },
+}
+\tikzdeclarecoordinatesystem{spath}{%
+ \group_begin:
+ \tl_set:Nn \l__spath_tmpa_tl {#1}
+ \tl_trim_spaces:N \l__spath_tmpa_tl
+
+ \seq_set_split:NnV \l__spath_tmpa_seq {~} \l__spath_tmpa_tl
+ \seq_pop_right:NN \l__spath_tmpa_seq \l__spath_tmpb_tl
+
+ \tl_set:Nx \l__spath_tmpa_tl { \seq_use:Nn \l__spath_tmpa_seq {~} }
+ \tl_if_exist:cTF
+ {
+ \tl_use:N \l__spath_prefix_tl
+ \tl_use:N \l__spath_tmpa_tl
+ \tl_use:N \l__spath_suffix_tl
+ }
+ {
+
+ \tl_set_eq:Nc
+ \l__spath_tmpa_tl
+ {
+ \tl_use:N \l__spath_prefix_tl
+ \tl_use:N \l__spath_tmpa_tl
+ \tl_use:N \l__spath_suffix_tl
+ }
+
+ \tl_if_empty:NTF \l__spath_tmpa_tl
+ {
+ \tl_gset_eq:NN \g__spath_smuggle_tl \pgfpointorigin
+ }
+ {
+ \spath_reallength:NV \l__spath_tmpa_int \l__spath_tmpa_tl
+ \tl_set:Nx \l__spath_tmpb_tl
+ {\fp_to_decimal:n {(\l__spath_tmpb_tl) * (\l__spath_tmpa_int)}}
+ \spath_point_at:NVV \l__spath_tmpc_tl \l__spath_tmpa_tl \l__spath_tmpb_tl
+
+ \tl_clear:N \l__spath_tmpd_tl
+ \tl_put_right:Nn \l__spath_tmpd_tl {\pgf@x=}
+ \tl_put_right:Nx \l__spath_tmpd_tl {\tl_item:Nn \l__spath_tmpc_tl {1}}
+ \tl_put_right:Nn \l__spath_tmpd_tl {\relax}
+ \tl_put_right:Nn \l__spath_tmpd_tl {\pgf@y=}
+ \tl_put_right:Nx \l__spath_tmpd_tl {\tl_item:Nn \l__spath_tmpc_tl {2}}
+ \tl_put_right:Nn \l__spath_tmpd_tl {\relax}
+ \tl_gset_eq:NN \g__spath_smuggle_tl \l__spath_tmpd_tl
+ }
+ }
+ {
+ \tl_gset_eq:NN \g__spath_smuggle_tl \pgfpointorigin
+ }
+ \group_end:
+ \tl_use:N \g__spath_smuggle_tl
+}
+
+\ExplSyntaxOff
+%%
+%% Copyright (C) 2011-2019 by Andrew Stacey <loopspace@mathforge.org>
+%%
+%% This work 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 work is "maintained" (as per LPPL maintenance status) by
+%% Andrew Stacey.
+%%
+%% This work consists of the files spath3.dtx
+%% calligraphy_doc.tex
+%% knots_doc.tex
+%% spath3.tex
+%% and the derived files spath3.ins,
+%% spath3_code.pdf,
+%% spath3.sty,
+%% tikzlibrarycalligraphy.code.tex
+%% tikzlibraryknots.code.tex
+%% tikzlibraryspath3.code.tex
+%% calligraphy.pdf
+%% knots.pdf
+%% spath3.pdf
+%% README
+%%
+%%
+%% End of file `tikzlibraryspath3.code.tex'.