Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7907651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:33:22+00:00 2026-06-03T11:33:22+00:00

I have a question relating to plotting a cylindrical surface in Matlab. My dataset

  • 0

I have a question relating to plotting a cylindrical surface in Matlab. My dataset consists of a point cloud of X, Y, Z coordinates with corresponding intensity values C.

I can plot them using the scatter3 function:

figure
scatter3(X,Y,Z,8,C)

results in the following image:

However, I would like to plot the surface of this object rather than the points. I have tried to achieve this using Delaunay triangulation

tri     = delaunay(X,Y);
figure
trisurf(tri,X,Y,Z,C,'FaceColor','interp')

Link to screenshots

As you can see from the image the result is not what I would like as there are difficulties with the triangulation. To me it seems as if the algorithm does not cope well with the fact that I get the same X and Y coordinates multiple times.

Following the examples introduced on the TriRep help page I have tried to use the following approach:

dt = DelaunayTri(X,Y,Z);
tr = TriRep(dt, X, Y, Z);

alas without success as I get the following error message when calling the TriRep function:

??? Error using ==> TriRep
Parameter must be ‘double matrix’.

I guess I have to constrain my geometry and I thought I found the solution in Example 1 here by using the freeBoundary function – though I do need the output of the TriRep function in order to calculate this. That’s where I am stuck. As you can see I am no expert in triangulation methods and I would really appreciate any help you could offer. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T11:33:27+00:00Added an answer on June 3, 2026 at 11:33 am

    I think what you want is not a simple triangulation, but rather the convex hull of your set of points.

    The classic analogy for a convex hull in 2d –
    If you imagine your set of points to be nails on a board, then the convex hull is the polygon that would be formed by stretching a rubber band around your points – that is, it touches the external points but not the internal ones.

    And extending this, you can think of the 3d convex hull as being a “skin” of the outside points in your point cloud.

    The convex hull is the starting point for more complicated Computational Geometry techniques, but in your case will give you the mesh you are looking for.

    I haven’t used Matlab’s version, but it looks pretty straightforward:
    http://www.mathworks.com/help/techdoc/ref/convhulln.html

    Edit: After seeing your comments below:
    If you are already using a TriRep structure, you can use it to get the face normals, then delete any triangles whose face has a normal close to straight up/down. EG, if you start with the example from Matlab’s FaceNormals doc page http://www.mathworks.com/help/techdoc/ref/trirep.facenormals.html :

    numpts = 100;
    thetha = rand(numpts,1)*2*pi;
    phi = rand(numpts,1)*pi;
    x = cos(thetha).*sin(phi);
    y = sin(thetha).*sin(phi);
    z = cos(phi);
    dt = DelaunayTri(x,y,z);
    [tri Xb] = freeBoundary(dt);
    tr = TriRep(tri, Xb);
    P = incenters(tr);
    fn = faceNormals(tr);
    trisurf(tri,Xb(:,1),Xb(:,2),Xb(:,3), 'FaceColor', 'cyan', 'faceAlpha', 0.8);
    

    Then you can simply run through the normals, and remove any faces with a high z magnitude:

    for(i=196:-1:1)
        if(abs(fn(i,3))>0.8)
            tri(i)=[];
        end
    end
    trisurf(tri,Xb(:,1),Xb(:,2),Xb(:,3),'FaceColor','red','faceAlpha',0.7);
    

    HTH — RC

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this question relating to Lucene. I have a form and I get
I have a question relating to alignment in C/C++. In Determining the alignment of
I have a design/best practice question relating to MVC3. I have a front page
I am hoping someone can help me with a question i have relating to
This is a follow on from my last question relating to plotting timestamps in
I have a question relating programming and english language both: Whether to use third
I have a question relating to the timer function. I have managed to find
I have a question relating to the usage of this. Suppose I have two
I have a question relating to properties for a specific instance of a CI
Ok, I have a question relating to an issue I've previously had. I know

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.