2026-3-30Bug修复
This commit is contained in:
@@ -10,11 +10,6 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
// ReSharper disable SuggestVarOrType_SimpleTypes
|
||||
// ReSharper disable SuggestVarOrType_BuiltInTypes
|
||||
// ReSharper disable SuggestVarOrType_Elsewhere
|
||||
// ReSharper disable InvertIf
|
||||
|
||||
namespace CPSO.Forms._92_Knowledge
|
||||
{
|
||||
public partial class FrmStepsManager : UserControls.FrmProperties
|
||||
@@ -74,40 +69,42 @@ namespace CPSO.Forms._92_Knowledge
|
||||
|
||||
Self.Form.SetStateWorking(@"构建切削力分析模型...");
|
||||
|
||||
// 先把所有计算步反激活
|
||||
// 1. 先把所有计算步反激活
|
||||
var stepList = Self.GetAllSteps().ToList();
|
||||
stepList.ForEach(x =>
|
||||
{
|
||||
Self.ActivateDeactivateStep(x.Name, false);
|
||||
});
|
||||
|
||||
// 2. 加载网格
|
||||
var mesh = LoadMesh(surface);
|
||||
|
||||
List<ProcessingJob> jobs = new List<ProcessingJob>();
|
||||
|
||||
await Task.Run(() =>
|
||||
{
|
||||
// 加载网格
|
||||
var mesh = LoadMesh(surface);
|
||||
|
||||
foreach (var tp in Self.ToolPositions)
|
||||
{
|
||||
// 1. 计算最接近的顶点
|
||||
int vertId = GetClosedVertex(mesh, tp.Base); // PlanktonMesh中存储的Id
|
||||
|
||||
if (vertId < 0)
|
||||
if (vertId < 0) // 找不到最近节点,继续执行
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// 2. 最接近节点
|
||||
int nodeId = _vertexToNodeMapping[vertId]; // 全局网格中的Id
|
||||
FeNode node = Self.Model.Mesh.Nodes[nodeId];
|
||||
// int nodeId = _vertexToNodeMapping[vertId]; // 全局网格中的Id
|
||||
FeNode node = Self.Model.Mesh.Nodes[_vertexToNodeMapping[vertId]];
|
||||
|
||||
// 3. 最近节点周围的面单元
|
||||
List<FeFace> faces = new List<FeFace>();
|
||||
foreach (var f in mesh.Vertices.GetVertexFaces(vertId))
|
||||
{
|
||||
if (_cellToFaceMapping.TryGetValue(f, out var face))
|
||||
{
|
||||
faces.Add(face);
|
||||
}
|
||||
}
|
||||
|
||||
// 4. 复制一份基础计算步并激活
|
||||
@@ -154,7 +151,7 @@ namespace CPSO.Forms._92_Knowledge
|
||||
// 5.3 添加载荷
|
||||
Self.AddLoad(newStep.Name, stLoad);
|
||||
|
||||
// 5.4 添加到 List<ProcessingJob> jobs
|
||||
// 6. 添加到 List<ProcessingJob> jobs
|
||||
jobs.Add(new ProcessingJob(tp.Base)
|
||||
{
|
||||
StepName = newStep.Name,
|
||||
@@ -175,6 +172,7 @@ namespace CPSO.Forms._92_Knowledge
|
||||
catch (Exception ex)
|
||||
{
|
||||
ExceptionTools.Show(ex);
|
||||
Self.Form.SetStateReady(@"构建切削力分析模型...");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user