Skip to main content

vJSONSortByMeshProx

Sorts points by their distance to the closest mesh vertex, and can pull them toward it.

IntermediateMograph / JSONJSONArrayScriptVal
vJSONSortByMeshProx node

vJSONSortByMeshProx takes an array of XYZ points and a mesh, and outputs the points sorted by their distance to the mesh. Sort Order picks near first or far first.

Parameters​

ParameterTypeDefaultDescription
Proximity ToDropdownSurfaceSurface (default), Vertex or Face Centroid. Surface and Vertex measure to the closest vertex. Face Centroid measures to the closest patch point.
Sort OrderDropdownAscendingAscending (default) puts the nearest points first. Descending puts the farthest first.
Blend To TargetFloat0Moves each point toward its reference by this share. Range 0 to 1, default 0.
Target OffsetFloat0Offset of each written point along the normal, or along the line from the reference. Slider -5 to 5, default 0.
PointsDATATYPE—Point positions.
+1 more parameters
ParameterTypeDefaultDescription
Mesh PointsDATATYPE—Mesh vertices that distances are measured to.
Read the full description

For each point the node finds the reference on the mesh: the closest Mesh Points vertex (Surface and Vertex) or the closest patch point (Face Centroid). The points are sorted by the distance to it, nearest first for Ascending (default) or farthest first for Descending. Equal distances keep their input order.

The written points can also move: Blend To Target (0 to 1, default 0) mixes each point toward its reference, and Target Offset (default 0) adds an offset along the normal or along the line from the reference. Only the vertex list of the mesh is used. With no mesh data, the points are output in their original order.

Example Connections​

vJSONPointsOnGrid.Output -> vJSONSortByMeshProx.ArrayPoints
vJSONFromOBJ.Points -> vJSONSortByMeshProx.MeshPoints
vJSONSortByMeshProx.Output -> vJSONCameraProjection.ArrayA
vJSONCameraProjection.Output -> vJSONShapeRender.ArrayPoint
Background.Output -> vJSONShapeRender.Input