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

Refer to the Molding DFM Analyzer Example

feature_group.cs

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

shape_processor.cs

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

Program.cs

// ****************************************************************************
// $Id$
//
// Copyright (C) 2008-2014, Roman Lygin. All rights reserved.
// Copyright (C) 2014-2025, CADEX. All rights reserved.
//
// This file is part of the Manufacturing Toolkit software.
//
// You may use this file under the terms of the BSD license as follows:
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// ****************************************************************************
using cadex;
using feature_group;
using shape_processor;
using System;
using System.Collections.Generic;
namespace dfm_analyzer
{
class Program
{
static int Main(string[] args)
{
string aKey = MTKLicenseKey.Value();
// Activate the license (the key should be defined in mtk_license.cs)
if (!LicenseManager.Activate(aKey))
{
Console.WriteLine("Failed to activate Manufacturing Toolkit license.");
return 1;
}
if (args.Length != 1)
{
Console.WriteLine("Usage: " +
$"{System.Reflection.Assembly.GetExecutingAssembly().Location} <input_file>, where:");
Console.WriteLine($" <input_file> is a name of the file to be read");
Console.WriteLine($"");
return 1;
}
string aSource = args[0];
var aModel = new Model();
var aReader = new ModelReader();
// Reading the file
if (!aReader.Read(new UTF16String(aSource), aModel))
{
Console.WriteLine($"Failed to read the file {aSource}");
return 1;
}
Console.WriteLine($"Model: {aModel.Name()}\n");
var aPartProcessor = new PartProcessor();
var aVisitor = new ModelElementUniqueVisitor(aPartProcessor);
aModel.Accept(aVisitor);
return 0;
}
class PartProcessor : SolidProcessor
{
public PartProcessor()
{ }
public override void ProcessSolid(Solid theSolid)
{
// Set up recognizer
var aRecognizerParameters = new Molding_FeatureRecognizerParameters();
aRecognizerParameters.SetMaxRibThickness(30.0);
aRecognizerParameters.SetMaxRibDraftAngle(0.2);
aRecognizerParameters.SetMaxRibTaperAngle(0.1);
var aRecognizer = new Molding_FeatureRecognizer(aRecognizerParameters);
// Set up analyzer
var anAnalyzer = new Molding_Analyzer();
anAnalyzer.AddTool(aRecognizer);
// Fill molding data
var aData = anAnalyzer.Perform(theSolid);
// Run DFM analyzer for found features
var aParameters = new DFMMolding_AnalyzerParameters();
var aDFMAnalyzer = new DFMMolding_Analyzer(aParameters);
var anIssueList = aDFMAnalyzer.Perform(aData);
PrintIssues(anIssueList);
}
}
static void PrintIssues(MTKBase_FeatureList theIssueList)
{
FeatureGroupManager aManager = new FeatureGroupManager();
//group by parameters to provide more compact information about issues
for (uint i = 0; i < theIssueList.Size(); ++i)
{
MTKBase_Feature anIssue = theIssueList.Feature(i);
{
aManager.AddFeature("Irregular Core Depth Screw Boss Issue(s)", "Screw Boss(es)", true, anIssue);
}
{
aManager.AddFeature("Irregular Core Diameter Screw Boss Issue(s)", "Screw Boss(es)", true, anIssue);
}
{
aManager.AddFeature("Irregular Wall Thickness Screw Boss Issue(s)", "Screw Boss(es)", true, anIssue);
}
{
aManager.AddFeature("High Screw Boss Issue(s)", "Screw Boss(es)", true, anIssue);
}
{
aManager.AddFeature("Small Base Radius Screw Boss Issue(s)", "Screw Boss(es)", true, anIssue);
}
{
aManager.AddFeature("Small Draft Angle Screw Boss Issue(s)", "Screw Boss(es)", true, anIssue);
}
{
aManager.AddFeature("High Rib Issue(s)", "Rib(s)", true, anIssue);
}
{
aManager.AddFeature("Irregular Thickness Rib Issue(s)", "Rib(s)", true, anIssue);
}
{
aManager.AddFeature("Small Base Radius Rib Issue(s)", "Rib(s)", true, anIssue);
}
{
aManager.AddFeature("Small Draft Angle Rib Issue(s)", "Rib(s)", true, anIssue);
}
{
aManager.AddFeature("Small Distance Between Ribs Issue(s)", "Rib(s)", true, anIssue);
}
{
aManager.AddFeature("Small Hole Base Radius Screw Boss Issue(s)", "Screw Boss(es)", true, anIssue);
}
{
aManager.AddFeature("Non Chamfered Screw Boss Issue(s)", "Screw Boss(es)", false, anIssue);
}
{
aManager.AddFeature("Irregular Wall Thickness Issue(s)", "Wall(s)", true, anIssue);
}
{
aManager.AddFeature("Large Wall Thickness Issue(s)", "Wall(s)", true, anIssue);
}
{
aManager.AddFeature("Small Wall Thickness Issue(s)", "Wall(s)", true, anIssue);
}
{
aManager.AddFeature("Small Draft Angle Wall Thickness Issue(s)", "Wall(s)", true, anIssue);
}
{
aManager.AddFeature("Small Distance Between Bosses Issue(s)", "Boss(es)", true, anIssue);
}
}
//print
Action<MTKBase_Feature> PrintFeatureParameters = theIssue =>
{
{
FeatureGroupManager.PrintFeatureParameter("actual height", aICDSBIssue.ActualCoreDepth(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual core depth", aICDSBIssue.ActualHeight(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter("expected min core diameter", aICDSBIssue.ExpectedMinCoreDiameter(), "mm");
FeatureGroupManager.PrintFeatureParameter("expected max core diameter", aICDSBIssue.ExpectedMaxCoreDiameter(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual core diameter", aICDSBIssue.ActualCoreDiameter(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter("expected max thickness", aIWTSBIssue.ExpectedMaxThickness(), "mm");
FeatureGroupManager.PrintFeatureParameter("expected min thickness", aIWTSBIssue.ExpectedMinThickness(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual thickness", aIWTSBIssue.ActualThickness(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter("expected max height", aHSBIssue.ExpectedMaxHeight(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual height", aHSBIssue.ActualHeight(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter("expected min base radius", aSBRSBIssue.ExpectedMinBaseRadius(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual base radius", aSBRSBIssue.ActualBaseRadius(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter("expected min draft angle", ToDegrees(aSDASBIssue.ExpectedMinDraftAngle()), "deg");
FeatureGroupManager.PrintFeatureParameter("actual draft angle", ToDegrees(aSDASBIssue.ActualDraftAngle()), "deg");
}
{
FeatureGroupManager.PrintFeatureParameter("expected max height", aHRIssue.ExpectedMaxHeight(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual height", aHRIssue.ActualHeight(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter("expected min thickness", aITRIssue.ExpectedMinThickness(), "mm");
FeatureGroupManager.PrintFeatureParameter("expected max thickness", aITRIssue.ExpectedMaxThickness(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual thickness", aITRIssue.ActualThickness(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter("expected min base radius", aSBRRIssue.ExpectedMinBaseRadius(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual base radius", aSBRRIssue.ActualBaseRadius(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter("expected min draft angle", ToDegrees(aSDARIssue.ExpectedMinDraftAngle()), "deg");
FeatureGroupManager.PrintFeatureParameter("actual draft angle", ToDegrees(aSDARIssue.ActualDraftAngle()), "deg");
}
{
FeatureGroupManager.PrintFeatureParameter("expected min distance", aSDBRIssue.ExpectedMinDistanceBetweenRibs(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual distance", aSDBRIssue.ActualDistanceBetweenRibs(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter("expected min hole base radius", aSHBRSBIssue.ExpectedMinHoleBaseRadius(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual hole base radius", aSHBRSBIssue.ActualHoleBaseRadius(), "mm");
}
{
//no parameters
}
{
FeatureGroupManager.PrintFeatureParameter("expected max thickness", aIWTIIssue.ExpectedMaxThickness(), "mm");
FeatureGroupManager.PrintFeatureParameter("expected min thickness", aIWTIIssue.ExpectedMinThickness(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual thickness", aIWTIIssue.ActualThickness(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter("expected max thickness", aLWTIIssue.ExpectedMaxThickness(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual thickness", aLWTIIssue.ActualThickness(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter("expected min thickness", aSWTIIssue.ExpectedMinThickness(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual thickness", aSWTIIssue.ActualThickness(), "mm");
}
{
FeatureGroupManager.PrintFeatureParameter("expected min draft angle", ToDegrees(aSDAWIssue.ExpectedMinDraftAngle()), "deg");
FeatureGroupManager.PrintFeatureParameter("actual draft angle", ToDegrees(aSDAWIssue.ActualDraftAngle()), "deg");
}
{
FeatureGroupManager.PrintFeatureParameter("expected min distance", aSDBBIssue.ExpectedMinDistanceBetweenBosses(), "mm");
FeatureGroupManager.PrintFeatureParameter("actual distance", aSDBBIssue.ActualDistanceBetweenBosses(), "mm");
}
};
aManager.Print("issues", PrintFeatureParameters);
}
static double ToDegrees(double theAngleRad)
{
return theAngleRad * 180 / Math.PI;
}
}
}
Provides an interface to run DFM Molding analysis.
Definition DFMMolding_Analyzer.cs:19
Defines parameters used in injection molding design analysis.
Definition DFMMolding_AnalyzerParameters.cs:19
Describes large height rib issues found during injection molding design analysis.
Definition DFMMolding_HighRibIssue.cs:37
double ActualHeight()
Definition DFMMolding_HighRibIssue.cs:114
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM molding high rib issue.
Definition DFMMolding_HighRibIssue.cs:120
double ExpectedMaxHeight()
Definition DFMMolding_HighRibIssue.cs:105
Describes high screw boss issues found during injection molding design analysis.
Definition DFMMolding_HighScrewBossIssue.cs:38
double ActualHeight()
Definition DFMMolding_HighScrewBossIssue.cs:115
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM molding boss outer diameter issue.
Definition DFMMolding_HighScrewBossIssue.cs:121
double ExpectedMaxHeight()
Definition DFMMolding_HighScrewBossIssue.cs:106
Describes irregular core depth screw boss issues found during injection molding design analysis.
Definition DFMMolding_IrregularCoreDepthScrewBossIssue.cs:39
double ActualCoreDepth()
Definition DFMMolding_IrregularCoreDepthScrewBossIssue.cs:99
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM molding boss core depth issue.
Definition DFMMolding_IrregularCoreDepthScrewBossIssue.cs:105
double ActualHeight()
Definition DFMMolding_IrregularCoreDepthScrewBossIssue.cs:90
Describes irregular screw boss core diameter issues found during injection molding design analysis.
Definition DFMMolding_IrregularCoreDiameterScrewBossIssue.cs:39
double ActualCoreDiameter()
Definition DFMMolding_IrregularCoreDiameterScrewBossIssue.cs:142
double ExpectedMaxCoreDiameter()
Definition DFMMolding_IrregularCoreDiameterScrewBossIssue.cs:133
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM molding irregular core diameter screw boss issue.
Definition DFMMolding_IrregularCoreDiameterScrewBossIssue.cs:148
double ExpectedMinCoreDiameter()
Definition DFMMolding_IrregularCoreDiameterScrewBossIssue.cs:124
Describes irregular thickness rib issues found during injection molding design analysis.
Definition DFMMolding_IrregularThicknessRibIssue.cs:40
double ActualThickness()
Definition DFMMolding_IrregularThicknessRibIssue.cs:161
double ExpectedMinThickness()
Definition DFMMolding_IrregularThicknessRibIssue.cs:127
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM molding irregular thickness rib issue.
Definition DFMMolding_IrregularThicknessRibIssue.cs:167
double ExpectedMaxThickness()
Definition DFMMolding_IrregularThicknessRibIssue.cs:144
Describes wall with irregular thickness issues found during molding design analysis.
Definition DFMMolding_IrregularWallThicknessIssue.cs:41
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM molding irregular wall thickness issue.
Definition DFMMolding_IrregularWallThicknessIssue.cs:142
double ExpectedMaxThickness()
Definition DFMMolding_IrregularWallThicknessIssue.cs:115
double ExpectedMinThickness()
Definition DFMMolding_IrregularWallThicknessIssue.cs:132
Describes irregular wall thickness screw boss issues found during injection molding design analysis.
Definition DFMMolding_IrregularWallThicknessScrewBossIssue.cs:42
double ExpectedMaxThickness()
Definition DFMMolding_IrregularWallThicknessScrewBossIssue.cs:127
double ExpectedMinThickness()
Definition DFMMolding_IrregularWallThicknessScrewBossIssue.cs:144
double ActualThickness()
Definition DFMMolding_IrregularWallThicknessScrewBossIssue.cs:161
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM molding irregular wall thickness issue.
Definition DFMMolding_IrregularWallThicknessScrewBossIssue.cs:167
Describes wall with large thickness issues found during molding design analysis.
Definition DFMMolding_LargeWallThicknessIssue.cs:41
double ExpectedMaxThickness()
Definition DFMMolding_LargeWallThicknessIssue.cs:91
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM molding large wall thickness issue.
Definition DFMMolding_LargeWallThicknessIssue.cs:105
Describes screw boss without top chamfer issues found during injection molding design analysis.
Definition DFMMolding_NonChamferedScrewBossIssue.cs:27
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM molding non chamfered screw boss issue.
Definition DFMMolding_NonChamferedScrewBossIssue.cs:75
Describes small rib base radius issues found during injection molding design analysis.
Definition DFMMolding_SmallBaseRadiusRibIssue.cs:39
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM molding small base radius rib issue.
Definition DFMMolding_SmallBaseRadiusRibIssue.cs:139
double ActualBaseRadius()
Definition DFMMolding_SmallBaseRadiusRibIssue.cs:125
double ExpectedMinBaseRadius()
Definition DFMMolding_SmallBaseRadiusRibIssue.cs:108
Describes small screw boss base radius issues found during injection molding design analysis.
Definition DFMMolding_SmallBaseRadiusScrewBossIssue.cs:39
double ExpectedMinBaseRadius()
Definition DFMMolding_SmallBaseRadiusScrewBossIssue.cs:108
double ActualBaseRadius()
Definition DFMMolding_SmallBaseRadiusScrewBossIssue.cs:125
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM molding small base radius screw boss issue.
Definition DFMMolding_SmallBaseRadiusScrewBossIssue.cs:139
Describes a base class for small distance between bosses issues found during molding design analysis.
Definition DFMMolding_SmallDistanceBetweenBossesIssue.cs:32
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returnstrue if theFeature is a DFM molding small distance between bosses issue.
Definition DFMMolding_SmallDistanceBetweenBossesIssue.cs:172
double ActualDistanceBetweenBosses()
Definition DFMMolding_SmallDistanceBetweenBossesIssue.cs:122
double ExpectedMinDistanceBetweenBosses()
Definition DFMMolding_SmallDistanceBetweenBossesIssue.cs:105
Describes a class for small distance between ribs issues found during molding design analysis.
Definition DFMMolding_SmallDistanceBetweenRibsIssue.cs:38
double ActualDistanceBetweenRibs()
Definition DFMMolding_SmallDistanceBetweenRibsIssue.cs:151
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM molding small distance between ribs issue.
Definition DFMMolding_SmallDistanceBetweenRibsIssue.cs:165
double ExpectedMinDistanceBetweenRibs()
Definition DFMMolding_SmallDistanceBetweenRibsIssue.cs:107
Describes small draft angle rib issues found during injection molding design analysis.
Definition DFMMolding_SmallDraftAngleRibIssue.cs:37
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM molding small draft angle rib issue.
Definition DFMMolding_SmallDraftAngleRibIssue.cs:111
double ExpectedMinDraftAngle()
Definition DFMMolding_SmallDraftAngleRibIssue.cs:88
double ActualDraftAngle()
Definition DFMMolding_SmallDraftAngleRibIssue.cs:105
Describes small screw boss draft angle issues found during injection molding design analysis.
Definition DFMMolding_SmallDraftAngleScrewBossIssue.cs:37
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM molding small draft angle screw boss issue.
Definition DFMMolding_SmallDraftAngleScrewBossIssue.cs:111
double ExpectedMinDraftAngle()
Definition DFMMolding_SmallDraftAngleScrewBossIssue.cs:88
double ActualDraftAngle()
Definition DFMMolding_SmallDraftAngleScrewBossIssue.cs:105
Describes small wall draft angle issues found during injection molding design analysis.
Definition DFMMolding_SmallDraftAngleWallIssue.cs:36
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM molding small draft angle wall issue.
Definition DFMMolding_SmallDraftAngleWallIssue.cs:136
double ActualDraftAngle()
Definition DFMMolding_SmallDraftAngleWallIssue.cs:101
double ExpectedMinDraftAngle()
Definition DFMMolding_SmallDraftAngleWallIssue.cs:86
Describes small screw boss hole base radius issues found during injection molding design analysis.
Definition DFMMolding_SmallHoleBaseRadiusScrewBossIssue.cs:38
double ActualHoleBaseRadius()
Definition DFMMolding_SmallHoleBaseRadiusScrewBossIssue.cs:124
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM molding small hole base radius screw boss issue.
Definition DFMMolding_SmallHoleBaseRadiusScrewBossIssue.cs:138
double ExpectedMinHoleBaseRadius()
Definition DFMMolding_SmallHoleBaseRadiusScrewBossIssue.cs:107
Describes wall with small thickness issues found during molding design analysis.
Definition DFMMolding_SmallWallThicknessIssue.cs:41
static new bool CompareType(cadex.MTKBase_Feature theFeature)
Returns true if theFeature is a DFM molding small wall thickness issue.
Definition DFMMolding_SmallWallThicknessIssue.cs:105
double ExpectedMinThickness()
Definition DFMMolding_SmallWallThicknessIssue.cs:91
double ActualThickness()
Definition DFMMolding_WallThicknessIssue.cs:83
Activates the license key.
Definition LicenseManager.cs:48
Defines a list of features.
Definition MTKBase_FeatureList.cs:20
uint Size()
Returns the number of elements in the list.
Definition MTKBase_FeatureList.cs:110
cadex.MTKBase_Feature Feature(uint theIndex)
Access specified element.
Definition MTKBase_FeatureList.cs:99
Defines a visitor that visits each unique element only once.
Definition ModelElementUniqueVisitor.cs:25
Provides MTK data model.
Definition Model.cs:30
Reads supported formats, see Import section.
Definition ModelReader.cs:17
Provides an interface to run several analyzer tools for different types of Molding processing.
Definition Molding_Analyzer.cs:21
Provides an interface to recognizing molding features.
Definition Molding_FeatureRecognizer.cs:21
Defines parameters used by Molding_FeatureRecognizer.
Definition Molding_FeatureRecognizerParameters.cs:17