LayMesh文档
EN

Functions

functions.lay
# Built-in functions, units, loops, conditions and a user function.page = canvas(name="LayMesh functions", size=(120 mm, 55 mm), background="#ffffff")font = "DejaVu Sans" function twice(value) { return value * 2 }values = [2, 4]values = append(values, 6)count = 0for value in values { count = count + value }for index in range(3) { count = count + index }while count < 18 { count = count + 1 }status = "pending"if count == 18 { status = "ready" } else { status = "error" }

预览

背景
Functions
原始示例
合计 —
详情

尚未运行

本设备浏览器实测;不含防抖等待。

修改仅保留在本页
依赖文件
  • examples/functions.lay

复现

sh
laymesh validate examples/functions.laylaymesh render examples/functions.lay -o figure.svglaymesh render examples/functions.lay -o figure.pdflaymesh render examples/functions.lay -o figure.png --dpi 300