octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #65431] crash after hgload certain data


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #65431] crash after hgload certain data
Date: Sat, 9 Mar 2024 16:27:54 -0500 (EST)

Follow-up Comment #58, bug #65431 (group octave):

I stand somewhat corrected:  

if you instead create the patch with x/y/cdatahp.


x = [0 0;0 1;1 1];
y = [0 1;1 0;0 1];
 cdata = reshape (1:6, 3, 2);
hp = patch ("XData",x,"YData",y, "cdata", cdata, "FaceColor", "interp")


things plot fine, the properties become:


>> hp.Faces

ans =

     1     2     3
     4     5     6

>> hp.Vertices

ans =

     0     0
     0     1
     1     0
     0     1
     1     0
     1     1

(so it does expand the vertices here too)

the color data becomes:

>> hp.CData

ans =

     1     4
     2     5
     3     6

>> hp.FaceVertexCData

ans =

     1
     2
     3
     4
     5
     6


if you create CData with one color per face instead, it yells and fails to
render because it seems when FaceColor=Interp it requires number of colors to
match number of vertices.


Warning: Error creating or updating Patch
 Error in value of property FaceVertexCData
 Number of colors must equal number of vertices.


if you set facecolor = flat, and create a patch with 1 color per face it also
expands vertices, but it stores colors as column vectors, which seems wierd.


>> hp = patch ("XData",x,"YData",y, "cdata", [10 20], "FaceColor",
"flat");get(hp)

>> hp.Vertices

ans =

     0     0
     0     1
     1     0
     0     1
     1     0
     1     1

>> hp.Faces

ans =

     1     2     3
     4     5     6

>> hp.CData

ans =

    10
    20

>> hp.FaceVertexCData

ans =

    10
    20


If you call it with xydata and FaceVertexCData, it also extends Vertices.

If i call back and call it with Face/vertex and CData for each face, it does
NOT extend vertices.

trying to set cdata back to 3x2 afterward gives warnings:

>> set(hp, 'CData', cdata)
Warning: Error creating or updating Patch
 Error in value of property FaceVertexCData
 Number of colors must equal number of vertices. 
Warning: Error creating or updating Patch
 Error in value of property FaceVertexCData
 Number of colors must equal number of vertices or faces. 


but Vertices hasn't been changed.
 

I'm sure i'm missing some combination there.

SO, it seems the decision to extend vertices is based on whether or not the
patch is created with xyzdata.  if so, vertices is extended to have the same
number of points.




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65431>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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