bugGNU Octave - Bugs: bug #42159, Inconsistent patch vertices/faces...

 
 

bug #42159: Inconsistent patch vertices/faces should lead to a warning

Submitter:  Pantxo Diribarne <pantxo>
Submitted:  Mon 21 Apr 2014 06:22:36 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 07 Jul 2014 05:36:42 PM UTC, comment #3: 

I pushed the changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/df972b9d080a), after having verified all demos using patch objects returned the same images. Closing report.

Pantxo Diribarne <pantxo>
Group Member
Sat 21 Jun 2014 11:33:52 AM UTC, comment #2: 

I attached an updated patch that corrects a bug when calling patch without argument.

(file #31586)

Pantxo Diribarne <pantxo>
Group Member
Sun 15 Jun 2014 02:56:09 PM UTC, comment #1: 

I attached a patch. It is pretty huge for such a minor bug, but it brings patch graphics objects in line with other primitives (don't rely on .m listeners but rather on C++ updaters).

(file #31555)

Pantxo Diribarne <pantxo>
Group Member
Mon 21 Apr 2014 06:22:36 PM UTC, original submission:  

In octave :


t1 = (1/16:1/8:1)' * 2*pi;
t2 = ((1/16:1/8:1)' + 1/32) * 2*pi;
x1 = sin (t1) - 0.8;
y1 = cos (t1);
x2 = sin (t2) + 0.8;
y2 = cos (t2);
pa = patch ([x1,x2], [y1,y2], 'r');
set (pa, 'vertices', get (0, 'defaultpatchvertices'))

## error: setdata: A(I): index out of bounds; value 16 out of bound 3
## error: called from:
## error:   /home/pantxo/media/dev/octavebuild/../octaveclone/scripts/plot/draw/private/__patch__.m at line 262, column 5
## error: evaluating argument list element number 2
## error:   /home/pantxo/media/dev/octavebuild/../octaveclone/scripts/plot/draw/private/__patch__.m at line 362, column 7
## error:   /home/pantxo/media/dev/octavebuild/../octaveclone/scripts/plot/draw/private/__patch__.m at line 352, column 3


This is due to inconsistent vertices/faces properties. In Matlab it leads to a warning "Warning: Values in patch Faces must be in [1 : rows(Vertices)] - not rendering"

Contrary to all other base graphics objects, patch property updaters are implemented using listeners. This bug has an easy fix, but it would probably be more consistent to rewrite (translate) the listeners in the form of c++ updaters.

Pantxo Diribarne <pantxo>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #31586:  listeners2updtaers_bug42159_v2.patch added by pantxo (17KiB - application/x-download)
file #31555:  listeners2updtaers_bug42159.patch added by pantxo (17KiB - application/x-download)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bpabbott (Updated the item)
  • -email is unavailable- added by pantxo (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-07-07 pantxo StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2014-06-21 bpabbott StatusNone Patch Submitted
    2014-06-21 pantxo Attached File- Added listeners2updtaers_bug42159_v2.patch, #31586
    2014-06-15 pantxo Attached File- Added listeners2updtaers_bug42159.patch, #31555

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code