Custom colormap based on data values and not coordinates

5 次查看(过去 30 天)
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