[Therion] Drawing tiled floor
Dave Clucas
dave at daveclucas.com
Fri Apr 18 18:13:30 CEST 2014
Try this as a starting point. You should be able to introduce some randomization and rounded corners.
def a_tiless (expr p) =
T:=identity;
pickup PenC;
path q, qq; q = bbox p;
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 2uu until xpart urcorner q:
for j = ypart llcorner q step 2uu until ypart urcorner q:
qq := punked (((-.5uu,-.5uu)--(.5uu,-.5uu)--(.5uu,.5uu)--(-.5uu,.5uu)--cycle)
)
shifted ((.6i,.6j) );
if xpart (p intersectiontimes qq) < 0:
thclean qq;
thdraw qq;
fi;
endfor;
endfor;
);
clip tmp_pic to p;
drawoptions();
draw tmp_pic;
enddef;
Dave Clucas
daveclucas.com
mycaves.org.
daveclucas at icloud.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.speleo.sk/pipermail/therion/attachments/20140418/244e09c9/attachment.htm>
More information about the Therion
mailing list