Re: convert pgf to g-code
Alexandru Dumitrache <alex <at> cimr.pub.ro>
2011-01-04 07:35:15 GMT
You can go to the system layer (if I remember well) and you'll find the
low-level paths, after TikZ executes its loops and all the high level
processing. From there you can extract the points and output the G-code.
Probably the most elegant method is to create a new output backend (like
the PDF, PS, SVG). It's not easy to do, but with the help of someone who
knows pgf/tikz internals, it is possible.
A few months ago I did some experiments with overriding tikz <at> finish and
passing the points to a lua script (in lualatex), with partial success.
Some code:
\def\tikz <at> finish{\message{^^Jtest^^J}
\pgfsyssoftpath <at> getcurrentpath{\thePath}
\directlua{intercept([[\meaning\thePath]], [[\meaning\tikz <at> mode]])}
\orig <at> tikz <at> finish}
> using pgf source is preferred to get the graphical feedback and
> documentation w/o a commercial windows-based cad package. most ops are
> simple straight cuts, circular arcs, etc. so a dictionary lookup is
> straightfoward. what you really want is the compiler though, so you can
> build hierarchical structures, loops, etc. does pgf output an
> intermediate machine-like code, or is this simply the tex code? my
> impression has been that pgf is more than a tex pre-processor, so it
> should be possible to bind another output, but perhaps i'm mistaken.
>
> -SM-
>
> On Jan 2, 2011, at 10:10 PM, Alexandru Dumitrache wrote:
>
(Continue reading)