API & MCP

Everything a person can do on Path Boolean Operations (SVG), a program or AI agent can do with the same inputs and get the identical result.

HTTP API

Path Boolean Operations (SVG)

Paste two SVG paths (the d attribute) and combine them like a vector editor's Path menu: union, intersection, difference or exclusion. With an empty second path, union removes overlaps and self-intersections. Curves are flattened within your tolerance, combined exactly as polygons and refitted to Bézier curves; the result is checked against both inputs on a grid of test points. Threadsmith uses the same engine for Object → Combine shapes.

Inputs of Path Boolean Operations (SVG)
FieldTypeDefaultDescription
pathA (required)textarea"M-10 0A10 10 0 1 0 10 0A10 10 0 1 0 -10 0Z"Path A (SVG path data)
pathBtextarea—Path B (SVG path data; empty = remove the overlaps of path A)
opselect (union, intersect, difference, xor)"union"Operation
fillAselect (nonzero, evenodd)"nonzero"Fill rule of path A
fillBselect (nonzero, evenodd)"nonzero"Fill rule of path B
tolerancenumber0.05Curve tolerance (path units)
refitbooleantrueRefit Bézier curves to the result
fitTolerancenumber0.05Refit tolerance (path units)
precisioninteger3Decimals in the result

Example request

Union of two overlapping circles

curl -X POST https://threadsmithpathboolean.usefulweb.app/api/v1/calculate -H 'content-type: application/json' -d '{"pathA":"M-10 0A10 10 0 1 0 10 0A10 10 0 1 0 -10 0Z","pathB":"M0 0A10 10 0 1 0 20 0A10 10 0 1 0 0 0Z","op":"union","fillA":"nonzero","fillB":"nonzero","tolerance":0.01,"refit":true,"fitTolerance":0.01,"precision":3}'

Every result contains

inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.

MCP (Model Context Protocol)

{
  "mcpServers": {
    "threadsmith-path-boolean": { "type": "http", "url": "https://threadsmithpathboolean.usefulweb.app/mcp" }
  }
}