[Therion] Point altitude/deph, Help !

Xavier Robert xavier.robert at univ-grenoble-alpes.fr
Thu Feb 21 19:28:21 CET 2019


Dear all, 

On the caves’ survey I draw, I am often adding the altitude of points that are characteristic in the cave by using the point « altitude ». I find that really great and I want to keep it. 

However, I received several remarks from my co-cavers/surveyors that this is not quite readable, and that they would prefer if I can also add the depth since the entrance at those points. I can do it manually with the point label, but for a complex system, that will be a pain to maintain each time we add a new survey or a connection with an other cave previously unconnected. 

I thus tried to add a new user defined point (u:prof) based on the present altitude definition. However I am really not a mpost guru and I am facing two problems. Here is the code I wrote : 

###### New point depth ###### 
code metapost 
def p_u_prof (expr pos, R, S, A) = 
T:=identity aligned A scaled 1.5S rotated R shifted pos; 
# calcul of the depth of the point: altitude of the point - altitude max of the cave 
# (it will be better with the altitude of the main entrance 
# defined by the option -entrance of the survey block) 
depth := \thaltitude - \cavemaxz; 
# Print the label 
begingroup 
interim defaultscale:=1; 
label (btex {-- } depth {m --} etex, (0, 0)) transformed T withcolor(0.5,0.,0.); 
# 1) Why is profondeur value NOT printed ? Where is the error ? 
endgroup; 
enddef; 
initsymbol("p_u_prof") 
endcode 
############################## 

The problem is that this point will print the text "-- depth m --", but not the value of the depth. I suspect that : 


    1. the depth calcul may not be accurate? 
    2. the way I call the variable depth is not accurate? 

Does anyone has a clue for that problem? 


My second problem/question deals with the way to calculate the depth. Here I try to calculate it by using the maximum altitude of the cave (\cavemaxz). But it should be better if I use the altitude of the main entrance if it exists. But I did not find if there is such a varaible already defined. Does anyone knows how to do that ? 

Cheers, 

Xavier 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.speleo.sk/pipermail/therion/attachments/20190221/a4128b52/attachment.htm>


More information about the Therion mailing list