You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Optimize the TikZ format when a draw and fill occur separately.
This is accomplished using the spath3 TikZ library. To make this work
all paths need to be named, and if a draw and fill are done separately,
then the fill just uses the path from the draw so it does not need to be
recomputed.
Additionally refactor multipaths to make the TikZ format much more
efficient, as well as to make multipaths more versatile. Both the TikZ
and JSXGraph formats are done differently now. They both join the paths
in a completely different way that does not use the x transform (so the
`function_string` x transform code is now never used in fact). Instead
in TikZ the spath3 TikZ library is used and the paths are drawn
individually, and then concatenated. For the JSXGraph format the paths
are created individually and their data points concatenated to form a
single curve. The result allows for more versatility since now paths do
not need to end where the next path starts. The paths are connected by
a line segment if needed. For JSXGraph this just works with the
concatenation approach. For TikZ this has to be added. Note this
actually happened before with the previous TikZ implementation, but not
for the JSXGraph implementation. The most important thing is that with
this implementation the time that it takes for TeX to run for multipaths
is greatly reduced. For the example in the POD and the current TikZ
code it takes about 3 seconds for TikZ to run, and the CPU usage is
quite high. If the fill and draw are on different layers so that the
fill and draw occur separately, it takes even longer. With the new code
it takes about 1 second for either case and the CPU usage is much less.
One reason for this is that the number of steps needed with the new
approach (which is now per curve) is much less. Previously 500 steps
were used (by default) for the entire curve. Now 30 (by default) are
used for each curve. Note that this can now be optimized and steps set
per curve.
There is also a new `cycle` option for multipaths. If `cycly => 1` is
set for a `multipath`, then a line segment will be inserted from the end
of the last path to the start of the first in the case that the last
path does not end at the start of the first, thus closing the path.
0 commit comments