Skip to content

Commit

Permalink
Add \rawx, \rawy, \rawz to let operation
Browse files Browse the repository at this point in the history
There is an issue with 3D coordinates being projected onto the 2D canvas.
There is not way to reverse the projection because a system of two equations
(the project 2D coordinates) with three unknowns (the original 3D coordiantes)
is underdetermined and unsolvable.  Hence I introduce these new little helpers
which can be used to access the parsed original coordinates.  This works only
if you use literal coordinates in the let operation, i.e.

    \path let \p1=(1,2,3) in ...

will work as expected, but

    \coordinate (A) at (1,2,3);
    \path let \p1=(A) in ...

will not work, because the projection has already been performed when defining
the \coordinate.
  • Loading branch information
hmenke committed Feb 4, 2019
1 parent 1cff3cb commit 9467c17
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tex/generic/pgf/basiclayer/pgfcorepoints.code.tex
Expand Up @@ -851,11 +851,11 @@

\def\pgfpointxyz#1#2#3{%
\pgfmathparse{#1}%
\let\pgftemp@x=\pgfmathresult%
\global\let\pgftemp@x=\pgfmathresult%
\pgfmathparse{#2}%
\let\pgftemp@y=\pgfmathresult%
\global\let\pgftemp@y=\pgfmathresult%
\pgfmathparse{#3}%
\let\pgftemp@z=\pgfmathresult%
\global\let\pgftemp@z=\pgfmathresult%
\global\pgf@x=\pgftemp@x\pgf@xx%
\global\advance\pgf@x by \pgftemp@y\pgf@yx%
\global\advance\pgf@x by \pgftemp@z\pgf@zx%
Expand Down
Expand Up @@ -39,6 +39,9 @@
\let\x=\tikz@cc@dox%
\let\y=\tikz@cc@doy%
\let\n=\tikz@cc@don%
\let\rawx=\tikz@cc@dotempx%
\let\rawy=\tikz@cc@dotempy%
\let\rawz=\tikz@cc@dotempz%
\pgfutil@ifnextchar i{\tikz@cc@stop@let}{\tikz@cc@handle@line}%
}%
\def\tikz@cc@handle@line{%
Expand Down Expand Up @@ -66,6 +69,9 @@
\expandafter\edef\csname tikz@cc@p@\tikz@cc@coord@name\endcsname{\the\pgf@x,\the\pgf@y}%
\expandafter\edef\csname tikz@cc@x@\tikz@cc@coord@name\endcsname{\the\pgf@x}%
\expandafter\edef\csname tikz@cc@y@\tikz@cc@coord@name\endcsname{\the\pgf@y}%
\expandafter\edef\csname tikz@cc@tempx@\tikz@cc@coord@name\endcsname{\pgftemp@x}%
\expandafter\edef\csname tikz@cc@tempy@\tikz@cc@coord@name\endcsname{\pgftemp@y}%
\expandafter\edef\csname tikz@cc@tempz@\tikz@cc@coord@name\endcsname{\pgftemp@z}%
\pgfutil@ifnextchar,{\tikz@cc@handle@nextline}{\tikz@cc@stop@let}%
}%
\def\tikz@cc@handle@nextline,{%
Expand All @@ -79,6 +85,9 @@
\def\tikz@cc@dox#1{\csname tikz@cc@x@#1\endcsname}%
\def\tikz@cc@doy#1{\csname tikz@cc@y@#1\endcsname}%
\def\tikz@cc@don#1{\csname tikz@cc@n@#1\endcsname}%
\def\tikz@cc@dotempx#1{\csname tikz@cc@tempx@#1\endcsname}%
\def\tikz@cc@dotempy#1{\csname tikz@cc@tempy@#1\endcsname}%
\def\tikz@cc@dotempz#1{\csname tikz@cc@tempz@#1\endcsname}%



Expand Down

0 comments on commit 9467c17

Please sign in to comment.