Problem with mesh plots and hidden line removal

View: New views
6 Messages — Rating Filter:   Alert me  

Problem with mesh plots and hidden line removal

by Kai Habel-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I noticed the following problem in octave3.0.0/gnuplot4.2.2 using the wxt terminal. When I try to plot a 3D mesh with "hidden on" and a rgb color set, only the white facets without grid are drawn.

Please have a look at the script below. If I change "set hidden" to "unset hidden" a magenta grid is drawn as expected, but with "set hidden" it is not (only white facets).

Also, if I I use

'set style line 1 default;'

instead of

'set style line 1 linewidth 0.500000 pointsize 1.000000 linecolor rgbcolor "#FF00FF";'

and 'set hidden' it works as expected - a grid, with hidden line removal and the default (green) color is drawn.

Is this a bug in the script or a gnuplot problem?

Thanks in advance,
Kai

--script starts here ---

set terminal wxt enhanced;

reset;
set autoscale fix;
set origin 0, 0;
set size 1, 1;
set size noratio;
set grid xtics;
set grid ytics;
set grid ztics;
set grid nomxtics;
set grid nomytics;
set grid nomztics;
set grid layerdefault;
set format x "%g";
set xtics border textcolor rgb "#000000";
set format y "%g";
set ytics border textcolor rgb "#000000";
set format z "%g";
set ztics border textcolor rgb "#000000";
set parametric;
set style data lines;
set surface;
#set style line 1 default;
set style line 1 linewidth 0.500000 pointsize 1.000000 linecolor rgbcolor "#FF00FF";
set hidden3d;
set xrange [1.0:3.0] noreverse;
set yrange [1.0:3.0] noreverse;
set zrange [0.0:1.0] noreverse;
set border 895;
unset key;
set style data lines;
set ticslevel 0;
set view 60, 322.5;
splot "-" using ($1):($2):($3):($4) title "" with lines linestyle 1 ;
1 1 1 1
1 2 0 0
1 3 0 0

2 1 0 0
2 2 1 1
2 3 0 0

3 1 0 0
3 2 0 0
3 3 1 1

e


--- script end ---

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: Problem with mesh plots and hidden line removal

by Ethan Merritt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Friday 07 March 2008 03:38, Kai Habel wrote:

> Hello,
>
> I noticed the following problem in octave3.0.0/gnuplot4.2.2 using the wxt terminal.
> When I try to plot a 3D mesh with "hidden on" and a rgb color set, only the white
> facets without grid are drawn.  
>
> if I use
>    'set style line 1 default;'
> instead of
>    'set style line 1 linewidth 0.500000 pointsize 1.000000 linecolor rgbcolor "#FF00FF";'
> and 'set hidden' it works as expected - a grid, with hidden line removal and the
> default (green) color is drawn.
>
> Is this a bug in the script or a gnuplot problem?

A bit of both. The issue is that the colors for hidden-surfaces are
auto-generated based on the line _type_,  but you gave an splot
command using a line _style_.   Bad luck that it somehow ends up choosing a
linetype lt -2 or -3 (background color or no line).

This is supposed to be fixable using the command
        set style increment user
(which is a truly horrible name for a command;  kudos to anyone who
can suggest a better one so that we can deprecate this).  This command
causes the user-defined line _styles_ to be substituted everywhere a line
_type_ would normally be used.  

So much for the script buglet.  Unfortunately, the hidden3d code in
4.2.2 fails to notice when you set this flag, although the CVS version
gets it right.  The fixed code will be in 4.2.3, which should be out
"real soon now".

        Ethan


>
> Thanks in advance,
> Kai
>
> --script starts here ---
>
> set terminal wxt enhanced;
>
> reset;
> set autoscale fix;
> set origin 0, 0;
> set size 1, 1;
> set size noratio;
> set grid xtics;
> set grid ytics;
> set grid ztics;
> set grid nomxtics;
> set grid nomytics;
> set grid nomztics;
> set grid layerdefault;
> set format x "%g";
> set xtics border textcolor rgb "#000000";
> set format y "%g";
> set ytics border textcolor rgb "#000000";
> set format z "%g";
> set ztics border textcolor rgb "#000000";
> set parametric;
> set style data lines;
> set surface;
> #set style line 1 default;
> set style line 1 linewidth 0.500000 pointsize 1.000000 linecolor rgbcolor "#FF00FF";
> set hidden3d;
> set xrange [1.0:3.0] noreverse;
> set yrange [1.0:3.0] noreverse;
> set zrange [0.0:1.0] noreverse;
> set border 895;
> unset key;
> set style data lines;
> set ticslevel 0;
> set view 60, 322.5;
> splot "-" using ($1):($2):($3):($4) title "" with lines linestyle 1 ;
> 1 1 1 1
> 1 2 0 0
> 1 3 0 0
>
> 2 1 0 0
> 2 2 1 1
> 2 3 0 0
>
> 3 1 0 0
> 3 2 0 0
> 3 3 1 1
>
> e
>
>
> --- script end ---

--
Ethan A Merritt

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: linetype vs linestyle mess

by Ralf Juengling :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Fri, 7 Mar 2008, Ethan Merritt wrote:

> A bit of both. The issue is that the colors for hidden-surfaces are
> auto-generated based on the line _type_,  but you gave an splot
> command using a line _style_.   Bad luck that it somehow ends up choosing a
> linetype lt -2 or -3 (background color or no line).
>
> This is supposed to be fixable using the command
> set style increment user
> (which is a truly horrible name for a command;  kudos to anyone who
> can suggest a better one so that we can deprecate this).  This command


