- 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.
3.7 KiB
3.7 KiB
5.2.XX管理模块设计说明
5.2.1.XX设计说明。
5.2.1.1.模块描述。
本模块对应【模型查看-统计】功能开发,聚焦模型查看过程中的结构化统计信息输出,支持:
- 零部件数量统计。
- 模型装配层级展示与层级统计。
模块价值:
- 在查看阶段快速掌握模型规模与复杂度。
- 为后续分析、优化、删除策略提供结构化依据。
·5.2.1.2.功能·。
- 零部件数量统计:
- 统计模型网格数量、节点数量、组件总数。
- 展示顶点数、面数等规模指标。
- 装配层级展示:
- 支持树形结构展示装配层级。
- 支持层级展开/收起、子层级加载。
- 支持层级总数统计与层级分布查看。
- 统计联动展示:
- 统计卡片与层级树同步更新。
- 选中节点时可联动高亮与聚焦查看。
5.2.1.3.性能。
- 统计在模型加载完成后一次性计算,避免重复遍历。
- 层级树支持按需展开,降低大模型初次渲染压力。
- 统计展示与查看渲染解耦,保障交互流畅性。
5.2.1.4.输入输出项·。
1.字段输入输出。
输入字段:
model(当前加载模型对象)mesh集合(用于统计零部件)node集合(用于层级构建)component.path/type/level(用于装配层级展示)
输出字段:
parts_count(零部件数量)vertices_count(顶点总数)faces_count(面总数)meshes_count(网格数)levels_count(装配层级数)hierarchy_tree(层级树数据)
2.界面交互输入输出。
输入交互:
- 打开模型后自动触发统计。
- 点击层级节点展开/收起子层级。
- 点击树节点定位对应模型部件。
输出交互:
- 顶部/底部统计信息面板显示数量指标。
- 侧边层级树展示装配结构。
- 选中状态在树与3D视图中同步反馈。
5.2.1.5.算法
零部件统计算法:
- 遍历模型
mesh集合。 - 累加
VertexCount、TriangleCount、meshCount。 - 输出部件规模统计结果。
层级构建算法:
- 从根节点递归遍历子节点。
- 读取节点名称、深度、子节点关系。
- 生成
hierarchy_tree并标注层级深度。 - 计算
levels_count与每层组件数量。
5.2.1.6.流程逻辑
- 用户打开模型进入查看页。
- 系统加载模型并触发统计计算。
- 页面展示零部件统计卡片与层级树。
- 用户通过层级树浏览装配结构并联动查看。
- 统计结果可用于后续分析与执行模块。
·5.2.1.7.接口。
查看统计接口:
onModelLoaded():模型加载后触发统计。buildModelTree(model):构建装配层级树。EnumerateMeshes(callback):遍历网格并统计数量。toggleNode(component, index):层级节点展开/收起。
数据输出接口:
modelInfo:输出文件名、顶点数、面数、网格数。analysisResults:输出层级统计信息(总组件、总层级)。
5.2.1.8.注释设计
- 统计口径注释:明确“零部件数/网格数/组件数”的定义差异。
- 层级注释:明确
level与装配深度的映射关系。 - 联动注释:明确树节点与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": []
}
]
}