Go to: Attributes.

This node returns the closest point of an (x,y,z) point (attribute "inPosition") to a mesh (given by the attribute "inputMesh"). You can query the closest (x,y,z) point (attribute "position") or you can query the closest mesh (u,v) point (given by attributes "parameterU" and "parameterV").

Node name Parents MFn type Compatible function sets
closestPointOnMesh dependNode kClosestPointOnMesh kBase
kNamedObject
kDependencyNode
kClosestPointOnMesh

Attributes (19)

closestFaceIndex, closestVertexIndex, inMesh, inPosition, inPositionX, inPositionY, inPositionZ, inputMatrix, normal, normalX, normalY, normalZ, parameterU, parameterV, position, positionX, positionY, positionZ, result

Long name (short name) Type Default Flags
inMesh (im) mesh NULL outputinputconnectable
The input mesh for the info
inputMatrix (ix) matrix NULL outputinputconnectablestorable
Input transformation matrix of the mesh, which allows the closest point to be calculated in world space coords. This defaults to the identity matrix, so if it's not set to something else, the closest point will be calculated in the mesh's local space.
inPosition (ip) double3 0.0, 0.0, 0.0 outputinputconnectablestorable
Input reference point
inPositionX (ipx) distance (double) 0.0cm outputinputconnectablestorable
Input X value of reference position
inPositionY (ipy) distance (double) 0.0cm outputinputconnectablestorable
Input Y value of reference position
inPositionZ (ipz) distance (double) 0.0cm outputinputconnectablestorable
Input Z value of reference position
result (r) compound n/a outputconnectable
All results - container holding closest point, its normal, u and v parameter values and closest face index.
position (p) double3 0.0, 0.0, 0.0 outputconnectable
The closest (x,y,z) point (in result compound)
positionX (px) distance (double) 0.0cm outputconnectable
Computed X value of closest point
positionY (py) distance (double) 0.0cm outputconnectable
Computed Y value of closest point
positionZ (pz) distance (double) 0.0cm outputconnectable
Computed Z value of closest point
parameterU (u) double 0.0 outputconnectable
The U parameter value on the mesh at the closest point
parameterV (v) double 0.0 outputconnectable
The V parameter value on the mesh at the closest point
normal (n) double3 0.0, 0.0, 0.0 outputconnectable
The normal of the point (in result compound)
normalX (nx) distance (double) 0.0cm outputconnectable
X normal of closest point
normalY (ny) distance (double) 0.0cm outputconnectable
Y normal of closest point
normalZ (nz) distance (double) 0.0cm outputconnectable
Z normal of closest point
closestFaceIndex (f) integer -1 outputconnectable
Index of the face on which the closest point lies.
closestVertexIndex (vt) integer -1 outputconnectable
Index of the vertex closest to position on faceIndex.