I think a clean solution would be to phase out the
use of linetypes in plot commands altogether.
Instead, the plot command would cycle through line
styles. There would be a set of pre-defined default
line styles, the definitions you get now with

    set style line <n> default

for n=1..1000, or something like that.
For backwards compatibility 'lt x' in a plot command
would be interpreted as 'ls x'. There is no need for

    set style increment user

it can be declared deprecated (for backwards
compatibility it would be a command without effect).
Linetypes would be used in defining line styles only,

    set style line 1 lt 5 lw 2 lc rgb "green"

Ralf


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: linetype vs linestyle mess

by Ethan Merritt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Friday 07 March 2008 17:55, Ralf Juengling wrote:
>
> I think a clean solution would be to phase out the
> use of linetypes in plot commands altogether.

It's almost at that point now.  I use it that way already.
In the cvs version (but not I think in 4.2) the line style
defaults to the linetype of the same number, so mostly it
"just works". The are 2 tricky points:

1) As you noted, the line styles themselves are defined in terms
   of linetype.  So we have a bit of a circularity problem :-)

2) color assignments for contours don't work. It's the same
   problem as with the hidden surface colors, but much worse.

There may be a few other corner cases. Mostly it would just
need a lot of testing.  After settling the 2 issues above we
could switch it over in CVS and let people gradually flush
out any problems.


> Instead, the plot command would cycle through line
> styles. There would be a set of pre-defined default
> line styles, the definitions you get now with
>
>     set style line <n> default
>
> for n=1..1000, or something like that.
> For backwards compatibility 'lt x' in a plot command
> would be interpreted as 'ls x'. There is no need for
>
>     set style increment user
>
> it can be declared deprecated (for backwards
> compatibility it would be a command without effect).
> Linetypes would be used in defining line styles only,
>
>     set style line 1 lt 5 lw 2 lc rgb "green"
>
> Ralf
>
>

--
Ethan A Merritt            Courier Deliveries: 1959 NE Pacific
Dept of Biochemistry
Health Sciences Building
University of Washington - Seattle WA 98195-7742

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: linetype vs linestyle mess

by Ralf Juengling :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Fri, 7 Mar 2008, Ethan Merritt wrote:

> It's almost at that point now.  I use it that way already.
> In the cvs version (but not I think in 4.2) the line style
> defaults to the linetype of the same number, so mostly it
> "just works". The are 2 tricky points:
>
> 1) As you noted, the line styles themselves are defined in terms
>   of linetype.  So we have a bit of a circularity problem :-)

Where do you see a circularity? In the scheme I sketched
"linetype" refers to the line pattern, which is orthogonal
to all other aspects of line appearance. A command like

   set style line 1 linetype 3

would mean you change the line pattern of line style 1
to 3 but don't change any other property of line style 1.

Ralf




>
> 2) color assignments for contours don't work. It's the same
>   problem as with the hidden surface colors, but much worse.
>
> There may be a few other corner cases. Mostly it would just
> need a lot of testing.  After settling the 2 issues above we
> could switch it over in CVS and let people gradually flush
> out any problems.
>
>
>> Instead, the plot command would cycle through line
>> styles. There would be a set of pre-defined default
>> line styles, the definitions you get now with
>>
>>     set style line <n> default
>>
>> for n=1..1000, or something like that.
>> For backwards compatibility 'lt x' in a plot command
>> would be interpreted as 'ls x'. There is no need for
>>     set style increment user
>>
>> it can be declared deprecated (for backwards
>> compatibility it would be a command without effect).
>> Linetypes would be used in defining line styles only,
>>
>>     set style line 1 lt 5 lw 2 lc rgb "green"
>>
>> Ralf
>>
>>
>
> --
> Ethan A Merritt            Courier Deliveries: 1959 NE Pacific
> Dept of Biochemistry
> Health Sciences Building
> University of Washington - Seattle WA 98195-7742
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

Re: Problem with mesh plots and hidden line removal

by kahacjde :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ethan Merritt schrieb:

> On Friday 07 March 2008 03:38, Kai Habel wrote:
>  
>> Hello,
>>
>> I noticed the following problem in octave3.0.0/gnuplot4.2.2 using the wxt terminal.
>> When I try to plot a 3D mesh with "hidden on" and a rgb color set, only the white
>> facets without grid are drawn.  
>>
>> if I use
>>    'set style line 1 default;'
>> instead of
>>    'set style line 1 linewidth 0.500000 pointsize 1.000000 linecolor rgbcolor "#FF00FF";'
>> and 'set hidden' it works as expected - a grid, with hidden line removal and the
>> default (green) color is drawn.
>>
>> Is this a bug in the script or a gnuplot problem?
>>    
>
> A bit of both. The issue is that the colors for hidden-surfaces are
> auto-generated based on the line _type_,  but you gave an splot
> command using a line _style_.   Bad luck that it somehow ends up choosing a
> linetype lt -2 or -3 (background color or no line).
>
> This is supposed to be fixable using the command
> set style increment user
> (which is a truly horrible name for a command;  kudos to anyone who
> can suggest a better one so that we can deprecate this).  This command
> causes the user-defined line _styles_ to be substituted everywhere a line
> _type_ would normally be used.  
>
> So much for the script buglet.  Unfortunately, the hidden3d code in
> 4.2.2 fails to notice when you set this flag, although the CVS version
> gets it right.  The fixed code will be in 4.2.3, which should be out
> "real soon now".
>
> Ethan
>
>  
Hello Ethan,

thanks for your quick reply. After including the sequence "set style
increment user" and using 4.2.3 I was able to plot the uniform colored
mesh with hidden3d.

Kai

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@...
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta