I have a 3D mesh made of vertices and triangles. I know the position and smoothed normal of the vertices, and the flat normals of the triangles. I would like to calculate the curve segment passing through 2 given vertices, using only their positions and normals.
Right now, I'm using a Catmull Rom spline, but it needs 4 points to draw 1 curve segment, as shown in this picture of a sliced view of a simple mesh :
To draw the yellow curved segment between B and C, corresponding to the estimated curvature of the red edge, I have to use the positions of vertices A,B,C and D The other cyan segments are drawn using the same method.
I would like to compute each curved segment only using the data in the segment's vertices. Here it would be only using the positions and normals of B and C as input data to compute the yellow curved segment... And still keep an homogeneous overall shape when computing the curves of all segments
I'm not sure this curve is the right one to represent the simulated curvature shown by the smoothed normals of the mesh while rendering it with a simple 3D diffuse shading, therefore I would like to know which other type of curve could be a better match in this precise case. And maybe one more adapted to the constrain of using as input only the positions and normals of the two points.
Thanks ! :)
EDIT :
The result using a Hermite spline as suggested by Fang :
This is perfect for me. Thanks again :)
If you simply want to interpolate between two end points and two end normal vectors, you can use cubic Hermite curve. Cubic Hermite curve is defined by two end points and two end first derivatives. Since you don't have first derivatives at the vertices, you can infer them from the vertex normal
Given vertex B and C and vertex normal Nb and Nc,
If vector(BC) is already perpendicular to normal Nb and Nc, the cubic Hermite curve will become a straight line.
The cubic Hermite curve constructed in this way only utilizes the data within segment between vertex B and C. Therefore, it is likely that it will not be joined smoothly to its adjacent curve segments. If you would like to avoid this issue, then you will have to utilize data from adjacent segments. Instead of projecting vector S = 1/3*(C-B), project vectors Sb and Sc onto planes at vertex B and C respectively where
Sb = m*(A + C - 2*B)/2,
Sc = m*(B + D - 2*C)/2.
and m is a constant (typically < 1.0) to adjust for the first derivative's magnitude.
This way, the first derivative will be the same at vertex B for segment BC and for segment AB, which will ensure that the curve segment BC and curve segment AB will be joined smoothly.