using System;
using System.Collections.Generic;
using System.IO;
using ShapeIDVectorType = System.Collections.Generic.List<uint>;
using ShapeIDVectorVectorType = System.Collections.Generic.List<System.Collections.Generic.List<uint>>;
System.Collections.Generic.KeyValuePair<uint, System.Collections.Generic.List<System.Collections.Generic.List<uint>>>>;
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)";
}
private string MachiningPocketTypeToString(Machining_PocketType theType)
{
switch (theType)
{
case Machining_PocketType.Machining_PT_Closed: return "Closed Pocket(s)";
case Machining_PocketType.Machining_PT_Open: return "Open Pocket(s)";
case Machining_PocketType.Machining_PT_Through: return "Through Pocket(s)";
default:
break;
}
return "Pocket(s)";
}
private string MachiningPocketColor(Machining_PocketType theType)
{
switch (theType)
{
case Machining_PocketType.Machining_PT_Closed: return "(81, 20, 0)";
case Machining_PocketType.Machining_PT_Open: return "(189, 103, 37)";
case Machining_PocketType.Machining_PT_Through: return "(255, 217, 188)";
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);
}
{
Machining_PocketType aType = aPocket.
Type();
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(MachiningPocketTypeToString(aType), MachiningPocketColor(aType), aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
"Draft Angle",
"deg", aScrewBoss.
DraftAngle() * 180 / Math.PI,
theShapeIdVector);
theManager.AddGroupData("Screw Boss(es)", "(12, 32, 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(
"Length",
"mm", aRib.
Length(),
"Height",
"mm", aRib.
Height(),
"Draft Angle",
"deg", aRib.
DraftAngle() * 180 / Math.PI,
theShapeIdVector);
theManager.AddGroupData("Rib(s)", "(34, 51, 127)", 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);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Small Wall Thickness Issue(s)", "(64, 224, 208)", 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 AddMoldingIssue (FeatureGroupManager theManager,
DFMBase_Issue theIssue,
uint theCount, ShapeIDVectorVectorType theShapeIdVector)
{
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("High Rib(s)", "(284, 36, 12)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("High Screw Boss(es)", "(16, 75, 95)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Irregular Core Depth Screw Boss(es)", "(56, 176, 95)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Irregular Core Diameter Screw Boss(es)", "(195, 195, 195)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Irregular Thickness Rib(s)", "(68, 114, 250)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
"Actual Wall Thickness",
"mm", aIWTIssue.
ActualThickness(),
theShapeIdVector);
theManager.AddGroupData ("Irregular Wall(s)", "(23, 11, 19)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData ("Irregular Wall Thickness Screw Boss(es)", "(13, 12, 245)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
"Actual Wall Thickness", "mm", aLWTIssue.ActualThickness(),
theShapeIdVector);
theManager.AddGroupData ("Large Wall(s)", "(101, 22, 129)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData ("Small Base Radius Rib(s)", "(13, 12, 90)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData ("Small Base Radius Screw Boss(es)", "(56, 18, 23)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Small Draft Angle Rib(s)", "(189, 200, 13)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Small Draft Angle Screw Boss(es)", "(27, 101, 27)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Small Hole Base Radius Screw Boss(es)", "(98, 8, 2)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Small Draft Angle Wall(s)", "(101, 67, 33)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(theShapeIdVector);
theManager.AddGroupData("Non Chamfered Screw Boss(es)", "(38, 38, 10)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData("Small Distance Between Ribs Issue(s)", "(11, 90, 111)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
"Actual Wall Thickness", "mm", aSWTIssue.ActualThickness(),
theShapeIdVector);
theManager.AddGroupData ("Small Wall(s)", "(14, 209, 199)", aFeatureData, theCount);
}
{
string aFeatureData = WriteFeatureDataToString(
theShapeIdVector);
theManager.AddGroupData ("Small Distance Between Bosses Issue(s)", "(255, 102, 0)", 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);
}
}
private ShapeIDVectorType GetShapesId(
Shape theShape,
ShapeType theType)
{
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
while (aShapeIt.HasNext())
{
Shape aShape = aShapeIt.Next();
aShapeIdVector.Add(aShape.
Id());
}
return aShapeIdVector;
}
private void AddShapesId(
Shape theShape,
ShapeType theType, ShapeIDVectorType theShapesIdVec)
{
while (aShapeIt.HasNext())
{
Shape aShape = aShapeIt.Next();
theShapesIdVec.Add(aShape.
Id());
}
}
{
for (uint i = 0; i < theFeatures.
Size(); i++)
{
{
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(), aShapeType);
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(new ShapeIDVectorType());
}
{
ShapeIDVectorType aShapeIdVector = GetShapesId(aMSICRIssue.
Shape(),
ShapeType.Face);
aValue.Add(aShapeIdVector);
}
{
DFMMachining_NonPerpendicularMilledPartShapeIssue.Cast (aFeature);
ShapeIDVectorType aShapeIdVector = GetShapesId (aNPMPSIssue.
Shape(),
ShapeType.Face);
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = GetShapesId(aMPEEFIssue.
Fillet(),
ShapeType.Face);
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
aValue.Add(aShapeIdVector);
}
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
aValue.Add(aShapeIdVector);
}
ShapeIDVectorType aShapeIdVector = GetShapesId(aSWTIssue.
Shape(),
ShapeType.Face);
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = GetShapesId(aISBHIssue.
Shape(),
ShapeType.Face);
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = GetShapesId(aODPRIssue.
Face(),
ShapeType.
Face);
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = GetShapesId(aTSICRIssue.
Shape(),
ShapeType.Face);
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(new ShapeIDVectorType());
}
{
aValue.Add(new ShapeIDVectorType());
}
{
ShapeIDVectorType aShapeIdVector = GetShapesId(aHRIssue.
Rib().
Shape(),
ShapeType.Face);
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = GetShapesId(aITRIssue.
Rib().
Shape(),
ShapeType.Face);
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = GetShapesId(aSBRRIssue.
Rib().
Shape(),
ShapeType.Face);
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = GetShapesId(aSMDARIssue.
Rib().
Shape(),
ShapeType.Face);
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = GetShapesId(aIWTIssue.
Shape(),
ShapeType.Face);
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = GetShapesId(aLWTIssue.Shape(),
ShapeType.Face);
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = GetShapesId(aSWTIssue.Shape(),
ShapeType.Face);
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector =
new ShapeIDVectorType { aFPIIssue.
FirstFace().
Id(),
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = GetShapesId(aICFRNIssue.
Bend().
Shape(),
ShapeType.Face);
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = GetShapesId(aIDEHIssue.
Hole().
Shape(),
ShapeType.Face);
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = new ShapeIDVectorType();
if (!aFirstActualRelief.
IsNull())
{
AddShapesId(aFirstActualRelief.
Shape(),
ShapeType.Edge, aShapeIdVector);
}
if (!aSecondActualRelief.
IsNull())
{
AddShapesId(aSecondActualRelief.
Shape(),
ShapeType.Edge, aShapeIdVector);
}
aValue.Add(aShapeIdVector);
}
{
aValue.Add(aShapeIdVector);
}
{
ShapeIDVectorType aShapeIdVector = GetShapesId(aISTIssue.
Tab().
Shape(),
ShapeType.Edge);
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();
aShapeIdVector.Add(aSDIssue.
Edge().
Id());
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();
aShapeIdVector.Add(aSDIssue.
Edge().
Id());
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,
{
theWriter.OpenSection(theSubgroupName);
theWriter.WriteData("name", theGroupName);
{
theWriter.WriteData("message", theMessageForEmptyList);
}
else
{
FeatureMapType aSortedFeatures = new FeatureMapType(new FeatureComparer());
SortFeatures(theFeatures, 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);
}
{
AddMoldingIssue(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";
}
private bool HasShapes(
cadex.Collections.BodyList theBodies,
ShapeType theType)
{
for (int i = 0, n = theBodies.Count; i < n; ++i)
{
Body aBody = theBodies[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));
cadex.Collections.BodyList aBodies = aMD.myPart.Bodies();
if (!aMD.myFeatureList.IsEmpty())
{
WriteFeatures(theWriter, "Feature Recognition", "featureRecognition", aMD.myFeatureList, "");
WriteFeatures(theWriter, "Design for Manufacturing", "dfm", aMD.myIssueList,
"Part contains no DFM improvement suggestions.");
aRes = true;
}
else if (!HasShapes(aBodies,
ShapeType.Solid))
{
anErrorMsg = "The part can't be analyzed due to lack of: BRep representation or solids in BRep representation.";
}
}
else if (theProcessData is MTKConverter_MoldingData)
{
MTKConverter_MoldingData aMoldingData = (MTKConverter_MoldingData)theProcessData;
theWriter.WriteData("process", "Molding Analysis");
cadex.Collections.BodyList aBodies = aMoldingData.myPart.Bodies();
if (!aMoldingData.myFeatureList.IsEmpty())
{
WriteFeatures(theWriter, "Feature Recognition", "featureRecognition", aMoldingData.myFeatureList, "");
WriteFeatures(theWriter, "Design for Manufacturing", "dfm", aMoldingData.myIssueList,
"Part contains no DFM improvement suggestions.");
aRes = true;
}
else if (!HasShapes(aBodies,
ShapeType.Solid))
{
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");
cadex.Collections.BodyList aBodies = aSMD.myPart.Bodies();
if (aSMD.myIsSheetMetalPart)
{
WriteFeatures(theWriter, "Feature Recognition", "featureRecognition", aSMD.myFeatureList,
"Part contains no features.");
WriteFeatures(theWriter, "Design for Manufacturing", "dfm", aSMD.myIssueList,
"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,
"Unfolded part contains no DFM improvement suggestions.");
}
aRes = true;
}
{
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 if (theProcessData is MTKConverter_WallThicknessData)
{
MTKConverter_WallThicknessData aWTD = (MTKConverter_WallThicknessData)theProcessData;
theWriter.WriteData("process", "Wall Thickness Analysis");
cadex.Collections.BodyList aBodies = aWTD.myPart.Bodies();
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 (!HasShapes(aBodies,
ShapeType.Solid))
{
anErrorMsg = "The part can't be analyzed due to lack of: " +
"BRep representation, solids in BRep representation.";
}
}
else
{
anErrorMsg = "Unrecognized process";
}
if (!aRes)
{
theWriter.WriteData("error", anErrorMsg);
}
}
}
}
size_t Id() const
Return unique identifier of public object.
Definition BaseObject.cxx:46
const MTKBase_Hole & Hole() const
Definition DFMBase_HoleIssue.cxx:50
Describes a base class for issues found during design for manufacturing (DFM) analysis.
Definition DFMBase_Issue.hxx:33
static bool CompareType(const MTKBase_Feature &theFeature)
Returnstrue if theFeature is a dfm issue.
Definition DFMBase_Issue.cxx:36
Describes deep bored hole issue found during cnc machining turning design analysis.
Definition DFMMachining_DeepBoredHoleIssue.hxx:33
double ActualDiameter() const
Definition DFMMachining_DeepBoredHoleIssue.cxx:130
const ModelData::Shell & Shape() const
Definition DFMMachining_DeepBoredHoleIssue.cxx:150
double ActualDepth() const
Definition DFMMachining_DeepBoredHoleIssue.cxx:110
double ExpectedMaxDepth() const
Definition DFMMachining_DeepBoredHoleIssue.cxx:100
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm deep bored hole issue.
Definition DFMMachining_DeepBoredHoleIssue.cxx:165
Describes deep hole issues found during cnc machining drilling design analysis.
Definition DFMMachining_DeepHoleIssue.hxx:29
double ExpectedMaxDepth() const
Definition DFMMachining_DeepHoleIssue.cxx:111
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining deep hole issue.
Definition DFMMachining_DeepHoleIssue.cxx:126
double ActualDepth() const
Definition DFMMachining_DeepHoleIssue.cxx:120
double ExpectedMaxDepth() const
Definition DFMMachining_DeepPocketIssue.cxx:100
const Machining_Pocket & Pocket() const
Definition DFMMachining_DeepPocketIssue.cxx:127
double ActualDepth() const
Definition DFMMachining_DeepPocketIssue.cxx:109
Describes a base class for drilling issues found during cnc machining drilling design analysis.
Definition DFMMachining_DrillingIssue.hxx:36
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining drilling issue.
Definition DFMMachining_DrillingIssue.cxx:65
Describes flat bottom hole issues found during cnc machining drilling design analysis.
Definition DFMMachining_FlatBottomHoleIssue.hxx:29
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining flat bottom hole issue.
Definition DFMMachining_FlatBottomHoleIssue.cxx:66
Describes high boss issues found during cnc machining milling design analysis.
Definition DFMMachining_HighBossIssue.hxx:30
double ActualHeight() const
Definition DFMMachining_HighBossIssue.cxx:116
double ExpectedMaxHeight() const
Definition DFMMachining_HighBossIssue.cxx:104
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theIssue is a dfm high boss issue.
Definition DFMMachining_HighBossIssue.cxx:143
const MTKBase_Boss & Boss() const
Definition DFMMachining_HighBossIssue.cxx:128
Describes inconsistent radius milled part floor fillet issue found during cnc machining milling desig...
Definition DFMMachining_InconsistentRadiusMilledPartFloorFilletIssue.hxx:33
const ModelData::Shell & FloorFillet() const
Definition DFMMachining_InconsistentRadiusMilledPartFloorFilletIssue.cxx:99
double ActualRadius() const
Definition DFMMachining_InconsistentRadiusMilledPartFloorFilletIssue.cxx:79
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:114
double ExpectedRadius() const
Definition DFMMachining_InconsistentRadiusMilledPartFloorFilletIssue.cxx:59
Describes intersecting cavity hole issues found during cnc machining drilling design analysis.
Definition DFMMachining_IntersectingCavityHoleIssue.hxx:29
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining intersecting cavity hole issue.
Definition DFMMachining_IntersectingCavityHoleIssue.cxx:68
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:68
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm irregular outer diameter profile relief issue.
Definition DFMMachining_IrregularTurnedPartOuterDiameterProfileReliefIssue.cxx:124
const ModelData::Face & Face() const
Definition DFMMachining_IrregularTurnedPartOuterDiameterProfileReliefIssue.cxx:109
double ActualFaceInclineAngle() const
Definition DFMMachining_IrregularTurnedPartOuterDiameterProfileReliefIssue.cxx:89
Described the Narrow Pocket maximum to minimum sizes ratio issue found during cnc machining milling d...
Definition DFMMachining_LargeDifferenceRegionsSizeInPocketIssue.hxx:35
const ModelData::Shell & MinRegionPocketSidewall() const
Definition DFMMachining_LargeDifferenceRegionsSizeInPocketIssue.cxx:191
const ModelData::Shell & MaxRegionPocketSidewall() const
Definition DFMMachining_LargeDifferenceRegionsSizeInPocketIssue.cxx:173
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:206
const ModelData::Shell & InnerFeature() const
Definition DFMMachining_LargeDifferenceRegionsSizeInPocketIssue.cxx:155
double ActualMaxRegionsMaxToMinSizeRatio() const
Definition DFMMachining_LargeDifferenceRegionsSizeInPocketIssue.cxx:126
double ExpectedMaxRegionsMaxToMinSizeRatio() const
Definition DFMMachining_LargeDifferenceRegionsSizeInPocketIssue.cxx:66
Describes large milled part issue found during cnc machining milling design analysis.
Definition DFMMachining_LargeMilledPartIssue.hxx:31
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining large milled part issue.
Definition DFMMachining_LargeMilledPartIssue.cxx:105
const DFMMachining_MilledPartSize & ExpectedMaxMilledPartSize() const
Definition DFMMachining_LargeMilledPartIssue.cxx:72
const DFMMachining_MilledPartSize & ActualMilledPartSize() const
Definition DFMMachining_LargeMilledPartIssue.cxx:90
Describes large turned part issue found during cnc machining turning design analysis.
Definition DFMMachining_LargeTurnedPartIssue.hxx:31
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining large turned part issue.
Definition DFMMachining_LargeTurnedPartIssue.cxx:104
const DFMMachining_TurnedPartSize & ExpectedMaxTurnedPartSize() const
Definition DFMMachining_LargeTurnedPartIssue.cxx:71
const DFMMachining_TurnedPartSize & ActualTurnedPartSize() const
Definition DFMMachining_LargeTurnedPartIssue.cxx:89
Describes long-slender turned part issue found during cnc machining turning design analysis.
Definition DFMMachining_LongSlenderTurnedPartIssue.hxx:29
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining long-slender turned part issue.
Definition DFMMachining_LongSlenderTurnedPartIssue.cxx:146
double ActualLength() const
Definition DFMMachining_LongSlenderTurnedPartIssue.cxx:109
double ExpectedMaxLength() const
Definition DFMMachining_LongSlenderTurnedPartIssue.cxx:100
double ActualMinDiameter() const
Definition DFMMachining_LongSlenderTurnedPartIssue.cxx:129
Describes external edge fillet issue found during cnc machining milling design analysis.
Definition DFMMachining_MilledPartExternalEdgeFilletIssue.hxx:33
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm milled part external edge fillet issue.
Definition DFMMachining_MilledPartExternalEdgeFilletIssue.cxx:74
const ModelData::Shell & Fillet() const
Definition DFMMachining_MilledPartExternalEdgeFilletIssue.cxx:59
Describes milled part size used in cnc machining milling design analysis.
Definition DFMMachining_MilledPartSize.hxx:34
double Width() const
Definition DFMMachining_MilledPartSize.cxx:59
double Length() const
Definition DFMMachining_MilledPartSize.cxx:79
double Height() const
Definition DFMMachining_MilledPartSize.cxx:99
Describes a base class for milling issues found during cnc machining milling design analysis.
Definition DFMMachining_MillingIssue.hxx:33
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:33
const ModelData::Shell & InnerFeature() const
Definition DFMMachining_NarrowRegionInPocketIssue.cxx:124
double ActualRegionSize() const
Definition DFMMachining_NarrowRegionInPocketIssue.cxx:86
double ExpectedMinRegionSize() const
Definition DFMMachining_NarrowRegionInPocketIssue.cxx:66
static bool CompareType(const MTKBase_Feature &theFeature)
Returnstrue if theFeature is a dfm narrow regions distance issue.
Definition DFMMachining_NarrowRegionInPocketIssue.cxx:157
const ModelData::Shell & NarrowRegionSidewall() const
Definition DFMMachining_NarrowRegionInPocketIssue.cxx:142
Describes non perpendicular hole issues found during cnc machining drilling design analysis.
Definition DFMMachining_NonPerpendicularHoleIssue.hxx:29
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining non perpendicular hole issue.
Definition DFMMachining_NonPerpendicularHoleIssue.cxx:64
Describes non perpendicular milled part shape issue found during cnc machining milling design analysi...
Definition DFMMachining_NonPerpendicularMilledPartShapeIssue.hxx:33
const ModelData::Shell & Shape() const
Definition DFMMachining_NonPerpendicularMilledPartShapeIssue.cxx:78
double ActualAngle() const
Definition DFMMachining_NonPerpendicularMilledPartShapeIssue.cxx:58
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:93
Describes non standard diameter hole issues found during cnc machining drilling design analysis.
Definition DFMMachining_NonStandardDiameterHoleIssue.hxx:29
double NearestStandardDiameter() const
Definition DFMMachining_NonStandardDiameterHoleIssue.cxx:71
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining non standard diameter hole issue.
Definition DFMMachining_NonStandardDiameterHoleIssue.cxx:97
double ActualDiameter() const
Definition DFMMachining_NonStandardDiameterHoleIssue.cxx:91
Describes non standard drill point angle blind hole issues found during cnc machining drilling design...
Definition DFMMachining_NonStandardDrillPointAngleBlindHoleIssue.hxx:29
double NearestStandardAngle() const
Definition DFMMachining_NonStandardDrillPointAngleBlindHoleIssue.cxx:69
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:107
double ActualAngle() const
Definition DFMMachining_NonStandardDrillPointAngleBlindHoleIssue.cxx:90
Describes non standard radius milled part floor fillet issue found during cnc machining milling desig...
Definition DFMMachining_NonStandardRadiusMilledPartFloorFilletIssue.hxx:33
const ModelData::Shell & FloorFillet() const
Definition DFMMachining_NonStandardRadiusMilledPartFloorFilletIssue.cxx:98
double NearestStandardRadius() const
Definition DFMMachining_NonStandardRadiusMilledPartFloorFilletIssue.cxx:58
double ActualRadius() const
Definition DFMMachining_NonStandardRadiusMilledPartFloorFilletIssue.cxx:78
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:113
Describes asymmetric axial slot issue found during cnc machining turning design analysis.
Definition DFMMachining_NonSymmetricalAxialSlotIssue.hxx:29
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a non-symmetrical axial slot issue.
Definition DFMMachining_NonSymmetricalAxialSlotIssue.cxx:83
const Machining_Pocket & AxialSlot() const
Definition DFMMachining_NonSymmetricalAxialSlotIssue.cxx:68
Describes partial hole issues found during cnc machining drilling design analysis.
Definition DFMMachining_PartialHoleIssue.hxx:28
double ActualMaterialPercent() const
Definition DFMMachining_PartialHoleIssue.cxx:98
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining partial hole issue.
Definition DFMMachining_PartialHoleIssue.cxx:115
double ExpectedMinMaterialPercent() const
Definition DFMMachining_PartialHoleIssue.cxx:78
Describes small depth blind bored hole relief found during cnc machining turning design analysis.
Definition DFMMachining_SmallDepthBlindBoredHoleReliefIssue.hxx:32
double ActualDiameter() const
Definition DFMMachining_SmallDepthBlindBoredHoleReliefIssue.cxx:134
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:169
double ExpectedMinReliefDepth() const
Definition DFMMachining_SmallDepthBlindBoredHoleReliefIssue.cxx:104
double ActualReliefDepth() const
Definition DFMMachining_SmallDepthBlindBoredHoleReliefIssue.cxx:114
const ModelData::Shell & BlindBoredHole() const
Definition DFMMachining_SmallDepthBlindBoredHoleReliefIssue.cxx:154
Describes small diameter hole issues found during cnc machining drilling design analysis.
Definition DFMMachining_SmallDiameterHoleIssue.hxx:29
double ActualDiameter() const
Definition DFMMachining_SmallDiameterHoleIssue.cxx:99
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining small diameter hole issue.
Definition DFMMachining_SmallDiameterHoleIssue.cxx:105
double ExpectedMinDiameter() const
Definition DFMMachining_SmallDiameterHoleIssue.cxx:79
Describes internal corner radius issues found during cnc machining milling design analysis.
Definition DFMMachining_SmallRadiusMilledPartInternalCornerIssue.hxx:33
double ExpectedMinRadius() const
Definition DFMMachining_SmallRadiusMilledPartInternalCornerIssue.cxx:102
const ModelData::Shell & Shape() const
Definition DFMMachining_SmallRadiusMilledPartInternalCornerIssue.cxx:154
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:169
double ActualRadius() const
Definition DFMMachining_SmallRadiusMilledPartInternalCornerIssue.cxx:112
Describes internal corner radius issues found during cnc machining turning design analysis.
Definition DFMMachining_SmallRadiusTurnedPartInternalCornerIssue.hxx:33
double ActualRadius() const
Definition DFMMachining_SmallRadiusTurnedPartInternalCornerIssue.cxx:88
double ExpectedMinRadius() const
Definition DFMMachining_SmallRadiusTurnedPartInternalCornerIssue.cxx:68
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:125
const ModelData::Shell & Shape() const
Definition DFMMachining_SmallRadiusTurnedPartInternalCornerIssue.cxx:110
Describes wall with small thickness issues found during cnc machining milling design analysis.
Definition DFMMachining_SmallWallThicknessIssue.hxx:33
double ActualThickness() const
Definition DFMMachining_SmallWallThicknessIssue.cxx:85
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm machining small wall thickness issue.
Definition DFMMachining_SmallWallThicknessIssue.cxx:121
double ExpectedMinThickness() const
Definition DFMMachining_SmallWallThicknessIssue.cxx:65
ModelData::Shell Shape() const
Definition DFMMachining_SmallWallThicknessIssue.cxx:103
Describes square form keyway issue found during cnc machining turning design analysis.
Definition DFMMachining_SquareEndKeywayIssue.hxx:30
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm square-end keyway issue.
Definition DFMMachining_SquareEndKeywayIssue.cxx:85
const Machining_Pocket & Keyway() const
Definition DFMMachining_SquareEndKeywayIssue.cxx:70
Describes turned part size used in cnc machining turning design analysis.
Definition DFMMachining_TurnedPartSize.hxx:33
double Radius() const
Definition DFMMachining_TurnedPartSize.cxx:61
double Length() const
Definition DFMMachining_TurnedPartSize.cxx:81
Describes large height rib issues found during injection molding design analysis.
Definition DFMMolding_HighRibIssue.hxx:28
double ExpectedMaxHeight() const
Definition DFMMolding_HighRibIssue.cxx:97
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm molding high rib issue.
Definition DFMMolding_HighRibIssue.cxx:112
double ActualHeight() const
Definition DFMMolding_HighRibIssue.cxx:106
Describes high screw boss issues found during injection molding design analysis.
Definition DFMMolding_HighScrewBossIssue.hxx:34
double ActualHeight() const
Definition DFMMolding_HighScrewBossIssue.cxx:107
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm molding boss outer diameter issue.
Definition DFMMolding_HighScrewBossIssue.cxx:113
double ExpectedMaxHeight() const
Definition DFMMolding_HighScrewBossIssue.cxx:98
Describes irregular core depth screw boss issues found during injection molding design analysis.
Definition DFMMolding_IrregularCoreDepthScrewBossIssue.hxx:34
double ActualCoreDepth() const
Definition DFMMolding_IrregularCoreDepthScrewBossIssue.cxx:88
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm molding boss core depth issue.
Definition DFMMolding_IrregularCoreDepthScrewBossIssue.cxx:94
double ActualHeight() const
Definition DFMMolding_IrregularCoreDepthScrewBossIssue.cxx:79
Describes irregular screw boss core diameter issues found during injection molding design analysis.
Definition DFMMolding_IrregularCoreDiameterScrewBossIssue.hxx:34
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm molding irregular core diameter screw boss issue.
Definition DFMMolding_IrregularCoreDiameterScrewBossIssue.cxx:144
double ExpectedMinCoreDiameter() const
Definition DFMMolding_IrregularCoreDiameterScrewBossIssue.cxx:120
double ExpectedMaxCoreDiameter() const
Definition DFMMolding_IrregularCoreDiameterScrewBossIssue.cxx:129
double ActualCoreDiameter() const
Definition DFMMolding_IrregularCoreDiameterScrewBossIssue.cxx:138
Describes irregular thickness rib issues found during injection molding design analysis.
Definition DFMMolding_IrregularThicknessRibIssue.hxx:28
double ExpectedMaxThickness() const
Definition DFMMolding_IrregularThicknessRibIssue.cxx:141
double ExpectedMinThickness() const
Definition DFMMolding_IrregularThicknessRibIssue.cxx:121
double ActualThickness() const
Definition DFMMolding_IrregularThicknessRibIssue.cxx:161
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm molding irregular thickness rib issue.
Definition DFMMolding_IrregularThicknessRibIssue.cxx:167
Describes wall with irregular thickness issues found during molding design analysis.
Definition DFMMolding_IrregularWallThicknessIssue.hxx:29
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm molding irregular wall thickness issue.
Definition DFMMolding_IrregularWallThicknessIssue.cxx:147
double ExpectedMaxThickness() const
Definition DFMMolding_IrregularWallThicknessIssue.cxx:110
double ExpectedMinThickness() const
Definition DFMMolding_IrregularWallThicknessIssue.cxx:130
Describes irregular wall thickness screw boss issues found during injection molding design analysis.
Definition DFMMolding_IrregularWallThicknessScrewBossIssue.hxx:34
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm molding irregular wall thickness issue.
Definition DFMMolding_IrregularWallThicknessScrewBossIssue.cxx:168
double ExpectedMaxThickness() const
Definition DFMMolding_IrregularWallThicknessScrewBossIssue.cxx:122
double ExpectedMinThickness() const
Definition DFMMolding_IrregularWallThicknessScrewBossIssue.cxx:142
double ActualThickness() const
Definition DFMMolding_IrregularWallThicknessScrewBossIssue.cxx:162
Describes wall with large thickness issues found during molding design analysis.
Definition DFMMolding_LargeWallThicknessIssue.hxx:28
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm molding large wall thickness issue.
Definition DFMMolding_LargeWallThicknessIssue.cxx:96
double ExpectedMaxThickness() const
Definition DFMMolding_LargeWallThicknessIssue.cxx:79
Describes screw boss without top chamfer issues found during injection molding design analysis.
Definition DFMMolding_NonChamferedScrewBossIssue.hxx:28
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm molding non chamfered screw boss issue.
Definition DFMMolding_NonChamferedScrewBossIssue.cxx:63
const Molding_Rib & Rib() const
Definition DFMMolding_RibIssue.cxx:52
const Molding_ScrewBoss & ScrewBoss() const
Definition DFMMolding_ScrewBossIssue.cxx:51
Describes small rib base radius issues found during injection molding design analysis.
Definition DFMMolding_SmallBaseRadiusRibIssue.hxx:28
double ExpectedMinBaseRadius() const
Definition DFMMolding_SmallBaseRadiusRibIssue.cxx:99
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm molding small base radius rib issue.
Definition DFMMolding_SmallBaseRadiusRibIssue.cxx:136
double ActualBaseRadius() const
Definition DFMMolding_SmallBaseRadiusRibIssue.cxx:119
Describes small screw boss base radius issues found during injection molding design analysis.
Definition DFMMolding_SmallBaseRadiusScrewBossIssue.hxx:28
double ActualBaseRadius() const
Definition DFMMolding_SmallBaseRadiusScrewBossIssue.cxx:119
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm molding small base radius screw boss issue.
Definition DFMMolding_SmallBaseRadiusScrewBossIssue.cxx:136
double ExpectedMinBaseRadius() const
Definition DFMMolding_SmallBaseRadiusScrewBossIssue.cxx:99
Describes a base class for small distance between bosses issues found during molding design analysis.
Definition DFMMolding_SmallDistanceBetweenBossesIssue.hxx:34
static bool CompareType(const MTKBase_Feature &theFeature)
Returnstrue if theFeature is a dfm molding small distance between bosses issue.
Definition DFMMolding_SmallDistanceBetweenBossesIssue.cxx:174
double ExpectedMinDistanceBetweenBosses() const
Definition DFMMolding_SmallDistanceBetweenBossesIssue.cxx:100
const MTKBase_Boss & SecondBoss() const
Definition DFMMolding_SmallDistanceBetweenBossesIssue.cxx:159
double ActualDistanceBetweenBosses() const
Definition DFMMolding_SmallDistanceBetweenBossesIssue.cxx:121
const MTKBase_Boss & FirstBoss() const
Definition DFMMolding_SmallDistanceBetweenBossesIssue.cxx:141
Describes a class for small distance between ribs issues found during molding design analysis.
Definition DFMMolding_SmallDistanceBetweenRibsIssue.hxx:30
double ActualDistanceBetweenRibs() const
Definition DFMMolding_SmallDistanceBetweenRibsIssue.cxx:120
double ExpectedMinDistanceBetweenRibs() const
Definition DFMMolding_SmallDistanceBetweenRibsIssue.cxx:100
const Molding_Rib & SecondRib() const
Definition DFMMolding_SmallDistanceBetweenRibsIssue.cxx:161
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm molding small distance between ribs issue.
Definition DFMMolding_SmallDistanceBetweenRibsIssue.cxx:167
const Molding_Rib & FirstRib() const
Definition DFMMolding_SmallDistanceBetweenRibsIssue.cxx:152
Describes small draft angle rib issues found during injection molding design analysis.
Definition DFMMolding_SmallDraftAngleRibIssue.hxx:28
double ExpectedMinDraftAngle() const
Definition DFMMolding_SmallDraftAngleRibIssue.cxx:77
double ActualDraftAngle() const
Definition DFMMolding_SmallDraftAngleRibIssue.cxx:97
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm molding small draft angle rib issue.
Definition DFMMolding_SmallDraftAngleRibIssue.cxx:103
Describes small screw boss draft angle issues found during injection molding design analysis.
Definition DFMMolding_SmallDraftAngleScrewBossIssue.hxx:28
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm molding small draft angle screw boss issue.
Definition DFMMolding_SmallDraftAngleScrewBossIssue.cxx:102
double ExpectedMinDraftAngle() const
Definition DFMMolding_SmallDraftAngleScrewBossIssue.cxx:76
double ActualDraftAngle() const
Definition DFMMolding_SmallDraftAngleScrewBossIssue.cxx:96
Describes small wall draft angle issues found during injection molding design analysis.
Definition DFMMolding_SmallDraftAngleWallIssue.hxx:30
double ExpectedMinDraftAngle() const
Definition DFMMolding_SmallDraftAngleWallIssue.cxx:75
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm molding small draft angle wall issue.
Definition DFMMolding_SmallDraftAngleWallIssue.cxx:131
double ActualDraftAngle() const
Definition DFMMolding_SmallDraftAngleWallIssue.cxx:93
Describes small screw boss hole base radius issues found during injection molding design analysis.
Definition DFMMolding_SmallHoleBaseRadiusScrewBossIssue.hxx:28
double ActualHoleBaseRadius() const
Definition DFMMolding_SmallHoleBaseRadiusScrewBossIssue.cxx:118
double ExpectedMinHoleBaseRadius() const
Definition DFMMolding_SmallHoleBaseRadiusScrewBossIssue.cxx:98
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm molding small hole base radius screw boss issue.
Definition DFMMolding_SmallHoleBaseRadiusScrewBossIssue.cxx:135
Describes wall with small thickness issues found during molding design analysis.
Definition DFMMolding_SmallWallThicknessIssue.hxx:28
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a dfm molding small wall thickness issue.
Definition DFMMolding_SmallWallThicknessIssue.cxx:96
double ExpectedMinThickness() const
Definition DFMMolding_SmallWallThicknessIssue.cxx:79
const Geom::Direction & Direction() const
Returns a direction value.
Definition Axis1d.cxx:67
const Direction & Axis() const
Returns a Z-direction of the axis.
Definition Axis3d.cxx:110
Defines a 3D Direction.
Definition Direction.hxx:34
Defines a 3D point.
Definition Point.hxx:35
Describes a boss. In CNC Machining a boss is a protrusion or raised area on a workpiece that is creat...
Definition MTKBase_Boss.hxx:31
double Length() const
Definition MTKBase_Boss.cxx:94
static bool CompareType(const MTKBase_Feature &theFeature)
Returnstrue if theFeature is a Boss.
Definition MTKBase_Boss.cxx:131
double Width() const
Definition MTKBase_Boss.cxx:74
double Height() const
Definition MTKBase_Boss.cxx:114
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:93
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a composite feature.
Definition MTKBase_CompositeFeature.cxx:99
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:50
const Geom::Axis3d & Axis() const
Definition MTKBase_Hole.cxx:128
double Depth() const
Definition MTKBase_Hole.cxx:99
double Radius() const
Definition MTKBase_Hole.cxx:79
Describes a feature with assigned shape.
Definition MTKBase_ShapeFeature.hxx:36
const ModelData::Shape & Shape() const
Definition MTKBase_ShapeFeature.cxx:63
static bool CompareType(const MTKBase_Feature &theFeature)
Returnstrue if theFeature is a shape feature.
Definition MTKBase_ShapeFeature.cxx:78
Describes a machining countersink.
Definition Machining_Countersink.hxx:33
const Geom::Axis3d & Axis() const
Definition Machining_Countersink.cxx:134
double Radius() const
Definition Machining_Countersink.cxx:85
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a machining countersink.
Definition Machining_Countersink.cxx:149
double Depth() const
Definition Machining_Countersink.cxx:105
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:233
Machining_FaceType Type() const
Definition Machining_Face.cxx:218
Describes a machining hole of a specified type. Hole is a cylindrical feature that can be made by cut...
Definition Machining_Hole.hxx:30
Machining_HoleType Type() const
Definition Machining_Hole.cxx:144
static bool CompareType(const MTKBase_Feature &theFeature)
Returnstrue if theFeature is a machining hole.
Definition Machining_Hole.cxx:159
Describes a machining pocket. A pocket is a feature obtained by milling the material inside an arbitr...
Definition Machining_Pocket.hxx:33
double Width() const
Definition Machining_Pocket.cxx:78
const Geom::Axis1d & Axis() const
Definition Machining_Pocket.cxx:147
Machining_PocketType Type() const
Definition Machining_Pocket.cxx:165
double Depth() const
Definition Machining_Pocket.cxx:118
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a machining Pocket.
Definition Machining_Pocket.cxx:180
double Length() const
Definition Machining_Pocket.cxx:98
Describes a face with radius produced by a specified machining operation. Cutting material from workp...
Definition Machining_TurningFace.hxx:29
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a machining turning face.
Definition Machining_TurningFace.cxx:88
double Radius() const
Definition Machining_TurningFace.cxx:71
Base class of topological shapes.
Definition Shape.hxx:32
Describes a rib.
Definition Molding_Rib.hxx:29
double Thickness() const
Definition Molding_Rib.cxx:83
double Height() const
Definition Molding_Rib.cxx:123
double DraftAngle() const
Definition Molding_Rib.cxx:143
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a Rib.
Definition Molding_Rib.cxx:160
double Length() const
Definition Molding_Rib.cxx:103
Describes a screw boss. In injection molding, the Screw Boss is essentially a cylindrical protrusion ...
Definition Molding_ScrewBoss.hxx:29
double InnerRadius() const
Definition Molding_ScrewBoss.cxx:123
double DraftAngle() const
Definition Molding_ScrewBoss.cxx:143
static bool CompareType(const MTKBase_Feature &theFeature)
Returns true if theFeature is a molding Screw Boss.
Definition Molding_ScrewBoss.cxx:189
double OuterRadius() const
Definition Molding_ScrewBoss.cxx:103
Defines a Unicode (UTF-16) string wrapping a standard string.
Definition UTF16String.hxx:30
Defines classes, types, enums, and functions related to geometric entities.
Machining_HoleType
Defines a hole type in machining.
Definition Machining_HoleType.hxx:28
Machining_FaceType
Describes a face produced by a specified machining operation.
Definition Machining_FaceType.hxx:28
SheetMetal_HemBendType
Defines a hem bend type in sheet metal.
Definition SheetMetal_HemBendType.hxx:28