Colorizing sections of centerline
Hello everyone, is there a way to change the color of different sections of the centerline? I'm at the stickmap-stage of the survey and it would be really helpful to put some colors to it. Regards Alvaro
No idea, but i usually just use the generated .3d file and aven at this stage. Aven can also generate screenshots for printing, and can color the centerline based on various metrics.
Am 15.11.2020 um 12:48 schrieb Alvaro Aguilera <aag@posteo.de>:
Hello everyone,
is there a way to change the color of different sections of the centerline?
I'm at the stickmap-stage of the survey and it would be really helpful to put some colors to it.
Regards Alvaro _______________________________________________ Therion mailing list Therion@speleo.sk https://mailman.speleo.sk/listinfo/therion
is there a way to change the color of different sections of the centerline?
Sort-of. https://therion.speleo.sk/wiki/metapost#centreline_that_is_only_visible_when... So what you need is a way to detect your different centrelines. If they are fake centrelines ("line survey") in scraps, you can actually set "-attr somename somevalue" and then look for the corresponding ATTR_somename in your metapost. Like this: https://therion.speleo.sk/wiki/metapost#p-hangers_that_face_the_right_way_an... But automatically generated centrelines have fewer options, since there are fewer variables to look for. I use this in one place to colour the splays and centreline differently: code metapost def l_survey_cave (expr P) = T:=identity; pickup PenC; if ATTR__shotflag_splay: thdraw P withcolor (1,0.5,0.5); else: thdraw P; fi; enddef; endcode You could look for ATTR__scrap instead, if scraps were involved... Or current_scrap := "scrap@section"; I don't think it creates a variable like that for automatically generated scraps so that you can identify the survey though. Use the -d option to get the data.mp and look through the stuff at the end to see if there is a useful variable you can look for. I suspect that you won't find a useful variable. But let's assume you created a single scrap in each survey, with nothing in it, just a single survey station so it has a location. You create a map that includes that scrap, and then includes the survey itself (to render the centreline) - you may need to experiment to see which order Therion will render them. Now when you render that survey, I suspect that the current_scrap variable and ATTR__scrap variable will get created. You can use metapost to look for it, and change the colour. Not a complete idea, and definitely not as easy as you might have hoped, but it should be possible to make it work. Maybe someone else can get creative with this idea... Tarquin
But let's assume you created a single scrap in each survey, with nothing in it, just a single survey station so it has a location. You create a map that includes that scrap, and then includes the survey itself (to render the centreline) - you may need to experiment to see which order Therion will render them. Now when you render that survey, I suspect that the current_scrap variable and ATTR__scrap variable will get created. You can use metapost to look for it, and change the colour.
Just to point out that this works. survey whatever scrap emptyscrap point 0 0 station -name 1@somesurvey endscrap map emptymap -projection plan emptyscrap endmap map outermap -projection plan emptymap somesurvey endmap survey somesurvey centreline ... data goes here ... Render the "outermap". Now the MetaPost output contains this: current_scrap := "emptyscrap@whatever"; ATTR__scrap := "emptyscrap"; And then a whole load of centreline stuff. code metapost def l_survey_cave (expr P) = T:=identity; pickup PenC; if known current_scrap: if current_scrap = "emptyscrap@whatever": thdraw P withcolor (1,0.5,0.5); else: thdraw P; fi; else: thdraw P; fi; enddef; endcode You would need to add maps like that to each major survey section that you want to colour, as well as the first section that you do not want to colour, because it will keep applying that colour until it encounters another scrap. Not how you want to leave it when you are done, but useful for debugging, perhaps.
participants (3)
-
Alvaro Aguilera -
Benedikt Hallinger -
Tarquin Wilton-Jones