Normals to the surface at intersection vertex

I need to obtain normals at the intersection vertices between my voxel discretization and surface. What is the easiest way to obtain such normals, and intersection points.

Benjamin Bihler's picture

For intersection points between curves and surfaces you might want to check GeomAPI_ExtremaCurveSurface.

A surface normal at a certain point can be obtained like this: project the point onto the surface to get its u and v parameter. For this you could use ShapeAnalysis_Surface::ValueOfUV. Then compute the first derivatives of the surface to have vectors spanning the tangent space. This can be done with Geom_Surface::D1. If you compute the cross product of both vectors, you have the normal vector.

Benjamin

Stefan Gavranovic's picture

Hi Benjamin,
Thank you for your answer, I understood the second part, but could you elaborate a bit on first part. I have voxelised surface, and then I need to find the intersection points for every voxel.

Stefan

Benjamin Bihler's picture

I am sorry, my proposal only works if you have a Geom_Surface or something similar.

Benjamin

Stefan Gavranovic's picture

Anyway thanks for the effort