octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

improved __contourc__.cc + filled contours


From: John W. Eaton
Subject: improved __contourc__.cc + filled contours
Date: Fri, 19 Oct 2007 16:39:38 -0400

On 11-Oct-2007, Kai Habel wrote:

| since octave has support for patch objects since some time now, I have 
| ported contourf.m (filled contours) from octplot to octave itself.
| 
| As a first step a modification for __contourc__.cc is required. For some 
| inputs contourc.m (__contourc__.cc) "loses" the contour, that means e.g. 
| a closed contour consists of two or more segments. For the contour.m
| function this is no problem, but if you draw patches with this input you
| get disordered patches.
| 
| See the following examples:
| 
| ##this test fails (two contour segements)
| test1 = [0 0 1;0 1 1;0 0 0]
| contourc(test1,[0.5 0.5])
| input('press enter');
| 
| ##this test fails (two contour segements)
| test2 = [0 0 0 0 0;0 1 1 1 0;0 1 0.5 0 0;0 1 1 1 0;0 0 0 0 0]
| contourc(test2,[0.5 0.5])
| input('press enter');
| 
| ##this test does not fail (only one contour segements)
| contourc(test2,[0.6 0.6])
| input('press enter');
| 
| ##this test fails (two contour segements)
| test3 = [0 0 0 0 0;0 0 1 1 0;0 1 0 1 0;0 1 1 1 0;0 0 0 0 0]
| contourc(test3,[0.5 0.5])
| input('press enter');
| 
| If you look at the matrices test[1-3] you would expect that a single (or 
| two) closed contour should be returned from contourc. But as you can 
| see, this is not the case. Therefore I propose the following heavily 
| rewritten __contourc__.cc. (I hope it is o.k. to send the new file only, 
| since a patch would be larger)
| 
| The new contourf function works only with this modified __contourc__.cc.
| I would like to ask you to test both __contour__.cc and contourf.m. I 
| did a lot of tests, but maybe your input matrix causes one of the 
| functions to fail. In addtion I have attached small test script, which 
| shows some problems with the contour function (to be tackled later)
| 
| Since these functions need some review and we are close to a 3.0 release 
| (I think) we should target a later inclusion.

The consensus seems to be to include them since if there are bugs they
will at least be isolated to these functions, so I checked them in.

I made modifications for coding style, so if you have additional
change, please submit context diffs relative to the current versions
in CVS.

Thanks,

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]