Hide menu
Loading...
Searching...
No Matches
machining/dfm_analyzer/Program.cs

Refer to the CNC Machining DFM Analyzer Example

feature_group.cs

// ****************************************************************************
// $Id$
//
// Copyright (C) 2008-2014, Roman Lygin. All rights reserved.
// Copyright (C) 2014-2025, CADEX. All rights reserved.
//
// This file is part of the Manufacturing Toolkit software.
//
// You may use this file under the terms of the BSD license as follows:
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// ****************************************************************************
using cadex;
using System;
using System.Collections.Generic;
using FeatureMapType = System.Collections.Generic.SortedDictionary<cadex.MTKBase_Feature, uint>;
namespace feature_group
{
class FeatureComparer : IComparer<MTKBase_Feature>
{
public int Compare(MTKBase_Feature theA, MTKBase_Feature theB)
{
bool anALessThanB = aComparator.Apply(theA, theB);
if (anALessThanB)
{
return -1;
}
bool aBLessThanA = aComparator.Apply(theB, theA);
if (aBLessThanA)
{
return 1;
}
return 0;
}
}
public struct Pair
{
public Pair(double theFirst, double theSecond)
{
First = theFirst;
Second = theSecond;
}
public double First { get; }
public double Second { get; }
public override string ToString() => $"{First} x {Second}";
}
public struct Dimension
{
public Dimension(double theL, double theW, double theD)
{
L = theL;
W = theW;
D = theD;
}
public double L { get; }
public double W { get; }
public double D { get; }
public override string ToString() => $"{L} x {W} x {D}";
}
public struct Direction
{
public Direction(double theX, double theY, double theZ)
{
X = theX;
Y = theY;
Z = theZ;
}
public double X { get; }
public double Y { get; }
public double Z { get; }
public override string ToString() => $"({FormattedString(X)}, {FormattedString(Y)}, {FormattedString(Z)})";
private string FormattedString(double theValue)
{
System.Globalization.CultureInfo aCI = new System.Globalization.CultureInfo("en-US");
return string.Format(aCI, "{0:0.00}", theValue);
}
}
class FeatureGroupManager
{
public FeatureGroupManager()
{
myGroups = new List<FeatureGroup>();
}
private class FeatureGroup
{
public FeatureGroup(string theName, string theSubgroupName, bool theHasParameters)
{
myName = theName;
mySubgroupName = theSubgroupName;
myHasParameters = theHasParameters;
myFeatureSubgroups = new FeatureMapType(new FeatureComparer());
}
public uint FeatureCount()
{
uint aCount = 0;
foreach (var i in myFeatureSubgroups)
{
aCount += i.Value;
}
return aCount;
}
public string myName;
public string mySubgroupName;
public bool myHasParameters;
public FeatureMapType myFeatureSubgroups;
}
private class FeatureGroupComparer : IComparer<FeatureGroup>
{
public int Compare(FeatureGroup theA, FeatureGroup theB)
{
string anAName = theA.myName;
string aBName = theB.myName;
if (anAName == aBName)
{
return 0;
}
FeatureMapType anAFeatureSubgroups = theA.myFeatureSubgroups;
FeatureMapType aBFeatureSubgroups = theB.myFeatureSubgroups;
if (anAFeatureSubgroups.Count == 0 || aBFeatureSubgroups.Count == 0)
{
return anAName.CompareTo(aBName);
}
MTKBase_Feature anAFeature = new MTKBase_Feature();
MTKBase_Feature aBFeature = new MTKBase_Feature();
foreach (var i in anAFeatureSubgroups)
{
anAFeature = i.Key;
break;
}
foreach (var i in aBFeatureSubgroups)
{
aBFeature = i.Key;
break;
}
FeatureComparer aFeatureComparator = new FeatureComparer();
return aFeatureComparator.Compare(anAFeature, aBFeature);
}
}
private List<FeatureGroup> myGroups;
public void AddFeature(string theGroupName, string theSubgroupName, bool theHasParameters, MTKBase_Feature theFeature)
{
//find or create
int aRes = myGroups.FindIndex(theGroup => theGroup.myName == theGroupName);
if (aRes == -1)
{
myGroups.Add(new FeatureGroup(theGroupName, theSubgroupName, theHasParameters));
aRes = myGroups.Count - 1;
}
//update
FeatureGroup aGroup = myGroups[aRes];
FeatureMapType aSubgroups = aGroup.myFeatureSubgroups;
if (aSubgroups.ContainsKey(theFeature))
{
++aSubgroups[theFeature];
}
else
{
aSubgroups[theFeature] = 1;
}
}
public void Print(string theFeatureType, Action<MTKBase_Feature> thePrintFeatureParameters)
{
myGroups.Sort(new FeatureGroupComparer());
uint aTotalCount = 0;
foreach (var i in myGroups)
{
uint aFeatureCount = i.FeatureCount();
aTotalCount += aFeatureCount;
Console.WriteLine($" {i.myName}: {aFeatureCount}");
if (!i.myHasParameters)
{
continue;
}
string aSubgroupName = i.mySubgroupName;
foreach (var j in i.myFeatureSubgroups)
{
Console.WriteLine($" {j.Value} {aSubgroupName} with");
thePrintFeatureParameters(j.Key);
}
}
Console.WriteLine($"\n Total {theFeatureType}: {aTotalCount}\n");
}
public static void PrintFeatureParameter<T>(string theName, T theValue, string theUnits)
{
Console.WriteLine($" {theName}: {theValue} {theUnits}");
}
}
}
Provides possibility to compare MTK based features depending on their type and parameters.
Definition MTKBase_FeatureComparator.cs:21
Describes a base class of MTK based features.
Definition MTKBase_Feature.cs:21
Definition ArrayDouble2.cs:12
Contains classes, namespaces, enums, types, and global functions related to Manufacturing Toolkit.
Definition BaseObject.cs:12

