brepjs API Reference
    Preparing search index...

    Function importSVGPathD

    • Import a single SVG path data string (d attribute) as a Blueprint.

      Supports all SVG path commands: M, L, H, V, C, S, Q, T, A, Z (both absolute and relative). The Y axis is flipped to match brepjs coordinates (Y up).

      Parameters

      • pathD: string

        The SVG path data string (e.g., "M 0 0 L 10 0 L 10 10 Z").

      Returns Result<Blueprint>

      A Result wrapping the Blueprint, or an error if parsing fails.

      const bp = unwrap(importSVGPathD('M 0 0 L 10 0 L 10 10 Z'));
      

      importSVG to extract all <path> elements from a full SVG string.