Grasshopper

algorithmic modeling for Rhino

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

Views: 1643

Attachments:

Replies to This Discussion

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

Thanks David!

it works :)

Matteo

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service