# Best way to find variations in surface contours (slope)

If one considers a smooth ofmesh sphere, I would like to find any variations in the surface which are valleys or peaks. In grasshopper this is referred to as ‘slope’ or ‘elevation’ analysis, but is usually performed on relatively flat surfaces.

I am curious if there is an easy way to do this for a mesh in openframeworks or if I will have to analyze the surrounding face normals to find discrepancies that indicate steeper peaks and valleys, perhaps an average of surrounding ones, and then any variances.

I am doing this with a mesh generated from a Kinect to add detail to facial variations, but this is the easiest way I could think of to describe it. Since this mesh is not always from the front, but can be from the side, generating a profile, I was not going to use facial recognition for this.

I currently have a method that checks the angle of a face normal to a point that can move, and adding detail or complexity to those areas within range (detail, color, it doesn’t really matter)

Unfortunately, I am not quite getting the information I want. Instead of eye sockets having alterations or detail, I am getting (for instance) the forehead, cheekbones and perhaps regions of the shoulders (depending on the distance of the point being referenced, since areas will be larger if it is farther away)

Are there any libraries for analyzing the surface of a mesh as normal variations?

Quick idea:

Conver vertices to spherical coords refering to the center of the sphere. That will give you a radius value for each point. You can then compute the differece of radius with the neighbouring radiuses (some kind of graphical model). Use simple differential (node - neighbour) calculations to find minima and maxima.

If you need me to expand on the idea tell me!

If you are modelling a head then maybe cylindical coordinates may suit better!