Dear all, I have an other question link to the depth definition with Therion. In the header, Therion print only the total vertical distance between the highest point and the lowest point of the cave by default. As for the point depth, lots of my co-cavers/surveyors made me the remark that it would be better if we can print the depth in the form +xx, -yy where * +xx is the height of the highest point of the cave in regards to the main entrance, * -yy is the height of the lowest point of the cave in regards to the main entrance, It also ask question depending of the data: * If there are different entrances, which entrance to use? In that case, a solution will be to choose the entrance defined in the survey block with the option -entrance * If there are different caves on the map, what reference point to choose ? A solution could be to choose the highest entrance. I tried to find Therion's variables to calcule that, but it seems that we lack an info that is the altitude of the main entrance. Does anyone has an idea how to do that ? Do I need to open a request on Github (I am not sure to be able to code that myself) ? Cheers, Xav
Kia Ora Xavier I don’t have a proper answer for you. It would seem to me that this is too complicated to become a built in feature. As you suggest, for an export of one cave the problem might be easier to solve, but where many caves are exported it might be difficult to conceive an automated approach. Maybe an easier thing to code would be something where the user could just choose a reference altitude to use as a notional zero altitude for your user defined metapost? Personally I do not care much for the height relative to entrances, and I have modified the header to report height like this. Together with gridlines and altitude points throughout the map, the user of the map can do their own maths! Regarding ‘caves’ and ‘main entrances’, I explored some ideas in the wiki here <https://therion.speleo.sk/wiki/faq?s%5b%5d=entrance#how_do_i_specify_a_main_entrance_and_also_the_other_entrances> Regards Bruce
Hi Xavier, Hi Bruce, A trick that I used a while ago was to use the grid-origin command in the layout. According to Marco corvi's description (http://marcocorvi.altervista.org/caving/tbe/m_02/m_02a.htm): /grid-origin//specifies the coordinates of the grid origin. Example: "grid-origin 0 0 1875 m", assuming that the entrance altitude is 1875 m, sets the altitude values for the //|altitude|//points. Having set the entrance (grid origin) altitude, when you specify an "altitude" for a point of a wall line (with the line-point option "altitude .") the value of the altitude is computed and printed on the map. / The difficulty is that all the layouts need to have the same grid-origin if you want to have compatible depth in different exported maps. Hope that helps. Xavier Le 21-Feb-19 à 20:33, Bruce Mutton via Therion a écrit :
Kia Ora Xavier
I don’t have a proper answer for you. It would seem to me that this is too complicated to become a built in feature. As you suggest, for an export of one cave the problem might be easier to solve, but where many caves are exported it might be difficult to conceive an automated approach.
Maybe an easier thing to code would be something where the user could just choose a reference altitude to use as a notional zero altitude for your user defined metapost?
Personally I do not care much for the height relative to entrances, and I have modified the header to report height like this.
Together with gridlines and altitude points throughout the map, the user of the map can do their own maths!
Regarding ‘caves’ and ‘main entrances’, I explored some ideas in the wiki here <https://therion.speleo.sk/wiki/faq?s%5b%5d=entrance#how_do_i_specify_a_main_entrance_and_also_the_other_entrances>
Regards
Bruce
_______________________________________________ Therion mailing list Therion@speleo.sk https://mailman.speleo.sk/listinfo/therion
--
------------------------- Xavier Pennec Senior Research Scientist / Directeur de recherche Asclepios project-team, INRIA Sophia-Antipolis 2004 Route des Lucioles, BP93 F-06902 Sophia-Antipolis Cedex, France +33 4 92 38 76 64 +33 6 78 35 16 90 http://www-sop.inria.fr/asclepios/ -------------------------------
Hi Bruce ! Thanks a lot for your answer, it has given me some ideas (I try to be synthetic and hopefully understandable, but I am really far to be a Tex guru, I may misunderstand this language) : If I manually define a reference altitude that is the altitude of the main entrance, this is easy to calcul the depth for the header: +[Max. altitude of the cave - ref. altitude] / [Min. altitude of the cave - ref. altitude]. I thus tried to do that by combining a thconfig (where I should define the altitude reference) and a config.thc (where I should define the layouts and Tex codes to perform all the calculs and tweek the header) files to port the coding to multiple thconfig's files (see attachements, I tried to comment all my changes and my problems): * In the config.thc, I wrote 3 layouts * a layout langue-en that define some variables in english (Presently, I also have the same in french and spanish). This is where I also define all the new tokens I eventually use in my layouts (clubs, synthesys, webpage,...). This is working very well. * a layout headerl where I define all what I want to write in my header. I used the models from the Therion Wiki, and arrange it a bit to my desires... I specially wrote a section to modify the depth (between TEST / END TEST). This part seems OK, depending on the type of variables used (see further). * a layout Testdepth : this is the layout where I calcul the altitude differences above and under the entrance inside a code tex-map - endcode block. Here, I have a problem: If I do this calcul by using directly numbers (i.e. I need to give the values as numbers [e.g. \edef\cavemaxzc{1008}], and not as variable [e.g. \edef\cavemaxzc{\the\cavemaxz}] ), it is OK. If I try to use counters or token, I receive an error. The problem is that if I want to be able to use this code for a lot of caves, I need to be able to give the value of the tokens \cavemaxz and \caveminz. (I tried with \the\cavemaxz or \number\cavemaxz, and that does not work). * In the thconfig, I made 3 changes to change the depth in the header: * I manually define the variable \altref that correspond to the altitude of the entrance. If I declare the variable as a token (\newtoks) or a counter (\nexcount), I get an error: ! Missing number, treated as zero. <to be read again> { l.765 \newcount\altref \altref{ 1000}. I need to define it as \edef\altref{1000}. If this variable is empty, I also have an error, probably because this variable is not passed to the layouts in config.thc * I call the layout Testdepth from the config.thc. In that case, I have the error: ! Missing number, treated as zero<to be read again> \relax l.755 ...hc = \numexpr \cavemaxzc - \altref \relax. It seems that the variable \altref that I defined is not passed to the Tex code in the layout Tesdepth. I fear that is because this new defined variable is not a token. May I true ? * If I copy the layout Testdepth from the config.thc and paste it inside the layout my_layout from the thconfig (while I comment the line copy Testdepth), it does work, if the \cavemaxz and \caveminz are defined as numbers and not as token or counters. If this variable is empty, I also have an error, probably because this variable is not passed to the layouts in config.thc. (On the contrary, the new counters \maxdepthc and \mindepthc are passed !) If I good understood, in Tex, a token is not a number, and thus we cannot directly make any calculs with it. We need to translate it to a number. Moreover, it seems that if we want to pass variables between layouts that are stored in different files (i.e. here config.thc and thconfig), the variable needs to be defined everywhere as tokens (or counters ?). So I suppose that I need to find a way to translate a token or a counter into a number. Does anyone know how to do that? Sorry for this long email, Cheers, Xavier De: "List for Therion users" <therion@speleo.sk> À: "List for Therion users" <therion@speleo.sk> Cc: "Bruce Mutton" <bruce@tomo.co.nz> Envoyé: Jeudi 21 Février 2019 14:33:34 Objet: Re: [Therion] Depth in the header Kia Ora Xavier I don’t have a proper answer for you. It would seem to me that this is too complicated to become a built in feature. As you suggest, for an export of one cave the problem might be easier to solve, but where many caves are exported it might be difficult to conceive an automated approach. Maybe an easier thing to code would be something where the user could just choose a reference altitude to use as a notional zero altitude for your user defined metapost? Personally I do not care much for the height relative to entrances, and I have modified the header to report height like this. Together with gridlines and altitude points throughout the map, the user of the map can do their own maths! Regarding ‘caves’ and ‘main entrances’, I explored some ideas in the wiki [ https://therion.speleo.sk/wiki/faq?s%5b%5d=entrance#how_do_i_specify_a_main_... | here ] Regards Bruce _______________________________________________ Therion mailing list Therion@speleo.sk https://mailman.speleo.sk/listinfo/therion
Hi Xavier I ran your example, just to check that it compiles as provided, and it does. I have not tried to unpick it – no time at present. I think you have exhausted my metapost knowledge already, and come to the same road blocks and questions that I have previously experienced (converting variable types, doing maths with them, and parsing them from procedure to procedure (from file to file). :) Bruce From: Therion <therion-bounces@speleo.sk> On Behalf Of Xavier Robert via Therion Sent: Tuesday, 26 February 2019 10:16 Subject: Re: [Therion] Depth in the header Hi Bruce ! Thanks a lot for your answer, it has given me some ideas (I try to be synthetic and hopefully understandable, but I am really far to be a Tex guru, I may misunderstand this language) : If I manually define a reference altitude that is the altitude of the main entrance, this is easy to calcul the depth for the header: +[Max. altitude of the cave - ref. altitude] / [Min. altitude of the cave - ref. altitude]. I thus tried to do that by combining a thconfig (where I should define the altitude reference) and a config.thc (where I should define the layouts and Tex codes to perform all the calculs and tweek the header) files to port the coding to multiple thconfig's files (see attachements, I tried to comment all my changes and my problems): * In the config.thc, I wrote 3 layouts * a layout langue-en that define some variables in english (Presently, I also have the same in french and spanish). This is where I also define all the new tokens I eventually use in my layouts (clubs, synthesys, webpage,...). This is working very well. * a layout headerl where I define all what I want to write in my header. I used the models from the Therion Wiki, and arrange it a bit to my desires... I specially wrote a section to modify the depth (between TEST / END TEST). This part seems OK, depending on the type of variables used (see further). * a layout Testdepth : this is the layout where I calcul the altitude differences above and under the entrance inside a code tex-map - endcode block. Here, I have a problem: If I do this calcul by using directly numbers (i.e. I need to give the values as numbers [e.g. \edef\cavemaxzc{1008}], and not as variable[e.g. \edef\cavemaxzc{\the\cavemaxz}]), it is OK. If I try to use counters or token, I receive an error. The problem is that if I want to be able to use this code for a lot of caves, I need to be able to give the value of the tokens \cavemaxz and \caveminz. (I tried with \the\cavemaxz or \number\cavemaxz, and that does not work). * In the thconfig, I made 3 changes to change the depth in the header: * I manually define the variable \altref that correspond to the altitude of the entrance. If I declare the variable as a token (\newtoks) or a counter (\nexcount), I get an error: ! Missing number, treated as zero.<to be read again> {l.765 \newcount\altref \altref{1000}. I need to define it as \edef\altref{1000}. If this variable is empty, I also have an error, probably because this variable is not passed to the layouts in config.thc * I call the layout Testdepth from the config.thc. In that case, I have the error: ! Missing number, treated as zero<to be read again> \relax l.755 ...hc = \numexpr \cavemaxzc - \altref \relax. It seems that the variable \altref that I defined is not passed to the Tex code in the layout Tesdepth. I fear that is because this new defined variable is not a token. May I true ? * If I copy the layout Testdepth from the config.thc and paste it inside the layout my_layout from the thconfig (while I comment the line copy Testdepth), it does work, if the \cavemaxz and \caveminz are defined as numbers and not as token or counters. If this variable is empty, I also have an error, probably because this variable is not passed to the layouts in config.thc. (On the contrary, the new counters \maxdepthc and \mindepthc are passed !) If I good understood, in Tex, a token is not a number, and thus we cannot directly make any calculs with it. We need to translate it to a number. Moreover, it seems that if we want to pass variables between layouts that are stored in different files (i.e. here config.thc and thconfig), the variable needs to be defined everywhere as tokens (or counters ?). So I suppose that I need to find a way to translate a token or a counter into a number. Does anyone know how to do that? Sorry for this long email, Cheers, Xavier _____ De: "List for Therion users" <therion@speleo.sk <mailto:therion@speleo.sk> > Envoyé: Jeudi 21 Février 2019 14:33:34 Objet: Re: [Therion] Depth in the header Kia Ora Xavier I don’t have a proper answer for you. It would seem to me that this is too complicated to become a built in feature. As you suggest, for an export of one cave the problem might be easier to solve, but where many caves are exported it might be difficult to conceive an automated approach. Maybe an easier thing to code would be something where the user could just choose a reference altitude to use as a notional zero altitude for your user defined metapost? Personally I do not care much for the height relative to entrances, and I have modified the header to report height like this. Together with gridlines and altitude points throughout the map, the user of the map can do their own maths! Regarding ‘caves’ and ‘main entrances’, I explored some ideas in the wiki here <https://therion.speleo.sk/wiki/faq?s%5b%5d=entrance#how_do_i_specify_a_main_entrance_and_also_the_other_entrances> Regards Bruce
participants (3)
-
Bruce Mutton -
Xavier Pennec -
Xavier Robert