MianyVue/docs/功能点5-模型查看统计.md
sladro 863d717638 feat: Add management module design documentation for model viewing, analysis, and batch processing
- Implemented detailed design documents for model viewing and 3D interaction, including features like model loading, basic interactions, and performance metrics.
- Added documentation for model statistics, focusing on structured output during the viewing process, including part counts and assembly hierarchy.
- Developed design notes for multi-visualization of model analysis results, covering classification statistics, feature analysis, and report export capabilities.
- Introduced batch processing functionality documentation, detailing task creation, scheduling, and historical tracking.
- Created logs generation documentation for operation execution, emphasizing traceability and auditability of actions taken.
- Compiled a list of undeveloped features based on current project progress, outlining requirements and technical specifications for future implementation.
2026-02-26 18:03:13 +08:00

3.7 KiB
Raw Permalink Blame History

5.2.XX管理模块设计说明

5.2.1.XX设计说明。

5.2.1.1.模块描述。

本模块对应【模型查看-统计】功能开发,聚焦模型查看过程中的结构化统计信息输出,支持:

  1. 零部件数量统计。
  2. 模型装配层级展示与层级统计。

模块价值:

  1. 在查看阶段快速掌握模型规模与复杂度。
  2. 为后续分析、优化、删除策略提供结构化依据。

·5.2.1.2.功能·。

  1. 零部件数量统计:
    • 统计模型网格数量、节点数量、组件总数。
    • 展示顶点数、面数等规模指标。
  2. 装配层级展示:
    • 支持树形结构展示装配层级。
    • 支持层级展开/收起、子层级加载。
    • 支持层级总数统计与层级分布查看。
  3. 统计联动展示:
    • 统计卡片与层级树同步更新。
    • 选中节点时可联动高亮与聚焦查看。

5.2.1.3.性能。

  1. 统计在模型加载完成后一次性计算,避免重复遍历。
  2. 层级树支持按需展开,降低大模型初次渲染压力。
  3. 统计展示与查看渲染解耦,保障交互流畅性。

5.2.1.4.输入输出项·。

1.字段输入输出。

输入字段:

  1. model(当前加载模型对象)
  2. mesh 集合(用于统计零部件)
  3. node 集合(用于层级构建)
  4. component.path/type/level(用于装配层级展示)

输出字段:

  1. parts_count(零部件数量)
  2. vertices_count(顶点总数)
  3. faces_count(面总数)
  4. meshes_count(网格数)
  5. levels_count(装配层级数)
  6. hierarchy_tree(层级树数据)

2.界面交互输入输出。

输入交互:

  1. 打开模型后自动触发统计。
  2. 点击层级节点展开/收起子层级。
  3. 点击树节点定位对应模型部件。

输出交互:

  1. 顶部/底部统计信息面板显示数量指标。
  2. 侧边层级树展示装配结构。
  3. 选中状态在树与3D视图中同步反馈。

5.2.1.5.算法

零部件统计算法:

  1. 遍历模型 mesh 集合。
  2. 累加 VertexCountTriangleCountmeshCount
  3. 输出部件规模统计结果。

层级构建算法:

  1. 从根节点递归遍历子节点。
  2. 读取节点名称、深度、子节点关系。
  3. 生成 hierarchy_tree 并标注层级深度。
  4. 计算 levels_count 与每层组件数量。

5.2.1.6.流程逻辑

  1. 用户打开模型进入查看页。
  2. 系统加载模型并触发统计计算。
  3. 页面展示零部件统计卡片与层级树。
  4. 用户通过层级树浏览装配结构并联动查看。
  5. 统计结果可用于后续分析与执行模块。

·5.2.1.7.接口。

查看统计接口:

  1. onModelLoaded():模型加载后触发统计。
  2. buildModelTree(model):构建装配层级树。
  3. EnumerateMeshes(callback):遍历网格并统计数量。
  4. toggleNode(component, index):层级节点展开/收起。

数据输出接口:

  1. modelInfo:输出文件名、顶点数、面数、网格数。
  2. analysisResults:输出层级统计信息(总组件、总层级)。

5.2.1.8.注释设计

  1. 统计口径注释:明确“零部件数/网格数/组件数”的定义差异。
  2. 层级注释:明确 level 与装配深度的映射关系。
  3. 联动注释明确树节点与3D对象 ID 绑定关系。

5.2.1.9.数据结构。

模型统计结构(示意):

{
  "fileName": "sample.asm",
  "parts_count": 128,
  "vertices_count": 356000,
  "faces_count": 712000,
  "meshes_count": 128
}

层级树结构(示意):

{
  "name": "RootAssembly",
  "type": "node",
  "level": 0,
  "children": [
    {
      "name": "SubAssembly_A",
      "type": "node",
      "level": 1,
      "children": []
    }
  ]
}