Passer au contenu principal
S

plot3d-surface

suzunami/plot3d-surface

Interactive 3D surface plotting tool card for the DSH chat, with drag-rotate, wheel-zoom and live-editable expression, range and mesh.

Installer

dsh plugin --profile web add github:suzunami/plot3d-surface

README

plot3d-surface

在 DSH 聊天里渲染可交互 3D 函数曲面 (z=f(x,y)) 的 DeepSeek Harness 插件。

An interactive 3D surface plugin for DeepSeek Harness (DSH): a custom tool card with drag-rotate, wheel-zoom, and live-editable expression, ranges, and mesh density.

功能

  • 工具 plot3d_surface:模型调用后,聊天流里出现一张可拖拽旋转(不限角度)、滚轮缩放的 3D 曲面卡片。
  • 卡片内实时编辑:表达式、(x/y) 范围、网格密度改动后即时重绘,不需要重新请求模型。
  • 三种模式
    • explicit(默认):(z=f(x,y)),变量 x、y;
    • parametric:(r(u,v)=(x(u,v),y(u,v),z(u,v))),变量 u、v;
    • implicit:(F(x,y,z)=0),等值面渲染。
  • 表达式支持 sin/cos/tan/asin/acos/atan/exp/log/sqrt/abs/pow/min/max/floor/ceil/round 与常量 pi、e。
  • NaN 区域自动跳过,坐标轴画在原点;浅色/深色主题自适应。

安装

dsh plugin --profile desktop add link:C:/Users/Z/.dsh/plugins/plot3d-surface

或在 DSH 设置 → 插件里安装本仓库。插件声明了 bundle patch,装好后重载/重启 DSH 生效。

用法

模型侧直接调用工具:

{
  "expr": "sin(x)*cos(y)",
  "xMin": -3, "xMax": 3, "yMin": -3, "yMax": 3, "mesh": 48
}

参数化曲面:

{
  "mode": "parametric",
  "xExpr": "sin(u)*cos(v)", "yExpr": "sin(u)*sin(v)", "zExpr": "cos(u)",
  "uMin": 0, "uMax": 3.14159, "vMin": 0, "vMax": 6.28318, "mesh": 60
}

隐式曲面:

{ "mode": "implicit", "fExpr": "x*x+y*y+z*z-1", "zMin": -3, "zMax": 3 }

结构

plot3d-surface/
├── package.json          # dsh.bundle / dsh.client 声明
├── cordis.patch.yml      # 插入 tool-plot3d-surface 行
└── lib/
    ├── index.js          # 宿主侧:工具定义与渲染
    └── client.js         # Web 端:可交互 3D 卡片

License

MIT

Plugins associés