[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: |
Markus Mützel |
Subject: |
[Octave-bug-tracker] [bug #65421] patch fails to render if cdata is specified before geometry in property/value calling form |
Date: |
Fri, 15 Mar 2024 12:12:21 -0400 (EDT) |
Follow-up Comment #36, bug #65421 (group octave):
A reproducer with only `set` function calls:
vertices = [2.5, 7.5; 6.5, 7.0; 2.5, 5.5; 6.5, 6.0; 1.0, 6.5; 8.0, 6.5];
faces = [5, 3, 1; 1, 4, 2; 1, 3, 4; 4, 6, 2];
vert_color = (1:6).'; # index to colormap
cdata = vert_color(faces).';
hf = figure ();
clf (hf);
hax = axes (hf);
hp = patch (hax);
## step 1
set (hp, 'vertices', vertices);
v1 = get (hp, 'vertices')
f1 = get (hp, 'faces')
fvc1 = get (hp, 'facevertexcdata')
cd1 = get (hp, 'cdata')
## step 2
# set (hp, 'facevertexcdata', vert_color);
set (hp, 'cdata', cdata);
v2 = get (hp, 'vertices')
f2 = get (hp, 'faces')
fvc2 = get (hp, 'facevertexcdata')
cd2 = get (hp, 'cdata')
## step 3
set (hp, 'faces', faces);
v3 = get (hp, 'vertices')
f3 = get (hp, 'faces')
fvc3 = get (hp, 'facevertexcdata')
cd3 = get (hp, 'cdata')
When setting 'cdata' (which in general might require duplicating vertices)
before setting 'faces', the color data is lost.
If you invert steps 2 and 3 or set 'facevertexcdata' instead of 'cdata', the
color data isn't lost.
To be honest, it is quite unusual that a patch would be created with
'vertices' and 'faces' but the color data would be provided by 'cdata'.
More commonly, the color data comes from the "same sources" where the geometry
comes from. So, it would be more usual to set a combination of either
'vertices', 'faces', and 'facevertexcdata', or 'xdata', 'ydata', ('zdata',)
and 'cdata'.
The entire use-case looks pretty much constructed. So, fixing this has
probably a low priority.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?65421>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #65421] patch fails to render if cdata is specified before geometry, (continued)
- [Octave-bug-tracker] [bug #65421] patch fails to render if cdata is specified before geometry, Liang Tang, 2024/03/12
- [Octave-bug-tracker] [bug #65421] patch fails to render if cdata is specified before geometry in property/value calling form, Nicholas Jankowski, 2024/03/12
- [Octave-bug-tracker] [bug #65421] patch fails to render if cdata is specified before geometry in property/value calling form, Nicholas Jankowski, 2024/03/12
- [Octave-bug-tracker] [bug #65421] patch fails to render if cdata is specified before geometry in property/value calling form, Markus Mützel, 2024/03/14
- [Octave-bug-tracker] [bug #65421] patch fails to render if cdata is specified before geometry in property/value calling form, Nicholas Jankowski, 2024/03/14
- [Octave-bug-tracker] [bug #65421] patch fails to render if cdata is specified before geometry in property/value calling form, Nicholas Jankowski, 2024/03/14
- [Octave-bug-tracker] [bug #65421] patch fails to render if cdata is specified before geometry in property/value calling form, Markus Mützel, 2024/03/15
- [Octave-bug-tracker] [bug #65421] patch fails to render if cdata is specified before geometry in property/value calling form, Nicholas Jankowski, 2024/03/15
- [Octave-bug-tracker] [bug #65421] patch fails to render if cdata is specified before geometry in property/value calling form, Markus Mützel, 2024/03/15
- [Octave-bug-tracker] [bug #65421] patch fails to render if cdata is specified before geometry in property/value calling form, Nicholas Jankowski, 2024/03/15
- [Octave-bug-tracker] [bug #65421] patch fails to render if cdata is specified before geometry in property/value calling form,
Markus Mützel <=
- [Octave-bug-tracker] [bug #65421] patch fails to render if cdata is specified before geometry in property/value calling form, Nicholas Jankowski, 2024/03/15
- [Octave-bug-tracker] [bug #65421] patch fails to render if cdata is specified before geometry in property/value calling form, Markus Mützel, 2024/03/15
- [Octave-bug-tracker] [bug #65421] patch fails to render if cdata is specified before geometry in property/value calling form, Nicholas Jankowski, 2024/03/15
- [Octave-bug-tracker] [bug #65421] patch fails to render if cdata is specified before geometry in property/value calling form, Markus Mützel, 2024/03/18