# 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[0].co = o + [plot._scale[0], 0, 0]

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


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.[4] 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 – Robin De Schepper Apr 27 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. – batFINGER Apr 27 at 12:23