Skip to content

Commit

Permalink
Get ready for release
Browse files Browse the repository at this point in the history
Temporarily cset GMT_PUBLIC_RELEASE to TRUE.  Also added the add_Definition (DCHRISTMAS) to the CMake system for building the Christmas projection used by share/tools/christmas-cube.sh
  • Loading branch information
PaulWessel committed Dec 12, 2023
1 parent c9ec4ff commit 22c8b6f
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmake/ConfigDefault.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ set (GMT_PACKAGE_VERSION_PATCH 0)
# Whether to make a public release.
# When making internal releases or just an ordinary developer build, it is set to FALSE.
# When making *public* release, uncomment to set it to TRUE.
# set (GMT_PUBLIC_RELEASE TRUE)
set (GMT_PUBLIC_RELEASE TRUE)

# The GMT package version.
set (GMT_PACKAGE_VERSION "${GMT_PACKAGE_VERSION_MAJOR}.${GMT_PACKAGE_VERSION_MINOR}.${GMT_PACKAGE_VERSION_PATCH}${GMT_PACKAGE_VERSION_SUFFIX}")
Expand Down
4 changes: 4 additions & 0 deletions cmake/ConfigUserAdvancedTemplate.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ set (GMT_ENABLE_OPENMP TRUE)
# message("Add Xcode definition for GMT")
#endif()

# Uncomment if you want to temporarily replace Miller projection with the "Christmas" projection.
# add_definitions(-DCHRISTMAS)
# Then, rebuild GMT and try the script share/tools/christmas-cube.sh

# Uncomment these two statements if you are a developer debugging GMT:
#add_definitions(-DDEBUG)
#add_definitions(-DMEMDEBUG) # Turn on memory tracking; see gmt_memory .c on MEMDEBUG for information
Expand Down
90 changes: 90 additions & 0 deletions share/tools/christmas-cube.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#!/usr/bin/env bash
#
# Copyright (c) 1991-2023 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
# See LICENSE.TXT file for copying and redistribution conditions.
#
# GMT 3-D Christmas Ornament 2023!
# Un-comment the CHRISTMAS setting in ConfigUserAdvanced.cmake and recompile GMT.
# Then run this script for a 3D cube that you assemble with scissors and tape!

SIDE=8 # The side dimension of the cube (cm)
#------------------------------------------------
WQ=${SIDE}
WP=$(gmt math -Q ${SIDE} 2 DIV =)
H=$(gmt math -Q ${SIDE} 2 SQRT DIV =)
XSHIFT=$(gmt math -Q ${SIDE} 2 MUL NEG =)
YSHIFT=$(gmt math -Q ${SIDE} 0 ADD =)

gmt begin christmas-cube pdf
# N pole area and middle Earth
gmt coast -R0/90/-45/45 -JQ45/${WQ} -B0g15 -Gred
gmt coast -R0/90/45/90 -JJ45/${WP} -B0g15 -Gred -Y${WQ}
echo 45 90 | gmt plot -Sa16p -W0.5p -Gyellow
gmt coast -R90/180/-45/45 -JQ135/${WQ} -B0g15 -Gdarkgreen -X${SIDE} -Y-${WQ}
gmt coast -R90/180/45/90 -JJ135/${WP} -B0g15 -Gdarkgreen -Y${WQ}
echo 135 90 | gmt plot -Sa16p -W0.5p -Gyellow
gmt coast -R180/270/-45/45 -JQ225/${WQ} -B0g15 -Gred -X${SIDE} -Y-${WQ}
echo "225 8 Merry Christmas 2023" | gmt text -F+f24p,33+jCM -N -Gwhite
echo "225 -7 From the GMT Team!" | gmt text -F+f18p,33+jCM -N -Gwhite
gmt coast -R180/270/45/90 -JJ225/${WP} -B0g15 -Gred -Y${WQ}
echo 225 90 | gmt plot -Sa16p -W0.5p -Gyellow
gmt coast -R270/360/-45/45 -JQ315/${WQ} -B0g15 -Gdarkgreen -X${SIDE} -Y-${WQ}
gmt coast -R270/360/45/90 -JJ315/${WP} -B0g15 -Gdarkgreen -Y${WQ}
echo 315 90 | gmt plot -Sa16p -W0.5p -Gyellow
# S pole area
gmt coast -R0/90/-90/-45 -JJ45/${WP} -B0g15 -Gred -X${XSHIFT} -Y-${YSHIFT} -p180
echo 45 -90 | gmt plot -Sa16p -W0.5p -Gyellow -p
gmt coast -R90/180/-90/-45 -JJ135/${WP} -B0g15 -Gdarkgreen -X${SIDE} -p
echo 135 -90 | gmt plot -Sa16p -W0.5p -Gyellow -p
gmt coast -R180/270/-90/-45 -JJ225/${WP} -B0g15 -Gred -X${SIDE} -p
echo 225 -90 | gmt plot -Sa16p -W0.5p -Gyellow -p
gmt coast -R270/360/-90/-45 -JJ3155/${WP} -B0g15 -Gdarkgreen -X${SIDE} -p
echo 315 -90 | gmt plot -Sa16p -W0.5p -Gyellow -p
# Dashed cut lines for use with scissors
gmt plot -R0/32/-4/12 -Jx1c -W0.25p,blue,- -N -X-32c -Y-4c <<- EOF
>
32 0
33 0
33 8
32 8
32.707 8.707
28 13.3
24 9
24 8
>
16 8
16 9
12 13.3
8 9.3
8 8
>
28 13
28 12
>
12 13
12 12
>
0 0
-1 0
-1 8
0 8
>
0 0
-0.707 -0.707
4 -5
8 -1
8 0
>
16 0
16 -1
20 -5
24 -1
24 0
>
4 -5
4 -4
>
20 -5
20 -4
EOF
gmt end show
3 changes: 1 addition & 2 deletions src/gmt_proj.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,6 @@ GMT_LOCAL void gmtproj_vmiller (struct GMT_CTRL *GMT, double lon0, double slat)

GMT_LOCAL void gmtproj_miller (struct GMT_CTRL *GMT, double lon, double lat, double *x, double *y) {
/* Convert lon/lat to Cylindrical equidistant x/y */

gmt_M_wind_lon (GMT, lon) /* Remove central meridian and place lon in -180/+180 range */
if (lat > 0.0) {
*x = (0.5 + lon * (90.0 - lat) / 4050.0) * GMT->current.proj.j_x;
Expand All @@ -813,7 +812,7 @@ GMT_LOCAL void gmtproj_imiller (struct GMT_CTRL *GMT, double *lon, double *lat,
#else
GMT_LOCAL void gmtproj_vmiller (struct GMT_CTRL *GMT, double lon0, double unused) {
/* Set up a Miller Cylindrical transformation */

gmt_M_unused (unused);
gmtproj_check_R_J (GMT, &lon0);
GMT->current.proj.central_meridian = lon0;
GMT->current.proj.j_x = D2R * GMT->current.proj.EQ_RAD;
Expand Down

0 comments on commit 22c8b6f

Please sign in to comment.