Skip to main content

vScriptValOffsetByNormal

Moves each point along the normal estimated at the closest mesh vertex by Offset Distance.

IntermediateMograph / ScriptValScriptValArrayJSON
vScriptValOffsetByNormal node

vScriptValOffsetByNormal takes an array of XYZ points and a mesh, and adds the normal estimated at the closest mesh vertex times Offset Distance to each point. Offset Distance is the only value that matters, and it defaults to 0.

Parameters​

ParameterTypeDefaultDescription
Offset DistanceFloat0Distance along the normal. Slider -1 to 1, default 0.
Affect XFloat1X is offset when checked (default), otherwise it keeps the input value.
Affect YFloat1Y is offset when checked (default), otherwise it keeps the input value.
Affect ZFloat1Z is offset when checked (default), otherwise it keeps the input value.
PointsDATATYPE—Point positions.
+1 more parameters
ParameterTypeDefaultDescription
Mesh PointsDATATYPE—Points of the mesh that the input is compared with.
Read the full description

For every point the node finds the closest Mesh Points vertex and reads the normal estimated there, which is fitted to the 8 nearest vertices and points away from the center of the mesh. The output point is the input point plus that normal times Offset Distance, so the point moves along the normal from where it is, not from the mesh.

Offset Distance has a slider from -1 to 1 and defaults to 0, which leaves the points where they are. A negative value moves the points against the normal. Affect X, Y and Z are checked by default, and an unchecked axis keeps its input value.

If the points or the mesh are empty, the output is empty.

Example Connections​

vScriptValPointsOnGrid.Output -> vScriptValOffsetByNormal.ArrayPoints
vScriptValFromOBJ.Points -> vScriptValOffsetByNormal.MeshPoints
vScriptValOffsetByNormal.Output -> vScriptValCameraProjection.ArrayA
vScriptValCameraProjection.Output -> vScriptValShapeRender.ArrayPoint
Background.Output -> vScriptValShapeRender.Input