Page 1 of 1

Point to plane projection

Posted: Wed Aug 14, 2024 9:17 am
by Gin Chun
Hello all
I need to calculate projection of a point to a plane.
I hope someone can point me in the right direction
Thank you

Re: Point to plane projection

Posted: Thu Aug 15, 2024 12:12 am
by Prashant Kande
Hello Gin

The easiest way is to find the appropriate interface in the list.

Then search for IPlane_DG in the installed samples. You would find for an example in Face sample:

Code: Select all

private IUVSurface_DG CreatePlane()
{
    IPlane_DG iPlane = m_gen.Create<IPlane_DG>();
    // define the plane
    //....
    IUVSurface_DG iSurface = iPlane.As<IUVSurface_DG>();
    return iSurface;
}
You can use IPlane_DG.GetPointProjection() or IPlane_DG.GetDistance() straight away.

You can also attach the returned IUVSurface_DG to a face and add it to a model for later. IUVSurface_DG has GetNearestPoints() for the same purpose.

Regards