SVG generation functions for Lua