# Visualize Surface curvature using Color Attributes

In design models, there is often a minimum radius of curvature. For example an alloy wheel can usually not have shapes sharper than R 3mm, or the wheel will break. In the modelling workflow, it would be very useful to have a "tool" to visualize curvature of meshes.

I have tried to use the Color attributes to store Princ Max C and Princ Min C. Each of these can the be used in a material to visualize Min/Max C as well as Gaussian and Mean C. But the values must be normalized to fit the Color attribute channels, therefore a normalization scaling factor has to be stored as well: Min C => R Max C => G Scaling => B

My coding skills are just not good enough to get this working, any help would be appreciated.

• for instance blender.stackexchange.com/questions/146819/… or blender.stackexchange.com/questions/201804/… but these examples are more for visualisation than structure calculation so you'll need to adapt it for your needs Apr 23, 2023 at 17:40
• You can store it as a float attribute instead of cramming it into a color attribute. So you don't need a scaling factor or anything. Apr 23, 2023 at 17:47
• @lemon Thanks for the advice. Those threads are a bit of the inspiration for this attempt. It seem as if those curvature algorithms were not as "numerical" as I need it to be. Apr 25, 2023 at 17:08
• @scurest Yes that works of course. But the idea I had was to use the float color value in a shader to get a hue-clockwise ramp from the color attribute. Princ R of C; max and min would be the only calc required to drive a shader of min, max, mean and gauss curvature. The shader would also be able to shade R threshold like all areas of R < 3 mm. But It seems too hard. Apr 25, 2023 at 17:17
• @LarsS, sure. I'm not a specialist at all. The difficulty (to me) is to go over the immediate edges (from a vertex) to check around up to what the radius could be calculated. But that's interesting. Could you add more calculation indication in your question, so that we could just report it in the shader? (maybe) Apr 25, 2023 at 17:18