public XSecModelParams() { Material = new Material(); RemovalRate = new RemovalRate(); CurvatureEffect = new CurvatureEffect(); DepthInfo = new DepthInfo(); }
double GetNewMrr(double baseMrr, DepthInfo depthInfo) { depthInfo.CurrentDepth = GetInspectionDepth(); double mrrAdjustFactor = Math.Abs(depthInfo.TargetDepth / depthInfo.CurrentDepth); double newMrr = baseMrr * mrrAdjustFactor; return(newMrr); }
internal AbMachParameters(AbMachOperation op, RunInfo runInfo, RemovalRate removalRate, Material mat, AbMachJet abmachJet, DepthInfo depthInfo, double meshSize) { Operation = op; RunInfo = runInfo; RemovalRate = removalRate; Material = mat; AbMachJet = abmachJet; DepthInfo = depthInfo; _meshSize = meshSize; }
internal AbMachParameters() { _meshSize = .005; AbMachJet = new AbMachJet(); RunInfo = new RunInfo(); RemovalRate = new RemovalRate(); Material = new Material(); Operation = AbMachOperation.OTHER; DepthInfo = new DepthInfo(); }
public DepthInfo(DepthInfo info) { LocationOfDepthMeasure = info.LocationOfDepthMeasure; SearchRadius = info.SearchRadius; StartDepth = info.StartDepth; TargetDepth = info.TargetDepth; DepthTolerance = info.DepthTolerance; CurrentDepth = info.CurrentDepth; SearchType = info.SearchType; ConstTargetDepth = info.ConstTargetDepth; }
DepthInfo GetNewDepthInfo(DepthInfo oldDepthInfo) { var depthInfo = new DepthInfo(); double inspectionLoc = oldDepthInfo.LocationOfDepthMeasure.X; depthInfo.StartDepth = startProf.GetValue(inspectionLoc); depthInfo.TargetDepth = targetProf.GetValue(inspectionLoc); depthInfo.CurrentDepth = profile.GetValue(inspectionLoc); return(depthInfo); }
public static AbMachParameters Build() { double meshSize = .001; AbMachOperation op = AbMachOperation.OTHER; RunInfo runInfo = new RunInfo(); RemovalRate removalRate = new RemovalRate(); Material mat = new Material(); AbMachJet abmachJet = new AbMachJet(); DepthInfo depthInfo = new DepthInfo(); return(new AbMachParameters(op, runInfo, removalRate, mat, abmachJet, depthInfo, meshSize)); }
public AbmachSimModel3D(ISurface <AbmachPoint> initialSurface, ISurface <AbmachPoint> targetSurface, ModelPath path, AbMachParameters parms) { surface = initialSurface; this.targetSurface = targetSurface; this.initialSurface = initialSurface.Clone(); this.path = path; abmachParams = parms; runInfo = parms.RunInfo; jetRadius = abmachParams.AbMachJet.Diameter / 2.0; currentRemovalRate = parms.RemovalRate; depthInfo = abmachParams.DepthInfo; }
double getDepth(ModelPathEntity mpe, DepthInfo depthInfo) { switch (depthInfo.SearchType) { case DepthSearchType.FindMaxDepth: return(getMaxDepth(mpe, depthInfo.SearchRadius)); case DepthSearchType.FindMinDepth: return(getMinDepth(mpe, depthInfo.SearchRadius)); case DepthSearchType.FindAveDepth: default: return(getAveDepth(mpe, depthInfo.SearchRadius)); } }
double getDepth(DepthInfo depthInfo) { try { double depth = 0; if (depthInfo.SearchType == DepthSearchType.FindAveDepth) { depth = averageDepth(depthInfo.LocationOfDepthMeasure.X, depthInfo.LocationOfDepthMeasure.Y, depthInfo.SearchRadius); } return(depth); } catch (Exception) { throw; } }
private ModelPath newFeedrates(ModelPath path, DepthInfo depthInfo) { ModelPath newPath = new ModelPath(); foreach (ModelPathEntity mpe in path) { ModelPathEntity mpNew = mpe.Clone(); mpe.Depth = getDepth(mpe, depthInfo); if (mpe.Depth != 0) { mpNew.Feedrate.Value = mpe.Feedrate.Value * (mpe.Depth / mpe.TargetDepth); mpNew.Depth = mpe.Depth; } newPath.Add(mpNew); } savePath(path, "oldfeedrates"); savePath(newPath, "newFeedrates"); return(newPath); }
public void Run(CancellationToken ct, IProgress <int> progress, int innerIterations, int outerIterations) { try { var meshSize = parameters.MeshSize; var gridOrigin = profile.Origin; var gridWidth = profile.Width; var jetArr = new XSecJetPath(jet, path, parameters.MeshSize, parameters.RemovalRate.NominalSurfaceSpeed); var baseMrr = parameters.RemovalRate.DepthPerPass; var mrr = baseMrr; var averagingWindow = parameters.SmoothingWindowWidth; var critAngle = parameters.Material.CriticalRemovalAngle; int outerIterator = 0; int innerIterator = 0; totalModelRuns = outerIterations * innerIterations * parameters.RunTotal; currentModelRun = 0; var depthInfo = new DepthInfo(parameters.DepthInfo); while (outerIterator < outerIterations) { mrr = baseMrr; innerIterator = 0; while (innerIterator < innerIterations) { RunPath(ct, progress, jetArr, gridOrigin, gridWidth, averagingWindow, mrr, critAngle); depthInfo = GetNewDepthInfo(depthInfo); mrr = GetNewMrr(mrr, depthInfo); } } } catch { throw; } }
public static AbMachParameters Build(AbMachOperation op, RunInfo runInfo, RemovalRate removalRate, Material mat, AbMachJet abmachJet, DepthInfo depthInfo, double meshSize) { return(new AbMachParameters(op, runInfo, removalRate, mat, abmachJet, depthInfo, meshSize)); }
private RemovalRate newRemovalRate(ModelPath path, RunInfo runInfo, RemovalRate oldRemovalRate, DepthInfo depthInfo) { var newRemovalRate = new RemovalRate(); ModelPathEntity mpeDepth = nearestPathEntity(path, depthInfo.LocationOfDepthMeasure); double currentDepth = getDepth(mpeDepth, depthInfo); double currentDepthPerRun = currentDepth / runInfo.CurrentRun; double currentTargetDepthPerRun = depthInfo.TargetDepth / runInfo.CurrentRun; depthInfo.CurrentDepth = currentDepth; if (currentDepth != 0) { double newMrr = oldRemovalRate.DepthPerPass * (currentTargetDepthPerRun / currentDepthPerRun); return(newRemovalRate); } else { return(oldRemovalRate); } }