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

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

[Octave-bug-tracker] [bug #65421] patch fails to render if cdata is spec


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #65421] patch fails to render if cdata is specified before geometry
Date: Wed, 6 Mar 2024 17:39:46 -0500 (EST)

Follow-up Comment #3, bug #65421 (group octave):

regarding the different forms of D (it would help if you could indicate where
you got the forms from that you tried, as some you said you can't tell what
they should do): whether it's supplied to CData, or FaceVertexCData the
interpretation is slightly different. In particular, color ordering  for
vertices might be different because CData supposedly goes off the x/y/zdata
properties while FaceVertexCData uses the supplied Vertex property data. Also,
there seems to be insufficient input form checking on those properties, and
some strange results occur:

Using Colormap indices:

ONE COLOR: 
D = 20
both CData and FaceVertexCData - color all faces the 20th color in the current
colormap


ONE COLOR PER FACE: 
D = [10 20 30 40]'  # numel(D) = N = number of faces
Both CData and FaceVertexCData:  color Nth face the Nth index # specified in
the vector

D = [10 20 30 40]  # numel(D) = N = number of faces
CData:  color Nth face the Nth index # specified in the vector
FaceVertexCData:  error - invalid value for property


ONE COLOR PER VERTEX: 
D = [10 20 30 40 50 60]'  # numel(D) = M = number of Vertices
Both CData and FaceVertexCData:  color Nth face the Nth index # specified in
the vector

D = [10 20 30 40 50 60]  # numel(D) = M = number of vertices
CData:  color Nth face the Nth index # specified in the vector
FaceVertexCData:  error - invalid value for property


ONE COLOR PER VERTEX, DIFFERENT ON EACH FACE:
D=round(64*rand(size(P,1), size(T,1))) # N x M matrix
CData: specifies one color per vertex per face. if you do facecolor = interp,
you'll see that faces sharing vertices can have diff colors on either side of
the shared edge.
FaceVertexCData: error. invalid value for array property

D=round(64*rand(size(T,1), size(P,1))) # M x N matrix
CData: specifies one color per vertex per face like above. different
color/vertex ordering. Not sure how Octave maps it since the matlab docs say
should be NxM.
FaceVertexCData: error. invalid value for array property


Using RGB color specs:

ONE COLOR:
D = [0.1 0.5 0.7]
CData: odd color results. supposedly expects dim 3 vector. facevertexcdata
stored as column vector.
FaceVertexCData:  single rgb value applied to all faces (checking CData, it
contains the same values changed to a dim3 vector)

D = [0.1 0.5 0.7]'
CData: odd color results. supposedly expects dim 3 vector. facevertexcdata
stored as column vector.
FaceVertexCdata: odd color results. Cdata contains a seemingly random 3x4
numeric array. 

D = cat(3,0.1 ,0.5, 0.7)
CData: single rgb value applied to all faces. (facevertexdata, same values
stored as a row vector)
FaceVertexCData: error. invalid value for array property.


ONE COLOR PER FACE:
D = [0 0.1 0.2; 0.3 0.4 0.5; 0.6 0.7 0.8; 0.9 1.0 0.0] #(Nx3 matrix)
CData: odd color results. Cdata stored as 4x3, FaceVertexCData stored as D(:)
(12x1)
FaceVertexCData: One color per face. Cdata stored as 1x4x3 array.

D = D'  #(3xN matrix)
CData: odd color results. Cdata stored as 3x4, FaceVertexCData stored as D(:)
(12x1)
FaceVertexCData: Error - invalid value for property.

D = permute([0 0.1 0.2; 0.3 0.4 0.5; 0.6 0.7 0.8; 0.9 1.0 0.0], [1 3 2])  #
Nx1x3 array
CData: one color per face.  FaceVertexCData stored as 4x3.
FaceVertexCData:  Error - invalid value for property.


ONE COLOR PER VERTEX:
D = [0 0.1 0.2; 0.3 0.4 0.5; 0.6 0.7 0.8; 0.9 1.0 0.0; 0.1 0.2 0.3; 0.4 0.5
0.6] # M x 3 matrix
CData:  odd color values. Cdata is 6x3. FaceVertexCData is 18x1.
FaceVertexCData: one color per vertex. CData stored as 3x4x3

D = D'  #(3xM matrix)
CData: odd color results. Cdata stored as 3x6, FaceVertexCData stored as D(:)
(18x1)
FaceVertexCData: Error - invalid value for property.


D = rand(3x4x3) # dim1&2 size to match x/y/zdata, RGB in dim3
CData: one color per vertex per face. (color can jump across edges).
FaceVertexCData stored as 12x3.
FaceVertexCData: Error - invalid value for property.


I think those are all of the likely options to be tried for D. 
some of the behavior needs to be checked for compatibility, then maybe some
more refined bug reports generated for input validation, especially with
cdata. Also, see bug #63523 where some input validation checks were noticed to
be lacking. 


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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