Page 1 of 1

Orthogonal projection to a face

Posted: Wed Jun 15, 2022 5:22 am
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

Re: Orthogonal projection to a face

Posted: Thu Jun 16, 2022 7:41 am
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);

Re: Orthogonal projection to a face

Posted: Thu Jun 16, 2022 11:21 pm
by Hugo Dorma
Thank you, I will try that