shape_processor.cs

// ****************************************************************************
// $Id$
//
// Copyright (C) 2008-2014, Roman Lygin. All rights reserved.
// Copyright (C) 2014-2025, CADEX. All rights reserved.
//
// This file is part of the Manufacturing Toolkit software.
//
// You may use this file under the terms of the BSD license as follows:
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// ****************************************************************************
using System;
using cadex;
namespace shape_processor
{
abstract class ShapeProcessor : ModelElementVoidVisitor
{
public override void Apply(Part thePart)
{
var aPartName = thePart.Name().IsEmpty() ? new UTF16String("noname") : thePart.Name();
var aBodyVec = thePart.Bodies();
if (aBodyVec.Count != 0)
{
// Looking for a suitable body
for (int i = 0; i < aBodyVec.Count; ++i)
{
Body aBody = aBodyVec[i];
var aShapeIt = new ShapeIterator(aBody);
foreach (var aShape in aShapeIt)
{
if (aShape.Type() == ShapeType.Solid)
{
Console.Write($"Part #{myPartIndex} [\"{aPartName}\"] - solid #{i} has:\n");
ProcessSolid(Solid.Cast(aShape));
}
else if (aShape.Type() == ShapeType.Shell)
{
Console.Write($"Part #{myPartIndex} [\"{aPartName}\"] - shell #{i} has:\n");
ProcessShell(Shell.Cast(aShape));
}
}
++myPartIndex;
}
}
}
public abstract void ProcessSolid(Solid theSolid);
public abstract void ProcessShell(Shell theShell);
private uint myPartIndex = 0;
}
abstract class SolidProcessor : ModelElementVoidVisitor
{
public override void Apply(Part thePart)
{
var aPartName = thePart.Name().IsEmpty() ? new UTF16String("noname") : thePart.Name();
var aBodyVec = thePart.Bodies();
if (aBodyVec.Count != 0)
{
// Looking for a suitable body
for (int i = 0; i < aBodyVec.Count; ++i)
{
Body aBody = aBodyVec[i];
var aShapeIt = new ShapeIterator(aBody);
foreach (var aShape in aShapeIt)
{
if (aShape.Type() == ShapeType.Solid)
{
Console.Write($"Part #{myPartIndex} [\"{aPartName}\"] - solid #{i} has:\n");
ProcessSolid(Solid.Cast(aShape));
}
}
++myPartIndex;
}
}
}
public abstract void ProcessSolid(Solid theSolid);
private uint myPartIndex = 0;
}
}
Provides a base body class.
Definition Body.cs:19
cadex.UTF16String Name()
Returns a name.
Definition ModelElement.cs:67
Element visitor with empty implementation.
Definition ModelElementVoidVisitor.cs:20
Defines a leaf node in the scene graph hierarchy.
Definition Part.cs:23
Iterates over subshapes in a shape.
Definition ShapeIterator.cs:58
Defines a connected set of faces.
Definition Shell.cs:29
Defines a topological solid.
Definition Solid.cs:25
Defines a Unicode (UTF-16) string wrapping a standard string.
Definition UTF16String.cs:17
bool IsEmpty()
Returns true if the string is empty.
Definition UTF16String.cs:96
Defines classes, types, enums, and functions related to topological entities and scene graph elements...
Definition AngleUnit.cs:12
ShapeType
Defines shape type.
Definition ShapeType.cs:17

Program.cs

