# Why GP points collection has method pop(), but curves not?

Why GP points collection has method pop(), but curves not?

Short answer: Bézier control points correlate with an underlying sequence of basis functions. Popping out a point leaves an unmatched basis function, consequently an ill-defined spline.

Long answer: The position of any point on a degree d Bézier spline, say on the i th segment, arises from the weighted sum of the control point sequence { P i, P i+1 …, P i+d } scaled by the corresponding Bernstein polynomials { b 0 (u), b 1 (u), …, b d (u) }. ( Многочлен Бернштейна ). In light of this, a container of Bézier control points consists of so many repeating sequences of correlated elements, say, «entry point», «entry handle», «exit handle», «exit point» for the well-known degree 3 Bézier curve, where the exit point of the i th segment is also the entry point of the i + 1 th segment. To reach into the container and arbitrarily remove some point gives rise to an malformed sequence. I surmise that to avoid such mayhem, the container designer chose not to implement pop().

Grease pencil strokes are literally plot points and are not correlated. removing one does not leave the overall stroke undefined.

2 Likes

Well, one bezier point in blender consists with 3 control points: central point, left and right handle:

*class*  bpy.types.BezierSplinePoint( *bpy_struct* ) Bezier curve point with two handles

co    Coordinates of the control point
Type : float array of 3 items in [-inf, inf], default (0.0, 0.0, 0.0)

handle_left     Coordinates of the first handle
Type : float array of 3 items in [-inf, inf], default (0.0, 0.0, 0.0)

handle_left_type    Handle types
Type : enum in [‘FREE’, ‘AUTO’, ‘VECTOR’, ‘ALIGNED’], default ‘FREE’

handle_right    Coordinates of the second handle
Type : float array of 3 items in [-inf, inf], default (0.0, 0.0, 0.0)

handle_right_type     Handle types
Type : enum in [‘FREE’, ‘AUTO’, ‘VECTOR’, ‘ALIGNED’], default ‘FREE’

Deleting this 3-point system doesn’t broke system. And by the way, bpy.ops.curve.delete() already do this, so don’t tell me that it is impossible.

At the moment deleting curve points can be only using bpy.ops.curve.delete(). And it looks weird to use operator for this, you need to select this points (loose your selection, or save selection before, then try to restore that)