Skip to content

Spline Nodes

Spline nodes receive Unity SplineContainer data through a dedicated Spline input port and produce Point data that downstream attribute or instancer nodes can consume. All nodes in this category use the purple node color (#B34DB3).


Spline Sampler

Category: Spline
Description: Samples points along or inside splines and outputs Point data with spline-derived attributes.

The node can operate in two dimensions:

  • OnSpline — samples positions along the spline curve itself.
  • OnInterior — fills the enclosed area of a closed spline with a regular grid of points (XZ-plane projected).

Ports

DirectionNameType
InputSplineSpline
OutputOutPoint

Settings

Dimension

FieldTypeDefaultDescription
dimensionSplineSamplerDimensionOnSplineWhether to place points along the spline curve or fill the closed interior.

SplineSamplerDimension enum

ValueDescription
OnSplineSamples positions directly on the spline curve at regular count or distance intervals.
OnInteriorGrid-scans the XZ bounding box of a closed spline and keeps only points inside the polygon. Requires a closed spline.

On Spline

FieldTypeDefaultDescription
modeSampleModeByCountHow sample positions are determined. See SampleMode enum below.
sampleCountint20Number of evenly-spaced samples. Used when mode = ByCount. Minimum is 2.
sampleDistancefloat1.0World-space distance between samples. Used when mode = ByDistance. Minimum is 0.001.
includeEndPointsbooltrueWhen mode = ByDistance, guarantees the spline end point (t = 1) is always included.

SampleMode enum

ValueDescription
ByCountDivides the normalised spline parameter [0, 1] into sampleCount - 1 equal steps.
ByDistanceSteps along the spline in world-space increments of sampleDistance.

On Interior

FieldTypeDefaultDescription
interiorSpacingfloat1.0XZ grid cell spacing in world units. Smaller values create denser point clouds. Minimum is 0.01.
densityFalloffboolfalseWhen enabled, reduces point density near the spline boundary using a linear falloff.
falloffDistancefloat2.0World-space distance from the boundary over which density falls to zero. Only effective when densityFalloff is enabled.

Spline Filtering

FieldTypeDefaultDescription
useAllSplinesbooltrueProcess all splines in the input SplineContainer. Disable to filter by index.
splineMaskint~0Bitmask controlling which spline indices are processed when useAllSplines is false. Each bit corresponds to one spline index (bit 0 = spline 0, etc.). Hidden in the inspector.

Attributes

FieldTypeDefaultDescription
outputCurvaturebooltrueCompute and store spline curvature at each sample point as the SplineCurvature attribute.

Provided Attributes

The following metadata attributes are always written to every output point:

Attribute NameTypeDescription
SplineAlphafloatNormalised spline parameter t in the range [0, 1]. 0 = spline start, 1 = spline end.
SplineDistancefloatWorld-space arc-length distance from the spline start, in units. Computed as t × splineLength.
SplineCurvaturefloatCurvature magnitude at the sample point. Only written when outputCurvature is enabled.
SplineBorderDistancefloatMinimum world-space distance from the point to the spline boundary polygon. OnInterior only.

All four are declared through IPPGAttributeProvider.


Point Transform

Every sampled point receives:

  • Position: The spline position converted from world space into the PPGComponent's local space.
  • Rotation: A look-rotation built from the spline tangent and up vectors at the sample position. Interior points use the tangent/up of the nearest spline boundary point.
  • Scale: (1, 1, 1) (unit scale).
  • Density: 1.0 for OnSpline points. For OnInterior points, 1.0 unless densityFalloff is enabled, in which case the value linearly decays to 0 within falloffDistance of the boundary.

Tips

  • The interior polygon is approximated with 64 line segments; highly irregular splines may produce minor sampling artefacts near concave regions.
  • Curvature is computed using finite differences (h = 0.001) on the spline parameter. Very short splines or near-zero tangents may produce 0.
  • Each spline in the input container produces a separate PPGPointData output batch. Downstream filter nodes see each batch independently.
  • OnInterior requires a closed spline. If the spline is open, a warning is logged and the spline is skipped.
  • To sample only specific splines from a multi-spline SplineContainer, disable useAllSplines and set the splineMask bitmask via script or a custom editor.

Procedural Placement Graph for Unity