Custom colormap based on data values and not coordinates

조회 수: 6 (최근 30일)
Harold
Harold 2013년 1월 19일
I'm having a very hard time creating a colormap for the pressure distribution over a surface. My program takes in vertices and normals from an STL file and creates the model using fill3(). With the normals known, I can calculate the pressure on each facet(triangle) of interest of the model. The facets of interest are shown in red in the figure below. What I want to be able to do is plot the model and fill the facets with the appropriate colormap color that corresponds to the pressure value of said facet. Plotting function that I have seen plot the color using values from Z(height). Also when I try to use any other plotting function other than fill3(), vertices that are not supposed to be connected get connected. Is there some way I can generate my own custom colormap by providing a color for the min and max pressure and have the program interpolate the colors in between by supplying the function with the pressure values. It should also be noted that some pressure values appear more than once due to symmetry of the model. I guess the concern I am having is that I want all the pressure values to be associated with a color that I can use in the color parameter of fill3().
  댓글 수: 2
Harold
Harold 2013년 1월 19일
Thanks Walter. I meant to include that link in my post. It seems like I keep having these problems. Funny thing is that I already have coded the majority of the program but decided to switch from 2D to 3D models.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Colormaps에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by