closest point using rhino.common - U V parameter in output

hi to everybody!

i wanted to know if it is possible to calculate the UV coordinate of a closest point on a surface using rhino.common library:

the surface.closestpoint method (

public bool ClosestPoint( Point3d testPoint, out double u, out double v )

)

give as output a boolean, while I need the UV coordinate of this on the surface, like the surface closest point component from GH as you can see in the sketch below:

 

thanks for your help!

Matteo

  • up

    David Rutten

    the U and V parameters have been tagged with the out keyword, meaning the result is returned there:

    double u, v;

    if (surface.CosestPoint(point, out u, out v))

    {

      //The operation worked and u & v now contain the UV coordinates.

    }

    --

    David Rutten

    david@mcneel.com

    Tirol, Austria

    • up

      matteo

      Thanks David!

      it works :)

      Matteo