跳到正文
网页珍奇柜Web Curio

和声:程序化绘画工具

Harmony,Ricardo Cabello (Mr.doob),2010 年

正在布展…

原作直展:这是 Ricardo Cabello (Mr.doob) 的原始作品,按 GPL-3.0 许可证收录(版本 a891256)。原作原样展出。选一种笔刷在画布上拖动,线条会自动与附近的笔画相连,长出毛茸茸的网状结构。 许可证全文 · 收录说明

它是怎么做的

  1. 第 1 步记录笔画经过的所有点
  2. 第 2 步每加入一个新点,就遍历历史点,距离小于阈值的点之间连一条极淡的线
  3. 第 3 步不同笔刷改变连接规则:sketchy 连近邻、web 连所有近点、fur 向外延伸
  4. 第 4 步低透明度线条反复叠加,形成明暗与纹理

复刻配方

一段技术配方,可以直接交给 AI 编程助手,也可以自己照着写。想指定技术栈、位置和性能预算,就把它加入实现方案。

Keep an array of every point the pointer has visited in the current drawing. On each pointer move, draw the main segment, then loop over previous points and, for those within a distance threshold, draw a faint line from the current point toward them, optionally shortened by a random factor. Use a very low alpha so overlapping lines accumulate into shading. Variants change the threshold, whether lines extend beyond the neighbour (fur), or connect only to recent points (sketchy).

档案

交互

能不能拿来用

原作以 GPL-3.0 (LICENSE file) 许可开源:可以阅读源码学习,按许可证条款使用;在自己的项目里引用时保留原作者署名。

性能开销

视觉强度

实现难度

尺度为策展判断(1 到 5),用于比较和推荐。

核实记录:Opened https://mrdoob.github.io/harmony/ (200, title 'Harmony'); repo mrdoob/harmony exists; read LICENSE (GNU GPL v3, Copyright 2010 Mr.doob).