Export a SOP's geometry as SVG
export_sop_to_svgExport a TouchDesigner SOP to an SVG document of polylines, suitable for pen-plotter, laser cutting, or print deliverables. Configurable stroke, fill, scale, and flip Y axis.
Instructions
Walk a SOP's primitives via the bridge and emit an SVG document of polylines (each primitive becomes one <polyline>). Projects to x/y (drops z), auto-fits viewBox, supports stroke/fill/scale/flip_y. Writes to disk when output_path is supplied and always returns the SVG string in the report. Pen-plotter / laser / print deliverable.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source_path | Yes | SOP path to export (e.g. '/project1/geo1/circle1'). | |
| output_path | No | Filesystem path to write the SVG to. Absolute is recommended; relative paths are resolved against the server's current working directory. Omit to only return the SVG inline. | |
| stroke_color | No | CSS color for polyline strokes (default black). Accepts hex, rgb()/rgba()/hsl()/hsla(), or a named colour; anything that could break out of an SVG attribute is rejected. | #000000 |
| stroke_width | No | Stroke width in SVG units. | |
| fill_color | No | CSS color for fills (default 'none' — outlines only, plotter-style). Same allowlist as stroke_color. | none |
| scale | No | Scale factor applied to SOP units (TD SOPs are typically [-1..1]). | |
| flip_y | No | Flip Y so the SVG matches TD's viewport orientation. |