I've used mathutils.geometry.interpolate_bezier()
in the past to create points for a curve using the bezier handle and knot coordinates.
from the docs:
interpolate_bezier(knot1, handle1, handle2, knot2, resolution)
My question is; given an existing curve in the scene, is there a neat way to get at the points that describe the curve without converting it to a mesh, or figuring out which handle (left or right) to use for each spline point.
curve = bpy.data.curves[0].splines[0]
curve.bezier_points[0].co
curve.bezier_points[0].handle_left
curve.bezier_points[0].handle_right