Skip to main content

vScriptValFromPolyline

Sample a path drawn in the viewer into evenly spaced points, with flip, aspect and scale controls.

BeginnerMograph / ScriptValScriptValArrayJSON
vScriptValFromPolyline node

vScriptValFromPolyline outputs an array of XYZ points taken at equal distances along a path that is drawn in the viewer. Point Count sets how many points are taken, and Closed Loop decides whether the path is closed.

Parameters​

ParameterTypeDefaultDescription
Reset PathInteger0.0Button that clears the drawn path.
Point CountInteger64Number of points taken along the path. Minimum 2, default 64.
Closed LoopInteger0.0When on, the path is treated as closed and the first point is not repeated at the end. Default off.
Flip YInteger1.0Negates Y after sampling. Default on.
Flip XInteger1.0Negates X after sampling. Default on.
+6 more parameters
ParameterTypeDefaultDescription
Aspect CorrectInteger1.0Divides Y by 16 / 9. Default on.
Scale XFloat2.0Multiplier applied to X. Minimum 0, default 2.
Scale YFloat2.0Multiplier applied to Y. Minimum 0, default 2.
Canvas RFloat0.15Red level of the image the node creates. Range 0 to 1, default 0.15.
Canvas GFloat0.15Green level of the image the node creates. Range 0 to 1, default 0.15.
Canvas BFloat0.25Blue level of the image the node creates. Range 0 to 1, default 0.25.
Read the full description

The Path control is a spline that is drawn in the viewer. The node takes Point Count positions along the path at equal fractions of its length. Without Closed Loop the first point is at the start and the last at the end of the path. With Closed Loop on, the spacing is divided by Point Count instead of Point Count - 1, so the last point stops one step before the start and the first point is not repeated.

Each point is then changed in this order. Flip X and Flip Y negate the X and Y values. Aspect Correct divides Y by 16 / 9, a fixed ratio that does not depend on the image size. Scale X and Scale Y multiply the values. Z is always 0. Flip X, Flip Y and Aspect Correct are on by default, and both scales default to 2.

The node is a source tool and also creates an image. It fills the image with the color from Canvas R, Canvas G and Canvas B, so the path can be drawn and seen in the viewer. The image does not change the point output. If the path has fewer than two points, the output is an empty array.

Reset Path clears the drawn path. Point Count is rounded to a whole number and has a minimum of 2.

Example Connections​

vScriptValFromPolyline.Output -> vScriptValCameraProjection.ArrayA
vScriptValCameraProjection.Output -> vScriptValShapeRender.ArrayPoint
Background.Output -> vScriptValShapeRender.Input