[Therion] Scale dependant error when using area fills

Tom Foord tomfoord at gmail.com
Mon Feb 13 23:26:15 CET 2017


Hi all

I'm having some problems compiling a project which includes debris area
fills. Depending on the exact symbol fill that I use, I am getting strange
scale-dependant errors which seem to cause the compiler to loop endlessly
until I force it to stop.

I originally noticed the problem when using a custom area fill that I made
by modifying the standard a_debris_AUT symbol fill. I've attached my
modified metapost definition in the attached text file 'a_debris_WUG.txt'.
The error occurs for any scale between 1:2000 and 1:4483 (outside of this
range the project compiles fine).
See attached output log 'Output log - a_debris_WUG.txt'. As you can see,
the file seems to loop over and over again.

Initially I thought this problem was specific to my custom fill, but then I
noticed that I also get a similar error when using the standard
a_debris_AUT fill, however this time the error only occurs when the scale
is set to exactly 1:2000 (any other scale seems to be fine).
See attached output log 'Output log - a_debris_AUT.txt'.

Can anyone help with this problem?

Thanks
Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.speleo.sk/pipermail/therion/attachments/20170213/a3d6b846/attachment.htm>
-------------- next part --------------
def a_debris_WUG (expr p) =
			T:=identity;
		  
			symbol_distance:=0.8;
			scale_factor:= 0.08;
			pickup PenC;
			path q, qq; q = bbox p;
			pair outside;
			outside:= ulcorner q + up;
			picture tmp_pic; 
			uu := max(u, (xpart urcorner q - xpart llcorner q)/100, (ypart urcorner q - ypart     llcorner q)/100);
			tmp_pic := image(
				for i = xpart llcorner q step symbol_distance*uu until xpart urcorner q:
					for j = ypart llcorner q step symbol_distance*uu until ypart urcorner q:
						qq := punked (((-.5uu,-.5uu)--(.5uu,-.5uu)--(1.05uu,0.01uu)--(.5uu,.5uu)--(-.5uu,.5uu)--cycle) 
						randomized (uu/2))
						scaled (uniformdeviate(0.4)+scale_factor )
						rotated uniformdeviate(360) 
						shifted ((i,j) randomized 0.5uu);
						if xpart (p intersectiontimes qq) < 0:
							if pointinside((i,j),p,outside):
								thclean qq;
								thdraw qq;
							fi;
						else:
							qq:= qq scaled (uniformdeviate(.2)+.5 )
							if xpart (p intersectiontimes qq) < 0:
								if pointinside((i,j),p,outside):
									thclean qq;
									thdraw qq;
								fi;
							fi;
						fi;
					endfor;  
				endfor;
			);
			clip tmp_pic to p;
			drawoptions();
			draw tmp_pic;
		enddef; 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Output log - a_debris_WUG.log
Type: application/octet-stream
Size: 59335 bytes
Desc: not available
URL: <http://mailman.speleo.sk/pipermail/therion/attachments/20170213/a3d6b846/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Output log - a_debris_AUT.log
Type: application/octet-stream
Size: 13468 bytes
Desc: not available
URL: <http://mailman.speleo.sk/pipermail/therion/attachments/20170213/a3d6b846/attachment-0001.obj>


More information about the Therion mailing list