Surface normals at wire intersections
-
- Posts: 1
- Joined: Thu Nov 14, 2024 10:54 pm
Surface normals at wire intersections
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.
-
- Posts: 1
- Joined: Mon Nov 18, 2024 3:29 am
Re: Surface normals at wire intersections
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
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