I’ve got a latex macro that makes small pictures. In that picture I need to draw area. Borders of that area are quadratic bezier curves and that area is to be filled. I did not know how to do it so currently I’m “filling” the area by drawing a plenty of bezier curves inside it…
This slows down typeseting and when a macro is used multiple times (so tex is drawing really a lot of quadratic bezier curves) it produces following error:
! TeX capacity exceeded, sorry [main memory size=3000000].
How can I prevent this error ? (by freeing memory after macro or such…) Or even better how do I fill the area determined by two quadratic bezier curves?
Code that produces error:
\usepackage{forloop}
\usepackage{picture}
\usepackage{eepic}
...
\linethickness{\lineThickness\unitlength}%
\forloop[\lineThickness]{cy}{\cymin}{\value{cy} < \cymax}{%
\qbezier(\ax, \ay)(\cx, \value{cy})(\bx, \by)%
}%
Here are some example values for variables:
\setlength{\unitlength}{0.01pt}
\lineThickness=20
%cy is just a counter - inital value is not important
\cymin=450 \cymax=900
%from following only the difference between \ax and \bx is important
\ax=0 \ay=0 \bx=550 \by=0
Note: To reproduce the error this code have to execute approximately 150 times (could be more depending on your latex memory settings).
Thanks a lot for any help
It seems to me that my question does not have simple and all solving answer.
Using more advanced picture drawing package as Little Bobby Tables suggested caused latex to be able to draw more pictures with some memory size(+- 2 times more) but when drawing more than that the error still occurs.
Enlarging the memory as ConcernedOfTunbridgeWells suggested and then recompiling is something I wanted to avoid. It has also same problem as Little Bobby’s suggestion: you can enlarge it 100 times but when typesetting 100 times longer document it will not be sufficient again.
The solution would be to rewrite latex completely as I find this only one of more problems that makes it insufficient for my purposes or use some better typesetting engine(any ideas ?). As I find this too hard I’ll be forced to just enlarge memory.