逐顶点网格测量 插件用户手册
Compute Vertex Measurements (Mesh) - User Manual
Dragonfly Prototype Apps · Compute Vertex Measurements (Mesh)...
版本 Version 1.0 · 2026-07-04
第一部分 中文手册
目录
1. 简介
2. 适用场景
3. 安装与启用
4. 运行环境与首次配置
5. 界面说明
6. 使用步骤
7. 参数说明
8. 输出结果
9. 常见问题与故障排除
10. 注意事项与已知限制
11. 参考资料
1. 简介
逐顶点网格测量(Compute Vertex Measurements (Mesh)) 是一个 Dragonfly 插件,针对场景中已经存在的表面网格(Mesh)计算多达 20 种逐顶点(per-vertex)测量。每个测量都会为网格的每一个顶点产生一个标量值,并作为一个新的逐顶点标量场(per-vertex scalar field)写回到同一个网格上——就像网格自带的其他标量属性一样,可以直接在 Dragonfly 中用色图(colormap)显示。使用方法非常简单:选择一个网格、勾选想要计算的测量项、点击 Compute 即可。
本插件提供的 20 种测量按用途分为 5 组:曲率(Curvature)、厚度与距离(Thickness & distance)、表面暴露度与粗糙度(Surface exposure & roughness)、局部几何与拓扑(Local geometry & topology),以及谱形状特征(Spectral shape signatures)。涵盖平均曲率 / 高斯曲率 / 主曲率 / 形状指数、局部壁厚(SDF)、测地距离与径向距离、相对最佳拟合球 / 平面 / 第二个参考网格的偏差、环境光遮蔽、粗糙度,以及热核特征(HKS)与波核特征(WKS)。
底层引擎与算法
所有繁重的计算都在一个与 Dragonfly 隔离的 Windows 虚拟环境(venv)子进程中完成,因此绝不会改动 Dragonfly 自带的 Python 环境。核心计算库均为宽松许可(MIT / BSD / MPL-2.0),不含任何 GPL / CGAL 组件:
- trimesh(MIT)——几何测量、内向射线投射测厚、临近 / 偏差查询、法向、邻接关系。
- libigl(MPL-2.0,仅使用其宽松核心,从不导入
igl.copyleft.*)——曲率组(主曲率二次曲面拟合)。 - potpourri3d(MIT)——基于热方法(heat method)的稳健测地距离。
- robust-laplacian(MIT)——稳健的余切拉普拉斯 / 质量矩阵,用于粗糙度、HKS、WKS。
- rtree(MIT,底层 libspatialindex 亦为 MIT)——trimesh 射线投射与最近点查询所需的空间索引后端。
- numpy / scipy——纯数值计算(径向距离、最佳拟合球 / 平面等)。
许可证要点:本插件所用的全部第三方库均采用宽松开源许可(MIT / BSD / MPL-2.0),不包含 GPL 或 CGAL 代码,可安全用于商业环境。
2. 适用场景
只要关注局部表面几何,本插件就能派上用场。典型场景包括:
- 材料科学与工业 CT:测量零件的壁厚与表面粗糙度;评估扫描件相对参考网格 / CAD 派生网格的偏差(deviation)。
- 增材制造(AM)质量检查:比较实际打印件(as-built)与名义模型(nominal),定位形变、翘曲与过厚 / 过薄区域。
- 生命科学:对分割得到的解剖表面(骨骼、细胞、膜等)进行曲率与形状分析,识别脊、沟、凹陷等局部特征。
- 逆向工程与计量:通过最佳拟合球 / 平面的偏差评估圆度(roundness)与平面度(flatness)等形位误差。
- 形状分析研究:利用 HKS / WKS 等内在(intrinsic)、等距不变(isometry-invariant)的谱特征描述并比较形状。
前提是场景中已存在网格。本插件不生成网格,而是对已有网格计算逐顶点属性。若尚无网格,请先用 Dragonfly 的网格生成 / 导入功能得到一个表面网格。
3. 安装与启用
本插件随 Prototype Labs & Apps 完整安装包(Full Package) 一起分发。安装步骤如下:
1. 将下载到的压缩包解压到任意位置(建议使用较短的目录,如 C:\PL\,以避免 Windows 260 字符路径限制)。
2. 双击 `Install_FullPackage.bat`。
3. 在弹出的对话框中选择核心安装模式(Fresh 全新 / Compatible 兼容),并在下方的 Prototype Apps 列表中勾选 `Compute Vertex Measurements (Mesh)...`。
4. 点击 Install,等待控制台完成。
5. 完全退出并重启 Dragonfly(菜单只在启动时扫描)。
本插件属于重型插件,在安装包列表中默认未勾选。若安装时未勾选,重启后菜单中不会出现,请重新运行安装器并勾选,或按下面的方法在 Dragonfly 内启用。
菜单位置
重启后,插件出现在菜单:Prototype Apps ▸ Compute Vertex Measurements (Mesh)...(位于 Measurements & Analysis 分组)。点击即可打开一个可停靠的浮动面板。
以后修改勾选
以后可以随时在 Dragonfly 内启用 / 停用本插件:打开 Developer ▸ Prototype Labs... ▸ Menu Item Manager,在底部的 “Prototype Apps (Full Package)” 列表中找到本插件,勾选=部署、取消勾选=移除菜单项,重启 Dragonfly 生效。停用从不删除已搭建的运行环境,重新启用后立即可用。
卸载
双击安装器目录中的 `Uninstall_FullPackage.bat` 即可移除所有 Full Package 的菜单项与插件。卸载会保留已搭建的插件环境(venv),脚本结束时会列出其路径,如需释放磁盘空间可手动删除。
4. 运行环境与首次配置
安装时不下载任何计算库。首次使用本插件前,需在面板中点击一次 Setup environment(搭建环境)。此操作会以 Dragonfly 自带的 Python 为基础(若不可用则退回到系统 Python)在插件代码目录内构建一个隔离的 venv,并通过 pip 安装所需的计算库。
Setup environment 具体做什么
- 构建
runner\venv隔离环境(位于已安装的GenericMenuItems\VertexMeasurements\runner\目录内)。 - pip 安装核心依赖:
numpy、scipy、trimesh、rtree、potpourri3d、robust-laplacian(这些都有预编译 wheel,通常几分钟即可完成)。 - 尽力(best-effort)安装可选依赖
libigl。libigl 2.6.x 在 Windows 无预编译 wheel,pip 会从源码编译(需要 C++ / CMake 工具链,耗时数分钟)。若机器上没有编译器导致 libigl 安装失败,setup 不会整体失败——只是曲率组的 7 项测量暂时不可用,其余约 13 项测量照常工作。 - 环境就绪后,把 venv 的 Python 路径记录到
runner\venv_python.txt,下次打开面板会自动识别为 “Environment: ready”。
资源需求
项目 | 说明 |
联网 | 需要。仅在点击 Setup environment 下载依赖时需要一次联网;之后计算完全离线。 |
下载体积 | 核心依赖约几十至百余 MB(numpy/scipy/trimesh/rtree/potpourri3d/robust-laplacian)。 |
GPU | 不需要。全部为 CPU 计算。 |
WSL / 外部软件 | 不需要。无需 WSL,也无需安装任何外部程序。 |
Dragonfly 版本 | 本插件在 Dragonfly 2027.1 上验证。 |
环境安装到哪里
- 隔离环境:已安装插件代码目录下的
runner\venv(位于%LOCALAPPDATA%\comet\<Dragonfly版本>\pythonUserExtensions\GenericMenuItems\VertexMeasurements\runner\内)。 - 每次计算的作业目录(输入 / 结果文件):
runner\jobs\(运行时自动创建)。 - venv Python 路径记录:
runner\venv_python.txt。
失败时的替代方案:若因缺少编译器导致 libigl 安装失败,可先照常使用其余测量;需要曲率组时,再在机器上安装 C++ / CMake 工具链后重新点击 Setup environment。核心依赖本身有预编译 wheel,一般不会失败。
5. 界面说明
面板从上到下依次为:网格选择区、分组测量清单、全选 / 全不选按钮、环境行、计算行、进度条与日志框。
5.1 网格选择区
- Mesh(网格下拉框):列出当前场景中的所有表面网格,选择要测量的目标网格。
- Refresh(刷新按钮):重新扫描场景并刷新网格列表。若你在打开面板后新建 / 导入了网格,请点此刷新。
5.2 分组测量清单
一个可滚动区域,按 5 个分组列出全部 20 个测量,每项一个复选框(勾选=计算该项)。默认仅勾选 Mean curvature (H) 与 Gaussian curvature (K) 两项。部分测量项旁有一个 ? 按钮,点击可弹出该测量的详细说明对话框。5 个分组分别是:
- Curvature(曲率):平均曲率、高斯曲率、最大 / 最小主曲率、形状指数、曲率强度、最大绝对曲率(共 7 项)。
- Thickness & distance(厚度与距离):局部厚度(SDF)、测地距离、径向距离、相对最佳拟合球 / 平面的偏差、相对参考网格的偏差(共 5 项)。
- Surface exposure & roughness(表面暴露度与粗糙度):环境光遮蔽 / 可达性、表面粗糙度(高通)(共 2 项)。
- Local geometry & topology(局部几何与拓扑):法向变化、顶点价数、顶点(重心)面积(共 3 项)。
- Spectral shape signatures(谱形状特征):热核特征(HKS)、波核特征(WKS)(共 2 项)。
5.3 参考网格选择器(条件显示)
当且仅当勾选 Deviation from reference mesh(相对参考网格的偏差) 时,清单下方会显示一个带框的区域,提示 “Select a SECOND mesh to measure deviation against:”,其中包含一个 Reference mesh(参考网格下拉框)。请在此选择用于比较的第二个网格。取消勾选该测量项后,此区域会自动隐藏。
5.4 全选 / 全不选
- Select all(全选):勾选全部测量项。
- Select none(全不选):清空所有勾选。
5.5 环境行
- Environment 状态标签:显示环境状态,如 “Environment: ready”(就绪)或 “Environment: not set up — click 'Setup environment'.”(尚未搭建)。
- Setup environment(搭建环境按钮):首次使用时点击一次,构建隔离 venv 并安装依赖(见第 4 章)。
5.6 计算行、进度条与日志
- Compute(计算按钮):对选中的网格执行所有勾选的测量,并把结果写回网格。
- Cancel(取消按钮):计算 / 搭建过程中变为可用,可请求中止当前任务。
- 进度条:任务进行时显示忙碌状态。
- 日志框(只读):实时输出运行信息,包括检测到的网格数、顶点 / 面数、写回的标量槽名称,以及任何失败测量的错误摘要。
6. 使用步骤
6.1 基本工作流(单网格测量)
1. 确保场景中已有一个表面网格(本插件不生成网格)。
2. 打开 Prototype Apps ▸ Compute Vertex Measurements (Mesh)...。
3. 若首次使用,点击 Setup environment 并等待状态变为 “Environment: ready”(需联网,数分钟)。
4. 在顶部 Mesh 下拉框中选择目标网格(必要时先点 Refresh 刷新列表)。
5. 在测量清单中勾选需要的测量项(默认已勾选平均曲率与高斯曲率;可用 Select all / Select none 快速调整)。
6. 点击 Compute。日志框会显示读取到的顶点 / 面数与计算进度。
7. 完成后弹出提示,说明已向网格添加了多少个逐顶点标量场;在 Dragonfly 中切换该网格的标量槽 / 色图即可查看每一项结果(见第 8 章)。
6.2 相对参考网格的偏差(双网格比较)
1. 确保场景中同时存在待测网格与参考网格两个网格(例如扫描件与名义 CAD 模型)。
2. 在 Mesh 下拉框中选择待测网格。
3. 在测量清单中勾选 Deviation from reference mesh;下方随即出现参考网格选择区。
4. 在 Reference mesh 下拉框中选择参考网格(必须与待测网格不同,否则会提示错误)。
5. 点击 Compute。插件计算待测网格每个顶点到参考网格表面的有符号距离并写回。
6. 符号约定:位于参考网格内部为正、外部为负;色图图例会据此标注。
输入要求:输入必须是含三角面片的表面网格。插件从网格读取世界坐标下的顶点(V)与三角连接关系(F)。若网格无顶点 / 面,读取会报错。
7. 参数说明
下表列出全部 20 个测量项、其所属分组、单位、计算后端(库),以及内部默认参数。除 “是否默认勾选” 外,测量项的内部参数(如射线数、特征值数量等)由插件预设,面板中无需手动填写。
测量项 | 分组 | 单位 | 后端 | 默认勾选 / 参数 |
Mean curvature (H) 平均曲率 | 曲率 | 1/length | libigl | 默认勾选;H=(κ₁+κ₂)/2 |
Gaussian curvature (K) 高斯曲率 | 曲率 | 1/length² | libigl | 默认勾选;K=κ₁·κ₂ |
Max principal curvature (κ₁) 最大主曲率 | 曲率 | 1/length | libigl | — |
Min principal curvature (κ₂) 最小主曲率 | 曲率 | 1/length | libigl | — |
Shape index 形状指数 | 曲率 | [-1, 1] | libigl | +1 穹顶 / 0 鞍点 / -1 凹坑 |
Curvedness 曲率强度 | 曲率 | 1/length | libigl | C=sqrt((κ₁²+κ₂²)/2) |
Max absolute curvature |κ| 最大绝对曲率 | 曲率 | 1/length | libigl | max(|κ₁|,|κ₂|) |
Local thickness (SDF) 局部厚度 | 厚度与距离 | length | trimesh | n_rays=5, cone_deg=20.0 |
Geodesic distance 测地距离 | 厚度与距离 | length | potpourri3d | source_mode=auto |
Radial distance 径向距离 | 厚度与距离 | length | numpy | 到网格质心的直线距离 |
Deviation from best-fit sphere 相对最佳拟合球偏差 | 厚度与距离 | length | numpy | 到最小二乘球的有符号距离 |
Deviation from best-fit plane 相对最佳拟合平面偏差 | 厚度与距离 | length | numpy | 到最小二乘平面的有符号距离 |
Deviation from reference mesh 相对参考网格偏差 | 厚度与距离 | length | trimesh | 需要第二个参考网格;内部为正 |
Ambient occlusion / accessibility 环境光遮蔽 / 可达性 | 表面暴露度与粗糙度 | [0, 1] | trimesh | n_samples=64, report=accessibility |
Surface roughness (high-pass) 表面粗糙度 | 表面暴露度与粗糙度 | length | robust-laplacian | smoothing=1.0 |
Normal variation (deg) 法向变化 | 局部几何与拓扑 | degrees | trimesh | 顶点法向与相邻面片的平均夹角 |
Vertex valence (degree) 顶点价数 | 局部几何与拓扑 | count | trimesh | 每个顶点连接的边数 |
Vertex (barycentric) area 顶点(重心)面积 | 局部几何与拓扑 | length² | trimesh | 周围三角形面积之和的 1/3 |
Heat Kernel Signature (HKS) 热核特征 | 谱形状特征 | a.u. | robust-laplacian + scipy | n_eig=80, scale=0.5 |
Wave Kernel Signature (WKS) 波核特征 | 谱形状特征 | a.u. | robust-laplacian + scipy | n_eig=80, energy=0.5 |
测地距离的源点说明
Geodesic distance 计算每个顶点沿网格表面(而非直线)到一组源点的最短距离,采用热方法(potpourri3d)。源点自动选取,无需额外手动拾取(source_mode=auto):若网格有开放边界(如裁剪 / 壳状表面),取所有边界顶点为源点,得到 “自边缘向内的距离”;若网格封闭(无边界),取离质心最远的单个顶点为源点,得到 “自最极端点跨越整个物体的距离”。
8. 输出结果
每一项成功的测量都会作为一个新的逐顶点标量场(per-vertex scalar slot)写回到你选择的那个网格上(参考网格不会被修改)。标量槽以该测量的名称命名(如 “Mean curvature (H)”),并附带相应单位。插件在写回后会刷新网格的显示与图例。
如何查看结果
1. 计算完成后阅读弹出提示与日志框:日志中的 “Added scalar slots: ...” 列出了本次成功写入的标量槽名称。
2. 在 Dragonfly 中选中该网格,在其属性 / 显示设置中切换要显示的顶点标量槽。
3. 为该标量槽选择合适的色图(colormap) 与数值范围,即可在 3D 视图中看到测量结果以颜色渲染在网格表面上。
4. 若同时计算了多个测量,可在不同标量槽之间切换,逐一查看。
本插件只向网格追加逐顶点标量场,不会创建 Channel、ROI、MultiROI 或新的网格对象,也不会更改网格的几何形状。若某项测量失败,其他成功的测量仍会正常写回,失败原因会打印在日志框中。
9. 常见问题与故障排除
Q1:菜单里找不到 “Compute Vertex Measurements (Mesh)...”。
A:本插件默认未勾选。请确认安装时已勾选它,或打开 Developer ▸ Prototype Labs... ▸ Menu Item Manager 勾选后重启 Dragonfly。菜单只在启动时扫描,任何启用 / 停用都需要重启一次。
Q2:环境状态显示 “not set up”,或点击 Compute 提示无法计算。
A:说明尚未搭建运行环境。点击 Setup environment,保持联网并耐心等待(数分钟)。完成后状态会变为 “Environment: ready”。若搭建失败,请查看日志框中的具体错误。
Q3:曲率组的 7 项测量算不出来 / 报错,其他测量却正常。
A:曲率组依赖可选库 libigl。libigl 在 Windows 无预编译 wheel,需从源码编译,若机器缺少 C++ / CMake 工具链则会安装失败(这是设计上的 best-effort 行为,不会阻断其余测量)。解决办法:安装 C++ / CMake 工具链后重新点击 Setup environment;在此之前可先使用其余约 13 项测量。
Q4:勾选了 “Deviation from reference mesh” 却无法计算。
A:该测量需要在下方出现的 Reference mesh 下拉框中选择第二个网格,且该参考网格必须与待测网格不同。若未选择,或参考网格与待测网格相同,插件会弹出提示。请确保场景中至少有两个网格并分别选择。
Q5:局部厚度(SDF)计算很慢。
A:局部厚度依赖从每个顶点向内投射射线,在非常大的网格上会较慢。可先在较小 / 抽稀的网格上试算;如需在大网格上加速,可在环境中额外安装可选的 embreex 加速库(缺失时 trimesh 会退回较慢的纯 Python 射线引擎)。
Q6:网格列表是空的。
A:说明当前场景中没有可识别的表面网格。请先生成 / 导入一个网格,然后点击面板上的 Refresh 重新扫描场景。
10. 注意事项与已知限制
- 输入必须是已存在的三角面片表面网格;本插件不生成、不导入网格,也不修改网格几何。
- 结果只写回到被选中的那个网格,以逐顶点标量槽形式追加;参考网格不受影响。
- 曲率组(7 项)与环境光遮蔽 / 部分测量依赖可选库(尤其 libigl);若可选库未成功安装,相关测量会在计算时给出清晰错误,而其余测量照常工作。
- HKS / WKS 需要对网格拉普拉斯做特征分解,比几何类测量更耗时,大网格上尤为明显。
- 局部厚度(SDF) 在实心 / 壳状表面上才有物理意义;射线投射在大网格上较慢。
- 测地距离 的源点自动选取取决于网格是否封闭(开放边界 vs 最远点),不同网格得到的场含义不同,详见第 7 章。
- 首次搭建环境需联网;安装 libigl 可能需要 C++ / CMake 编译工具链。
- 本插件在 Dragonfly 2027.1 上验证;计算为纯 CPU,无需 GPU。
11. 参考资料
- trimesh(MIT):https://github.com/mikedh/trimesh
- libigl(MPL-2.0):https://libigl.github.io/
- potpourri3d(MIT):https://github.com/nmwsharp/potpourri3d
- robust-laplacian(MIT):https://github.com/nmwsharp/robust-laplacians-py
- rtree(MIT) / libspatialindex:https://github.com/Toblerity/rtree
- SciPy:https://scipy.org/ · NumPy:https://numpy.org/
关于 Koenderink 形状指数(Shape index)、热核特征(HKS)、波核特征(WKS)与形状直径函数(SDF)等算法概念,可查阅上述项目文档及相关计算几何 / 形状分析文献。
Part II English Manual
Contents
1. Overview
2. Use cases
3. Installation and enabling
4. Environment and first-run setup
5. Interface reference
6. Step-by-step usage
7. Parameter reference
8. Outputs
9. FAQ and troubleshooting
10. Notes and known limitations
11. References
1. Overview
Compute Vertex Measurements (Mesh) is a Dragonfly plugin that computes up to 20 per-vertex measurements on a surface mesh that already exists in your scene. Each measurement produces one scalar value for every vertex of the mesh and writes it back onto the same mesh as a new per-vertex scalar field — displayable with a colormap just like any other mesh property. The workflow is simple: pick a mesh, tick the measurements you want, and click Compute.
The 20 measurements are organized into 5 groups by purpose: Curvature, Thickness & distance, Surface exposure & roughness, Local geometry & topology, and Spectral shape signatures. They cover mean / Gaussian / principal curvature and shape index, local wall thickness (SDF), geodesic and radial distance, deviation from a best-fit sphere / plane or from a second reference mesh, ambient occlusion, roughness, and the Heat Kernel Signature (HKS) and Wave Kernel Signature (WKS).
Engine and algorithms
All heavy computation runs in an isolated Windows venv subprocess kept separate from Dragonfly, so Dragonfly's own Python environment is never touched. All core libraries are permissively licensed (MIT / BSD / MPL-2.0) with no GPL / CGAL components:
- trimesh (MIT) — geometric measures, inward ray-cast thickness, proximity / deviation queries, normals, adjacency.
- libigl (MPL-2.0; only the permissive core is used,
igl.copyleft.*is never imported) — the Curvature group (principal-curvature quadric fit). - potpourri3d (MIT) — robust heat-method geodesic distance.
- robust-laplacian (MIT) — robust cotangent Laplacian / mass matrix for roughness, HKS, WKS.
- rtree (MIT; underlying libspatialindex is MIT) — spatial-index backend for trimesh ray casting and nearest-point queries.
- numpy / scipy — pure numerical computation (radial distance, best-fit sphere / plane, etc.).
Licensing: every third-party library used here is permissively licensed (MIT / BSD / MPL-2.0) with no GPL or CGAL code, so it is safe for commercial use.
2. Use cases
The plugin is useful wherever local surface geometry matters. Typical cases include:
- Materials science and industrial CT: measure wall thickness and surface roughness of parts; assess deviation of a scanned part from a reference / CAD-derived mesh.
- Additive manufacturing (AM) quality checks: compare the as-built print against the nominal model to locate distortion, warpage, and over-/under-thickness regions.
- Life science: curvature and shape analysis of segmented anatomical surfaces (bones, cells, membranes), identifying ridges, grooves, and depressions.
- Reverse engineering and metrology: evaluate form errors such as roundness and flatness via deviation from a best-fit sphere / plane.
- Shape-analysis research: describe and compare shapes with intrinsic, isometry-invariant spectral signatures such as HKS / WKS.
A mesh must already exist in the scene. This plugin does not create meshes — it computes per-vertex properties on existing ones. If you have no mesh yet, first generate or import a surface mesh with Dragonfly's own tools.
3. Installation and enabling
The plugin ships as part of the Prototype Labs & Apps Full Package. To install:
1. Unzip anywhere (prefer a short folder such as C:\PL\ to avoid the Windows 260-character path limit).
2. Double-click `Install_FullPackage.bat`.
3. In the dialog, choose the core install mode (Fresh or Compatible) and tick `Compute Vertex Measurements (Mesh)...` in the Prototype Apps list.
4. Click Install and wait for the console to finish.
5. Quit Dragonfly completely and restart it (menus are discovered only at startup).
This is a heavy plugin and is OFF by default in the installer list. If you didn't tick it, it won't appear after restart — re-run the installer and tick it, or enable it inside Dragonfly as described below.
Menu location
After restart the plugin appears at Prototype Apps ▸ Compute Vertex Measurements (Mesh)... (in the Measurements & Analysis section). Clicking it opens a dockable, floating panel.
Changing your choices later
You can enable / disable the plugin inside Dragonfly at any time: open Developer ▸ Prototype Labs... ▸ Menu Item Manager, find the plugin in the bottom “Prototype Apps (Full Package)” list, tick = deploy / untick = remove the menu entry, then restart Dragonfly to apply. Disabling never deletes the built environment; re-enabling is instant.
Uninstall
Double-click `Uninstall_FullPackage.bat` in the installer folder to remove all Full-Package menu items and plugins. Uninstalling keeps each plugin's built environment (venv); the script prints its path at the end so you can delete it manually to reclaim disk space.
4. Environment and first-run setup
Nothing is downloaded at install time. Before first use, click Setup environment once in the panel. This builds an isolated venv inside the plugin's code directory using Dragonfly's own Python as the base (falling back to a system Python if needed) and pip-installs the required compute libraries.
What Setup environment does
- Builds
runner\venv(inside the installedGenericMenuItems\VertexMeasurements\runner\directory). - pip-installs the core dependencies:
numpy,scipy,trimesh,rtree,potpourri3d,robust-laplacian(all ship prebuilt wheels; usually a few minutes). - Installs the optional
libiglon a best-effort basis. libigl 2.6.x has no prebuilt Windows wheel, so pip builds it from source (needs a C++ / CMake toolchain, a few minutes). If the build fails on a machine without a compiler, setup does not fail overall — only the 7 Curvature measurements become temporarily unavailable, while the other ~13 measurements keep working. - Once ready, the venv Python path is recorded in
runner\venv_python.txt; on the next open the panel shows “Environment: ready”.
Resource requirements
Item | Details |
Internet | Required once, only while Setup environment downloads dependencies; computation afterwards is fully offline. |
Download size | Roughly tens to ~100+ MB for the core deps (numpy/scipy/trimesh/rtree/potpourri3d/robust-laplacian). |
GPU | Not required. Everything runs on the CPU. |
WSL / external apps | Not required. No WSL and no external programs to install. |
Dragonfly version | Verified on Dragonfly 2027.1. |
Where the environment lives
- Isolated environment:
runner\venvunder the installed code directory (inside%LOCALAPPDATA%\comet\<Dragonfly version>\pythonUserExtensions\GenericMenuItems\VertexMeasurements\runner\). - Per-job directories (input / result files):
runner\jobs\(created at runtime). - venv Python path record:
runner\venv_python.txt.
Fallback if setup fails: if libigl fails to build for lack of a compiler, use the other measurements as usual; when you need the Curvature group, install a C++ / CMake toolchain and click Setup environment again. The core dependencies themselves ship prebuilt wheels and rarely fail.
5. Interface reference
From top to bottom the panel has: a mesh selector, the grouped measurement list, Select all / none buttons, an environment row, a compute row, a progress bar, and a log box.
5.1 Mesh selector
- Mesh (dropdown): lists every surface mesh in the current scene; pick the mesh you want to measure.
- Refresh (button): re-scans the scene and refreshes the list. Click it if you created / imported a mesh after opening the panel.
5.2 Grouped measurement list
A scrollable area listing all 20 measurements in 5 groups, one checkbox each (ticked = compute). By default only Mean curvature (H) and Gaussian curvature (K) are ticked. Some items have a ? button that opens a dialog explaining that measurement in detail. The 5 groups are:
- Curvature: mean, Gaussian, max / min principal curvature, shape index, curvedness, max absolute curvature (7 items).
- Thickness & distance: local thickness (SDF), geodesic distance, radial distance, deviation from best-fit sphere / plane, deviation from reference mesh (5 items).
- Surface exposure & roughness: ambient occlusion / accessibility, surface roughness (high-pass) (2 items).
- Local geometry & topology: normal variation, vertex valence, vertex (barycentric) area (3 items).
- Spectral shape signatures: Heat Kernel Signature (HKS), Wave Kernel Signature (WKS) (2 items).
5.3 Reference-mesh selector (conditional)
Only when Deviation from reference mesh is ticked does a framed area appear below the list, prompting “Select a SECOND mesh to measure deviation against:” and containing a Reference mesh (dropdown). Pick the second mesh to compare against here. Un-ticking the measurement hides this area automatically.
5.4 Select all / none
- Select all: ticks every measurement.
- Select none: clears all ticks.
5.5 Environment row
- Environment status label: shows the state, e.g. “Environment: ready” or “Environment: not set up — click 'Setup environment'.”
- Setup environment (button): click once on first use to build the isolated venv and install dependencies (see Chapter 4).
5.6 Compute row, progress bar and log
- Compute (button): runs all ticked measurements on the selected mesh and writes results back onto it.
- Cancel (button): becomes enabled during a run and requests cancellation of the current task.
- Progress bar: shows a busy state while a task runs.
- Log box (read-only): streams run info — number of meshes found, vertex / face counts, names of the scalar slots written back, and error summaries for any failed measurement.
6. Step-by-step usage
6.1 Basic workflow (single mesh)
1. Make sure a surface mesh exists in the scene (this plugin does not create meshes).
2. Open Prototype Apps ▸ Compute Vertex Measurements (Mesh)....
3. On first use, click Setup environment and wait until the status reads “Environment: ready” (needs internet, a few minutes).
4. Pick the target mesh in the top Mesh dropdown (click Refresh first if needed).
5. Tick the measurements you want (Mean and Gaussian curvature are ticked by default; use Select all / Select none to adjust quickly).
6. Click Compute. The log box shows the vertex / face counts read and the progress.
7. When finished, a dialog reports how many per-vertex scalar fields were added; switch the mesh's scalar slot / colormap in Dragonfly to view each result (see Chapter 8).
6.2 Deviation from reference mesh (two-mesh comparison)
1. Make sure both the measured mesh and the reference mesh exist in the scene (e.g. a scan vs a nominal CAD model).
2. Select the measured mesh in the Mesh dropdown.
3. Tick Deviation from reference mesh; the reference-mesh area appears below.
4. Pick the reference mesh in the Reference mesh dropdown (it must differ from the measured mesh, or an error is shown).
5. Click Compute. The plugin computes the signed distance from each vertex of the measured mesh to the reference surface and writes it back.
6. Sign convention: inside the reference = positive, outside = negative; the colormap legend is labelled accordingly.
Input requirement: the input must be a triangulated surface mesh. The plugin reads its world-space vertices (V) and triangle connectivity (F). If a mesh has no vertices / faces, reading fails.
7. Parameter reference
The table below lists all 20 measurements with their group, unit, compute backend (library), and internal default parameters. Apart from whether an item is ticked by default, each measurement's internal parameters (ray count, number of eigenvalues, etc.) are preset by the plugin — you do not enter them in the panel.
Measurement | Group | Unit | Backend | Default / parameters |
Mean curvature (H) | Curvature | 1/length | libigl | ticked by default; H=(κ₁+κ₂)/2 |
Gaussian curvature (K) | Curvature | 1/length² | libigl | ticked by default; K=κ₁·κ₂ |
Max principal curvature (κ₁) | Curvature | 1/length | libigl | — |
Min principal curvature (κ₂) | Curvature | 1/length | libigl | — |
Shape index | Curvature | [-1, 1] | libigl | +1 dome / 0 saddle / -1 cup |
Curvedness | Curvature | 1/length | libigl | C=sqrt((κ₁²+κ₂²)/2) |
Max absolute curvature |κ| | Curvature | 1/length | libigl | max(|κ₁|,|κ₂|) |
Local thickness (SDF) | Thickness & distance | length | trimesh | n_rays=5, cone_deg=20.0 |
Geodesic distance | Thickness & distance | length | potpourri3d | source_mode=auto |
Radial distance | Thickness & distance | length | numpy | straight-line distance to centroid |
Deviation from best-fit sphere | Thickness & distance | length | numpy | signed distance to least-squares sphere |
Deviation from best-fit plane | Thickness & distance | length | numpy | signed distance to least-squares plane |
Deviation from reference mesh | Thickness & distance | length | trimesh | needs a 2nd reference mesh; inside = positive |
Ambient occlusion / accessibility | Surface exposure & roughness | [0, 1] | trimesh | n_samples=64, report=accessibility |
Surface roughness (high-pass) | Surface exposure & roughness | length | robust-laplacian | smoothing=1.0 |
Normal variation (deg) | Local geometry & topology | degrees | trimesh | mean angle vs incident faces |
Vertex valence (degree) | Local geometry & topology | count | trimesh | number of edges meeting at the vertex |
Vertex (barycentric) area | Local geometry & topology | length² | trimesh | 1/3 of summed area of surrounding triangles |
Heat Kernel Signature (HKS) | Spectral shape signatures | a.u. | robust-laplacian + scipy | n_eig=80, scale=0.5 |
Wave Kernel Signature (WKS) | Spectral shape signatures | a.u. | robust-laplacian + scipy | n_eig=80, energy=0.5 |
Geodesic source explained
Geodesic distance computes, for each vertex, the shortest distance measured along the mesh surface (not straight-line) to a set of source vertices, using the heat method (potpourri3d). The source is chosen automatically, with no extra picking (source_mode=auto): if the mesh has an open boundary (e.g. a cropped / shell surface), every boundary vertex is a source, giving “distance inward from the edge”; if the mesh is closed (no boundary), the single vertex farthest from the centroid is the source, giving “distance across the object from its most extreme point”.
8. Outputs
Each successful measurement is written back as a new per-vertex scalar field (scalar slot) onto the mesh you selected (the reference mesh is never modified). The slot is named after the measurement (e.g. “Mean curvature (H)”) with the corresponding unit. After writing, the plugin refreshes the mesh display and legend.
How to view the results
1. Read the completion dialog and the log box after computing: the line “Added scalar slots: ...” lists the slots successfully written this run.
2. Select the mesh in Dragonfly and switch the vertex scalar slot to display in its property / display settings.
3. Choose a suitable colormap and value range for that slot to see the measurement rendered as colors on the mesh surface in the 3D view.
4. If you computed several measurements, switch between the scalar slots to inspect each one.
The plugin only appends per-vertex scalar fields to the mesh; it does not create Channels, ROIs, MultiROIs or new mesh objects, and it does not change the mesh geometry. If a measurement fails, the other successful ones are still written back and the failure reason is printed in the log box.
9. FAQ and troubleshooting
Q1: I can't find “Compute Vertex Measurements (Mesh)...” in the menu.
A: This plugin is OFF by default. Confirm you ticked it during install, or open Developer ▸ Prototype Labs... ▸ Menu Item Manager, tick it, and restart Dragonfly. Menus are scanned only at startup, so every enable / disable needs one restart.
Q2: The environment shows “not set up”, or Compute says it can't run.
A: The compute environment hasn't been built yet. Click Setup environment, stay online, and wait a few minutes. When it's done the status reads “Environment: ready”. If setup fails, read the specific error in the log box.
Q3: The 7 Curvature measurements fail while the others work.
A: The Curvature group depends on the optional libigl library. libigl has no prebuilt Windows wheel and must be built from source, so it fails to install on a machine lacking a C++ / CMake toolchain (this best-effort behaviour is by design and never blocks the other measurements). Fix: install a C++ / CMake toolchain, then click Setup environment again. Until then, use the other ~13 measurements.
Q4: I ticked “Deviation from reference mesh” but it won't compute.
A: This measurement needs a second mesh chosen in the Reference mesh dropdown that appears below, and the reference must be different from the measured mesh. If none is selected, or it equals the measured mesh, the plugin shows a message. Make sure the scene has at least two meshes and select them separately.
Q5: Local thickness (SDF) is slow.
A: Local thickness casts rays inward from every vertex, which is slow on very large meshes. Try a smaller / decimated mesh first; to speed up large meshes you can additionally install the optional embreex accelerator in the environment (without it, trimesh falls back to a slower pure-Python ray engine).
Q6: The mesh list is empty.
A: There is no recognizable surface mesh in the current scene. Generate or import a mesh first, then click Refresh on the panel to re-scan the scene.
10. Notes and known limitations
- The input must be an existing triangulated surface mesh; the plugin does not create, import, or modify mesh geometry.
- Results are written back only to the selected mesh, appended as per-vertex scalar slots; the reference mesh is untouched.
- The Curvature group (7 items) and some measurements depend on optional libraries (notably libigl); if an optional library did not install, those measurements report a clear error at compute time while the rest keep working.
- HKS / WKS require an eigen-decomposition of the mesh Laplacian and are heavier than the geometric measures, especially on large meshes.
- Local thickness (SDF) is meaningful mainly on solid / shell-like surfaces; ray casting is slow on large meshes.
- Geodesic distance auto-selects its source depending on whether the mesh is closed (open boundary vs farthest point); the field's meaning differs per mesh — see Chapter 7.
- Building the environment the first time needs internet; installing libigl may require a C++ / CMake build toolchain.
- Verified on Dragonfly 2027.1; computation is CPU-only and needs no GPU.
11. References
- trimesh (MIT): https://github.com/mikedh/trimesh
- libigl (MPL-2.0): https://libigl.github.io/
- potpourri3d (MIT): https://github.com/nmwsharp/potpourri3d
- robust-laplacian (MIT): https://github.com/nmwsharp/robust-laplacians-py
- rtree (MIT) / libspatialindex: https://github.com/Toblerity/rtree
- SciPy: https://scipy.org/ · NumPy: https://numpy.org/
For the algorithmic concepts behind the Koenderink shape index, Heat Kernel Signature (HKS), Wave Kernel Signature (WKS), and Shape Diameter Function (SDF), consult the project documentation above and the relevant computational-geometry / shape-analysis literature.