// ****************************************************************************
// $Id$
//
// Copyright (C) 2008-2014, Roman Lygin. All rights reserved.
// Copyright (C) 2014-2025, CADEX. All rights reserved.
//
// This file is part of the Manufacturing Toolkit software.
//
// You may use this file under the terms of the BSD license as follows:
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// ****************************************************************************
using cadex;
using feature_group;
using shape_processor;
using System;
using System.Collections.Generic;
namespace dfm_analyzer
{
class Program
{
static int Main(string[] args)
{
string aKey = MTKLicenseKey.Value();
// Activate the license (the key should be defined in mtk_license.cs)
if (!LicenseManager.Activate(aKey))
{
Console.WriteLine("Failed to activate Manufacturing Toolkit license.");
return 1;
}
if (args.Length != 2)
{
Console.WriteLine("Usage: " +
$"{System.Reflection.Assembly.GetExecutingAssembly().Location} <input_file> <operation>, where:");
Console.WriteLine($" <input_file> is a name of the file to be read");
Console.WriteLine($" <operation> is a name of desired machining operation");
Console.WriteLine($"");
PrintSupportedOperations();
return 1;
}
string aSource = args[0];
var aModel = new Model();
var aReader = new ModelReader();
// Reading the file
if (!aReader.Read(new UTF16String(aSource), aModel))
{
Console.WriteLine($"Failed to read the file {aSource}");
return 1;
}
Console.WriteLine($"Model: {aModel.Name()}\n");
string anOperationStr = args[1];
Machining_OperationType anOperation = OperationType(anOperationStr);
if (anOperation == Machining_OperationType.Machining_OT_Undefined)
{
Console.WriteLine($"Unsupported operation - {anOperationStr}");
Console.WriteLine($"Please use one of the following.");
PrintSupportedOperations();
return 1;
}
var aPartProcessor = new PartProcessor(anOperation);
var aVisitor = new ModelElementUniqueVisitor(aPartProcessor);
aModel.Accept(aVisitor);
return 0;
}
class PartProcessor : SolidProcessor
{
public PartProcessor(Machining_OperationType theOperation)
{
myOperation = theOperation;
}
public override void ProcessSolid(Solid theSolid)
{
// Find features
var aData = new Machining_Data();
aParam.SetOperation(myOperation);
var aRecognizer = new Machining_FeatureRecognizer(aParam);
aRecognizer.Perform(theSolid, aData);
// Run drilling analyzer for found features
var aDrillingParameters = new DFMMachining_DrillingAnalyzerParameters();
var aDrillingAnalyzer = new DFMMachining_Analyzer(aDrillingParameters);
var anIssueList = aDrillingAnalyzer.Perform(theSolid, aData);
// Run milling analyzer for found features
var aMillingParameters = new DFMMachining_MillingAnalyzerParameters();
var aMillingAnalyzer = new DFMMachining_Analyzer(aMillingParameters);
var aMillingIssueList = aMillingAnalyzer.Perform(theSolid, aData);
// Combine issue lists
CombineFeatureLists(anIssueList, aMillingIssueList);
var aTurningIssueList = new MTKBase_FeatureList();
if (myOperation == Machining_OperationType.Machining_OT_LatheMilling)
{
// Run turning analyzer for found features
var aTurninigParameters = new DFMMachining_TurningAnalyzerParameters();
var aTurningAnalyzer = new DFMMachining_Analyzer(aTurninigParameters);
aTurningIssueList = aTurningAnalyzer.Perform(theSolid, aData);
// Combine issue lists
CombineFeatureLists(anIssueList, aTurningIssueList);
}
PrintIssues(anIssueList);
}
private void CombineFeatureLists(MTKBase_FeatureList theFirst, MTKBase_FeatureList theSecond)
{
for (uint i = 0; i < theSecond.Size(); ++i)
{
MTKBase_Feature aFeature = theSecond.Feature(i);
if (myOperation == Machining_OperationType.Machining_OT_LatheMilling
{
continue;
}
theFirst.Append(aFeature);
}
}
private Machining_OperationType myOperation = Machining_OperationType.Machining_OT_Undefined;
}
static void PrintSupportedOperations()
{
Console.WriteLine($"Supported operations:");
Console.WriteLine($" milling:\t CNC Machining Milling feature recognition");
Console.WriteLine($" turning:\t CNC Machining Lathe+Milling feature recognition");
}
static Machining_OperationType OperationType(string theOperationStr)
{
var aProcessDictionary = new Dictionary<string, Machining_OperationType>()
{
{ "milling", Machining_OperationType.Machining_OT_Milling},
{ "turning", Machining_OperationType.Machining_OT_LatheMilling}
};
Machining_OperationType aProcess = Machining_OperationType.Machining_OT_Undefined;
bool aRes = aProcessDictionary.TryGetValue(theOperationStr, out aProcess);
if (aRes)
{
return aProcess;
}
return Machining_OperationType.Machining_OT_Undefined;
}
static void PrintIssues(MTKBase_FeatureList theIssueList)
{
FeatureGroupManager aManager = new FeatureGroupManager();
//group by parameters to provide more compact information about issues
for (uint i = 0; i < theIssueList.Size(); ++i)
{
MTKBase_Feature anIssue = theIssueList.Feature(i);
//drilling
{
aManager.AddFeature("Small Diameter Hole Issue(s)", "Hole(s)", true, anIssue);
}
{
aManager.AddFeature("Deep Hole Issue(s)", "Hole(s)", true, anIssue);
}
{
aManager.AddFeature("Non Standard Diameter Hole Issue(s)", "Hole(s)", true, anIssue);
}
{
aManager.AddFeature("Non Standard Drill Point Angle Blind Hole Issue(s)", "Hole(s)", true, anIssue);
}
{
aManager.AddFeature("Flat Bottom Hole Issue(s)", "", false, anIssue);
}
{
aManager.AddFeature("Non Perpendicular Hole Issue(s)", "", false, anIssue);
}
{
aManager.AddFeature("Intersecting Cavity Hole Issue(s)", "", false, anIssue);
}
{
aManager.AddFeature("Partial Hole Issue(s)", "Hole(s)", true, anIssue);
}
//milling
{
aManager.AddFeature("Non Standard Radius Milled Part Floor Fillet Issue(s)", "Floor Fillet(s)", true, anIssue);
}
{
aManager.AddFeature("Deep Pocket Issue(s)", "Pocket(s)", true, anIssue);
}
{
aManager.AddFeature("High Boss Issue(s)", "Boss(es)", true, anIssue);
}
{
aManager.AddFeature("Large Milled Part Issue(s)", "Part(s)", true, anIssue);
}
{
aManager.AddFeature("Small Radius Milled Part Internal Corner Issue(s)", "Internal Corner(s)", true, anIssue);
}
{
aManager.AddFeature("Non Perpendicular Milled Part Shape Issue(s)", "Shape(s)", true, anIssue);
}
{
aManager.AddFeature("Milled Part External Edge Fillet Issue(s)", "", false, anIssue);
}
{
aManager.AddFeature("Inconsistent Radius Milled Part Floor Fillet Issue(s)", "Floor Fillet(s)", true, anIssue);
}
{
aManager.AddFeature("Narrow Region In Pocket Issue(s)", "Region(s)", true, anIssue);
}
{
aManager.AddFeature("Large Difference Regions Size In Pocket Issue(s)", "Region Size(s)", true, anIssue);
}
{
aManager.AddFeature("Small Wall Thickness Issue(s)", "Wall(s)", true, anIssue);
}
{
aManager.AddFeature("Small Distance Between Threaded Hole And Edge Issue(s)", "Threaded Hole(s)", true, anIssue);
}
{
aManager.AddFeature("Undercut Issue(s)", "", false, anIssue);
}
//turning
{
aManager.AddFeature("Irregular Turned Part Outer Diameter Profile Relief Issue(s)", "Outer Diameter Profile Relief(s)", true, anIssue);
}
{
aManager.AddFeature("Small Radius Turned Part Internal Corner Issue(s)", "Internal Corner(s)", true, anIssue);
}
{
aManager.AddFeature("Large Turned Part Issue(s)", "Part(s)", true, anIssue);
}
{
aManager.AddFeature("Long Slender Turned Part Issue(s)", "Part(s)", true, anIssue);
}
{
aManager.AddFeature("Small Depth Blind Bored Hole Relief Issue(s)", "Blind Bored Hole(s)", true, anIssue);
}
{
aManager.AddFeature("Deep Bored Hole Issue(s)", "Bored Hole(s)", true, anIssue);
}
{
aManager.AddFeature("Square End Keyway Issue(s)", "", false, anIssue);
}
{
aManager.AddFeature("Non Symmetrical Axial Slot Issue(s)", "", false, anIssue);
}
}
//print
Action<MTKBase_Feature> PrintFeatureParameters = theIssue =>
{
//drilling
{
FeatureGroupManager.PrintFeatureParameter("expected min diameter", aSDHIssue.ExpectedMinDiameter(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual diameter", aSDHIssue.ActualDiameter(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter("expected max depth", aDHIssue.ExpectedMaxDepth(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual depth", aDHIssue.ActualDepth(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter("nearest standard diameter", aNSDHIssue.NearestStandardDiameter(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual diameter", aNSDHIssue.ActualDiameter(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter("nearest standard angle", ToDegrees(aNSDPABHIssue.NearestStandardAngle()), "deg");
FeatureGroupManager.PrintFeatureParameter("actual angle", ToDegrees(aNSDPABHIssue.ActualAngle()), "deg");
}
{
//no parameters
}
{
//no parameters
}
{
//no parameters
}
{
FeatureGroupManager.PrintFeatureParameter("expected min material percent", aPHIssue.ExpectedMinMaterialPercent(), "");
FeatureGroupManager.PrintFeatureParameter("actual material percent", aPHIssue.ActualMaterialPercent(), "");
}
//milling
{
FeatureGroupManager.PrintFeatureParameter("nearest standard radius", aNSRMPFFIssue.NearestStandardRadius(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual radius", aNSRMPFFIssue.ActualRadius(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter("expected max depth", aDPIssue.ExpectedMaxDepth(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual depth", aDPIssue.ActualDepth(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter("expected max height", aHBIssue.ExpectedMaxHeight(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual height", aHBIssue.ActualHeight(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter(
"expected max size (LxWxH)",
new Dimension(anExpectedSize.Length(), anExpectedSize.Width(), anExpectedSize.Height()),
"mm");
FeatureGroupManager.PrintFeatureParameter(
"actual size (LxWxH)",
new Dimension(anActualSize.Length(), anActualSize.Width(), anActualSize.Height()),
"mm");
}
{
FeatureGroupManager.PrintFeatureParameter("expected min radius", aSRMPICIssue.ExpectedMinRadius(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual radius", aSRMPICIssue.ActualRadius(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter("actual angle", ToDegrees(aNPMPSIssue.ActualAngle()), "deg");
}
{
//no parameters
}
{
FeatureGroupManager.PrintFeatureParameter("expected radius", aIRMPFFIssue.ExpectedRadius(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual radius", aIRMPFFIssue.ActualRadius(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter("expected minimum region size", aSMNRDIssue.ExpectedMinRegionSize(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual region size", aSMNRDIssue.ActualRegionSize(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter("expected regions maximum to minimum size ratio", aLMNRRIssue.ExpectedMaxRegionsMaxToMinSizeRatio(), "");
FeatureGroupManager.PrintFeatureParameter("actual regions maximum to minimum size ratio", aLMNRRIssue.ActualMaxRegionsMaxToMinSizeRatio(), "");
}
{
FeatureGroupManager.PrintFeatureParameter("expected min wall thickness", aSWTIssue.ExpectedMinThickness(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual wall thickness", aSWTIssue.ActualThickness(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter("expected min distance", anIssue.ExpectedMinDistance(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual distance", anIssue.ActualDistance(), "mm");
}
{
//no parameters
}
//turning
{
FeatureGroupManager.PrintFeatureParameter(
"expected max incline angle", ToDegrees(anITPODPRIssue.ExpectedMaxFaceInclineAngle()), "deg");
FeatureGroupManager.PrintFeatureParameter(
"actual incline angle", ToDegrees(anITPODPRIssue.ActualFaceInclineAngle()), "deg");
}
{
FeatureGroupManager.PrintFeatureParameter("expected min radius", aSRTPICIssue.ExpectedMinRadius(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual radius", aSRTPICIssue.ActualRadius(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter(
"expected max size (LxR)",
new Pair(anExpectedSize.Length(), anExpectedSize.Radius()),
"mm");
FeatureGroupManager.PrintFeatureParameter(
"actual size (LxR)",
new Pair(anActualSize.Length(), anActualSize.Radius()),
"mm");
}
{
FeatureGroupManager.PrintFeatureParameter("expected min length", aLSTPIssue.ExpectedMaxLength(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual length", aLSTPIssue.ActualLength(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual min diameter", aLSTPIssue.ActualMinDiameter(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter("expected min relief depth", aSDBBHRIssue.ExpectedMinReliefDepth(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual relief depth", aSDBBHRIssue.ActualReliefDepth(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual diameter", aSDBBHRIssue.ActualDiameter(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter("expected max depth", aDBHIssue.ExpectedMaxDepth(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual depth", aDBHIssue.ActualDepth(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual diameter", aDBHIssue.ActualDiameter(), "mm");
}
{
//no parameters
}
{
//no parameters
}
};
aManager.Print("issues", PrintFeatureParameters);
}
static double ToDegrees(double theAngleRad)
{
return theAngleRad * 180 / Math.PI;
}
}
}
Provides an interface to run DFM Machining analysis.
Definition DFMMachining_Analyzer.cs:43
Describes deep bored hole issue found during cnc machining turning design analysis.
Definition DFMMachining_DeepBoredHoleIssue.cs:39
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM deep bored hole issue.
Definition DFMMachining_DeepBoredHoleIssue.cs:173
double ActualDiameter()
Definition DFMMachining_DeepBoredHoleIssue.cs:138
double ActualDepth()
Definition DFMMachining_DeepBoredHoleIssue.cs:121
double ExpectedMaxDepth()
Definition DFMMachining_DeepBoredHoleIssue.cs:112
Describes deep hole issues found during cnc machining drilling design analysis.
Definition DFMMachining_DeepHoleIssue.cs:40
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM machining deep hole issue.
Definition DFMMachining_DeepHoleIssue.cs:134
double ActualDepth()
Definition DFMMachining_DeepHoleIssue.cs:128
double ExpectedMaxDepth()
Definition DFMMachining_DeepHoleIssue.cs:119
Describes deep pocket issue found during cnc machining milling design analysis.
Definition DFMMachining_DeepPocketIssue.cs:39
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM deep pocket issue.
Definition DFMMachining_DeepPocketIssue.cs:154
double ActualDepth()
Definition DFMMachining_DeepPocketIssue.cs:121
double ExpectedMaxDepth()
Definition DFMMachining_DeepPocketIssue.cs:112
Defines parameters used in cnc machining drilling design analysis.
Definition DFMMachining_DrillingAnalyzerParameters.cs:19
Describes flat bottom hole issues found during cnc machining drilling design analysis.
Definition DFMMachining_FlatBottomHoleIssue.cs:29
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM machining flat bottom hole issue.
Definition DFMMachining_FlatBottomHoleIssue.cs:77
Describes high boss issues found during cnc machining milling design analysis.
Definition DFMMachining_HighBossIssue.cs:42
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theIssue is a DFM high boss issue.
Definition DFMMachining_HighBossIssue.cs:146
double ActualHeight()
Definition DFMMachining_HighBossIssue.cs:120
double ExpectedMaxHeight()
Definition DFMMachining_HighBossIssue.cs:111
Describes inconsistent radius milled part floor fillet issue found during cnc machining milling desig...
Definition DFMMachining_InconsistentRadiusMilledPartFloorFilletIssue.cs:26
double ActualRadius()
Definition DFMMachining_InconsistentRadiusMilledPartFloorFilletIssue.cs:90
double ExpectedRadius()
Definition DFMMachining_InconsistentRadiusMilledPartFloorFilletIssue.cs:73
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM machining inconsistent radius milled part floor fillet issue.
Definition DFMMachining_InconsistentRadiusMilledPartFloorFilletIssue.cs:125
Describes intersecting cavity hole issues found during cnc machining drilling design analysis.
Definition DFMMachining_IntersectingCavityHoleIssue.cs:30
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM machining intersecting cavity hole issue.
Definition DFMMachining_IntersectingCavityHoleIssue.cs:78
Describes irregular outer diameter profile relief found during cnc machining turning design analysis.
Definition DFMMachining_IrregularTurnedPartOuterDiameterProfileReliefIssue.cs:38
double ActualFaceInclineAngle()
Definition DFMMachining_IrregularTurnedPartOuterDiameterProfileReliefIssue.cs:100
double ExpectedMaxFaceInclineAngle()
Definition DFMMachining_IrregularTurnedPartOuterDiameterProfileReliefIssue.cs:83
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM irregular outer diameter profile relief issue.
Definition DFMMachining_IrregularTurnedPartOuterDiameterProfileReliefIssue.cs:135
Described the Narrow Pocket maximum to minimum sizes ratio issue found during cnc machining milling d...
Definition DFMMachining_LargeDifferenceRegionsSizeInPocketIssue.cs:36
double ExpectedMaxRegionsMaxToMinSizeRatio()
Definition DFMMachining_LargeDifferenceRegionsSizeInPocketIssue.cs:81
double ActualMaxRegionsMaxToMinSizeRatio()
Definition DFMMachining_LargeDifferenceRegionsSizeInPocketIssue.cs:132
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM large difference regions size in pocket issue.
Definition DFMMachining_LargeDifferenceRegionsSizeInPocketIssue.cs:219
Describes large milled part issue found during cnc machining milling design analysis.
Definition DFMMachining_LargeMilledPartIssue.cs:42
cadex.DFMMachining_MilledPartSize ExpectedMaxMilledPartSize()
Definition DFMMachining_LargeMilledPartIssue.cs:87
cadex.DFMMachining_MilledPartSize ActualMilledPartSize()
Definition DFMMachining_LargeMilledPartIssue.cs:105
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM machining large milled part issue.
Definition DFMMachining_LargeMilledPartIssue.cs:120
Describes large turned part issue found during cnc machining turning design analysis.
Definition DFMMachining_LargeTurnedPartIssue.cs:41
cadex.DFMMachining_TurnedPartSize ExpectedMaxTurnedPartSize()
Definition DFMMachining_LargeTurnedPartIssue.cs:86
cadex.DFMMachining_TurnedPartSize ActualTurnedPartSize()
Definition DFMMachining_LargeTurnedPartIssue.cs:104
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM machining large turned part issue.
Definition DFMMachining_LargeTurnedPartIssue.cs:119
Describes long-slender turned part issue found during cnc machining turning design analysis.
Definition DFMMachining_LongSlenderTurnedPartIssue.cs:39
double ActualMinDiameter()
Definition DFMMachining_LongSlenderTurnedPartIssue.cs:138
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM machining long-slender turned part issue.
Definition DFMMachining_LongSlenderTurnedPartIssue.cs:152
double ExpectedMaxLength()
Definition DFMMachining_LongSlenderTurnedPartIssue.cs:112
double ActualLength()
Definition DFMMachining_LongSlenderTurnedPartIssue.cs:121
Describes external edge fillet issue found during cnc machining milling design analysis.
Definition DFMMachining_MilledPartExternalEdgeFilletIssue.cs:29
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM milled part external edge fillet issue.
Definition DFMMachining_MilledPartExternalEdgeFilletIssue.cs:88
Describes milled part size used in cnc machining milling design analysis.
Definition DFMMachining_MilledPartSize.cs:19
double Width()
Definition DFMMachining_MilledPartSize.cs:79
double Length()
Definition DFMMachining_MilledPartSize.cs:96
double Height()
Definition DFMMachining_MilledPartSize.cs:113
Defines parameters used in cnc machining milling design analysis.
Definition DFMMachining_MillingAnalyzerParameters.cs:19
Describes a base class for milling issues found during cnc machining milling design analysis.
Definition DFMMachining_MillingIssue.cs:19
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theIssue is a DFM machining milling issue.
Definition DFMMachining_MillingIssue.cs:57
Described the Narrow Pocket minimum size issue found during DFM analysis for Machining Milling operat...
Definition DFMMachining_NarrowRegionInPocketIssue.cs:36
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returnstrue if theFeature is a DFM narrow regions distance issue.
Definition DFMMachining_NarrowRegionInPocketIssue.cs:172
double ActualRegionSize()
Definition DFMMachining_NarrowRegionInPocketIssue.cs:98
double ExpectedMinRegionSize()
Definition DFMMachining_NarrowRegionInPocketIssue.cs:81
Describes non perpendicular hole issues found during cnc machining drilling design analysis.
Definition DFMMachining_NonPerpendicularHoleIssue.cs:27
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM machining non perpendicular hole issue.
Definition DFMMachining_NonPerpendicularHoleIssue.cs:75
Describes non perpendicular milled part shape issue found during cnc machining milling design analysi...
Definition DFMMachining_NonPerpendicularMilledPartShapeIssue.cs:28
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM machining non perpendicular milled part shape issue.
Definition DFMMachining_NonPerpendicularMilledPartShapeIssue.cs:104
double ActualAngle()
Definition DFMMachining_NonPerpendicularMilledPartShapeIssue.cs:73
Describes non standard diameter hole issues found during cnc machining drilling design analysis.
Definition DFMMachining_NonStandardDiameterHoleIssue.cs:30
double NearestStandardDiameter()
Definition DFMMachining_NonStandardDiameterHoleIssue.cs:81
double ActualDiameter()
Definition DFMMachining_NonStandardDiameterHoleIssue.cs:98
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM machining non standard diameter hole issue.
Definition DFMMachining_NonStandardDiameterHoleIssue.cs:104
Describes non standard drill point angle blind hole issues found during cnc machining drilling design...
Definition DFMMachining_NonStandardDrillPointAngleBlindHoleIssue.cs:28
double NearestStandardAngle()
Definition DFMMachining_NonStandardDrillPointAngleBlindHoleIssue.cs:79
double ActualAngle()
Definition DFMMachining_NonStandardDrillPointAngleBlindHoleIssue.cs:96
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM machining non standard drill point angle blind hole issue.
Definition DFMMachining_NonStandardDrillPointAngleBlindHoleIssue.cs:110
Describes non standard radius milled part floor fillet issue found during cnc machining milling desig...
Definition DFMMachining_NonStandardRadiusMilledPartFloorFilletIssue.cs:28
double NearestStandardRadius()
Definition DFMMachining_NonStandardRadiusMilledPartFloorFilletIssue.cs:73
double ActualRadius()
Definition DFMMachining_NonStandardRadiusMilledPartFloorFilletIssue.cs:90
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM machining non standard radius milled part floor fillet issue.
Definition DFMMachining_NonStandardRadiusMilledPartFloorFilletIssue.cs:125
Describes asymmetric axial slot issue found during cnc machining turning design analysis.
Definition DFMMachining_NonSymmetricalAxialSlotIssue.cs:28
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a non-symmetrical axial slot issue.
Definition DFMMachining_NonSymmetricalAxialSlotIssue.cs:94
Describes partial hole issues found during cnc machining drilling design analysis.
Definition DFMMachining_PartialHoleIssue.cs:38
double ExpectedMinMaterialPercent()
Definition DFMMachining_PartialHoleIssue.cs:89
double ActualMaterialPercent()
Definition DFMMachining_PartialHoleIssue.cs:106
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM machining partial hole issue.
Definition DFMMachining_PartialHoleIssue.cs:120
Describes small depth blind bored hole relief found during cnc machining turning design analysis.
Definition DFMMachining_SmallDepthBlindBoredHoleReliefIssue.cs:41
double ActualReliefDepth()
Definition DFMMachining_SmallDepthBlindBoredHoleReliefIssue.cs:123
double ExpectedMinReliefDepth()
Definition DFMMachining_SmallDepthBlindBoredHoleReliefIssue.cs:114
double ActualDiameter()
Definition DFMMachining_SmallDepthBlindBoredHoleReliefIssue.cs:140
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM small depth blind bored hole relief issue.
Definition DFMMachining_SmallDepthBlindBoredHoleReliefIssue.cs:175
Describes small diameter hole issues found during cnc machining drilling design analysis.
Definition DFMMachining_SmallDiameterHoleIssue.cs:39
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM machining small diameter hole issue.
Definition DFMMachining_SmallDiameterHoleIssue.cs:113
double ExpectedMinDiameter()
Definition DFMMachining_SmallDiameterHoleIssue.cs:90
double ActualDiameter()
Definition DFMMachining_SmallDiameterHoleIssue.cs:107
Describes small distance between threaded hole and edge issue found during CNC Machining drilling des...
Definition DFMMachining_SmallDistanceBetweenThreadedHoleAndEdgeIssue.cs:40
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM machining deep hole issue.
Definition DFMMachining_SmallDistanceBetweenThreadedHoleAndEdgeIssue.cs:155
Describes internal corner radius issues found during cnc machining milling design analysis.
Definition DFMMachining_SmallRadiusMilledPartInternalCornerIssue.cs:40
double ExpectedMinRadius()
Definition DFMMachining_SmallRadiusMilledPartInternalCornerIssue.cs:109
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theIssue is a DFM small radius milled part internal corner issue.
Definition DFMMachining_SmallRadiusMilledPartInternalCornerIssue.cs:172
double ActualRadius()
Definition DFMMachining_SmallRadiusMilledPartInternalCornerIssue.cs:118
Describes internal corner radius issues found during cnc machining turning design analysis.
Definition DFMMachining_SmallRadiusTurnedPartInternalCornerIssue.cs:38
double ExpectedMinRadius()
Definition DFMMachining_SmallRadiusTurnedPartInternalCornerIssue.cs:83
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM small radius turned part internal corner issue.
Definition DFMMachining_SmallRadiusTurnedPartInternalCornerIssue.cs:137
double ActualRadius()
Definition DFMMachining_SmallRadiusTurnedPartInternalCornerIssue.cs:100
Describes wall with small thickness issues found during cnc machining milling design analysis.
Definition DFMMachining_SmallWallThicknessIssue.cs:40
double ExpectedMinThickness()
Definition DFMMachining_SmallWallThicknessIssue.cs:85
double ActualThickness()
Definition DFMMachining_SmallWallThicknessIssue.cs:102
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM machining small wall thickness issue.
Definition DFMMachining_SmallWallThicknessIssue.cs:137
Describes square form keyway issue found during cnc machining turning design analysis.
Definition DFMMachining_SquareEndKeywayIssue.cs:30
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM square-end keyway issue.
Definition DFMMachining_SquareEndKeywayIssue.cs:96
Describes turned part size used in cnc machining turning design analysis.
Definition DFMMachining_TurnedPartSize.cs:23
double Length()
Definition DFMMachining_TurnedPartSize.cs:100
double Radius()
Definition DFMMachining_TurnedPartSize.cs:83
Defines parameters used in cnc machining turning design analysis.
Definition DFMMachining_TurningAnalyzerParameters.cs:19
Describes recessed or hidden areas inaccessible to standard end mills.
Definition DFMMachining_UndercutIssue.cs:26
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM undercut issue.
Definition DFMMachining_UndercutIssue.cs:112
Activates the license key.
Definition LicenseManager.cs:48
Defines a list of features.
Definition MTKBase_FeatureList.cs:20
uint Size()
Returns the number of elements in the list.
Definition MTKBase_FeatureList.cs:110
cadex.MTKBase_Feature Feature(uint theIndex)
Access specified element.
Definition MTKBase_FeatureList.cs:99
Defines data used in Machining analysis.
Definition Machining_Data.cs:19
Provides an interface to recognizing machining features tool.
Definition Machining_FeatureRecognizer.cs:24
Defines parameters used by Machining_FeatureRecognizer.
Definition Machining_FeatureRecognizerParameters.cs:39
Defines a visitor that visits each unique element only once.
Definition ModelElementUniqueVisitor.cs:25
Provides MTK data model.
Definition Model.cs:30
Reads supported formats, see Import section.
Definition ModelReader.cs:17
Machining_OperationType
Defines an operation type in machining.
Definition Machining_OperationType.cs:19