I need to find projection of a point to a face IBRepFace_DG. I know how to project a point on a IUVSurface_DG, but it is not aware of the edges. Is there another way?
Thanks
Point projection on a face
-
- Posts: 121
- Joined: Mon Apr 04, 2016 4:55 am
Re: Point projection on a face
Hello Tuto
Thanks for the good question. We have added it to the todo list for 6.2.
Right now you can use IUVSurface_DG.GetNearestPoints(). It will return the parameters. Use it to check if it is inside the 2D uv rectangle returned by IBRepFace_DG.GetParameterRange(). If it is not, depending on what do you need, you can either reject the point or get distance to all edges and take the nearest one. The nearest point would be be the (generalized) projection.
Distance to an edge can be found in the same manner: Get distance to the curve and check if it is inside the range and get distance to vertices, if not.
Regards
Thanks for the good question. We have added it to the todo list for 6.2.
Right now you can use IUVSurface_DG.GetNearestPoints(). It will return the parameters. Use it to check if it is inside the 2D uv rectangle returned by IBRepFace_DG.GetParameterRange(). If it is not, depending on what do you need, you can either reject the point or get distance to all edges and take the nearest one. The nearest point would be be the (generalized) projection.
Distance to an edge can be found in the same manner: Get distance to the curve and check if it is inside the range and get distance to vertices, if not.
Regards
-
- Posts: 2
- Joined: Thu Oct 22, 2020 4:09 am
Re: Point projection on a face
Thank you.
I will check it out
I will check it out