forked from robertxa/Topographies-Samoens_Folly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.thc
executable file
·2803 lines (2530 loc) · 97.1 KB
/
config.thc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
encoding utf-8
# Licence
#
#<en> Released under a Creative Commons Attribution-ShareAlike-NonCommercial License:
#<fr> Publié sous la licence Creative Commons Attribution-ShareAlike-NonCommercial:
# <http://creativecommons.org/licenses/by-nc-sa/4.0/>
#
# Written by: / Ecrit par : Xavier Robert
#
#<en> File to set up specific settings for Therion drawing outputs
# In your *.thconfig file, you need to call this file with:
#<fr> Fichier pour définir une configuration pour les dessins de issus de Therion
# Dans votre fichier *.thconfig, vous devez appeller ce fichier avec la ligne :
# input <path/to/the/file/>config.thc
#<en> and then, in each layout, you need to call the corresponding layout:
#<fr> et ensuite, dans chaque layout de votre thconfig, vous devez appeler les layouts qui vous intéressent comme par exemple :
# copy drawingconfig
#
#<en> Lots of definition comes from (or are deeply inspired by) the excellent Therion Wiki
#<fr> Beaucoup de définitions proviennent (ou sont fortement inspirées) de l'excellent Wiki Therion
# https://therion.speleo.sk/wiki/doku.php
# Existing user points / nouvelles définitions de points :
# - nid/nest (u:nest)
# - gradient --> geologic dip
# - danger (u:danger)
# - chauves-souris/bats (u:bats)
# - stalactite boss (u:boss)
# - Shell/coquille fossile (u:shell)
# - Masonry/maçonnerie (u:masonry)
# - Ex voto/Signature (u:ex_voto)
# - Human bones/Ossements humains (u:human_bones)
# - Walking Caver/Spéléo qui marche (u:man_w)
# - Climbing caver/Spéléo qui grimpe (u:man_c)
# - Plan view symbol/symbole de vue en plan (u:symbol_plan)
# - extended view symbol/symbole de vue en coupe développée (u:symbol_extend)
# Existing user lines:
# - strate/strata (u:strata; option -clip off)
# - coupole (u:coupole; option -clip off)
# - faille/fault (u:fault; option -clip off)
# - doline (u:doline; option -clip off)
# - chauves-souris/bats (u:bats)
# - rail (u:rail)
# - plan walk/ (u:planwalk)
# - handrail/rambarde (u:handrail)
# - Surface (u:surf)
# - Dive line/fil d'Ariane (u:ariane)
# - Deviation (u:deviation)
# Existing user areas:
# - boue/mud (u:boue)
# - guano (u:guano)
# - chauves-souris/bats (u:bats)
# - tronc/tree-trunk (u:tronc)
# - feuilles/tree-leaves (u:feuilles)
# - Tunnel initiation/Départ de galerie (u:galerie)
#<en> change the names for the legend
#<fr> change les descriptions des symboles pour la légende
text en "line u:rope" "rope" #text to appear in legend
text fr "line u:rope" "corde" #text to appear in legend
text es "line u:rope" "cuerda" #text to appear in legend
text en "line u:fault" "fault" #text to appear in legend
text fr "line u:fault" "faille" #text to appear in legend
text es "line u:fault" "falla" #text to appear in legend
text en "line u:strata" "strata" #text to appear in legend
text fr "line u:strata" "strate" #text to appear in legend
text es "line u:strata" "strata" #text to appear in legend
text en "line u:doline" "doline" #text to appear in legend
text fr "line u:doline" "doline" #text to appear in legend
text es "line u:doline" "dolina" #text to appear in legend
text en "point u:bats" "bat(s)"
text fr "point u:bats" "chauve-souris"
text es "point u:bats" "murciélago(s)"
text en "line u:bats" "bat path"
text fr "line u:bats" "passage de chauve-souris"
text es "line u:bats" "ruta de murciélagos"
text en "area u:bats" "lot of bats"
text fr "area u:bats" "beaucoup de chauve-souris"
text es "area u:bats" "muchos murciélagos"
text fr "area u:galerie" "départ de galerie"
text en "area u:galerie" "tunnel departure"
text es "area u:galerie" "salida de galeria"
text en "point u:guacharos" "guacharos"
text fr "point u:guacharos" "guacharos"
text es "point u:guacharos" "guacharos"
text fr "point danger" "danger !"
text en "point danger" "danger !"
text es "point danger" "danger !"
text en "point masonry" "masonry"
text fr "point masonry" "maçonnerie/murs"
text es "point masonry" "albañilería/muros"
text en "point ex-voto" "ex voto"
text fr "point ex-voto" "ex voto/signature"
text es "point ex-voto" "ex voto/firma"
text en "point human-bones" "human bones"
text fr "point human-bones" "ossements humains"
text es "point human-bones" "huesos humanos"
text en "point u:boss" "stalagmite boss"
text fr "point u:boss" "stalagmite boss"
text es "point u:boss" "stalagmite boss"
text fr "area u:guano" "guano"
text en "area u:guano" "guano"
text es "area u:guano" "guano"
text fr "area u:boue" "lac de boue"
text en "area u:boue" "mud lake"
text es "area u:boue" "lago de barro"
text fr "area u:tronc" "tronc d'arbre"
text en "area u:tronc" "Tree trunk"
text es "area u:tronc" "tronca de árbol"
text fr "area u:feuilles" "feuilles/feuillage"
text en "area u:feuilles" "tree leaves"
text es "area u:feuilles" "Hojas de árbol"
text en "line u:sentier" "trail"
text fr "line u:sentier" "sentier"
text es "line u:sentier" "sendero"
text en "point u:shell" "shell"
text fr "point u:shell" "fossile"
text es "point u:shell" "fosíl"
# Correction texte espagnol
text es "point air-draught" "corriente de aire"
text es "line rock-border" "contorno de bloque"
#text es "point water-flow" "curso de agua"
#text es "line water-flow" "curso de agua"
##text es "group water-flow" "curso de agua"
text es "point water-flow:permanent" "riachuelo"
text es "line water-flow:permanent" "riachuelo"
text es "point water-flow:intermittent" "riachuelo intermitente"
text es "line water-flow:intermittent" "riachuelo intermitente"
text es "line water-flow:conjectural" "riachuelo supuesto"
text es "line rock-edge" "arista de bloque"
text es "point cave-pearl" "perlas de cavernas"
text es "point rimstone-dam" "travertino"
text es "point rimstone-pool" "travertino"
text es "point stalactite" "estalactita"
text es "point stalactites" "estalactitas"
text es "point stalagmite" "estalagmita"
text es "point stalagmites" "estalagmitas"
text es "point pillars" "pilares"
text es "point pillar" "pilare"
text fr "point traverse" "vire"
text fr "point ice-stalagmite" "stalagmite de glace"
text fr "point u:anchor_artificial" "Ancrage artificiel"
text fr "point u:anchor_natural" "Ancrage naturel"
text en "point u:man_w" "caver (walking)"
text fr "point u:man_w" "spéléo (marchant)"
text es "point u:man_w" "espeleológo (caminando)"
text en "point u:man_c" "caver (climbing)"
text fr "point u:man_c" "spéléo (grimpant)"
text es "point u:man_c" "espeleológo (escalando)"
text en "point u:symbol_plan" ""
text fr "point u:symbol_plan" ""
text es "point u:symbol_plan" ""
text en "point u:symbol_extend" ""
text fr "point u:symbol_extend" ""
text es "point u:symbol_extend" ""
### Layouts Languages/langues
#<en> Different layouts to manage languages (en, fr, es)
# In your thconfig, call the layout langue-XX where XX is en, fr or es
# You need to add one of these layout if you use the layout headerl or header_coupe
# If you want to add one of the field club, syntesys, web page, expedition, guide, datat,
# add the following line in the code tex-map/endcode block of your layout in the thconfig
# \newtoks\YYYY \YYYY={the value of your variable}
# where YYYY = club, synth, wpage, expe, guide or datat
#<fr> Différents layouts pour définir les langues (pour l'instant : en, fr, es)
# Dans votre thconfig, appelez le layout langue-XX où XX est en, fr ou es
# Vous devez ajouter l'un de ces layouts si vous voulez utiliser les layouts headerl ou header_coupe
# qui redéfinissent la présentation et les informations du cartouche (header).
# Si vous voulez ajouter un de ces champs club, syntesys, web page, expedition, guide, datat,
# rajouter la ligne suivante dans le bloc code tex-map/endcode de votre layout dans votre thconfig
# (voir les exemples)
# \newtoks\YYYY \YYYY={Valeur de votre varialbe}
# où YYYY = club, synth, wpage, expe, guide or datat
#
#<en> You may add new fields, following the examples in the layouts.
# If you add a new field, you need to edit the layout(s) headerl and/or header_coupe
#<fr> Vous pouvez ajouter de nouveaux champs, en suivant les exemples dans les layouts suivant.
# Si vous rajouter un nouveau champ, vous devrez éditer le(s) layout(s) headerl et/ou header_coupe
layout langue-fr
# Définit la langue française
language fr
code tex-map
% Definition of variables for the tuned headers :
\newtoks\thversiontitleB \thversiontitleB={Therion }
\newtoks\thversiontitleA \thversiontitleA={Compilation }
\newtoks\datetitle \datetitle={le }
\newtoks\thproj \thproj={Projection }
\newtoks\thclub \thclub={Club(s) }
\newtoks\thsynth \thsynth={Synthèse }
\newtoks\thwpage \thwpage={Page internet }
\newtoks\thexpe \thexpe={Expedition }
\newtoks\thguide \thguide={Guide(s) }
\newtoks\thdatat \thdatat={Données topographiques }
\newtoks\depthrangetitle \depthrangetitle={Depth range from }
\newtoks\ththanksto \ththanksto{Nos remerciements }
\newtoks\thcoords \thcoords{Coordonnées GPS (WGS84) }
\newtoks\explolengthtitle \explolengthtitle{Longueur explorée }
\newtoks\explodepthtitle \explodepthtitle{\thinspace{}---\thinspace{}\thinspace{}\thinspace{}\thinspace{}Profondeur explorée }
# Initiate variables
\newtoks\club \club={}
\newtoks\synth \synth={}
\newtoks\wpage \wpage={}
\newtoks\expe \expe={}
\newtoks\guide \guide={}
\newtoks\datat \datat={}
\newtoks\thanksto \thanksto={}
\newtoks\ECoordinates \ECoordinates={}
endcode
endlayout
layout langue-es
# Definición del idioma español
language es
code tex-map
% Definition of variables for the tuned headers :
\newtoks\thversiontitleB \thversiontitleB={Therion }
\newtoks\thversiontitleA \thversiontitleA={Compilación}
\newtoks\datetitle \datetitle={el }
\newtoks\thproj \thproj={Proyección}
\newtoks\thclub \thclub={Club(es)}
\newtoks\thsynth \thsynth={Síntesis}
\newtoks\thwpage \thwpage={Página web}
\newtoks\thexpe \thexpe={Expedición}
\newtoks\depthrangetitle \depthrangetitle={Depth range from }
\newtoks\thguide \thguide={Guia(s)}
\newtoks\thdatat \thdatat={Datos topograficas }
\newtoks\ththanksto \ththanksto{Nuestros agradecimientos }
\newtoks\thcoords \thcoords{Coordinadas GPS (WGS84) }
\newtoks\explolengthtitle \explolengthtitle{Longitud explorada}
\newtoks\explodepthtitle \explodepthtitle{\thinspace{}---\thinspace{}\thinspace{}\thinspace{}\thinspace{}Profondidad explorada}
\cartotitle={Dibujo}
# Initiate variables
\newtoks\club \club={}
\newtoks\synth \synth={}
\newtoks\wpage \wpage={}
\newtoks\expe \expe={}
\newtoks\guide \guide={}
\newtoks\datat \datat={}
\newtoks\thanksto \thanksto={}
\newtoks\ECoordinates \ECoordinates={}
endcode
endlayout
layout langue-en
# Set the language english
language en
code tex-map
% Definition of variables for the tuned headers :
\newtoks\thversiontitleB \thversiontitleB={Therion }
\newtoks\thversiontitleA \thversiontitleA={Compiled}
\newtoks\datetitle \datetitle={on }
\newtoks\thproj \thproj={Projection}
\newtoks\thclub \thclub={Club(s)}
\newtoks\thsynth \thsynth={Synthesys}
\newtoks\thwpage \thwpage={Web page}
\newtoks\thexpe \thexpe={Expedition}
\newtoks\depthrangetitle \depthrangetitle={Depth range from }
\newtoks\thguide \thguide={Guide(s)}
\newtoks\thdatat \thdatat={Survey's data }
\newtoks\ththanksto \ththanksto{Acknowledgments }
\newtoks\thcoords \thcoords{GPS coordinates (WGS84) }
\newtoks\explolengthtitle \explolengthtitle{Explored length}
\newtoks\explodepthtitle \explodepthtitle{\thinspace{}---\thinspace{}\thinspace{}\thinspace{}\thinspace{}Explored depth}
# Initiate variables
\newtoks\club \club={}
\newtoks\synth \synth={}
\newtoks\wpage \wpage={}
\newtoks\expe \expe={}
\newtoks\guide \guide={}
\newtoks\datat \datat={}
\newtoks\thanksto \thanksto={}
\newtoks\ECoordinates \ECoordinates={}
endcode
endlayout
###<en> End of the layouts languages
###<fr> Fin des layouts languages
#______________________________
layout drawingconfig
#<en> Layout to draw the map and extended view.
#<fr> Layout pour dessiner les plans et les coupes développées.
#<en> pdf-Author
#<fr> Auteur du pdf
doc-author "Xavier Robert (G.S. Vulcain)"
#<en> Set the symology you want to use: UIS, ASF (Australie) CCNP (Etats Units) ou
# SKB (tchecoslovakia)
#<fr> Définit la banque de symboles que nous voulons utiliser :
# UIS, ASF (Australie) CCNP (Etats Units) ou SKB (tchecoslovakia)
#symbol-set UIS
#<en> Change the type or colors of specific symbols:
#<fr> Changer le type ou la couleur de symboles spécifiques:
symbol-assign point station:temporary SKBB
symbol-assign point pillar AUT
symbol-color point water-flow [17 46 100]
symbol-color point water-flow:intermittent [17 46 100]
symbol-color point water-flow:paleo [17 46 100]
symbol-color point water-drip [17 46 100]
symbol-color point water [17 46 100]
symbol-color line water-flow [17 46 100]
symbol-color line water-flow:conjectural [17 46 100]
symbol-color line water-flow:intermittent [17 46 100]
symbol-color point spring [17 46 100]
symbol-color point ice [0 0 100]
symbol-color line wall:ice [0 0 100]
symbol-color point ice-pillar [0 0 100]
symbol-color point ice-stalagmite [0 0 100]
symbol-color point ice-stalactite [0 0 100]
symbol-color area ice [0 0 100]
symbol-color point snow [0 0 100]
symbol-color area snow [0 0 100]
symbol-color point root [52 33 6]
symbol-color point vegetable-debris [13 47 6]
symbol-color point seed-germination [13 47 6]
symbol-color point altitude [100 50 0]
symbol-color point station [54 7 60]
symbol-color line flowstone [100 60 20]
symbol-color line wall:flowstone [100 60 20]
symbol-color point flowstone [100 60 20]
symbol-color area flowstone [100 60 20]
symbol-color area moonmilk [100 60 20] # Change the color ?
symbol-color point moonmilk [100 60 20] # Change the color ?
symbol-color line wall:moonmilk [100 60 20] # Change the color ?
symbol-color point curtains [100 60 20]
symbol-color point curtain [100 60 20]
symbol-color point disc-pillar [100 60 20]
symbol-color point disc-stalactite [100 60 20]
symbol-color point disc-stalagmite [100 60 20]
symbol-color point disc-pillars [100 60 20]
symbol-color point disc-stalactites [100 60 20]
symbol-color point disc-stalagmites [100 60 20]
symbol-color point disk [100 60 20]
symbol-color point wall-calcite [100 60 20]
symbol-color point pillar [100 60 20]
symbol-color point pillar-with-curtains [100 60 20]
symbol-color point pillars-with-curtains [100 60 20]
symbol-color point stalactite [100 60 20]
symbol-color point stalagmite [100 60 20]
symbol-color point stalactites [100 60 20]
symbol-color point stalagmites [100 60 20]
symbol-color point stalactite-stalagmite [100 60 20]
symbol-color point stalactites-stalagmites [100 60 20]
symbol-color point flowstone-choke [100 60 20]
symbol-color line rimstone-dam [100 60 20]
symbol-color line rimstone-pool [100 60 20]
symbol-color point rimstone-dam [100 60 20]
symbol-color area stalactite [100 60 20]
symbol-color area stalactite-stalagmite [100 60 20]
symbol-color area stalagmite [100 60 20]
symbol-color area pillar [100 60 20]
symbol-color area pillar-with-curtains [100 60 20]
symbol-color area mudcrack [52 33 6] # Color to verify ; Maybe to darken
symbol-color area clay [52 33 6] # Color to verify
symbol-color point volcano [52 33 6] # Color to verify
symbol-color point mud [52 33 6] # Color to verify
symbol-color point mudcrack [52 33 6] # Color to verify
symbol-color point clay [52 33 6] # Color to verify
symbol-color line wall:clay [52 33 6] # Color to verify
#symbol-color point clay-tree [52 33 6] # Color to verify
symbol-color point clay-choke [52 33 6] # Color to verify
symbol-color point wall-altitude [78 8 52] # rouge-violet 199, 21, 133
####### Metapost-changes ############
code metapost
#<en> Modify length/depth statistics to print
#<fr> Modifier l'aspect et les données des statistiques de longueur affichées si besoin
#code tex-map
# \cavelength{1330\thinspace{}m}
# + 150\thinspace{}m estimes}
# \cavedepth{243\thinspace{}m}
#endcode
#<en> Change the dashed line for the line wall:presumed
#<fr> Changer la ligne pointillée du symbole line wall:presumed
def l_wall_presumed (expr P) =
T:=identity;
pickup PenA;
# Old definition
#thdraw P dashed evenly scaled (2*optical_zoom);
# New definition
thdraw P dashed evenly scaled (.1u);
enddef;
#<en> Change the dashed line for the line chimney
#<fr> Changer la ligne pointillée du symbole line chemney (cheminée)
def l_chimney (expr P) =
T:=identity;
pickup PenC;
%thdraw P dashed evenly scaled optical_zoom;
thdraw P dashed evenly scaled (.05u);
enddef;
#<en> To change blocs size in the area blocks
#<fr> Pour modifier la taille des blocs dans l'aire blocks
def a_blocks (expr p) =
T:=identity;
pickup PenC;
path q, qq; q = bbox p;
picture tmp_pic;
uu := max(u, (xpart urcorner q - xpart llcorner q)/100, (ypart urcorner q - ypart llcorner q)/100);
tmp_pic := image(
for i = xpart llcorner q step 1.0uu until xpart urcorner q:
for j = ypart llcorner q step 1.0uu until ypart urcorner q:
qq := punked (((-.3uu,-.3uu)--(.3uu,-.3uu)--(.3uu,.3uu)--(-.3uu,.3uu)--cycle)
randomized (uu/2))
rotated uniformdeviate(360)
shifted ((i,j) randomized 1.0uu);
if xpart (p intersectiontimes qq) < 0:
thclean qq;
thdraw qq;
fi;
endfor;
endfor;
);
clip tmp_pic to p;
draw tmp_pic;
enddef;
#<en> To change sand aspects
#<fr> Pour modifier les aspects du sable dans l'aire associée
def a_sands (expr p) =
T:=identity;
pickup PenC;
path q; q = bbox p;
picture tmp_pic;
tmp_pic := image(
for i = xpart llcorner q step 0.1u until xpart urcorner q:
for j = ypart llcorner q step 0.1u until ypart urcorner q:
draw origin shifted ((i,j) randomized 0.1u) withpen PenC;
endfor;
endfor;
);
#clip tmp_pic to p;
draw tmp_pic;
enddef;
#<en> To change pebbles aspects
#<fr> Pour modifier l'aspects de l'aire pebbles (galets)
def a_pebbles_SKBB (expr p) =
T:=identity;
pickup PenC;
path q, qq; q = bbox p;
picture tmp_pic;
tmp_pic := image(
for i = xpart llcorner q step .1u until xpart urcorner q:
for j = ypart llcorner q step .5u until ypart urcorner q:
qq := (superellipse((.07u,0),(0,.03u), (-.07u,0),(0,.-.03u),.75))
%randomized (u/25)
rotated uniformdeviate(360)
shifted ((i,j) randomized 0.27u);
if xpart (p intersectiontimes qq) < 0:
thdraw qq;
fi;
endfor;
endfor;
);
clip tmp_pic to p;
draw tmp_pic;
enddef;
#<en> To change slopes aspects
#<fr> Pour modifier la ligne aspects
def l_slope (expr P,S)(text Q) =
%show Q;
T:=identity;
numeric dirs[];
numeric lengths[];
for i=Q:
dirs[redpart i]:=greenpart i;
lengths[redpart i]:=bluepart i;
endfor;
li:=length(P); % last
alw_perpendicular:=true;
for i=0 upto li:
if unknown dirs[i]: dirs[i]:=-1;
else:
if dirs[i]>-1:
dirs[i]:=((90-dirs[i]) - angle(thdir(P,i))) mod 360;
alw_perpendicular:=false;
fi;
fi;
if unknown lengths[i]: lengths[i]:=-1; fi;
endfor;
%for i=0 upto li: show dirs[i]; endfor;
ni:=0; % next
pi:=0; % previous
for i=0 upto li:
d:=dirs[i];
if d=-1:
if (i=0) or (i=li):
dirs[i] := angle(thdir(P,i) rotated 90) mod 360;
pi:=i;
else:
if ni<=i:
for j=i upto li:
ni:=j;
exitif dirs[j]>-1;
endfor;
fi;
w:=arclength(subpath(pi,i) of P) /
arclength(subpath(pi,ni) of P);
dirs[i]:=w[dirs[pi],dirs[ni]];
%if (dirs[i]-angle(thdir(P,i))) mod 360>180:
%dirs[i]:=w[dirs[ni],dirs[pi]];
%message("*******");
%fi;
fi;
else:
pi:=i;
fi;
endfor;
%for i=0 upto li: show dirs[i]; endfor;
ni:=0; % next
pi:=0; % previous
for i=0 upto li:
l:=lengths[i];
if l=-1:
if (i=0) or (i=li):
lengths[i] := 1cm; % should never happen!
thwarning("slope width at the end point not specified");
pi:=i;
else:
if ni<=i:
for j=i+1 upto li:
ni:=j;
exitif lengths[j]>-1;
endfor;
fi;
w:=arclength(subpath(pi,i) of P) /
arclength(subpath(pi,ni) of P);
lengths[i]:=w[lengths[pi],lengths[ni]];
pi:=i;
fi;
else:
pi:=i;
fi;
endfor;
%for i=0 upto li: show lengths[i]; endfor;
T:=identity;
boolean par;
cas := 0.3u;
krok := 0.7u;
dlzka := (arclength P);
if dlzka>3u: dlzka:=dlzka-0.6u fi;
mojkrok:=adjust_step(dlzka,1.4u) / 5;
pickup PenD;
par := false;
forever:
t := arctime cas of P;
if t mod 1>0: % not a key point
w := (arclength(subpath(floor t,t) of P) /
arclength(subpath(floor t,ceiling t) of P));
if alw_perpendicular:
a := 90;
else:
a := w[dirs[floor t],dirs[ceiling t]];
fi;
l := w[lengths[floor t],lengths[ceiling t]];
else:
if alw_perpendicular:
a := 90;
else:
a:= dirs[t];
fi;
l:=lengths[t];
fi;
a := a + angle(thdir(P,t));
thdraw (point t of P) --
((point t of P) + if par: 0.333 * fi l * unitvector(dir(a)));
cas := cas + mojkrok;
par := not par;
exitif cas > dlzka + .3u + (krok / 3); % for rounding errors
endfor;
if S = 1: pickup PenC; draw P fi;
%pickup pencircle scaled 3pt;
%for i=0 upto li: draw point i of P; endfor;
enddef;
#<en> To change color of Mud area
#<fr> Pour modifier la couleur de l'aire Boue
def a_u_boue (expr p) =
T:=identity;
#thfill p withcolor (0.22, 0.22, 0.95);
#126, 51, 0
thfill p withcolor (0.49, 0.20, 0.00);
enddef;
#<en> To change color of Sump
#<fr> Pour modifier la couleur de l'aire siphon
def a_sump (expr p) =
T:=identity;
#thfill p withcolor (0.22, 0.22, 0.95);
thfill p withcolor (0.06, 0.20, 0.65);
enddef;
#<en> To change color of guano
#<fr> Pour modifier la couleur de l'aire guano
def a_u_guano (expr p) =
T:=identity;
thfill p withcolor (0.53, 0.26, 0.11);
enddef;
#<en> To change color of a tree-trunk
# I advise to use a line "border" to delimit the area
# If used with tree-leaves, add the option -place top
#<fr> Pour modifier la couleur de l'aire tronc
# Je suggère d'utiliser une ligne "border/bord" pour délimiter l'aire
# Si utilisé conjointement avec l'aire feuilles d'arbres, utiliser l'option -place top
def a_u_tronc (expr p) =
T:=identity;
thfill p withcolor (0.62, 0.24, 0.05);
enddef;
#<en> To change color of a tree-leaves
#<fr> Pour modifier la couleur de l'aire feuilles d'arbre/feuillage
def a_u_feuilles (expr p) =
T:=identity;
thfill p withcolor (0.0, 1.0, 0.0);
enddef;
#<en> To change color of Water area
#<fr> Pour modifier la couleur de l'aire eau
def a_water (expr p) =
T:=identity;
#thfill p withcolor (0.60, 0.8, 1);
thfill p withcolor (0.17, 0.46, 1);
enddef;
#<en> Northarrow more funnier !
#<fr> Pour définir une nouvelle flèche du nord
def s_northarrow (expr rot) =
begingroup
interim defaultscale:=0.7; % scale your north arrow here
#interim defaultscale:=0.5; % scale your north arrow here; 0.5 is the best value for atlas
T:=identity scaled defaultscale rotated -rot;
interim linecap:=squared;
interim linejoin:=rounded;
thfill (-.5cm,-.1cm)--(0,2.5cm)--(.5cm,-.1cm)--cycle;
pickup pencircle scaled (0.08cm * defaultscale);
thdraw (0,0)--(0,-2.5cm);
pickup pencircle scaled (0.16cm * defaultscale);
p:=(0.4cm,0.6cm);
thdraw ((p--(p yscaled -1)--(p xscaled -1)--(p scaled -1)) shifted (0,-1.0cm));
label.rt(thTEX("mg") scaled 1.6, (.6cm,-1.6cm)) transformed T;
endgroup;
enddef;
# #<en> Change Scale bar type
# #<fr> Pour modifier la barre d'échelle
# def s_scalebar (expr l, units, txt) =
# begingroup
# interim warningcheck:=0;
# tmpl:=l / Scale * cm * units / 2;
# tmpx:=l / Scale * cm * units / 5;
# tmph:=5bp; % bar height
# endgroup;
# pickup PenC;
# draw (-tmpl,0)--(tmpl,0)--(tmpl,-tmph)--(-tmpl,-tmph)--cycle;
# p:=(0,0)--(tmpx,0)--(tmpx,-tmph)--(0,-tmph)--cycle;
# for i:=-2.5 step 2 until 2:
# fill p shifted (i * tmpx,0);
# endfor;
# begingroup
# interim labeloffset:=3.5bp;
# for i:=0 step (l/5) until (l-1):
# tmpx:=tmpl * (i * 2 / l - 1);
# label.bot(thTEX(decimal (i)),(tmpx,-tmph));
# endfor;
# label.bot(thTEX(decimal (l) & "\thinspace" & txt),(tmpl,-tmph));
# %<en> To write the scale "1:scale" uncomment it the next line:
# %<fr> Pour écrire l'échelle "1:scale" au dessus de la barre décommenter la ligne suivante :
# %label.top(thTEX("Echelle 1 : " & decimal (Scale*100)),(0,0));
# endgroup;
# enddef;
# #<en> Write the point depth (not functionning...)
# #<fr> Définir un point qui écrit la côte/profondeur (Ne fonctionne pas actuellement...)
# def p_u_prof (expr pos) =
# T:=identity shifted pos;
# pickup PenD;
# p:=(-.3u,0)--(.3u,0);
# thdraw p; thdraw p rotated 90;
# p:=fullcircle scaled .2u;
# thclean p; thdraw p;
# enddef;
# vardef p_label@#(expr txt,pos,rot,mode) =
# if mode=1:
# thdrawoptions(withcolor .8red + .4blue);
# p_u_prof(pos);
# % append "m" to label
# picture txtm;
# % calcul profondeur
# %numeric profondeur;
# profondeur:=(\thaltitude-\cavemaxz);
# picture txtprofondeur;
# txtm:=image(
# draw txt;
# interim labeloffset:=0;
# label.urt(btex \thaltitude m etex, lrcorner txt);
# %label.urt(btex \thdepth m etex, lrcorner txt);
# );
# % give extra offset in case of l/r/t/b alignment
# pair ctmp;
# ctmp:=center thelabel@#("x", (0,0));
# if (xpart ctmp * ypart ctmp)=0:
# interim labeloffset:=(.4u);
# else: % diagonal alignment
# interim labeloffset:=(.2u);
# fi;
# % draw label
# lab:=thelabel@#(txtm, pos);
# draw lab _thop_; % use color
# thdrawoptions();
# bboxmargin:=0.8bp;
# write_circ_bbox((bbox lab) smoothed 2);
# else:
# if mode=7: interim labeloffset:=(u/8) fi;
# lab:=thelabel@#(txt, pos);
# if mode>1: pickup PenD fi;
# if mode=2: process_uplabel;
# elseif mode=3: process_downlabel;
# elseif mode=4: process_updownlabel;
# elseif mode=5: process_circledlabel;
# elseif mode=6: process_boxedlabel;
# elseif mode=7: process_label(pos,rot); % station name
# elseif mode=8: process_filledlabel(pos, rot);
# else: process_label(pos,rot); fi;
# fi;
# enddef;
#<en> Change the altitude definition
# This label requires to specify the position of text relative to point with
# help of -align in the options box.
#<fr> Changer la définition du point altitude
# Ce label nécessite la position spécifique de l'étiquette de texte de façon relative
# au point avec l'aide de l'option -align.
#ex: -align bottom-right/top-left/top-right/bottom-left/top/bottom/left/right...
def p_altitude (expr pos) =
T:=identity shifted pos;
pickup PenD;
p:=(-.3u,0)--(.3u,0);
thdraw p; thdraw p rotated 90;
p:=fullcircle scaled .2u;
thclean p; thdraw p;
enddef;
vardef p_label@#(expr txt,pos,rot,mode) =
if mode=1:
thdrawoptions(withcolor .8red + .4blue);
p_altitude(pos);
% append "m" to label
picture txtm;
txtm:=image(
draw txt;
interim labeloffset:=0;
label.urt(btex \thaltitude { m} etex, lrcorner txt);
#label.urt(btex \thheight m etex, lrcorner txt);
);
% give extra offset in case of l/r/t/b alignment
pair ctmp;
ctmp:=center thelabel@#("x", (0,0));
if (xpart ctmp * ypart ctmp)=0:
interim labeloffset:=(.4u);
else: % diagonal alignment
interim labeloffset:=(.2u);
fi;
% draw label
lab:=thelabel@#(txtm, pos);
draw lab _thop_; % use color
thdrawoptions();
bboxmargin:=0.8bp;
write_circ_bbox((bbox lab) smoothed 2);
else:
if mode=7: interim labeloffset:=(u/8) fi;
lab:=thelabel@#(txt, pos);
if mode>1: pickup PenD fi;
if mode=2: process_uplabel;
elseif mode=3: process_downlabel;
elseif mode=4: process_updownlabel;
elseif mode=5: process_circledlabel;
elseif mode=6: process_boxedlabel;
elseif mode=7: process_label(pos,rot); % station name
elseif mode=8: process_filledlabel(pos, rot);
else: process_label(pos,rot); fi;
fi;
enddef;
#<en> For point height with P or C prefixe
# use “point 0 0 height -value [+10 m]”
# or “point 0 0 height -value [-85 m]”
# in your data to get E10 or P85
#<fr> Pour obtenir un point de hauteur de passage avec P ou C comme préfixe
# utiliser “point 0 0 height -value [+10 m]”
# ou “point 0 0 height -value [-85 m]”
# dans les données vous donnez E10 ou P85 respectivement
verbatimtex \def\thheightpos{E}\def\thheightneg{P} etex
#<en> Change the altitude definition for the wall-line label (add units)
# To modify the color, you need to modify the triplets after the 3 withcolor command.
# BE CAREFUL ! Sometimes, it generates mpost errors when using point wall:altitude.
# If you get this kind of error, comment the whole p_wallaltitude definition.
#<fr> Changer la définition de l'altitude pour le label de la ligne mur (ajout de l'unité)
# Pour modifier la couleur, modifier le triplet (RGB) après les 3 commandes withcolor.
# ATTENTION ! Parfois, cette redéfinition génère des erreurs métapost.
# Si c'est le cas, commenter toute la redéfinition du point p_wallaltitude.
# def p_wallaltitude (expr pprev,pos,pnext,txt) =
# rot:=angle(unitvector(pnext-pos)+unitvector(pos-pprev)) - 90;
# pickup PenD;
# pair zz;
# %zz:=(pos + 3*unitvector(dir rot));
# zz:=(pos + (u/4)*unitvector(dir rot));
# %draw (pos)--zz withcolor (0.78, 0.08, 0.52); % tic in black
# draw (pos)--zz withcolor (0.78, 0.08, 0.52); % tic in color
# % add the unit (here, meters as m)
# txtm:=image(
# %draw txt; % altitude in black
# draw txt withcolor (0.78, 0.08, 0.52); % altitude in color
# %interim labeloffset:=0;
# %label.urt(btex \thaltitude { m} etex, lrcorner txt); % unit in black
# label.urt(btex \thaltitude { m} etex, lrcorner txt) withcolor (0.78, 0.08, 0.52); % unit in color
# );
# begingroup
# % interim labeloffset:=2pt;
# interim labeloffset:=(u/12);
# if horiz_labels:
# rot:=rot mod 360;
# if rot<=22.5: lab:=thelabel.rt(txtm, zz);
# elseif rot<=67.5: lab:=thelabel.urt(txtm, zz);
# elseif rot<=112.5: lab:=thelabel.top(txtm, zz);
# elseif rot<=157.5: lab:=thelabel.ulft(txtm, zz);
# elseif rot<=202.5: lab:=thelabel.lft(txtm, zz);
# elseif rot<=247.5: lab:=thelabel.llft(txtm, zz);
# elseif rot<=292.5: lab:=thelabel.bot(txtm, zz);
# elseif rot<=337.5: lab:=thelabel.lrt(txtm, zz);
# else: lab:=thelabel.rt(txtm, zz);
# fi;
# else:
# if (abs rot>90) and (abs rot <=270):
# rot:=rot-180;
# lab:=thelabel.lft(txtm, pos);
# else:
# lab:=thelabel.rt(txtm, pos);
# fi;
# fi;
# process_label(pos, if horiz_labels: 0 else: rot fi);
# endgroup;
# enddef;
#<en> Definition of new lines symbols
#<fr> Définition de nouveau symboles de lignes
#<en> Line symbol for strata for cross sections (u:strata). It works exactly as line section
# symbol but you should use -clip off option:
#<fr> Symbole de ligne pour dessiner des strates (u:strata).
# Cela fonctionne exactement comme les autres sections de ligne
# mais vous devrez rajouter l'option -clip off:
def l_u_strata (expr P) =
T:=identity;
path Q; Q = punked P;
for t = 0 upto length P - 1:
pair zz[];
zz1 := point t of P;
zz2 := point t+1 of P;
zz3 := postcontrol t of P;
zz4 := precontrol t+1 of P;
linecap:=0;
if (length(zz3-1/3[zz1,zz2]) > 0.1pt) or (length(zz4-2/3[zz1,zz2]) > 0.1pt):
zz5 = whatever[zz1,zz2];
(zz3-zz5) = whatever * (zz1-zz2) rotated 90;
pickup pencircle scaled 1 mm;
draw zz1--zz5 dashed evenly;
pickup PenA;
draw zz1--zz5 withcolor background;
zz6 = whatever[zz1,zz2];
(zz4-zz6) = whatever * (zz1-zz2) rotated 90;
pickup pencircle scaled 1 mm;
draw zz2--zz6 dashed evenly;
pickup PenA;
draw zz2--zz6 withcolor background;
else:
pickup pencircle scaled 1 mm;
draw zz1--zz2 dashed evenly;
pickup PenA;
draw zz1--zz2 withcolor background;
fi;
endfor;
enddef;
#<en> Line symbol for Coupoles (u:coupole). It works exactly as line section
#<fr> Symbole de ligne pour dessiner des coupoles de plafond.
# Fonctionne comme les autres lignes
def l_u_coupole (expr P) =
T:=identity;
cas := 0; % cursor to step along path
dlzka := arclength P;
mojkrok:=adjust_step(dlzka, 0.25u); % symbol length nudged to be multiple of path length
q:= (0.10u,0.16u) -- (0.13u,0.17u); % dot
pickup PenC; %2nd thinnest pen
forever:
t := arctime cas of P;
thdraw q rotated angle(thdir(P,t)) shifted (point t of P ); % draw dots
cas := cas + mojkrok;
exitif cas > dlzka + (mojkrok / 3); % for rounding errors
endfor;
pickup PenC; %2nd thickest pen
thdraw P; %continuous line
enddef;
#<en> Line symbol for fault.
# It works exactly as line section symbol but you should use -clip off option:
#<fr> Symbole de ligne pour dessiner des failles (u:fault).
# Cela fonctionne exactement comme les autres sections de ligne
# mais vous devrez rajouter l'option -clip off:
def l_u_fault (expr P) =
T:=identity;
path Q; Q = punked P;
pickup PenA;
for t = 0 upto length P - 1:
pair zz[];
zz1 := point t of P;
zz2 := point t+1 of P;
zz3 := postcontrol t of P;
zz4 := precontrol t+1 of P;
if (length(zz3-1/3[zz1,zz2]) > 0.1pt) or (length(zz4-2/3[zz1,zz2]) > 0.1pt):
zz5 = whatever[zz1,zz2];
(zz3-zz5) = whatever * (zz1-zz2) rotated 90;