Point to plane projection

Everything DG Kernel: Technical discussions and issues
Post Reply
Gin Chun
Posts: 1
Joined: Wed Aug 14, 2024 9:15 am

Point to plane projection

Post 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
Prashant Kande
Posts: 46
Joined: Tue Jun 18, 2024 6:12 am

Re: Point to plane projection

Post 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
Post Reply