Metapost modifications
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@daveclucas.com http://daveclucas.com http://mycaves.org
Take a look at Bruce's customised symbol sets on the wiki. I based mine on those. I have not tried adding a completely new symbol to therion yet, but here is how I override the pebbles area fill with one which looks more like I prefer. Include this layout in your pdf export command to see pebbles rendered with this custom style: layout CustomisedSymbols code metapost beginpattern(pattern_pebbles); pickup PenC; path qq; for i=0.0u step 0.6u until 5.1u: for j=0.0u step 0.6u until 5.1u: qq := (superellipse((.05u,0),(0,.05u),(-.05u,0),(0,.-.05u),.75)) randomized (u/45) scaled (uniformdeviate(1.2)+.55) rotated uniformdeviate(360) shifted ((i,j) randomized 0.55u); draw qq; endfor; endfor; patternstep(5.1u,5.1u); endpattern; def a_pebbles (expr p) = T:=identity; thfill p withpattern pattern_pebbles; enddef; endcode endlayout CustomisedSymbols On 16 November 2012 09:28, Dave Clucas <dave@daveclucas.com> 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@daveclucas.com http://daveclucas.com http://mycaves.org
______________________________**_________________ Therion mailing list Therion@speleo.sk http://mailman.speleo.sk/**mailman/listinfo/therion<http://mailman.speleo.sk/mailman/listinfo/therion>
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@daveclucas.com http://daveclucas.com http://mycaves.org
Dave Clucas dave@daveclucas.com http://daveclucas.com http://mycaves.org
participants (2)
-
Dave Clucas -
Footleg