Skip to main content

Module svg

Module svg 

Source
Expand description

SVG import and export.

Export writes world geometry (model Y up → SVG Y down) in millimetres, one <g> per layer, styles as attributes, and reports what SVG cannot carry (constraints, plugin parameters, associative dimensions).

Import supports svg, g, line, rect, circle, ellipse, polyline, polygon, path (all commands; elliptical arcs become Béziers) and text, with nested transforms, viewBox and absolute size units, and stroke/fill/ stroke-width presentation attributes or inline style. DTDs are rejected; script, style, use, image, foreignObject, gradients, filters, masks and clip paths are skipped and reported; hrefs are never followed.

Structs§

SvgExportOptions
Export options.
SvgImport
Result of an SVG import: layers and entities ready for Command::CreateEntity.

Enums§

SvgError
SVG errors.

Constants§

MAX_SVG_BYTES
Maximum SVG input size.

Functions§

export_svg
Export the engine’s committed document as SVG.
import_svg
Import SVG text into built-in Dotloom geometry (mm, Y up).