summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/spath3/tikzlibraryknots.code.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/spath3/tikzlibraryknots.code.tex')
-rw-r--r--Master/texmf-dist/tex/latex/spath3/tikzlibraryknots.code.tex62
1 files changed, 51 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/latex/spath3/tikzlibraryknots.code.tex b/Master/texmf-dist/tex/latex/spath3/tikzlibraryknots.code.tex
index 2cc0806f588..e8a0872539c 100644
--- a/Master/texmf-dist/tex/latex/spath3/tikzlibraryknots.code.tex
+++ b/Master/texmf-dist/tex/latex/spath3/tikzlibraryknots.code.tex
@@ -61,14 +61,16 @@
}
{
\tikz@addmode{\tikz@mode@doubletrue}
- \tl_if_empty:nTF {#1}
+ \tl_if_eq:nnTF {\pgfkeysnovalue} {#1}
{
- \pgfsetinnerstrokecolor{\tikz@strokecolor}
+ \tikz@addoption{\pgfsetinnerstrokecolor{.}}
}
{
\pgfsetinnerstrokecolor{#1}
}
- \tikz@addoption{\pgfsetstrokecolor{knotbg}}
+ \tikz@addoption{
+ \pgfsetstrokecolor{knotbg}
+ }
\tl_set:Nn \tikz@double@setup{
\pgfsetinnerlinewidth{\pgflinewidth}
\pgfsetlinewidth{\dim_eval:n {\tl_use:N \l__knot_gap_tl \pgflinewidth}}
@@ -204,7 +206,7 @@
{
\pgfscope
\pgftransformreset
- \int_step_function:nnnN {1} {1} {\l__knot_strands_int} \knot_draw_strand:n
+ \int_step_function:nnnN {1} {1} {\l__knot_strands_int} \knot_draw_strand:n
\bool_if:NF \l__knot_super_draft_bool
{
\int_step_function:nnnN {1} {1} {\l__knot_strands_int} \knot_draw_labels:n
@@ -245,6 +247,7 @@
\tl_set:Nn \l_tmpa_tl {knot~ diagram/every~ strand/.try,}
\tl_put_right:Nv \l_tmpa_tl {l__knot_options_strand #1}
\tl_put_right:Nn \l_tmpa_tl {,knot~ diagram/only~ when~ rendering/.try,only~ when~ rendering/.try}
+ \spath_bake_round:n {knot strand #1}
\spath_tikz_path:Vn \l_tmpa_tl {knot strand #1}
\group_end:
\endpgfscope
@@ -276,7 +279,7 @@
}
\cs_new_protected_nopar:Npn \knot_split_self_intersects:NN #1#2
{
- \tl_case:Nnn #1
+ \tl_case:NnF #1
{
\g__spath_curvetoa_tl
{
@@ -462,10 +465,24 @@
\tl_set_eq:cc {l__knot_options_ \tl_use:N \l__knot_prefix_tl -1} {l__knot_options_ \tl_use:N \l__knot_tmpg_tl}
- \bool_if:NT \l__knot_prepend_prev_bool
+ \bool_if:nT
+ {
+ \l__knot_prepend_prev_bool
+ &&
+ \tl_if_exist_p:c {knot previous \tl_use:N \l__knot_tmpg_tl}
+ &&
+ !\tl_if_empty_p:c {knot previous \tl_use:N \l__knot_tmpg_tl}
+ }
{
\spath_prepend_no_move:nn {knot \tl_use:N \l__knot_prefix_tl -1} {knot \tl_use:c {knot previous \tl_use:N \l__knot_tmpg_tl}}
- \bool_if:NT \l__knot_splits_bool
+ \bool_if:nT
+ {
+ \l__knot_splits_bool
+ &&
+ \tl_if_exist_p:c {knot previous \tl_use:N \l__knot_tmpg_tl}
+ &&
+ !\tl_if_empty_p:c {knot previous \tl_use:N \l__knot_tmpg_tl}
+ }
{
\knot_test_endpoint:vnT {knot previous \tl_use:N \l__knot_tmpg_tl} {initial point}
{
@@ -476,10 +493,25 @@
}
}
}
- \bool_if:NT \l__knot_append_next_bool
+ \bool_if:nT
+ {
+ \l__knot_append_next_bool
+ &&
+ \tl_if_exist_p:c {knot next \tl_use:N \l__knot_tmpg_tl}
+ &&
+ !\tl_if_empty_p:c {knot previous \tl_use:N \l__knot_tmpg_tl}
+ }
{
\spath_append_no_move:nn {knot \tl_use:N \l__knot_prefix_tl -1} {knot \tl_use:c {knot next \tl_use:N \l__knot_tmpg_tl}}
- \bool_if:NT \l__knot_splits_bool
+ \bool_if:nT
+ {
+ \l__knot_splits_bool
+ &&
+ \tl_if_exist_p:c {knot previous \tl_use:N
+ \l__knot_tmpg_tl}
+ &&
+ !\tl_if_empty_p:c {knot previous \tl_use:N \l__knot_tmpg_tl}
+ }
{
\knot_test_endpoint:vnT {knot previous \tl_use:N \l__knot_tmpg_tl} {final point}
{
@@ -492,10 +524,12 @@
\tl_set:Nn \l__knot_tmpg_tl {\tl_use:N \l__knot_prefix_tl -1}
}
}
+ \pgfscope
\group_begin:
- \tikzset{knot~ diagram/intersection~ \int_use:N \l__knot_intersections_int/.try}
+ \tikzset{knot~ diagram/every~ intersection/.try, every~ intersection/.try, knot~ diagram/intersection~ \int_use:N \l__knot_intersections_int/.try}
\knot_draw_crossing:nVV {\tl_use:N \l__knot_tmpg_tl} \l__knot_tmpa_dim \l__knot_tmpb_dim
\group_end:
+ \endpgfscope
\tl_use:N \l__knot_node_tl (\l__knot_name_tl \c_space_tl \int_use:N \l__knot_intersections_int) at (\l__knot_tmpa_dim, \l__knot_tmpb_dim) {};
}
}
@@ -580,11 +614,12 @@
{
\int_set_eq:NN \l__knot_component_start_int \l__knot_filaments_int
\int_incr:N \l__knot_component_start_int
+ \tl_set_eq:Nc \l__knot_tmpa_tl {l__knot_options_strand #1}
\spath_map_segment_function:nN {knot strand #1} \knot_save_filament:NN
}
\cs_new_protected_nopar:Npn \knot_save_filament:NN #1#2
{
- \tl_case:Nnn #1
+ \tl_case:NnF #1
{
\g__spath_moveto_tl
{
@@ -598,6 +633,8 @@
\int_gincr:N \l__knot_filaments_int
\spath_clear_new:n {knot filament \int_use:N \l__knot_filaments_int}
\spath_put:nnV {knot filament \int_use:N \l__knot_filaments_int} {path} #2
+ \tl_set_eq:cN {l__knot_options_filament \int_use:N \l__knot_filaments_int} \l__knot_tmpa_tl
+
\tl_clear_new:c {knot previous filament \int_use:N \l__knot_filaments_int}
\int_compare:nF {\l__knot_component_start_int == \l__knot_filaments_int}
{
@@ -609,6 +646,8 @@
\int_gincr:N \l__knot_filaments_int
\spath_clear_new:n {knot filament \int_use:N \l__knot_filaments_int}
\spath_put:nnV {knot filament \int_use:N \l__knot_filaments_int} {path} #2
+ \tl_set_eq:cN {l__knot_options_filament \int_use:N \l__knot_filaments_int} \l__knot_tmpa_tl
+
\tl_clear_new:c {knot previous filament \int_use:N \l__knot_filaments_int}
\int_compare:nF {\l__knot_component_start_int == \l__knot_filaments_int}
{
@@ -624,6 +663,7 @@
\tl_put_right:NV \l_tmpa_tl \g__spath_lineto_tl
\tl_set:Nx \l_tmpa_tl {\tl_item:Nn #2 {5}\tl_item:Nn #2 {6}}
\spath_put:nnV {knot filament \int_use:N \l__knot_filaments_int} {path} \l_tmpa_tl
+ \tl_set_eq:cN {l__knot_options_filament \int_use:N \l__knot_filaments_int} \l__knot_tmpa_tl
\tl_clear_new:c {knot previous filament \int_use:N \l__knot_filaments_int}
\int_compare:nF {\l__knot_component_start_int == \l__knot_filaments_int}
{