Page 1 of 1

Surface normals at wire intersections

Posted: Thu Nov 14, 2024 10:57 pm
by Mick Saleh
I need to obtain normals at the intersection vertices between a wireframe box and surface. What is the easiest way to obtain such normals, and intersection points.

Re: Surface normals at wire intersections

Posted: Mon Nov 18, 2024 3:47 am
by Carlos Dsouza
I think you need to do it for each of the twelve edges of the box. The main tool is IUVSurface_DG.GetCurveIntersection(ICurve_DG curve, ...) see it in the documentation.

When you get coordinates of an edge, create a ILine_DG out of it: IObjectGenerator_DG.Create<ILine_DG>(), cast to ILine_DG. Set the location and direction accordingly.

Query ICurve_DG out of the ILine_DG and use the IUVSurface_DG.GetCurveIntersection(). It will return you parameters for both u,v of the surface and the line/curve. IUVSurface_DG.GetPoint(uv) and IUVSurface_DG.GetNormal(uv) will return what you need.

Cheers