MianyVue/docs/功能点10-薄壳化与层级多重分析.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

217 lines
6.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 5.2.XX管理模块设计说明
## 5.2.1.XX设计说明。
### 5.2.1.1.模块描述。
本模块对应 `1.3.1【模型分析-具备多重模型分析能力】`,包含两条主能力链路:
1. 薄壳化分析:针对模型外部件(保留外部轮廓)进行轻量化分析与删除建议。
2. 模型层级分析:针对模型层级命名进行层级查询、分析归类,并形成删除/保留策略。
执行机制:
所有分析均通过已连接的 CAD 插件在 CAD 内核内执行,前端负责参数下发、结果展示、交互决策。
说明:你原文中的“横型/横糊化”按业务语义理解为“模型/模糊化”。
### ·5.2.1.2.功能·。
1. 薄壳化分析(已实现核心):
- 调用 `startShellAnalysis` 发起分析。
- 参数含 `preserveExternalSurfaces=true`,聚焦外部件保留。
- 输出分类:`safeDeletions / suggestedDeletions / preserveList`。
- 输出统计:体积减少、文件减小、性能提升估计。
- 支持前端筛选、分页、选择、批量删除联动。
2. 模型层级分析(已实现核心):
- 调用 `startHierarchyAnalysis` 获取层级结构。
- 展示树视图/表格视图。
-`deletion_safety` 分类safe/risky/forbidden
- 支持子层级按需展开加载children API
3. 预估时间:
- 在分析前给出预计耗时(模型规模驱动)。
- 在分析中展示剩余时间动态更新。
4. 分析步骤可视化:
- “准备模型 -> 特征提取 -> 多算法计算 -> 方案融合 -> 结果输出”步骤条。
5. 层级模糊查询与归类:
- 支持按层级名称、路径关键字、类型进行模糊检索与归类视图。
6. 多算法赋权最优方案:
- 对每种算法方案赋权并融合,输出综合最优建议。
### 5.2.1.3.性能。
1. 分析计算在 CAD 插件侧完成,前端负担主要是结果渲染。
2. 层级树采用“按需加载子节点”,避免一次性加载全量层级造成卡顿。
3. 薄壳化结果列表支持分页和前端筛选,保证大结果集可操作性。
4. 步骤可视化采用事件流更新,避免高频全量重绘。
### 5.2.1.4.输入输出项·。
#### 1.字段输入输出。
薄壳化输入(当前):
1. `software_type=creo`
2. `analysisType=surface_shell`
3. `preserveExternalSurfaces=true`
4. `minWallThickness`
5. `confidenceThreshold`
薄壳化输出(当前):
1. `safeDeletions[]`
2. `suggestedDeletions[]`
3. `preserveList[]`
4. `estimatedReduction.{volumeReduction,fileSizeReduction,performanceImprovement}`
5. `analysis_time`
层级分析输入(当前):
1. `software_type=creo`
2. `project_name`
3. `max_depth`
4. `include_geometry`
5. `target_level`
层级分析输出(当前):
1. `hierarchy[]`
2. `deletion_recommendations.{safe_deletions,risky_deletions}`
3. `total_components`
4. `total_levels`
5. 组件字段:`filename/path/type/level/deletion_safety/children_count`
分析输出:
1. `estimated_time_seconds`
2. `progress_steps[]`(步骤状态、百分比、耗时)
3. `algorithm_scores[]`(各算法得分)
4. `fusion_result`(综合权重与最终方案)
#### 2.界面交互输入输出。
输入交互:
1. 用户点击薄壳化分析/层级分析。
2. 用户按分类筛选、分页、选择组件执行删除。
3. 用户切换树/表视图、展开子层级。
4. 输入模糊查询关键字、查看步骤进度。
输出交互:
1. 分析摘要卡片、结果表格、层级树。
2. 删除建议标签(安全/风险/禁止)。
3. 预计耗时展示、步骤可视化、最优方案解释。
### 5.2.1.5.算法
薄壳化算法(当前链路):
1. 插件提取模型外部壳层特征。
2. 对零件进行可删除性判定并给出置信度。
3. 输出三类建议集合(安全删/建议删/保留)。
层级分析算法(当前链路):
1. 解析装配层级结构与命名信息。
2. 对节点做风险判定并打上 `deletion_safety`
3. 生成层级删除建议集合。
多算法赋权融合(目标设计):
1. 并行算法层:
- `A1` 结构依赖算法(装配关系、父子约束)
- `A2` 几何复杂度算法(体积、面数、特征密度)
- `A3` 规则引擎算法(命名规则、类型黑白名单)
2. 归一化:将各算法输出标准化为 `[0,1]` 分值。
3. 赋权:`score = w1*A1 + w2*A2 + w3*A3``w1+w2+w3=1`)。
4. 决策阈值:
- `score >= T_safe` -> 安全删除
- `T_risk <= score < T_safe` -> 建议人工确认
- `< T_risk` -> 保留
5. 输出最优方案:按综合权重排序给出 Top 方案及解释项。
### 5.2.1.6.流程逻辑
1. 用户在模型分析页选择“薄壳化分析”或“层级分析”。
2. 前端校验 CAD 插件连接状态。
3. 调用对应 API 发起分析。
4. 插件执行多重分析并回传结果。
5. 前端展示摘要、列表/树结构、删除建议。
6. 用户可继续删除组件或进入后续优化页。
7. 分析流程:分析前给预估时间,分析中展示步骤,分析后输出融合最优方案。
### ·5.2.1.7.接口。
当前接口:
1. `creoApi.startShellAnalysis()`
2. `creoApi.startHierarchyAnalysis()`
3. `creoApi.getChildrenComponents(componentPath, componentId?)`
4. `creoApi.deleteComponentsByPath(componentPaths, forceDelete?)`
业务接口:
1. `creoApi.getAnalysisEstimate(params)`:返回预估耗时。
2. `creoApi.getAnalysisProgress(taskId)`:返回步骤状态与进度。
3. `creoApi.searchHierarchyFuzzy(query)`:层级模糊查询。
4. `creoApi.getFusionDecision(params)`:返回多算法赋权融合结果。
### 5.2.1.8.注释设计
建议注释策略:
1. 明确“外部件薄壳化”判定依据(外表面保留、内部件识别)。
2. 明确层级 `deletion_safety` 标签语义和来源。
3. 对赋权公式、阈值含义、版本号做注释(便于调参追踪)。
4. 对“预估时间”为估算值而非硬实时承诺做标注。
### 5.2.1.9.数据结构。
薄壳化结果结构(示意):
```
{
"analysis_time": "2026-02-26 10:30:00",
"estimatedReduction": {
"volumeReduction": "35%",
"fileSizeReduction": "42%",
"performanceImprovement": "28%"
},
"safeDeletions": [],
"suggestedDeletions": [],
"preserveList": []
}
```
层级组件结构(示意):
```
{
"filename": "ASM0001.asm",
"path": "top.asm/ASM0001.asm",
"type": "ASM",
"level": 1,
"children_count": 12,
"deletion_safety": "safe"
}
```
赋权融合结构(目标设计):
```
{
"algorithm_scores": {
"structure": 0.82,
"geometry": 0.67,
"rule_engine": 0.74
},
"weights": {
"structure": 0.4,
"geometry": 0.35,
"rule_engine": 0.25
},
"final_score": 0.75,
"decision": "recommended_delete"
}
```