compas-dev / compas_view2

Standalone viewer for COMPAS
https://compas.dev/compas_view2/
MIT License
7 stars 9 forks source link

Gradient colour to elements / meshes #134

Open ricardoavelino opened 2 years ago

ricardoavelino commented 2 years ago

Feature Request

It would be a great adition to be able to add "gradient colour" to elements or meshes.

This could be done, for example, by assigning colours to the vertices of a mesh (or mesh face), instead of assigning only one colour to it. Then the Viewer should interpolate the colour of that face (or mesh itself) based on an interpolation of the colour values assigned to the vertices.

Details

This could be very useful, for example to express the stresses in a cross section. @GeneKao perhaps can also give some insight since he implemented his own colour interpolation for compas_cra. (See his nice paper)

GeneKao commented 2 years ago

@ricardoavelino I hacked this in the old viewer, which is quite different from the current version. Maybe @Licini can find a better way to implement this? maybe from the user level can give a parameter called face_vertice_color? and the viewer needs to be safeguarded to make sure that the user provides the length of a list colour needs to match with vertice number. For example, for a polygon with 5 points, the user needs to provide 5 colours, and the middle point (make triangles for the polygon) needs to be interpreted.

franaudo commented 2 years ago

@Licini is there any update on this? It can be very useful for FEA2. Thanks!!