Orthogonal projection to a face

Technical discussions
Post Reply
Hugo Dorma
Posts: 2
Joined: Wed Jun 15, 2022 5:12 am

Orthogonal projection to a face

Post by Hugo Dorma »

Hi
I am messing with projecting a point to a face using IUVSurface_DG.GetNearestPoints()

The issue I am having: if face is, say a hemisphere the methods returns two points, so there is an extra work of sorting which point is relevant. I also need to check distance to edge(s) and vertices.

Is there a better automated API for this?

Thanks

Alfio_Tr
Posts: 6
Joined: Fri Aug 09, 2013 9:20 am

Re: Orthogonal projection to a face

Post by Alfio_Tr »

I think you can use the method described in this thread: Project point to solid.

Query IMetrics_DG from the entity of the face. If you have just a face, you can wrap it in an entity in the same way as the point is wrapped in the above topic:

Code: Select all

	IEntity_DG iEntityPoint = iGener.Create("IEntity_DG") as IEntity_DG;
	IBRepGeometry_DG iGeom = iEntityPoint.SetGeometryType("BRep") as IBRepGeometry_DG;
	iGeom.SetShape(iFace as IBRepShape_DG);

Hugo Dorma
Posts: 2
Joined: Wed Jun 15, 2022 5:12 am

Re: Orthogonal projection to a face

Post by Hugo Dorma »

Thank you, I will try that

Post Reply