[latex3-commits] [git/LaTeX3-latex3-latex3] master: l3draw: Arc axes and support functions (bbe5e4e)
Joseph Wright
joseph.wright at morningstar2.co.uk
Sat Feb 17 16:51:42 CET 2018
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/bbe5e4ec814dc046d33cb8eab85a0e22850910ed
>---------------------------------------------------------------
commit bbe5e4ec814dc046d33cb8eab85a0e22850910ed
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Sat Feb 17 15:51:42 2018 +0000
l3draw: Arc axes and support functions
>---------------------------------------------------------------
bbe5e4ec814dc046d33cb8eab85a0e22850910ed
l3trial/l3draw/l3draw-paths.dtx | 11 ++++++++++
l3trial/l3draw/l3draw-transforms.dtx | 30 ++++++++++++++++++++++++++
l3trial/l3draw/l3draw.dtx | 13 +++++++++++
l3trial/l3draw/testfiles/m3draw002.lvt | 6 ++++++
l3trial/l3draw/testfiles/m3draw002.tlg | 9 +++++++-
l3trial/l3draw/testfiles/m3draw003.lvt | 10 +++++++++
l3trial/l3draw/testfiles/m3draw003.ptex.tlg | 16 ++++++++++++++
l3trial/l3draw/testfiles/m3draw003.tlg | 16 ++++++++++++++
l3trial/l3draw/testfiles/m3draw003.uptex.tlg | 16 ++++++++++++++
l3trial/l3draw/testfiles/m3draw003.xetex.tlg | 16 ++++++++++++++
10 files changed, 142 insertions(+), 1 deletion(-)
diff --git a/l3trial/l3draw/l3draw-paths.dtx b/l3trial/l3draw/l3draw-paths.dtx
index a920e8b..338f53b 100644
--- a/l3trial/l3draw/l3draw-paths.dtx
+++ b/l3trial/l3draw/l3draw-paths.dtx
@@ -574,6 +574,17 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\draw_path_arc_axes:nnnn}
+% A simple wrapper.
+% \begin{macrocode}
+\cs_new_protected:Npn \draw_path_arc_axes:nnnn #1#2#3#4
+ {
+ \draw_transform_triangle:nnn { 0cm , 0cm } {#3} {#4}
+ \draw_path_arc:nnn {#1} {#2} { 1pt }
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macrocode}
%</initex|package>
% \end{macrocode}
diff --git a/l3trial/l3draw/l3draw-transforms.dtx b/l3trial/l3draw/l3draw-transforms.dtx
index 61fef7e..b74b181 100644
--- a/l3trial/l3draw/l3draw-transforms.dtx
+++ b/l3trial/l3draw/l3draw-transforms.dtx
@@ -249,6 +249,36 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\draw_transform_triangle:nnn}
+% Simple maths to move the canvas origin to |#1| and the two axes to
+% |#2| and |#3|.
+% \begin{macrocode}
+\cs_new_protected:Npn \draw_transform_triangle:nnn #1#2#3
+ {
+ \@@_point_process:nnn
+ {
+ \@@_point_process:nn
+ { \@@_tranform_triangle:nnnnnn }
+ {#1}
+ }
+ {#2} {#3}
+ }
+\cs_new_protected:Npn \@@_tranform_triangle:nnnnnn #1#2#3#4#5#6
+ {
+ \use:x
+ {
+ \@@_transform:nnnnnnn
+ { #3 - #1 }
+ { #4 - #2 }
+ { #5 - #1 }
+ { #6 - #2 }
+ {#1}
+ {#2}
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macrocode}
%</initex|package>
% \end{macrocode}
diff --git a/l3trial/l3draw/l3draw.dtx b/l3trial/l3draw/l3draw.dtx
index cb7ec37..f995dc7 100644
--- a/l3trial/l3draw/l3draw.dtx
+++ b/l3trial/l3draw/l3draw.dtx
@@ -257,6 +257,12 @@
% % Note interface
% \end{function}
%
+% \begin{function}{\draw_path_arc_axes:nnnn}
+% \begin{syntax}
+% \cs{draw_path_arc_axes:nnn} \Arg{angle1} \Arg{angle2} \Arg{point expr1} \Arg{point expr2}
+% \end{syntax}
+% \end{function}
+%
% \begin{function}{\draw_path_close:}
% \begin{syntax}
% \cs{draw_path_close:}
@@ -285,6 +291,13 @@
% \end{syntax}
% \end{function}
%
+% \begin{function}{\draw_transform_triangle:nnn}
+% \begin{syntax}
+% \cs{draw_transform:nnn}
+% \Arg{origin} \Arg{point expr1} \Arg{point expr2}
+% \end{syntax}
+% \end{function}
+%
% \begin{function}{\draw_transform_invert:}
% \begin{syntax}
% \cs{draw_transform_invert:}
diff --git a/l3trial/l3draw/testfiles/m3draw002.lvt b/l3trial/l3draw/testfiles/m3draw002.lvt
index d1830df..3b426e3 100644
--- a/l3trial/l3draw/testfiles/m3draw002.lvt
+++ b/l3trial/l3draw/testfiles/m3draw002.lvt
@@ -44,6 +44,12 @@
\exp_args:Nx \tl_show:n { \draw_point_transform:n { \l_tmpa_tl } }
}
+\TEST { \draw_transform_triangle: }
+ {
+ \draw_transform_triangle:nnn { 0cm , 0cm } { 1cm , 1cm } { -1cm , 1cm }
+ \exp_args:Nx \tl_show:n { \draw_point_transform:n { 0.5 , 0.5 } }
+ }
+
\TEST { \draw_transform_reset: }
{
\draw_transform:nnnnn { 1 } { 0 } { 1 } { 1 } { 10pt , 0pt }
diff --git a/l3trial/l3draw/testfiles/m3draw002.tlg b/l3trial/l3draw/testfiles/m3draw002.tlg
index c66682c..31cfd2d 100644
--- a/l3trial/l3draw/testfiles/m3draw002.tlg
+++ b/l3trial/l3draw/testfiles/m3draw002.tlg
@@ -37,7 +37,14 @@ l. ... }
l. ... }
============================================================
============================================================
-TEST 4: \draw_transform_reset:
+TEST 4: \draw_transform_triangle:
+============================================================
+> 0pt,28.4527559055118pt.
+<recently read> }
+l. ... }
+============================================================
+============================================================
+TEST 5: \draw_transform_reset:
============================================================
> 1pt,1pt.
<recently read> }
diff --git a/l3trial/l3draw/testfiles/m3draw003.lvt b/l3trial/l3draw/testfiles/m3draw003.lvt
index 54b9631..4400efb 100644
--- a/l3trial/l3draw/testfiles/m3draw003.lvt
+++ b/l3trial/l3draw/testfiles/m3draw003.lvt
@@ -123,4 +123,14 @@
}
}
+\TEST { \draw_path_arc_axes:nnnn }
+ {
+ \test:n
+ {
+ \draw_path_arc_axes:nnnn { 0 } { 90 }
+ { \draw_point_vec:nn { 2 } { 0 } }
+ { \draw_point_vec:nn { 0 } { 2 } }
+ }
+ }
+
\END
diff --git a/l3trial/l3draw/testfiles/m3draw003.ptex.tlg b/l3trial/l3draw/testfiles/m3draw003.ptex.tlg
index c10d1e0..ba3b0b0 100644
--- a/l3trial/l3draw/testfiles/m3draw003.ptex.tlg
+++ b/l3trial/l3draw/testfiles/m3draw003.ptex.tlg
@@ -217,3 +217,19 @@ l. ... }
<argument> \l_tmpa_box
l. ... }
============================================================
+============================================================
+TEST 7: \draw_path_arc_axes:nnnn
+============================================================
+> \box...=
+\hbox(202.1446+0.0)x56.90552
+.\hbox(202.1446+0.0)x56.90552
+..\glue 85.35828
+..\hbox(0.0+0.0)x0.0, shifted 88.33357
+...\special{pdf:literal q}
+...\special{pdf:literal 0.3985 w}
+...\special{pdf:literal -28.34647 88.00356 -53.72874 113.38583 -85.03938 113.3858\ETC.}
+...\special{pdf:literal Q}
+! OK.
+<argument> \l_tmpa_box
+l. ... }
+============================================================
diff --git a/l3trial/l3draw/testfiles/m3draw003.tlg b/l3trial/l3draw/testfiles/m3draw003.tlg
index 5cef8e8..7d02b06 100644
--- a/l3trial/l3draw/testfiles/m3draw003.tlg
+++ b/l3trial/l3draw/testfiles/m3draw003.tlg
@@ -217,3 +217,19 @@ l. ... }
<argument> \l_tmpa_box
l. ... }
============================================================
+============================================================
+TEST 7: \draw_path_arc_axes:nnnn
+============================================================
+> \box...=
+\hbox(202.1446+0.0)x56.90552
+.\hbox(202.1446+0.0)x56.90552
+..\glue 85.35828
+..\hbox(0.0+0.0)x0.0, shifted 88.33357
+...\pdfliteral{q}
+...\pdfliteral{0.3985 w}
+...\pdfliteral{-28.34647 88.00356 -53.72874 113.38583 -85.03938 113.38583 c}
+...\pdfliteral{Q}
+! OK.
+<argument> \l_tmpa_box
+l. ... }
+============================================================
diff --git a/l3trial/l3draw/testfiles/m3draw003.uptex.tlg b/l3trial/l3draw/testfiles/m3draw003.uptex.tlg
index c10d1e0..ba3b0b0 100644
--- a/l3trial/l3draw/testfiles/m3draw003.uptex.tlg
+++ b/l3trial/l3draw/testfiles/m3draw003.uptex.tlg
@@ -217,3 +217,19 @@ l. ... }
<argument> \l_tmpa_box
l. ... }
============================================================
+============================================================
+TEST 7: \draw_path_arc_axes:nnnn
+============================================================
+> \box...=
+\hbox(202.1446+0.0)x56.90552
+.\hbox(202.1446+0.0)x56.90552
+..\glue 85.35828
+..\hbox(0.0+0.0)x0.0, shifted 88.33357
+...\special{pdf:literal q}
+...\special{pdf:literal 0.3985 w}
+...\special{pdf:literal -28.34647 88.00356 -53.72874 113.38583 -85.03938 113.3858\ETC.}
+...\special{pdf:literal Q}
+! OK.
+<argument> \l_tmpa_box
+l. ... }
+============================================================
diff --git a/l3trial/l3draw/testfiles/m3draw003.xetex.tlg b/l3trial/l3draw/testfiles/m3draw003.xetex.tlg
index c10d1e0..ba3b0b0 100644
--- a/l3trial/l3draw/testfiles/m3draw003.xetex.tlg
+++ b/l3trial/l3draw/testfiles/m3draw003.xetex.tlg
@@ -217,3 +217,19 @@ l. ... }
<argument> \l_tmpa_box
l. ... }
============================================================
+============================================================
+TEST 7: \draw_path_arc_axes:nnnn
+============================================================
+> \box...=
+\hbox(202.1446+0.0)x56.90552
+.\hbox(202.1446+0.0)x56.90552
+..\glue 85.35828
+..\hbox(0.0+0.0)x0.0, shifted 88.33357
+...\special{pdf:literal q}
+...\special{pdf:literal 0.3985 w}
+...\special{pdf:literal -28.34647 88.00356 -53.72874 113.38583 -85.03938 113.3858\ETC.}
+...\special{pdf:literal Q}
+! OK.
+<argument> \l_tmpa_box
+l. ... }
+============================================================
More information about the latex3-commits
mailing list