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: anonymous
Subject: [Octave-bug-tracker] [bug #48109] Trisurf fails to colour triangles correctly.
Date: Fri, 3 Jun 2016 09:03:05 +0000 (UTC)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36

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

                 Summary: Trisurf fails to colour triangles correctly. 
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Fri 03 Jun 2016 09:03:02 AM UTC
                Category: Plotting
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: Tim D
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.0.0
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

Hi all,

I am running the trisurf function. 

I am calling it like so:

trisurf(Triangles,Points(:,2),Points(:,3),Points(:,4),SSDisp);

'Triangles' is a 3xn vector of the triangluation
This points to rows in the 'Points' which is a vector where each row defines
the corner points of each triangle. 
'SSDisp' is a value at the centre of each triangle I have calculated. 
If I try and run this in the current octave version (4.0) this gives an error
'error: trisurf: C must have 'numel (Z)' elements'

This is not in the octave documentation or explicitly in the MATLAB online
docs either but MATLAB actually allows users to colour triangles in trisurf
with a colour matrix that is the size of the number of triangles, This means
the user does not need the colour vector to be the same size as the 'z'
values. Picture attached

Currently the Trisurf code looks like this:


    handle = patch ("Faces", tri, "Vertices", [x(:), y(:), z(:)],
                    "FaceVertexCData", reshape (c, numel (c), 1),
                    varargin{:});


It will colour the triangles without an error if changed to:


    handle = patch ("Faces", tri, "Vertices", [x(:), y(:), z(:)],
                    "FaceVertexCData", c(:),
                    varargin{:});
    if (nargout > 0)


I.e this is not reshaping c (the colour vector) but just saying its a column
vector.

The function works fine for me if I change this to the code I have added
above. I have attached a picture of this working.

(Ps I am English so spell colour differently to Americans) 

Cheers,

Tim



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Fri 03 Jun 2016 09:03:02 AM UTC  Name: SSDisp.PNG  Size: 95kB   By: None
Coloured correctly with the new code
<http://savannah.gnu.org/bugs/download.php?file_id=37369>

    _______________________________________________________

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]