Skip to main content

Function: svgToVMobjects()

svgToVMobjects(svgElement, options): VGroup

Defined in: mobjects/text/svgPathParser.ts:438

Walk an SVG element tree (as produced by MathJax) and convert every <path> element into a VMobject. Returns a VGroup containing one VMobject child per glyph / path element.

Handles MathJax SVG specifics:

  • <defs> blocks with glyph definitions referenced via <use>
  • Nested <g> transforms
  • viewBox → coordinate mapping

Parameters

svgElement

Element | SVGElement

options

SVGToVMobjectOptions = {}

Returns

VGroup