<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div data-marker="__QUOTED_TEXT__"><div style="" data-mce-style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000;"><div><span style="font-size: 12pt;" data-mce-style="font-size: 12pt;">Dear all,</span><br><br><div style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;" data-mce-style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;">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.</div><br><div style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;" data-mce-style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;">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.</div><br><div style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;" data-mce-style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;">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 :</div><div style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;" data-mce-style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;"><br data-mce-bogus="1"></div><div><div>######   New point depth   ######</div><div>code metapost</div><div>  <span style="white-space: pre;" data-mce-style="white-space: pre;">   </span>def p_u_prof (expr pos, R, S, A) =</div><div><span style="white-space: pre;" data-mce-style="white-space: pre;">             </span>T:=identity aligned A scaled 1.5S rotated R shifted pos;</div><div><span style="white-space: pre;" data-mce-style="white-space: pre;">               </span># calcul of the depth of the point: altitude of the point - altitude max of the cave</div><div><span style="white-space: pre;" data-mce-style="white-space: pre;">           </span>#                                   (it will be better with the altitude of the main entrance</div><div><span style="white-space: pre;" data-mce-style="white-space: pre;">                </span>#                                    defined by the option -entrance of the survey block)</div><div><span style="white-space: pre;" data-mce-style="white-space: pre;">            </span>depth := \thaltitude - \cavemaxz;</div><div><span style="white-space: pre;" data-mce-style="white-space: pre;">         </span># Print the label</div><div><span style="white-space: pre;" data-mce-style="white-space: pre;">              </span>begingroup</div><div><span style="white-space: pre;" data-mce-style="white-space: pre;">                     </span>interim defaultscale:=1;</div><div><span style="white-space: pre;" data-mce-style="white-space: pre;">                       </span>label (btex {-- } depth {m --} etex, (0, 0)) transformed T withcolor(0.5,0.,0.);</div><div><span style="white-space: pre;" data-mce-style="white-space: pre;">                               </span># 1) Why is profondeur value NOT printed ? Where is the error ?</div><div><span style="white-space: pre;" data-mce-style="white-space: pre;">                </span>endgroup;</div><div><span style="white-space: pre;" data-mce-style="white-space: pre;">      </span>enddef;</div><div><span style="white-space: pre;" data-mce-style="white-space: pre;">        </span>initsymbol("p_u_prof")</div><div>endcode</div></div></div><div style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;" data-mce-style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;">##############################</div><div style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;" data-mce-style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;"><br data-mce-bogus="1"></div><div style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;" data-mce-style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;">The problem is that this point will print the text "-- depth m --", but not the value of the depth. I suspect that :</div><ol><li data-mce-style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;" style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;">the depth calcul may not be accurate?</li><li data-mce-style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;" style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;">the way I call the variable depth is not accurate?</li></ol><div style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;" data-mce-style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;">Does anyone has a clue for that problem?</div><div style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;" data-mce-style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;"><br data-mce-bogus="1"></div><div style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;" data-mce-style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;"><div><div><br data-mce-bogus="1"></div><div>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 ?</div><br></div>Cheers,</div><div style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;" data-mce-style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: 12pt;"><br><div>Xavier</div></div></div><br></div></div></body></html>