using System;
using System.Collections.Generic;
using System.IO;
using ShapeIDVectorType = System.Collections.Generic.List<int>;
using ShapeIDVectorVectorType = System.Collections.Generic.List<System.Collections.Generic.List<int>>;
System.Collections.Generic.KeyValuePair<uint, System.Collections.Generic.List<System.Collections.Generic.List<int>>>>;
namespace mtkconverter
{
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() => $"{FormattedString(First)} x {FormattedString(Second)}";
private string FormattedString(double theValue)
{
System.Globalization.CultureInfo aCI = new System.Globalization.CultureInfo("en-US");
return string.Format(aCI, "{0:0.00}", theValue);
}
}
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() => $"{FormattedString(L)} x {FormattedString(W)} x {FormattedString(D)}";
private string FormattedString(double theValue)
{
System.Globalization.CultureInfo aCI = new System.Globalization.CultureInfo("en-US");
return string.Format(aCI, "{0:0.00}", theValue);
}
}
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);
}
}
public struct Point
{
public Point(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 FeatureComparer : IComparer<MTKBase_Feature>
{
{
bool anALessThanB = aComparator.Apply(theA, theB);
if (anALessThanB)
{
return -1;
}
bool aBLessThanA = aComparator.Apply(theB, theA);
if (aBLessThanA)
{
return 1;
}
return 0;
}
}
class JSONWriter
{
public JSONWriter(TextWriter theStream, int theStartNestingLevel = 0)
{
myStream = theStream;
myNestingLevel = theStartNestingLevel;
myPrevNestingLevel = theStartNestingLevel - 1;
}
public void OpenSection()
{
DoOpenSection("", '{');
}
public void OpenSection(string theName)
{
DoOpenSection(theName, '{');
}
public void OpenArraySection(string theName)
{
DoOpenSection(theName, '[');
}
public void CloseSection()
{
DoCloseSection('}');
}
public void CloseArraySection()
{
DoCloseSection(']');
}
public void WriteData<T>(string theParamName, T theValue)
{
System.Globalization.CultureInfo aCI = new System.Globalization.CultureInfo ("en-US");
string aValueString = theValue is double ? string.Format(aCI, "{0:0.00}", theValue) : theValue.ToString();
Stream().Write("\"" + theParamName + "\": \"" + aValueString + "\"");
}
public void WriteRawData(string theRawData)
{
PrepareStream();
myStream.Write(theRawData);
}
public void WriteEmptyArray(string theParamName)
{
Stream().Write("\"" + theParamName + "\": []");
}
public int NestingLevel()
{
return myNestingLevel;
}
private void DoOpenSection(string theName, char theOpenBracketSymbol)
{
TextWriter aStream = Stream();
if (theName.Length > 0)
{
aStream.Write("\"" + theName + "\": ");
}
aStream.Write(theOpenBracketSymbol);
++myNestingLevel;
}
private void DoCloseSection(char theCloseBracketSymbol)
{
--myNestingLevel;
Stream().Write(theCloseBracketSymbol);
}
private void PrepareStream()
{
if (myNestingLevel == myPrevNestingLevel)
{
myStream.Write(",");
}
myPrevNestingLevel = myNestingLevel;
if (myIsInit)
{
myStream.WriteLine();
}
myIsInit = true;
}
private TextWriter Stream()
{
PrepareStream();
for (int i = 0; i < myNestingLevel; ++i)
{
myStream.Write(" ");
}
return myStream;
}
private TextWriter myStream;
private bool myIsInit = false;
private int myNestingLevel;
private int myPrevNestingLevel;
}
class FeatureGroupManager
{
public FeatureGroupManager()
{
myGroups = new List<FeatureGroup>();
}
private class FeatureGroup
{
public FeatureGroup(string theName, string theColor)
{
myName = theName;
myColor = theColor;
myFeatureData = new List<string>();
}
public string myName;
public string myColor;
public List<string> myFeatureData;
public uint myFeatureCount = 0;
}
private List<FeatureGroup> myGroups;
public void AddGroupData(string theGroupName, string theGroupColor, string theFeatureData, uint theFeatureNb)
{
int aRes = myGroups.FindIndex(theGroup => theGroup.myName == theGroupName);
if (aRes == -1)
{
myGroups.Add(new FeatureGroup(theGroupName, theGroupColor));
aRes = myGroups.Count - 1;
}
FeatureGroup aGroup = myGroups[aRes];
aGroup.myFeatureData.Add(theFeatureData);
aGroup.myFeatureCount += theFeatureNb;
}
public uint TotalFeatureCount()
{
uint aTotalFeatureCount = 0;
foreach (FeatureGroup aGroup in myGroups)
{
aTotalFeatureCount += aGroup.myFeatureCount;
}
return aTotalFeatureCount;
}
public void Write(JSONWriter theWriter)
{
foreach(FeatureGroup aGroup in myGroups)
{
theWriter.OpenSection();
theWriter.WriteData("name", aGroup.myName);
theWriter.WriteData("color", aGroup.myColor);
theWriter.WriteData("totalGroupFeatureCount", aGroup.myFeatureCount);
List<string> aFeatureData = aGroup.myFeatureData;
if (aFeatureData.Count !=0 )
{
bool aHasParams = aFeatureData[0].IndexOf("parameters") != -1;
if (aHasParams)
{
theWriter.WriteData("subGroupCount", aFeatureData.Count);
theWriter.OpenArraySection("subGroups");
foreach (string j in aFeatureData)
{
theWriter.WriteRawData(j);
}
theWriter.CloseArraySection();
}
else
{
foreach (string j in aFeatureData)
{
theWriter.WriteRawData(j);
}
}
}
theWriter.CloseSection();
}
}
}
class MTKConverter_Report
{
public MTKConverter_Report()
{
myData = new List<MTKConverter_ProcessData>();
}
private List<MTKConverter_ProcessData> myData;
public void AddData(MTKConverter_ProcessData theData)
{
myData.Add(theData);
}
{
string aPath = thePath.ToString();
if (File.Exists(aPath))
{
File.Delete(aPath);
}
try
{
using (StreamWriter aStream = File.CreateText(aPath))
{
JSONWriter aWriter = new JSONWriter(aStream);
aWriter.OpenSection();
aWriter.WriteData("version", "1");
if (myData.Count == 0)
{
aWriter.WriteData("error", "The model doesn't contain any parts.");
}
else
{
aWriter.OpenArraySection("parts");
foreach (MTKConverter_ProcessData aProcessData in myData)
{
aWriter.OpenSection();
WritePartProcessData(aWriter, aProcessData);
aWriter.CloseSection();
}
aWriter.CloseArraySection();
}
aWriter.CloseSection();
}
}
catch
{
return false;
}
return true;
}
private void WriteParameter<T>(JSONWriter theWriter, string theParamName, string theParamUnits, T theParamValue)
{
theWriter.OpenSection();
theWriter.WriteData("name", theParamName);
theWriter.WriteData("units", theParamUnits);
theWriter.WriteData("value", theParamValue);
theWriter.CloseSection();
}
private void WriteShapeIDs(JSONWriter theWriter, ShapeIDVectorVectorType theVector)
{
if (theVector.Count == 0)
{
return;
}
theWriter.WriteData("featureCount", theVector.Count);
theWriter.OpenArraySection("features");
foreach (ShapeIDVectorType aShapeIDVector in theVector) {
theWriter.OpenSection();
theWriter.WriteData("shapeIDCount", aShapeIDVector.Count);
if (aShapeIDVector.Count == 0)
{
theWriter.WriteEmptyArray("shapeIDs");
}
else
{
theWriter.OpenArraySection("shapeIDs");
foreach (uint aShapeID in aShapeIDVector)
{
theWriter.OpenSection();
theWriter.WriteData("id", aShapeID);
theWriter.CloseSection();
}
theWriter.CloseArraySection();
}
theWriter.CloseSection();
}
theWriter.CloseArraySection();
}
private string DoWriteFeatureDataToString(Action<JSONWriter> theFunc, int theParamCount, ShapeIDVectorVectorType theVector)
{
StringWriter aStream = new StringWriter();
JSONWriter aWriter = new JSONWriter(aStream, 7);
aWriter.OpenSection();
aWriter.WriteData("parametersCount", theParamCount);
aWriter.OpenArraySection("parameters");
theFunc(aWriter);
aWriter.CloseArraySection();
WriteShapeIDs(aWriter, theVector);
aWriter.CloseSection();
return aStream.ToString();
}
private string WriteFeatureDataToString(ShapeIDVectorVectorType theVector)
{
StringWriter aStream = new StringWriter();
JSONWriter aWriter = new JSONWriter(aStream, 6);
WriteShapeIDs(aWriter, theVector);
return aStream.ToString();
}
private string WriteFeatureDataToString<T>(string theParamName, string theParamUnits,
T theParamValue, ShapeIDVectorVectorType theVector)
{
Action<JSONWriter> WriteParams = theWriter => WriteParameter(theWriter, theParamName, theParamUnits, theParamValue);
return DoWriteFeatureDataToString(WriteParams, 1, theVector);
}
private string WriteFeatureDataToString<T1, T2>(string theParamName1, string theParamUnits1, T1 theParamValue1,
string theParamName2, string theParamUnits2, T2 theParamValue2, ShapeIDVectorVectorType theVector)
{
Action<JSONWriter> WriteParams = theWriter =>
{
WriteParameter(theWriter, theParamName1, theParamUnits1, theParamValue1);
WriteParameter(theWriter, theParamName2, theParamUnits2, theParamValue2);
};
return DoWriteFeatureDataToString(WriteParams, 2, theVector);
}
private string WriteFeatureDataToString<T1, T2, T3>(string theParamName1, string theParamUnits1, T1 theParamValue1,
string theParamName2, string theParamUnits2, T2 theParamValue2,
string theParamName3, string theParamUnits3, T3 theParamValue3, ShapeIDVectorVectorType theVector)
{
Action<JSONWriter> WriteParams = theWriter =>
{
WriteParameter(theWriter, theParamName1, theParamUnits1, theParamValue1);
WriteParameter(theWriter, theParamName2, theParamUnits2, theParamValue2);
WriteParameter(theWriter, theParamName3, theParamUnits3, theParamValue3);
};
return DoWriteFeatureDataToString(WriteParams, 3, theVector);
}
private string WriteFeatureDataToString<T1, T2, T3, T4>(string theParamName1, string theParamUnits1, T1 theParamValue1,
string theParamName2, string theParamUnits2, T2 theParamValue2,
string theParamName3, string theParamUnits3, T3 theParamValue3,
string theParamName4, string theParamUnits4, T4 theParamValue4, ShapeIDVectorVectorType theVector)
{
Action<JSONWriter> WriteParams = theWriter =>
{
WriteParameter(theWriter, theParamName1, theParamUnits1, theParamValue1);
WriteParameter(theWriter, theParamName2, theParamUnits2, theParamValue2);
WriteParameter(theWriter, theParamName3, theParamUnits3, theParamValue3);
WriteParameter(theWriter, theParamName4, theParamUnits4, theParamValue4);
};
return DoWriteFeatureDataToString(WriteParams, 4, theVector);
}
{
switch (theType)
{
case Machining_FaceType.Machining_FT_ConvexProfileEdgeMilling:
return "Convex Profile Edge Milling Face(s)";
case Machining_FaceType.Machining_FT_ConcaveFilletEdgeMilling:
return "Concave Fillet Edge Milling Face(s)";
default:
break;
}
return "Face(s)";
}
{
switch (theType)
{
default:
break;
}
return "(0, 0, 0)";
}
{
switch (theType)
{
default:
break;
}
return "Hole(s)";
}
{
switch (theType)
{
default:
break;
}
return "(0, 0, 0)";
}
{
switch (theType) {
default:
break;
}
return "Hem Bend(s)";
}
{
{
return HemTypeToString(aHemBend.
Type());
}
{
return "Curved Bend(s)";
}
return "Bend(s)";
}
{
{
switch (aType) {
default:
break;
}
return "(0, 0, 0)";
}
{
return "(255, 254, 145)";
}
return "(0, 35, 245)";
}
{
{
return "Complex Hole(s)";
}
return "Hole(s)";
}
{
{
return "(115, 43, 245)";
}
return "(129, 127, 38)";
}
{
{
return "Small Distance Between Bend And Louver Issue(s)";
}
{
return "Small Distance Between Extruded Hole And Bend Issue(s)";
}
{
return "Small Distance Between Extruded Hole And Edge Issue(s)";
}
{
return "Small Distance Between Extruded Holes Issue(s)";
}
{
return "Small Distance Between Hole And Bend Issue(s)";
}
{
return "Small Distance Between Hole And Cutout Issue(s)";
}
{
return "Small Distance Between Hole And Edge Issue(s)";
}
{
return "Small Distance Between Hole And Louver Issue(s)";
}
{
return "Small Distance Between Hole And Notch Issue(s)";
}
{
return "Small Distance Between Holes Issue(s)";
}
{
return "Small Distance Between Notch And Bend Issue(s)";
}
{
return "Small Distance Between Notches Issue(s)";
}
{
return "Small Distance Between Tabs Issue(s)";
}
return "Small Distance Between Feature(s)";
}
{
{
return "(195, 56, 19)";
}
{
return "(212, 75, 90)";
}
{
return "(198, 75, 105)";
}
{
return "(170, 65, 120)";
}
{
return "(239, 136, 190)";
}
{
return "(127, 130, 187)";
}
{
return "(240, 135, 132)";
}
{
return "(15, 5, 129)";
}
{
return "(235, 51, 36)";
}
{
return "(142, 64, 58)";
}
{
return "(58, 6, 3)";
}
{
return "(0, 215, 3)";
}
{
return "(157, 160, 207)";
}
return "(0, 0, 0)";
}
uint theCount, ShapeIDVectorVectorType theShapeIdVector)
{
{
string aFeatureData = WriteFeatureDataToString(
"Radius",
"mm", aTurningFace.
Radius(), theShapeIdVector);
theManager.AddGroupData(MachiningFaceTypeToString(aType), MachiningFaceColor(aType), aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(theShapeIdVector);
theManager.AddGroupData(MachiningFaceTypeToString(aType), MachiningFaceColor(aType), aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
"Radius",
"mm", aCountersink.
Radius(),
"Depth",
"mm", aCountersink.
Depth(),
"Axis", "", new Direction (aDir.X(), aDir.Y(), aDir.Z()),
theShapeIdVector);
theManager.AddGroupData("Countersink(s)", "(55, 125, 34)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
"Radius",
"mm", aHole.
Radius(),
"Depth",
"mm", aHole.
Depth(),
"Axis", "", new Direction(aDir.X(), aDir.Y(), aDir.Z()),
theShapeIdVector);
theManager.AddGroupData(MachiningHoleTypeToString(aType), MachiningHoleColor(aType), aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
"Length",
"mm", aPocket.
Length(),
"Width",
"mm", aPocket.
Width(),
"Depth",
"mm", aPocket.
Depth(),
"Axis", "", new Direction(aDir.X(), aDir.Y(), aDir.Z()),
theShapeIdVector);
theManager.AddGroupData("Pocket(s)", "(23, 63, 63)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
"Length",
"mm", aBoss.
Length(),
"Width",
"mm", aBoss.
Width(),
"Height",
"mm", aBoss.
Height(),
theShapeIdVector);
theManager.AddGroupData("Boss(es)", "(56, 72, 13)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
"Depth",
"mm", aBead.
Depth(), theShapeIdVector);
theManager.AddGroupData("Bead(s)", "(115, 251, 253)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
"Radius",
"mm", aBend.
Radius(),
"Angle",
"deg", aBend.
Angle() * 180 / Math.PI,
"Length",
"mm", aBend.
Length(),
"Width",
"mm", aBend.
Width(),
theShapeIdVector);
theManager.AddGroupData(BendName(aBend), BendColor(aBend), aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
"Length",
"mm", aBridge.
Length(),
"Depth",
"mm", aBridge.
Depth(),
theShapeIdVector);
theManager.AddGroupData("Bridge(s)", "(240, 155, 89)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
"Radius",
"mm", aHole.
Radius(),
"Depth",
"mm", aHole.
Depth(),
"Axis", "", new Direction(aDir.X(), aDir.Y(), aDir.Z()),
theShapeIdVector);
theManager.AddGroupData(SheetMetalHoleName(aHole), SheetMetalHoleColor(aHole), aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
"Perimeter",
"mm", aCutout.
Perimeter(), theShapeIdVector);
theManager.AddGroupData("Cutout(s)", "(88, 19, 94)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
"Depth",
"mm", aLouver.
Depth(),
theShapeIdVector);
theManager.AddGroupData("Louver(s)", "(161, 251, 142)", aFeatureData, theCount);
}
{
{
string aFeatureData = WriteFeatureDataToString (
"Length",
"mm", aNotch.
Length(),
"Width",
"mm", aNotch.
Width(),
theShapeIdVector);
theManager.AddGroupData ("Straight Notch(es)", "(240, 135, 132)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString (
"Length",
"mm", aNotch.
Length(),
"Width",
"mm", aNotch.
Width(),
"Angle",
"deg", aVNotch.
Angle() * 180 / Math.PI,
theShapeIdVector);
theManager.AddGroupData ("V Notch(es)", "(235, 51, 36)", aFeatureData, theCount);
}
else
{
string aFeatureData = WriteFeatureDataToString(
"Length",
"mm", aNotch.
Length(),
"Width",
"mm", aNotch.
Width(),
theShapeIdVector);
theManager.AddGroupData("Notch(es)", "(239, 136, 190)", aFeatureData, theCount);
}
}
{
string aFeatureData = WriteFeatureDataToString(
"Length",
"mm", aTab.
Length(),
"Width",
"mm", aTab.
Width(),
theShapeIdVector);
theManager.AddGroupData("Tab(s)", "(127, 130, 187)", aFeatureData, theCount);
}
}
uint theCount, ShapeIDVectorVectorType theShapeIdVector)
{
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Small Diameter Hole(s)", "(115, 251, 253)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Deep Hole(s)", "(0, 35, 245)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Non Standard Diameter Hole(s)", "(22, 65, 124)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
"Nearest Standard Angle",
"deg", aNSDrillPointAngleBlindHoleIssue.
NearestStandardAngle() * 180 / Math.PI,
"Actual Angle",
"deg", aNSDrillPointAngleBlindHoleIssue.
ActualAngle() * 180 / Math.PI,
theShapeIdVector);
theManager.AddGroupData("Non Standard Drill Point Angle Blind Hole(s)", "(88, 13, 78)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Partial Hole(s)", "(255, 254, 145)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(theShapeIdVector);
theManager.AddGroupData("Flat Bottom Hole(s)", "(240, 155, 89)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(theShapeIdVector);
theManager.AddGroupData("Non Perpendicular Hole(s)", "(129, 127, 38)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(theShapeIdVector);
theManager.AddGroupData("Intersecting Cavity Hole(s)", "(115, 43, 245)", aFeatureData, theCount);
}
}
uint theCount, ShapeIDVectorVectorType theShapeIdVector)
{
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Non Standard Radius Milled Part Floor Fillet Issue(s)", "(0, 215, 3)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Deep Pocket Issue(s)", "(190, 10, 100)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("High Boss Issue(s)", "(180, 100, 50)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
"Expected Maximum Size (LxWxH)", "mm",
new Dimension(anExpectedSize.
Length(), anExpectedSize.
Width(), anExpectedSize.
Height()),
"Actual Size (LxWxH)", "mm",
theShapeIdVector);
theManager.AddGroupData("Large Milled Part(s)", "(17, 37, 205)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Small Radius Milled Part Internal Corner(s)", "(10, 10, 200)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
"Actual Angle",
"deg", aNPMPSIssue.
ActualAngle() * 180 / Math.PI,
theShapeIdVector);
theManager.AddGroupData("Non Perpendicular Milled Part Shape(s)", "(129, 227, 138)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(theShapeIdVector);
theManager.AddGroupData("Milled Part External Edge Fillet(s)", "(201, 227, 13)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
"Actual Radius",
"mm", anInconsistentRadiusIssue.
ActualRadius(),
theShapeIdVector);
theManager.AddGroupData("Inconsistent Radius Milled Part Floor Fillet Issue(s)", "(180, 15, 190)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Narrow Region In Pocket Issue(s)", "(70, 150, 150)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Large Difference Regions Size In Pocket Issue(s)", "(100, 150, 150)", aFeatureData, theCount);
}
}
private void AddTurningIssue(FeatureGroupManager theManager,
DFMBase_Issue theIssue,
uint theCount, ShapeIDVectorVectorType theShapeIdVector)
{
{
string aFeatureData = WriteFeatureDataToString(
"Expected Maximum Size (LxR)",
"mm",
new Pair(anExpectedSize.
Length(), anExpectedSize.
Radius()),
"Actual Size (LxR)",
"mm",
new Pair(anActualSize.
Length(), anActualSize.
Radius()),
theShapeIdVector);
theManager.AddGroupData("Large Turned Part(s)", "(195, 195, 195)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Long-Slender Turned Part(s)", "(195, 195, 195)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Small Depth Blind Bored Hole Relief(s)", "(88, 19, 94)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Deep Bored Hole(s)", "(161, 251, 142)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Irregular Turned Part Outer Diameter Profile Relief(s)", "(239, 136, 190)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Small Radius Turned Part Internal Corner(s)", "(127, 130, 187)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(theShapeIdVector);
theManager.AddGroupData("Square End Keyway(s)", "(157, 160, 207)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(theShapeIdVector);
theManager.AddGroupData("Non Symmetrical Axial Slot(s)", "(130, 170, 200)", aFeatureData, theCount);
}
}
private void AddSheetMetalIssue(FeatureGroupManager theManager,
DFMBase_Issue theIssue,
uint theCount, ShapeIDVectorVectorType theShapeIdVector)
{
{
string aFeatureData = WriteFeatureDataToString(theShapeIdVector);
theManager.AddGroupData("Flat Pattern Interference(s)", "(115, 251, 253)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Irregular Corner Fillet Radius Notch(es)", "(239, 136, 190)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Irregular Depth Extruded Hole(s)", "(50, 120, 210)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Irregular Radius Open Hem Bend(s)", "(188, 121, 11)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Inconsistent Radius Bend(s)", "(0, 35, 245)", aFeatureData, theCount);
}
{
string aFeatureData;
if (!aFirstActualRelief.
IsNull() && !aSecondActualRelief.
IsNull())
{
aFeatureData = WriteFeatureDataToString(
"Expected Minimum Relief Size (LxW)",
"mm",
new Pair(anExpectedRelief.
Length(), anExpectedRelief.
Width()),
"First Actual Relief Size (LxW)",
"mm",
new Pair(aFirstActualRelief.
Length(), aFirstActualRelief.
Width()),
"Second Actual Relief Size (LxW)",
"mm",
new Pair(aSecondActualRelief.
Length(), aSecondActualRelief.
Width()),
theShapeIdVector);
}
else if (aFirstActualRelief.
IsNull())
{
aFeatureData = WriteFeatureDataToString(
"Expected Minimum Relief Size (LxW)",
"mm",
new Pair(anExpectedRelief.
Length(), anExpectedRelief.
Width()),
"Actual Relief Size (LxW)",
"mm",
new Pair(aSecondActualRelief.
Length(), aSecondActualRelief.
Width()),
theShapeIdVector);
}
else
{
aFeatureData = WriteFeatureDataToString(
"Expected Minimum Relief Size (LxW)",
"mm",
new Pair(anExpectedRelief.
Length(), anExpectedRelief.
Width()),
"Actual Relief Size (LxW)",
"mm",
new Pair(aFirstActualRelief.
Length(), aFirstActualRelief.
Width()),
theShapeIdVector);
}
theManager.AddGroupData("Irregular Size Bend Relief(s)", "(22, 65, 124)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Irregular Size Notch(s)", "(255, 254, 145)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Irregular Size Tab(s)", "(240, 155, 89)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Large Depth Bead(s)", "(129, 127, 38)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Small Depth Louver(s)", "(190, 127, 58)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
"Nearest Standard Size (LxW)",
"mm",
new Pair(aNesrestStandardSize.
Length(), aNesrestStandardSize.
Width()),
"Actual Size (LxW)",
"mm",
new Pair(anActualSize.
Length(), anActualSize.
Width()),
theShapeIdVector);
theManager.AddGroupData("Non Standard Sheet Size(s)", "(0, 0, 0)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Non Standard Sheet Thickness(s)", "(0, 0, 0)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Small Diameter Hole(s)", "(115, 43, 245)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Small Length Flange(s)", "(88, 19, 94)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Small Length Hem Bend Flange(s)", "(70, 139, 51)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Small Radius Bend(s)", "(161, 251, 142)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData(SmallDistanceIssueName(aSDIssue), SmallDistanceIssueColor(aSDIssue), aFeatureData, theCount);
}
}
{
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
while (aShapeIt.HasNext())
{
aShapeIdVector.Add(theBRep.
ShapeId(aShape));
}
return aShapeIdVector;
}
{
while (aShapeIt.HasNext())
{
theShapesIdVec.Add(theBRep.
ShapeId(aShape));
}
}
{
for (uint i = 0; i < theFeatures.
Size(); i++)
{
{
SortFeatures(aCompositeFeature.
FeatureList(), theBRep, theMap);
continue;
}
KeyValuePair<uint, ShapeIDVectorVectorType> anElement;
if (theMap.ContainsKey(aFeature))
{
anElement = theMap[aFeature];
}
else
{
anElement = new KeyValuePair<uint, ShapeIDVectorVectorType>(0, new ShapeIDVectorVectorType());
}
var aValue = anElement.Value;
{
{
}
ShapeIDVectorType aShapeIdVector = GetShapesId(aShapeFeature.
Shape(), theBRep, aShapeType);
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(new ShapeIDVectorType());
}
{
aValue.Add(aShapeIdVector);
}
{
DFMMachining_NonPerpendicularMilledPartShapeIssue.Cast (aFeature);
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
aValue.Add(aShapeIdVector);
}
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(new ShapeIDVectorType());
}
{
aValue.Add(new ShapeIDVectorType());
}
{
ShapeIDVectorType aShapeIdVector =
new ShapeIDVectorType { theBRep.
ShapeId(aFPIIssue.
FirstFace()),
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
if (!aFirstActualRelief.
IsNull())
{
}
if (!aSecondActualRelief.
IsNull())
{
}
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(new ShapeIDVectorType());
}
{
aValue.Add(new ShapeIDVectorType());
}
{
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
for (uint j = 0; j < aFlange.
Size(); j++)
{
{
}
}
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
for (uint j = 0; j < aFlange.
Size(); j++)
{
{
}
}
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
aValue.Add(aShapeIdVector);
}
anElement = new KeyValuePair<uint, ShapeIDVectorVectorType>(anElement.Key + 1, aValue);
theMap[aFeature] = anElement;
}
}
private bool WriteFeatures(JSONWriter theWriter,
string theGroupName,
string theSubgroupName,
MTKBase_FeatureList theFeatures,
{
theWriter.OpenSection(theSubgroupName);
theWriter.WriteData("name", theGroupName);
{
theWriter.WriteData("message", theMessageForEmptyList);
}
else
{
FeatureMapType aSortedFeatures = new FeatureMapType(new FeatureComparer());
SortFeatures(theFeatures, theBRep, aSortedFeatures);
FeatureGroupManager aFGManager = new FeatureGroupManager();
foreach (var i in aSortedFeatures) {
uint aCount = i.Value.Key;
ShapeIDVectorVectorType aShapeIDVec = i.Value.Value;
{
}
{
}
{
}
{
AddSheetMetalIssue(aFGManager,
DFMBase_Issue.Cast(aFeature), aCount, aShapeIDVec);
}
{
AddTurningIssue(aFGManager,
DFMBase_Issue.Cast(aFeature), aCount, aShapeIDVec);
}
}
theWriter.WriteData("totalFeatureCount", aFGManager.TotalFeatureCount());
theWriter.OpenArraySection("featureGroups");
aFGManager.Write(theWriter);
theWriter.CloseArraySection();
}
theWriter.CloseSection();
return true;
}
{
switch (theOperation)
{
default:
break;
}
return "CNC Machining";
}
{
for (uint i = 0, n = aBodyList.Size(); i < n; ++i)
{
if (aShapeIt.HasNext())
{
return true;
}
}
return false;
}
private void WriteThicknessNode(JSONWriter theWriter, string theParamName, double theParamValue,
PointPairType thePoints, string theNodeName)
{
theWriter.OpenSection(theNodeName);
theWriter.WriteData("name", theParamName);
theWriter.WriteData("units", "mm");
theWriter.WriteData("value", theParamValue);
theWriter.WriteData("firstPoint", new Point (aFirstPoint.X(), aFirstPoint.Y(), aFirstPoint.Z()));
theWriter.WriteData("secondPoint", new Point(aSecondPoint.X(), aSecondPoint.Y(), aSecondPoint.Z()));
theWriter.CloseSection();
}
private void WriteUnfoldedPartFeatures(JSONWriter theWriter, MTKConverter_UnfoldedPartData theData)
{
theWriter.OpenSection("featureRecognitionUnfolded");
theWriter.WriteData("name", "Feature Recognition");
if (theData.IsInit())
{
StringWriter aStream = new StringWriter();
JSONWriter aWriter = new JSONWriter(aStream, 4);
aWriter.WriteData("parametersCount", 3);
aWriter.OpenArraySection("parameters");
WriteParameter(aWriter,
"Length",
"mm", aFlatPattern.
Length());
WriteParameter(aWriter,
"Width",
"mm", aFlatPattern.
Width());
WriteParameter(aWriter,
"Thickness",
"mm", aFlatPattern.
Thickness());
WriteParameter(aWriter,
"Perimeter",
"mm", aFlatPattern.
Perimeter());
aWriter.CloseArraySection();
theWriter.WriteRawData(aStream.ToString());
}
else
{
theWriter.WriteData("message", "Unfolded part wasn't generated.");
}
theWriter.CloseSection();
}
private void WritePartProcessData(JSONWriter theWriter, MTKConverter_ProcessData theProcessData)
{
bool aRes = false;
theWriter.WriteData("partId", theProcessData.myPart.Uuid());
string anErrorMsg = "An error occurred while processing the part.";
if (theProcessData is MTKConverter_MachiningData)
{
MTKConverter_MachiningData aMD = (MTKConverter_MachiningData)theProcessData;
theWriter.WriteData("process", MachiningProcessName(aMD.myOperation));
if (!aMD.myFeatureList.IsEmpty())
{
WriteFeatures(theWriter, "Feature Recognition", "featureRecognition", aMD.myFeatureList, aBRep, "");
WriteFeatures(theWriter, "Design for Manufacturing", "dfm", aMD.myIssueList, aBRep,
"Part contains no DFM improvement suggestions.");
aRes = true;
}
{
anErrorMsg = "The part can't be analyzed due to lack of: BRep representation or solids in BRep representation.";
}
}
else if (theProcessData is MTKConverter_WallThicknessData)
{
MTKConverter_WallThicknessData aWTD = (MTKConverter_WallThicknessData)theProcessData;
theWriter.WriteData("process", "Wall Thickness Analysis");
if (aWTD.myIsInit)
{
WriteThicknessNode(theWriter, "Minimum Thickness", aWTD.myMinThickness, aWTD.myMinThicknessPoints, "minThickness");
WriteThicknessNode(theWriter, "Maximum Thickness", aWTD.myMaxThickness, aWTD.myMaxThicknessPoints, "maxThickness");
aRes = true;
}
else if ((aBRep ==
null || !HasShapes(aBRep,
ModelData_ShapeType.ModelData_ST_Solid)) && aPoly ==
null)
{
anErrorMsg = "The part can't be analyzed due to lack of: " +
"BRep representation, solids in BRep representation or Poly representations.";
}
}
else if (theProcessData is MTKConverter_SheetMetalData)
{
MTKConverter_SheetMetalData aSMD = (MTKConverter_SheetMetalData)theProcessData;
theWriter.WriteData("process", "Sheet Metal");
if (aSMD.myIsSheetMetalPart)
{
WriteFeatures(theWriter, "Feature Recognition", "featureRecognition", aSMD.myFeatureList, aBRep,
"Part contains no features.");
WriteFeatures(theWriter, "Design for Manufacturing", "dfm", aSMD.myIssueList, aBRep,
"Part contains no DFM improvement suggestions.");
MTKConverter_UnfoldedPartData anUnfoldedPartData = aSMD.myUnfoldedPartData;
WriteUnfoldedPartFeatures(theWriter, anUnfoldedPartData);
if (anUnfoldedPartData.IsInit())
{
WriteFeatures(theWriter, "Design for Manufacturing", "dfmUnfolded", anUnfoldedPartData.myIssueList,
anUnfoldedPartData.myBRep, "Unfolded part contains no DFM improvement suggestions.");
}
aRes = true;
}
else if (aBRep == null
{
anErrorMsg = "The part can't be analyzed due to lack of: BRep representation, solids and shells in BRep representation.";
}
else
{
anErrorMsg = "The part wasn't recognized as a sheet metal part.";
}
}
else
{
anErrorMsg = "Unrecognized process";
}
if (!aRes)
{
theWriter.WriteData("error", anErrorMsg);
}
}
}
}
Defines a Unicode (UTF-16) string wrapping a standard string.
Definition: Base_UTF16String.hxx:34
const MTKBase_Hole & Hole() const
Definition: DFMBase_HoleIssue.cxx:51
Describes a base class for issues found during design for manufacturing (DFM) analysis.
Definition: DFMBase_Issue.hxx:32
static bool CompareType(const MTKBase_Feature &theFeature)
Returnstrue if theFeature is a dfm issue.
Definition: DFMBase_Issue.cxx:35
Describes deep bored hole issue found during cnc machining turning design analysis.
Definition: DFMMachining_DeepBoredHoleIssue.hxx:33
double ActualDiameter() const
Definition: DFMMachining_DeepBoredHoleIssue.cxx:131
const ModelData_Shell & Shape() const
Definition: DFMMachining_DeepBoredHoleIssue.cxx:151
double ActualDepth() const
Definition: DFMMachining_DeepBoredHoleIssue.cxx:111
double ExpectedMaxDepth() const
Definition: DFMMachining_DeepBoredHoleIssue.cxx:101
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm deep bored hole issue.
Definition: DFMMachining_DeepBoredHoleIssue.cxx:166
Describes deep hole issues found during cnc machining drilling design analysis.
Definition: DFMMachining_DeepHoleIssue.hxx:31
double ExpectedMaxDepth() const
Definition: DFMMachining_DeepHoleIssue.cxx:112
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining deep hole issue.
Definition: DFMMachining_DeepHoleIssue.cxx:127
double ActualDepth() const
Definition: DFMMachining_DeepHoleIssue.cxx:121
double ExpectedMaxDepth() const
Definition: DFMMachining_DeepPocketIssue.cxx:101
const Machining_Pocket & Pocket() const
Definition: DFMMachining_DeepPocketIssue.cxx:128
double ActualDepth() const
Definition: DFMMachining_DeepPocketIssue.cxx:110
Describes a base class for drilling issues found during cnc machining drilling design analysis.
Definition: DFMMachining_DrillingIssue.hxx:37
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining drilling issue.
Definition: DFMMachining_DrillingIssue.cxx:66
Describes flat bottom hole issues found during cnc machining drilling design analysis.
Definition: DFMMachining_FlatBottomHoleIssue.hxx:31
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining flat bottom hole issue.
Definition: DFMMachining_FlatBottomHoleIssue.cxx:67
Describes high boss issues found during cnc machining milling design analysis.
Definition: DFMMachining_HighBossIssue.hxx:32
double ActualHeight() const
Definition: DFMMachining_HighBossIssue.cxx:117
double ExpectedMaxHeight() const
Definition: DFMMachining_HighBossIssue.cxx:105
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theIssue is a dfm high boss issue.
Definition: DFMMachining_HighBossIssue.cxx:144
const MTKBase_Boss & Boss() const
Definition: DFMMachining_HighBossIssue.cxx:129
Describes inconsistent radius milled part floor fillet issue found during cnc machining milling desig...
Definition: DFMMachining_InconsistentRadiusMilledPartFloorFilletIssue.hxx:32
double ActualRadius() const
Definition: DFMMachining_InconsistentRadiusMilledPartFloorFilletIssue.cxx:80
const ModelData_Shell & FloorFillet() const
Definition: DFMMachining_InconsistentRadiusMilledPartFloorFilletIssue.cxx:100
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining inconsistent radius milled part floor fillet issue.
Definition: DFMMachining_InconsistentRadiusMilledPartFloorFilletIssue.cxx:115
double ExpectedRadius() const
Definition: DFMMachining_InconsistentRadiusMilledPartFloorFilletIssue.cxx:60
Describes intersecting cavity hole issues found during cnc machining drilling design analysis.
Definition: DFMMachining_IntersectingCavityHoleIssue.hxx:31
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining intersecting cavity hole issue.
Definition: DFMMachining_IntersectingCavityHoleIssue.cxx:69
Describes irregular outer diameter profile relief found during cnc machining turning design analysis.
Definition: DFMMachining_IrregularTurnedPartOuterDiameterProfileReliefIssue.hxx:33
double ExpectedMaxFaceInclineAngle() const
Definition: DFMMachining_IrregularTurnedPartOuterDiameterProfileReliefIssue.cxx:69
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm irregular outer diameter profile relief issue.
Definition: DFMMachining_IrregularTurnedPartOuterDiameterProfileReliefIssue.cxx:125
double ActualFaceInclineAngle() const
Definition: DFMMachining_IrregularTurnedPartOuterDiameterProfileReliefIssue.cxx:90
const ModelData_Face & Face() const
Definition: DFMMachining_IrregularTurnedPartOuterDiameterProfileReliefIssue.cxx:110
Described the Narrow Pocket maximum to minimum sizes ratio issue found during cnc machining milling d...
Definition: DFMMachining_LargeDifferenceRegionsSizeInPocketIssue.hxx:34
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm large difference regions size in pocket issue.
Definition: DFMMachining_LargeDifferenceRegionsSizeInPocketIssue.cxx:207
double ActualMaxRegionsMaxToMinSizeRatio() const
Definition: DFMMachining_LargeDifferenceRegionsSizeInPocketIssue.cxx:127
const ModelData_Shell & MaxRegionPocketSidewall() const
Definition: DFMMachining_LargeDifferenceRegionsSizeInPocketIssue.cxx:174
const ModelData_Shell & InnerFeature() const
Definition: DFMMachining_LargeDifferenceRegionsSizeInPocketIssue.cxx:156
double ExpectedMaxRegionsMaxToMinSizeRatio() const
Definition: DFMMachining_LargeDifferenceRegionsSizeInPocketIssue.cxx:67
const ModelData_Shell & MinRegionPocketSidewall() const
Definition: DFMMachining_LargeDifferenceRegionsSizeInPocketIssue.cxx:192
Describes large milled part issue found during cnc machining milling design analysis.
Definition: DFMMachining_LargeMilledPartIssue.hxx:34
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining large milled part issue.
Definition: DFMMachining_LargeMilledPartIssue.cxx:106
const DFMMachining_MilledPartSize & ExpectedMaxMilledPartSize() const
Definition: DFMMachining_LargeMilledPartIssue.cxx:73
const DFMMachining_MilledPartSize & ActualMilledPartSize() const
Definition: DFMMachining_LargeMilledPartIssue.cxx:91
Describes large turned part issue found during cnc machining turning design analysis.
Definition: DFMMachining_LargeTurnedPartIssue.hxx:34
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining large turned part issue.
Definition: DFMMachining_LargeTurnedPartIssue.cxx:105
const DFMMachining_TurnedPartSize & ExpectedMaxTurnedPartSize() const
Definition: DFMMachining_LargeTurnedPartIssue.cxx:72
const DFMMachining_TurnedPartSize & ActualTurnedPartSize() const
Definition: DFMMachining_LargeTurnedPartIssue.cxx:90
Describes long-slender turned part issue found during cnc machining turning design analysis.
Definition: DFMMachining_LongSlenderTurnedPartIssue.hxx:31
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining long-slender turned part issue.
Definition: DFMMachining_LongSlenderTurnedPartIssue.cxx:147
double ActualLength() const
Definition: DFMMachining_LongSlenderTurnedPartIssue.cxx:110
double ExpectedMaxLength() const
Definition: DFMMachining_LongSlenderTurnedPartIssue.cxx:101
double ActualMinDiameter() const
Definition: DFMMachining_LongSlenderTurnedPartIssue.cxx:130
Describes external edge fillet issue found during cnc machining milling design analysis.
Definition: DFMMachining_MilledPartExternalEdgeFilletIssue.hxx:32
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm milled part external edge fillet issue.
Definition: DFMMachining_MilledPartExternalEdgeFilletIssue.cxx:75
const ModelData_Shell & Fillet() const
Definition: DFMMachining_MilledPartExternalEdgeFilletIssue.cxx:60
Describes milled part size used in cnc machining milling design analysis.
Definition: DFMMachining_MilledPartSize.hxx:37
double Width() const
Definition: DFMMachining_MilledPartSize.cxx:60
double Length() const
Definition: DFMMachining_MilledPartSize.cxx:80
double Height() const
Definition: DFMMachining_MilledPartSize.cxx:100
Describes a base class for milling issues found during cnc machining milling design analysis.
Definition: DFMMachining_MillingIssue.hxx:35
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theIssue is a dfm machining milling issue.
Definition: DFMMachining_MillingIssue.cxx:37
Described the Narrow Pocket minimum size issue found during DFM analysis for Machining Milling operat...
Definition: DFMMachining_NarrowRegionInPocketIssue.hxx:32
const ModelData_Shell & NarrowRegionSidewall() const
Definition: DFMMachining_NarrowRegionInPocketIssue.cxx:143
double ActualRegionSize() const
Definition: DFMMachining_NarrowRegionInPocketIssue.cxx:87
double ExpectedMinRegionSize() const
Definition: DFMMachining_NarrowRegionInPocketIssue.cxx:67
static bool CompareType(const MTKBase_Feature &theFeature)
Returnstrue if theFeature is a dfm narrow regions distance issue.
Definition: DFMMachining_NarrowRegionInPocketIssue.cxx:158
const ModelData_Shell & InnerFeature() const
Definition: DFMMachining_NarrowRegionInPocketIssue.cxx:125
Describes non perpendicular hole issues found during cnc machining drilling design analysis.
Definition: DFMMachining_NonPerpendicularHoleIssue.hxx:31
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining non perpendicular hole issue.
Definition: DFMMachining_NonPerpendicularHoleIssue.cxx:65
Describes non perpendicular milled part shape issue found during cnc machining milling design analysi...
Definition: DFMMachining_NonPerpendicularMilledPartShapeIssue.hxx:32
double ActualAngle() const
Definition: DFMMachining_NonPerpendicularMilledPartShapeIssue.cxx:59
const ModelData_Shell & Shape() const
Definition: DFMMachining_NonPerpendicularMilledPartShapeIssue.cxx:79
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining non perpendicular milled part shape issue.
Definition: DFMMachining_NonPerpendicularMilledPartShapeIssue.cxx:94
Describes non standard diameter hole issues found during cnc machining drilling design analysis.
Definition: DFMMachining_NonStandardDiameterHoleIssue.hxx:31
double NearestStandardDiameter() const
Definition: DFMMachining_NonStandardDiameterHoleIssue.cxx:72
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining non standard diameter hole issue.
Definition: DFMMachining_NonStandardDiameterHoleIssue.cxx:98
double ActualDiameter() const
Definition: DFMMachining_NonStandardDiameterHoleIssue.cxx:92
Describes non standard drill point angle blind hole issues found during cnc machining drilling design...
Definition: DFMMachining_NonStandardDrillPointAngleBlindHoleIssue.hxx:31
double NearestStandardAngle() const
Definition: DFMMachining_NonStandardDrillPointAngleBlindHoleIssue.cxx:70
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining non standard drill point angle blind hole issue.
Definition: DFMMachining_NonStandardDrillPointAngleBlindHoleIssue.cxx:108
double ActualAngle() const
Definition: DFMMachining_NonStandardDrillPointAngleBlindHoleIssue.cxx:91
Describes non standard radius milled part floor fillet issue found during cnc machining milling desig...
Definition: DFMMachining_NonStandardRadiusMilledPartFloorFilletIssue.hxx:32
double NearestStandardRadius() const
Definition: DFMMachining_NonStandardRadiusMilledPartFloorFilletIssue.cxx:59
double ActualRadius() const
Definition: DFMMachining_NonStandardRadiusMilledPartFloorFilletIssue.cxx:79
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining non standard radius milled part floor fillet issue.
Definition: DFMMachining_NonStandardRadiusMilledPartFloorFilletIssue.cxx:114
const ModelData_Shell & FloorFillet() const
Definition: DFMMachining_NonStandardRadiusMilledPartFloorFilletIssue.cxx:99
Describes asymmetric axial slot issue found during cnc machining turning design analysis.
Definition: DFMMachining_NonSymmetricalAxialSlotIssue.hxx:33
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a non-symmetrical axial slot issue.
Definition: DFMMachining_NonSymmetricalAxialSlotIssue.cxx:84
const Machining_Pocket & AxialSlot() const
Definition: DFMMachining_NonSymmetricalAxialSlotIssue.cxx:69
Describes partial hole issues found during cnc machining drilling design analysis.
Definition: DFMMachining_PartialHoleIssue.hxx:31
double ActualMaterialPercent() const
Definition: DFMMachining_PartialHoleIssue.cxx:99
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining partial hole issue.
Definition: DFMMachining_PartialHoleIssue.cxx:116
double ExpectedMinMaterialPercent() const
Definition: DFMMachining_PartialHoleIssue.cxx:79
Describes small depth blind bored hole relief found during cnc machining turning design analysis.
Definition: DFMMachining_SmallDepthBlindBoredHoleReliefIssue.hxx:33
double ActualDiameter() const
Definition: DFMMachining_SmallDepthBlindBoredHoleReliefIssue.cxx:135
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm small depth blind bored hole relief issue.
Definition: DFMMachining_SmallDepthBlindBoredHoleReliefIssue.cxx:170
double ExpectedMinReliefDepth() const
Definition: DFMMachining_SmallDepthBlindBoredHoleReliefIssue.cxx:105
const ModelData_Shell & BlindBoredHole() const
Definition: DFMMachining_SmallDepthBlindBoredHoleReliefIssue.cxx:155
double ActualReliefDepth() const
Definition: DFMMachining_SmallDepthBlindBoredHoleReliefIssue.cxx:115
Describes small diameter hole issues found during cnc machining drilling design analysis.
Definition: DFMMachining_SmallDiameterHoleIssue.hxx:31
double ActualDiameter() const
Definition: DFMMachining_SmallDiameterHoleIssue.cxx:100
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining small diameter hole issue.
Definition: DFMMachining_SmallDiameterHoleIssue.cxx:106
double ExpectedMinDiameter() const
Definition: DFMMachining_SmallDiameterHoleIssue.cxx:80
Describes internal corner radius issues found during cnc machining milling design analysis.
Definition: DFMMachining_SmallRadiusMilledPartInternalCornerIssue.hxx:32
double ExpectedMinRadius() const
Definition: DFMMachining_SmallRadiusMilledPartInternalCornerIssue.cxx:103
const ModelData_Shell & Shape() const
Definition: DFMMachining_SmallRadiusMilledPartInternalCornerIssue.cxx:155
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theIssue is a dfm small radius milled part internal corner issue.
Definition: DFMMachining_SmallRadiusMilledPartInternalCornerIssue.cxx:170
double ActualRadius() const
Definition: DFMMachining_SmallRadiusMilledPartInternalCornerIssue.cxx:113
Describes internal corner radius issues found during cnc machining turning design analysis.
Definition: DFMMachining_SmallRadiusTurnedPartInternalCornerIssue.hxx:33
double ActualRadius() const
Definition: DFMMachining_SmallRadiusTurnedPartInternalCornerIssue.cxx:89
double ExpectedMinRadius() const
Definition: DFMMachining_SmallRadiusTurnedPartInternalCornerIssue.cxx:69
const ModelData_Shell & Shape() const
Definition: DFMMachining_SmallRadiusTurnedPartInternalCornerIssue.cxx:111
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm small radius turned part internal corner issue.
Definition: DFMMachining_SmallRadiusTurnedPartInternalCornerIssue.cxx:126
Describes square form keyway issue found during cnc machining turning design analysis.
Definition: DFMMachining_SquareEndKeywayIssue.hxx:33
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm square-end keyway issue.
Definition: DFMMachining_SquareEndKeywayIssue.cxx:86
const Machining_Pocket & Keyway() const
Definition: DFMMachining_SquareEndKeywayIssue.cxx:71
Describes turned part size used in cnc machining turning design analysis.
Definition: DFMMachining_TurnedPartSize.hxx:37
double Radius() const
Definition: DFMMachining_TurnedPartSize.cxx:62
double Length() const
Definition: DFMMachining_TurnedPartSize.cxx:82
Describes a boss. In CNC Machining a boss is a protrusion or raised area on a workpiece that is creat...
Definition: MTKBase_Boss.hxx:27
double Length() const
Definition: MTKBase_Boss.cxx:89
static bool CompareType(const MTKBase_Feature &theFeature)
Returnstrue if theFeature is a Boss.
Definition: MTKBase_Boss.cxx:126
double Width() const
Definition: MTKBase_Boss.cxx:69
double Height() const
Definition: MTKBase_Boss.cxx:109
Describeas a base class for composite features.
Definition: MTKBase_CompositeFeature.hxx:34
const MTKBase_FeatureList & FeatureList() const
Returns the feature references list.
Definition: MTKBase_CompositeFeature.cxx:94
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a composite feature.
Definition: MTKBase_CompositeFeature.cxx:100
Provides possibility to compare MTK based features depending on their type and parameters.
Definition: MTKBase_FeatureComparator.hxx:29
bool IsEmpty() const
Definition: MTKBase_FeatureList.hxx:53
const ModelData_Axis3Placement & Axis() const
Definition: MTKBase_Hole.cxx:127
double Depth() const
Definition: MTKBase_Hole.cxx:98
double Radius() const
Definition: MTKBase_Hole.cxx:78
Describes a feature with assigned shape.
Definition: MTKBase_ShapeFeature.hxx:34
const ModelData_Shape & Shape() const
Definition: MTKBase_ShapeFeature.cxx:62
static bool CompareType(const MTKBase_Feature &theFeature)
Returnstrue if theFeature is a shape feature.
Definition: MTKBase_ShapeFeature.cxx:77
Describes a machining countersink.
Definition: Machining_Countersink.hxx:33
double Radius() const
Definition: Machining_Countersink.cxx:83
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a machining countersink.
Definition: Machining_Countersink.cxx:147
const ModelData_Axis3Placement & Axis() const
Definition: Machining_Countersink.cxx:132
double Depth() const
Definition: Machining_Countersink.cxx:103
Describes a face produced by a specified machining operation.
Definition: Machining_Face.hxx:38
static bool CompareType(const MTKBase_Feature &theFeature)
Returnstrue if theFeature is a machining face.
Definition: Machining_Face.cxx:231
Machining_FaceType Type() const
Definition: Machining_Face.cxx:216
Describes a machining hole of a specified type. Hole is a cylindrical feature that can be made by cut...
Definition: Machining_Hole.hxx:32
Machining_HoleType Type() const
Definition: Machining_Hole.cxx:142
static bool CompareType(const MTKBase_Feature &theFeature)
Returnstrue if theFeature is a machining hole.
Definition: Machining_Hole.cxx:157
Describes a machining pocket. A pocket is a feature obtained by milling the material inside an arbitr...
Definition: Machining_Pocket.hxx:32
double Width() const
Definition: Machining_Pocket.cxx:69
double Depth() const
Definition: Machining_Pocket.cxx:109
const ModelData_Axis1Placement & Axis() const
Definition: Machining_Pocket.cxx:138
static bool CompareType(const MTKBase_Feature &theFeature)
Returnstrue if theFeature is a machining Pocket.
Definition: Machining_Pocket.cxx:153
double Length() const
Definition: Machining_Pocket.cxx:89
Describes a face with radius produced by a specified machining operation. Cutting material from workp...
Definition: Machining_TurningFace.hxx:31
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a machining turning face.
Definition: Machining_TurningFace.cxx:87
double Radius() const
Definition: Machining_TurningFace.cxx:70
const ModelData_Direction & Direction() const
Returns a direction value.
Definition: ModelData_Axis1Placement.cxx:75
const ModelData_Direction & Axis() const
Returns a Z-direction of the axis placement.
Definition: ModelData_Axis3Placement.cxx:90
int ShapeId(const ModelData_Shape &theShape) const
Returns an Id of B-Rep shape.
Definition: ModelData_BRepRepresentation.cxx:1021
const ModelData_BodyList & Get() const
Returns an associated topological object.
Definition: ModelData_BRepRepresentation.cxx:626
Defines a 3D direction.
Definition: ModelData_Direction.hxx:180
Defines polygonal (faceted or tessellated) representation of part.
Definition: ModelData_PolyRepresentation.hxx:39
Machining_HoleType
Defines a hole type in machining.
Definition: Machining_HoleType.hxx:29
Machining_FaceType
Describes a face produced by a specified machining operation.
Definition: Machining_FaceType.hxx:29
SheetMetal_HemBendType
Defines a hem bend type in sheet metal.
Definition: SheetMetal_HemBendType.hxx:29