{
	weave.cal - function for simple diagonal weave pattern
			on horizontal surface.
	
	A1 is weave square size.
}

weave = f_weave(frac((Px+Pz)/1.4142/A1),frac((Px-Pz)/1.4142/A1));

f_weave(m1,m2) = if (m1-.5, if (m1-.55, f_weave(m2,1.05-m1), .1),
		 if (m2-.5, if (m2-.55, f_weave(1.05-m2,m1), .1),
	if (m1-.05, if (m2-.25, if (m2-.3, .5, .1), if (m2-.05, 1, .1)), .1)));
