Face to vertex data interpolation for patch interpolated colors

1 回表示 (過去 30 日間)
Arjan Lampe
Arjan Lampe 2021 年 6 月 23 日
I make a patch like so:
>> patch('verticex',xyz,'faces',conn,'faceVertexCData',c,'faceColor','flat')
In this the following is true:
>> size(xyz) == [nvertices, 3]
>> size(conn) == [nfaces, 4] % so these are quads
>> size(c,1) == nfaces
>> size(c,2) == 1;
Or in other words, I have one datavalue for the color per face and I let 'patch' figure out the color needed for each face using some colormap. This all works fine, however I want an interpolated shading (instead of flat) for the faces (and edges). It seems that I need one datavalue for the color per vertex for that, instead of one per face. Or, in other words, this must be true:
>> size(c,1) == nvertices
So the question is: is there an easy way to interpolate face data to vertex data? Of course I can think of complicated ways by first determining the center of each face, and then do a griddedinterpolant, or use a plethora of other ways. But I wondered if there is a more readymade solution for this.

回答 (0 件)

カテゴリ

Help Center および File ExchangePolygons についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by