Skip to content

v0.3.0

Choose a tag to compare

@jwu jwu released this 18 Oct 14:24
· 41 commits to main since this release

本版重做 2D 图元 API:按 3D 的命名把图元拆成「默认 / _d(虚线)/ _s(填充)」三态,由方法名决定虚实与填充;2D 网格支持 rotation、skew 与 outer 边界,并新增 Arrows 页面与逐 shape 示例页。

当前仍为 partial parity:与参考实现的视觉对照状态见 docs/reference-parity.md,不代表像素级等价。

Breaking:FrameDrawList2D 不再用 options.fill / options.dash 切换填充与虚线,改用方法名。shape(rect / rect_r / circle / ellipse / arc / annulus / capsule / polygon / triangle / rhombus / sector / segment)与线(line / ray / lineStrip / polyline / lineLoop / grid)各有 _d 变体,shape 另有 _s;箭头为 arrow(开放 V 头)/ arrow_s(实心三角头)/ arrow_d / arrow_s_d。

新功能

  • 2D 图元按「默认 / _d / _s」拆分,_d 沿周长做弧长参数化(ellipse 用 Simpson 积分近似)
  • 新增 Curve2D、sampleCurve2D、placeCurvePoint2D 与 curve / curve_d
  • 2D grid 接受 Grid2DOptions:逆时针 rotation、x/y skew、outer x/y 边界;与 3D gridLines 共用 cells/skew/outer 语义
  • 新增 2D Arrows 页面,统一 filled / line 两种头型
  • 按 3D grid 参数表重做 2d-grid 页面
  • 2D WASD 平移支持 Shift 加速

修复

  • 修正 sd_sector 补集楔形把圆盘半径混入、导致 arc / sector 缺口被绘制的问题
  • rounded-rect 的右侧直边基址补上一个圆角弧长
  • 2D axes 配色改用 x 红、y 绿
  • 2D filled 箭头简化为纯三角形

重构与性能

  • 2d-shapes / 2d-fill / 2d-outlines 由 12 个逐 shape 页替代,2d-gizmos 改为 2d-index 索引网格;矩阵页统一「normal 列在前、_d、_s」
  • 形状页各自持有绘制循环

文档

  • 同步 2D 图元变体与页面布局说明

包含内容