# What is the 4th coordinate of spline points?

When trying to set the .co property of a curve's SplinePoints I noticed that it has 4 coordinates, x, y, z and an unknown coordinate. What is this 4th coordinate of SplinePoints?

curve = bpy.data.curves.new("test, type="CURVE")
curve.dimensions = '3D'
curve.resolution_u = 2
curve.bevel_depth = 0.01
line = curve.splines.new('POLY')
line.points.co = o + [plot._scale, 0, 0]

ValueError: bpy_struct: item.attr = val: sequences of dimension 0 should contain 4 items, not 3

• Interesting, never noticed this before. It seems to be a Quaternion, but I can't really tell why, information seems sparse. behreajj.medium.com/… Apr 27, 2021 at 10:41

NURBS curves are a set of weighted control points.

Control Point, Vertex

In case of a NURBS curve, there is a fourth component available (W), which defines the weight of the selected control point or the median weight.

For further technical details see https://en.wikipedia.org/wiki/Non-uniform_rational_B-spline#Technical_specifications

A NURBS curve is defined by its order, a set of weighted control points, and a knot vector. NURBS curves and surfaces are generalizations of both B-splines and Bézier curves and surfaces, the primary difference being the weighting of the control points,

How to specify Nurbs path vertices in python?

Create curve from Numpy Array using Python

• Ah, I'll include how I created the curve so you can see whether it is a NURBS curve Apr 27, 2021 at 12:08
• TBH can't be definitive here, believe the 4th coord is for the weight of a NURBS curve, and unused in others, but keeping 4D let's us convert between them without losing data. Apr 27, 2021 at 12:23