[Therion] Metapost modifications
Dave Clucas
dave at daveclucas.com
Fri Nov 16 11:04:22 CET 2012
I've answered my own question. It was a lot easier than I expected!
code metapost
def a_u_pebbles (expr p) =
T:=identity;
pickup PenC;
path q, qq; q = bbox p;
picture tmp_pic;
tmp_pic := image(
for i = xpart llcorner q step 1.5u until xpart urcorner q:
for j = ypart llcorner q step 1.5u until ypart urcorner q:
qq := (superellipse((.2u,0),(0,.1u),(-.2u,0),(0,.-.1u),.75))
% randomized (u/25)
rotated uniformdeviate(360)
shifted ((i,j) randomized 0.8u);
if xpart (p intersectiontimes qq) < 0:
thdraw qq;
thfill qq withcolor(1, 0.85, 0.83);
fi;
endfor;
endfor;
);
clip tmp_pic to p;
draw tmp_pic;
enddef;
def p_u_pebbles (expr pos,theta,sc,al)=
U:=(.45u,.35u);
T:=identity aligned al rotated theta scaled sc shifted pos;
pickup PenC;
p:=superellipse((.2u,0),(0,.1u),(-.2u,0),(0,.-.1u),.75);
thdraw p rotated 20 shifted (0,.25u);
thfill p rotated 20 shifted (0,.25u) withcolor(1, 0.85, 0.83);
thdraw p rotated -37 shifted (.25u,-.25u);
thfill p rotated -37 shifted (.25u,-.25u) withcolor(1, 0.85, 0.83);
thdraw p rotated -62 shifted (-.25u,-.25u);
thfill p rotated -62 shifted (-.25u,-.25u) withcolor(1, 0.85, 0.83);
enddef;
endcode
On 16 Nov 2012, at 09:28, Dave Clucas wrote:
> In Mulu many of the passages are part filled with sandstone pebbles.
> I'd like to create a user area and a user symbol based on pebbles
> where the ellipses are filled with a colour (light brown). Can
> anybody tell me how to modify the standard definition?
>
> Dave Clucas
> dave at daveclucas.com
> http://daveclucas.com
> http://mycaves.org
>
>
>
Dave Clucas
dave at daveclucas.com
http://daveclucas.com
http://mycaves.org
More information about the Therion
mailing list