Face to vertex data interpolation for patch interpolated colors

1 visualizzazione (ultimi 30 giorni)
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.

Risposte (0)

Prodotti


Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by