I think this is kinda simple. I currently make a Bezier curve and set a circle curve as the bevel object.
R = 0.1
bpy.ops.curve.primitive_bezier_curve_add(align='WORLD', location=(0, 0, 0))
curve = bpy.context.active_object
bpy.ops.curve.primitive_bezier_circle_add(radius=R, align='WORLD', location=(0, 0, 0), scale=(1, 1, 1))
cross_section = bpy.context.active_object
curve.data.bevel_object = cross_section
curve.data.use_fill_caps = True
curve.data.bevel_mode = 'OBJECT'
This is all fine and I can set the circle radius to control the bevel radius. But I would like to make different radii at each end but still specified by a simple parameter:
R_1 = 0.1
R_2 = 0.3
I know this can be done with a taper curve but it not clear how to set the radius with parameters. Is there some simple/obvious/clever way to do this