[latex3-commits] [git/LaTeX3-latex3-latex3] master: First steps in l3draw point support (518514c)

Joseph Wright joseph.wright at morningstar2.co.uk
Wed Feb 7 08:52:25 CET 2018


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/518514cf8dbeecd2eebd372ed68baa326769429c

>---------------------------------------------------------------

commit 518514cf8dbeecd2eebd372ed68baa326769429c
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Wed Feb 7 07:52:25 2018 +0000

    First steps in l3draw point support
    
    Currently this follows pgf: non-expandable and using fixed dim names.
    
    As our FPU is expandable, it is possible to approach this a different way: semantics of the point functions then change.


>---------------------------------------------------------------

518514cf8dbeecd2eebd372ed68baa326769429c
 l3trial/l3draw/l3draw-points.dtx       |   31 +++++++++++++++++++++++++++++++
 l3trial/l3draw/l3draw.dtx              |    7 +++++++
 l3trial/l3draw/testfiles/m3draw000.tlg |    2 ++
 3 files changed, 40 insertions(+)

diff --git a/l3trial/l3draw/l3draw-points.dtx b/l3trial/l3draw/l3draw-points.dtx
index c3de978..1372a1b 100644
--- a/l3trial/l3draw/l3draw-points.dtx
+++ b/l3trial/l3draw/l3draw-points.dtx
@@ -60,6 +60,37 @@
 %<@@=draw>
 %    \end{macrocode}
 %
+% \begin{variable}{\g_@@_x_dim, \g_@@_y_dim}
+%   The \enquote{next}or \enquote{active} point.
+%    \begin{macrocode}
+\dim_new:N \g_@@_x_dim
+\dim_new:N \g_@@_y_dim
+%    \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}{\@@_set_point:n}
+%   Execute whatever code is passed to extract the $x$ and $y$ co-ordinates.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_set_point:n #1
+  {
+    \group_begin:
+      #1
+    \group_end:
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\draw_point:nn}
+%   Simply turn the given values into dimensions.
+%    \begin{macrocode}
+\cs_new_protected:Npn \draw_point:nn #1#2
+  {
+    \dim_gset:Nn \g_@@_x_dim { \fp_to_dim:n {#1} }
+    \dim_gset:Nn \g_@@_y_dim { \fp_to_dim:n {#2} }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
 %    \begin{macrocode}
 %</initex|package>
 %    \end{macrocode}
diff --git a/l3trial/l3draw/l3draw.dtx b/l3trial/l3draw/l3draw.dtx
index 2ddb42f..1e2fd64 100644
--- a/l3trial/l3draw/l3draw.dtx
+++ b/l3trial/l3draw/l3draw.dtx
@@ -59,6 +59,13 @@
 %     \cs{draw_end:}
 %   \end{syntax}
 %
+% \subsection{Points}
+%
+% \begin{function}[EXP]{\draw_point:nn}
+%   \begin{syntax}
+%     \cs{draw_point:nn} \marg{x} \marg{y}
+%   \end{syntax}
+%
 % \end{documentation}
 %
 % \begin{implementation}
diff --git a/l3trial/l3draw/testfiles/m3draw000.tlg b/l3trial/l3draw/testfiles/m3draw000.tlg
index a17ff47..4486cfb 100644
--- a/l3trial/l3draw/testfiles/m3draw000.tlg
+++ b/l3trial/l3draw/testfiles/m3draw000.tlg
@@ -8,6 +8,8 @@ Author: Joseph Wright
 \g__draw_path_xmin_dim=\dimen...
 \g__draw_path_ymax_dim=\dimen...
 \g__draw_path_ymin_dim=\dimen...
+\g__draw_x_dim=\dimen...
+\g__draw_y_dim=\dimen...
 \g__draw_xmax_dim=\dimen...
 \g__draw_xmin_dim=\dimen...
 \g__draw_ymax_dim=\dimen...





More information about the latex3-commits mailing list