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

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

[Octave-bug-tracker] [bug #48109] Trisurf fails to colour triangles corr


From: Rik
Subject: [Octave-bug-tracker] [bug #48109] Trisurf fails to colour triangles correctly.
Date: Mon, 20 Nov 2017 14:31:06 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #8, bug #48109 (project octave):

>> 1) the function is creating triangles and coloring them. The most
straightforward form should then provide one color per triangle in arguments.
What should be the expected behavior when giving one color per vertex ? I
guess coloring each triangle with the color of the first vertex defining it
makes sense (and seems to be the implemented behavior), but this should appear
in the documentation.

Matlab, and hence Octave, implements trisurf through the patch function.  The
coloring of patches is very complicated.  See
https://www.mathworks.com/help/matlab/creating_plots/how-patch-data-relates-to-a-colormap.html.
 From this documentation you can see that either one color per face, or one
color per vertex are acceptable.  The test results from Matlab show that it is
using one color per vertex though, so Octave should do the same.  In
particular, the default "FaceColor" property is set "flat" which means the
color of face is determined by the first vertex.  However, if the "FaceColor"
property is set to "interp" then the color varies smoothly across the face of
the polygon as it moves from the color at vertex1 to the color at vertex2 and
vertex3.  In this case, it is quite important to be able to specify the colors
of all vertices, not just one color per face.

>> 2) I agree that "extending the input validation to accept either scenario
is not hard", but it has currently not been done (Octave 4.2.1 in Linux) and
this is what caused this thread in the first place. 

It hasn't been done, because no one confirmed the correct behavior with Matlab
until 1 day ago.

>> Is any developer planning to do it? I'd be glad to do it myself but I do
not know yet where I should start to contribute, and if it is even worth for
such small changes.

It is always very helpful, and very useful, if an initial patch is supplied
for a bug report.  Polishing of a patch by developers is easier than writing a
patch from scratch.  And it is very likely that a 4.2.2 bug fix release will
be put out at the end/start of the year so there is still time to get any fix
posted here into that release.

For some general guidelines see
http://wiki.octave.org/Contribution_guidelines.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?48109>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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