[Therion] How to use user-defined symbols

Martin Sluka martinsluka at mac.com
Sun Feb 2 23:06:21 CET 2014


Bill,
There are two kinds of symbols in Therion - first one are symbols which are included to Therion in time of compilation - like symbol "stalagmite". Second kind are user symbols. The definition of user symbol should be like:

def u_p_stalagmaflat_AMER (expr pos,theta,sc,al) =

In XTherion you call it as:

point u:stalagmaflat_AMER

Red are symbols which definition is not known. 

M. 



Odesláno z iPhonu

2. 2. 2014 v 22:00, Bill Gee <bgee at campercaver.net>:

> Hello everyone -
> 
> I have been struggling for the last several days trying to figure out how to 
> build and use my own symbols.  I need a symbol for two kinds of formations - 
> Stalactiflats and Stalagmaflats.  These are basically stalagmites which are fat 
> (several feet diameter) and flat on top like a table (or flat on the bottom).
> 
> It appears there are two problems to solve.  The first, which I address in this 
> question, is how to get xTherion to use a custom symbol.  The second is to 
> figure out how to draw the symbol in Metapost.  For now I am ignoring the 
> second problem.  One step at a time!
> 
> After spending several hours going through Therion By Example, I was able to 
> get a custom symbol to work, but only by replacing an existing symbol.  I used 
> the NSS "gradient point" example.
> 
> Changing the Metapost code as shown does not produce any error messages.  
> However, it also does not produce a symbol in the PDF output.  All I get is a 
> red dot.
> 
> ===============
>        code metapost
> 
>        def p_stalagmaflat_AMER (expr pos,theta,sc,al) =
>          U:=(.15u, .4u);
>          T:=identity aligned al rotated theta scaled sc shifted pos;
>          pickup PenC;
> 
>          #Left Hand side
>          thdraw (-.3u, -.2u) -- (-.7u, .1u);
>          thdraw (-.2u, -.1u) -- (-.4u, .6u);
> 
>          #Centerline
>          thdraw (0u, 0u) -- (0u, .9u);
> 
>          #Right side
>          thdraw (.3u, -.2u) -- (.7u, .1u);
>          thdraw (.2u, -.1u) -- (.4u, .6u);
> 
>        enddef;
> 
>      initsymbol ("p_stalagmaflat_AMER");
> 
>   endcode
> ==================
> 
> Since I am not replacing an existing symbol, I leave out the "symbol-assign" 
> line.
> 
> In xTherion I try to use this by inserting a point of type "u" and adding an 
> option "-subtype stalagmaflat".
> 
> I think this is where I am missing something ...  How to call the custom 
> symbol with a "u" point.  Is this the right syntax?
> 
> In the worst case I suppose I could set it up to replace a symbol that I won't 
> use for this cave - a ladder, for example.  That would probably cause quite a 
> bit of confusion down the road, so I would much prefer to avoid it.
> 
> I am using Therion 5.3.13 on 64-bit Fedora 20.
> 
> Thanks - Bill Gee
> _______________________________________________
> Therion mailing list
> Therion at speleo.sk
> http://mailman.speleo.sk/mailman/listinfo/therion



More information about the Therion mailing list