Name

ST_Knots — Returns the knot vector of a NURBS curve.

Synopsis

float8[] ST_Knots(geometry nurbscurve);

설명

Returns the knot vector of a NURBS curve as an array of double precision values. The knot vector defines the parameter space and controls where and how the control points affect the curve. It must be a non-decreasing sequence with length equal to (number of control points + degree + 1).

Returns NULL if the curve uses the default uniform clamped knot vector or if the input is NULL. Raises an error if the input is not a NURBS curve.

Availability: 3.7.0

예시

-- Get knots from a NURBS curve with custom knot vector
SELECT ST_Knots(ST_MakeNurbsCurve(2, 'LINESTRING(0 0, 5 10, 10 0)'::geometry,
                 ARRAY[1.0, 2.0, 1.0], ARRAY[0,0,0,1,1,1]));
-- Result: {0,0,0,1,1,1}

-- Check if a curve uses default knot vector
SELECT ST_Knots('NURBSCURVE(2, (0 0, 5 10, 10 0))'::geometry);
-- Result: NULL (uniform clamped knot vector)