58 lines
2.0 KiB
C#
58 lines
2.0 KiB
C#
using CaeKnowledge.Data;
|
||
using System.Collections.Generic;
|
||
using ToolPathParser;
|
||
|
||
using FlatendCalc = CaeCuttingForce.FlatendCutter.ClassicalCuttingForceCalculate;
|
||
using ToroidalCalc = CaeCuttingForce.ToroidalCutter.ClassicalCuttingForceCalculate;
|
||
|
||
namespace CaeCuttingForce
|
||
{
|
||
public class CuttingForceTools
|
||
{
|
||
public List<ToolPosition> ToolPositionProcessor(string inputFile,
|
||
int totalPointsPerLayer = 50,
|
||
double radialDepth = 1.0,
|
||
double zOrigin = 0.0)
|
||
{
|
||
var list = ToolPathProcessor.ProcessToolPath(inputFile, totalPointsPerLayer, radialDepth, zOrigin);
|
||
|
||
return list;
|
||
}
|
||
|
||
public void Calculate(Cutter cutter, CuttingParameter para, List<ToolPosition> toolPositions)
|
||
{
|
||
// 1. 刀具参数
|
||
var toolParams = new ToolParameters
|
||
{
|
||
NumberOfTeeth = cutter.Flute,
|
||
ToolRadius = cutter.Diameter / 2.0,
|
||
HelixAngle = cutter.HelixAngle,
|
||
|
||
// 由西工大权琳雅添加
|
||
ArcRadius = cutter.ArcRadius // 环形刀的圆弧半径参数
|
||
};
|
||
|
||
// 2. 切削系数
|
||
var coefficients = new CuttingForceCoefficients
|
||
{
|
||
kte = para.TangentialForceCoefficient,
|
||
kre = para.RadialForceCoefficient,
|
||
kue = para.AxialForceCoefficient,
|
||
ktc = para.TangentialForceConstant,
|
||
krc = para.RadialForceConstant,
|
||
kuc = para.AxialForceConstant
|
||
};
|
||
|
||
// 3. 平底刀计算
|
||
// 底层代码由西工大权琳雅维护
|
||
if(toolParams.ArcRadius > 0 ) // 圆弧半径>0,采用环形刀代码计算
|
||
{
|
||
ToroidalCalc.AxialDepthGroupedForceCalculator(toolPositions, coefficients, toolParams);
|
||
}
|
||
else // 采用平底刀代码计算
|
||
{
|
||
FlatendCalc.AxialDepthGroupedForceCalculator(toolPositions, coefficients, toolParams);
|
||
}
|
||
}
|
||
}
|
||
} |