I need to project a point to a IBRepFace_DG. I need to make sure the projection is nearest within the wire, not any on the surface. What is the way to do that?
Thanks
Point to face projection
-
- Posts: 1
- Joined: Mon Oct 21, 2024 5:58 am
Re: Point to face projection
I am pretty sure you need to extract the face as another entity, query its IMetrics_DG and use IMetrics_DG.DistPoint.
Details (up to my likely errors):
Details (up to my likely errors):
Code: Select all
IModel_DG model;
IBRepFace theFace;
IBRepShape_DG shape = theFace.As<IBRepShape_DG>();
IEntity_DG entityFace = model.AddBRepShape(shape)
IMetrics_DG metrics = entityFace.As<IMetrics_DG>();
PointDg thePoint, pointProjected;
double d = metrics.DistPoint(thePoint, out pointProjected);
// When done:
model.RemoveEntity(entityFace);