You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add the so wished option to plot spheres in psxyz. (#8844)
* Add the so wished option to plot spheres in psxyz.
They aren't really spheres but circles in 3D plots.
This is mostly a Claude.ai creation but a one that needed a lot of baby-sitting development.
* Change -SQ to -SP for sphere plots. Add a sphere.sh test
* Add the baseline image sphere.ps to dvc
* Update src/psxyz.c
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
* Fixes and updates to this test.
* Make the -SP+e & +a work better.
Oddly the PS seem right but conversion to raster flips spheres upside-down.
---------
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
"c(u)be, (v)ector, (w)edge, (x)cross, (y)dash, (z)dash, or "
243
243
"=(geovector, i.e., great or small circle vectors).");
244
244
@@ -276,6 +276,13 @@ static int usage (struct GMTAPI_CTRL *API, int level) {
276
276
GMT_Usage (API, 2, "\n%s 3-D Cube: Give <size> as the length of all sides; append q if <size> "
277
277
"is a quantity in x-units.", GMT_LINE_BULLET);
278
278
279
+
GMT_Usage (API, 2, "\n%s 3-D Sphere: Give <size> as sphere diameter [Default unit is cm]. "
280
+
"Sphere is rendered with radial gradient shading from white at light source to fill color. Modifiers:", GMT_LINE_BULLET);
281
+
GMT_Usage (API, 3, "+a Set light source azimuth [0, from the right].");
282
+
GMT_Usage (API, 3, "+e Set light source elevation [90, perpendicular to viewing plane].");
283
+
GMT_Usage (API, 3, "+f Use flat/constant fill color (no gradient shading).");
284
+
GMT_Usage (API, 3, "+n Draw outline only (no fill). Outline color from -W.");
285
+
279
286
GMT_Usage (API, 2, "\n%s Ellipse: If not given, we read direction, major, and minor axis from columns 4-6. "
280
287
"If -SE rather than -Se is selected, %s will expect azimuth, and "
281
288
"axes [in km], and convert azimuths based on map projection. "
@@ -1048,6 +1055,10 @@ EXTERN_MSC int GMT_psxyz (void *V_API, int mode, void *args) {
1048
1055
fill_active=Ctrl->G.active; /* Make copies because we will change the values */
1049
1056
outline_active=Ctrl->W.active;
1050
1057
if (not_line&& !outline_active&&S.symbol!=PSL_WEDGE&& !fill_active&& !get_rgb&& !QR_symbol) outline_active= true; /* If no fill nor outline for symbols then turn outline on */
1058
+
if (S.symbol==PSL_SPHERE&& !fill_active&& !S.SP_no_fill) { /* Sphere needs a default fill for 3D shading */
1059
+
current_fill.rgb[0] =current_fill.rgb[1] =current_fill.rgb[2] =0.5; /* Black */
1060
+
fill_active= true;
1061
+
}
1051
1062
1052
1063
if (Ctrl->D.active) {
1053
1064
/* Shift the plot a bit. This is a bit frustrating, since the only way to do this
@@ -1892,6 +1903,31 @@ EXTERN_MSC int GMT_psxyz (void *V_API, int mode, void *args) {
0 commit comments