draw_curve
Draw a quadratic Bézier curve from a start point to an end point, bending toward a control point, with adjustable smoothness.
Instructions
Draw a quadratic Bézier curve from (x0,y0) to (x1,y1) bending toward the
control point (control_x, control_y). steps controls smoothness.
Coordinates: (0, 0) is the top-left pixel. x grows right, y grows DOWN. A span given as position plus size covers x .. x + width - 1, so width is a count of pixels, not an offset to the far edge.
Centring differs between primitives, so check this when aligning two shapes:
draw_rectangle(x, width) spans x .. x+width-1, centred on x + (width-1)/2. An even width therefore centres on a half pixel.
draw_ellipse(center, radius) spans center-radius .. center+radius, which is always an ODD 2*radius+1 pixels wide and always centred on a whole pixel.
draw_ellipse_in_box(x, y, width, height) takes the same bounding box as draw_rectangle and fills it exactly, so it is the one to use for an even diameter, a disc centred on an even canvas, or a circle that has to line up with a rectangle.
draw_symmetric_pixels mirrors about the canvas, not about either of the above.
Writes falling outside the canvas are dropped rather than raising. Every drawing tool reports pixels_written, and pixels_clipped when anything was dropped, so compare those against what you asked for rather than trusting ok.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"filename": "<filename>",
"x0": "<x0>",
"y0": "<y0>",
"control_x": "<control_x>",
"control_y": "<control_y>",
"x1": "<x1>",
"y1": "<y1>",
"color": "<color>"
},
"name": "draw_curve"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x0 | Yes | ||
| x1 | Yes | ||
| y0 | Yes | ||
| y1 | Yes | ||
| color | Yes | ||
| frame | No | Default: 1. | |
| layer | No | ||
| steps | No | Default: 32. | |
| filename | Yes | ||
| control_x | Yes | ||
| control_y | Yes |