I'd like to also include the following in this patch.

You will notice that the ps output has a strange gray background.

The following code snippet is responsible for setting color.

#define psShadeMax      17.0    /* same as XShadeMax */
#define psShadeMul (1.0/(psShadeMax-1.0)) /* white and 16 gray shades */

It makes no sense to compute a constant grey color and use it.
(I guess it was mono color so put a grey background there?)

Let's simply have a white background instead.

- Qian

diff --git a/src/graph/view3D/smoothShade3d.c b/src/graph/view3D/smoothShade3d.c
index 7e80157a..432a0f98 100644
--- a/src/graph/view3D/smoothShade3d.c
+++ b/src/graph/view3D/smoothShade3d.c
@@ -567,8 +567,7 @@ scanLines(int dFlag)
     XFillRectangle(dsply,viewport->viewWindow,trashGC,0,0,
                    vwInfo.width,vwInfo.height);
   } else {
-    GSetForeground(GC9991,
- 1.0-(float)((int)(psShadeMax-0.3*psShadeMax)-1)*psShadeMul,dFlag);
+    GSetForeground(GC9991, psWhite, dFlag);
     quadMesh[0].x = 0;  quadMesh[0].y = 0;
     quadMesh[1].x = graphWindowAttrib.width+2;
     quadMesh[1].y = 0;


On 4/18/24 17:57, Qian Yun wrote:
Currently we get mono color in postscript output of "smooth" style
3D drawings.

That's caused by "GSetForeground" before "GDrawPoint".
"GSetForeground" can only set gray scale.

Luckily the all four usage of "GDrawPoint" are all for the purpose
of generating "smooth" style image.  So this change will not break
anywhere else.

So I decode color and use "setrgbcolor" for it and remove
"installGC" from "drawpoint.ps" because that's responsible for
setting the grey color.

- Qian

--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fricas-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/18693513-a368-44c6-8783-a46980d51ffc%40gmail.com.

Reply via email to