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}");
}
}
}
Provides possibility to compare MTK based features depending on their type and parameters.
Definition MTKBase_FeatureComparator.hxx:29
Describes a base class of MTK based features.
Definition MTKBase_Feature.hxx:33
Defines classes, namespaces, enums, types, and global functions related to Manufacturing Toolkit.
Definition LicenseManager_LicenseError.hxx:30

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);
while (aShapeIt.HasNext())
{
var aShape = aShapeIt.Next();
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);
while (aShapeIt.HasNext())
{
var aShape = aShapeIt.Next();
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;
}
}
UTF16String Name() const
Returns a name.
Definition ModelElement.cxx:55
Element visitor with empty implementation.
Definition ModelElementVisitor.hxx:64
Defines a leaf node in the scene graph hiearchy.
Definition Part.hxx:34
Iterates over subshapes in a shape.
Definition ShapeIterator.hxx:32
Defines a connected set of faces.
Definition Shell.hxx:32
Defines a topological solid.
Definition Solid.hxx:32
Defines a Unicode (UTF-16) string wrapping a standard string.
Definition UTF16String.hxx:30
bool IsEmpty() const
Returns true if the string is empty.
Definition UTF16String.cxx:337
Defines classes, types, enums, and functions related to topological entities and scene graph elements...
ShapeType
Defines shape type.
Definition ShapeType.hxx:27

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 =>
{
{
DFMMolding_IrregularCoreDepthScrewBossIssue aICDSBIssue = DFMMolding_IrregularCoreDepthScrewBossIssue.Cast (theIssue);
FeatureGroupManager.PrintFeatureParameter ("actual height", aICDSBIssue.ActualCoreDepth(), "mm");
FeatureGroupManager.PrintFeatureParameter ("actual core depth", aICDSBIssue.ActualHeight(), "mm");
}
{
DFMMolding_IrregularCoreDiameterScrewBossIssue aICDSBIssue = DFMMolding_IrregularCoreDiameterScrewBossIssue.Cast (theIssue);
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");
}
{
DFMMolding_IrregularWallThicknessScrewBossIssue aIWTSBIssue = DFMMolding_IrregularWallThicknessScrewBossIssue.Cast (theIssue);
FeatureGroupManager.PrintFeatureParameter ("expected max thickness", aIWTSBIssue.ExpectedMaxThickness(), "mm");
FeatureGroupManager.PrintFeatureParameter ("expected min thickness", aIWTSBIssue.ExpectedMinThickness(), "mm");
FeatureGroupManager.PrintFeatureParameter ("actual thickness", aIWTSBIssue.ActualThickness(), "mm");
}
{
DFMMolding_HighScrewBossIssue aHSBIssue = DFMMolding_HighScrewBossIssue.Cast (theIssue);
FeatureGroupManager.PrintFeatureParameter ("expected max height", aHSBIssue.ExpectedMaxHeight(), "mm");
FeatureGroupManager.PrintFeatureParameter ("actual height", aHSBIssue.ActualHeight(), "mm");
}
{
DFMMolding_SmallBaseRadiusScrewBossIssue aSBRSBIssue = DFMMolding_SmallBaseRadiusScrewBossIssue.Cast (theIssue);
FeatureGroupManager.PrintFeatureParameter ("expected min base radius", aSBRSBIssue.ExpectedMinBaseRadius(), "mm");
FeatureGroupManager.PrintFeatureParameter ("actual base radius", aSBRSBIssue.ActualBaseRadius(), "mm");
}
{
DFMMolding_SmallDraftAngleScrewBossIssue aSDASBIssue = DFMMolding_SmallDraftAngleScrewBossIssue.Cast (theIssue);
FeatureGroupManager.PrintFeatureParameter ("expected min draft angle", ToDegrees(aSDASBIssue.ExpectedMinDraftAngle()), "deg");
FeatureGroupManager.PrintFeatureParameter ("actual draft angle", ToDegrees(aSDASBIssue.ActualDraftAngle()), "deg");
}
else if (DFMMolding_HighRibIssue.CompareType (theIssue))
{
DFMMolding_HighRibIssue aHRIssue = DFMMolding_HighRibIssue.Cast (theIssue);
FeatureGroupManager.PrintFeatureParameter ("expected max height", aHRIssue.ExpectedMaxHeight(), "mm");
FeatureGroupManager.PrintFeatureParameter ("actual height", aHRIssue.ActualHeight(), "mm");
}
{
DFMMolding_IrregularThicknessRibIssue aITRIssue = DFMMolding_IrregularThicknessRibIssue.Cast (theIssue);
FeatureGroupManager.PrintFeatureParameter ("expected min thickness", aITRIssue.ExpectedMinThickness(), "mm");
FeatureGroupManager.PrintFeatureParameter ("expected max thickness", aITRIssue.ExpectedMaxThickness(), "mm");
FeatureGroupManager.PrintFeatureParameter ("actual thickness", aITRIssue.ActualThickness(), "mm");
}
{
DFMMolding_SmallBaseRadiusRibIssue aSBRRIssue = DFMMolding_SmallBaseRadiusRibIssue.Cast (theIssue);
FeatureGroupManager.PrintFeatureParameter ("expected min base radius", aSBRRIssue.ExpectedMinBaseRadius(), "mm");
FeatureGroupManager.PrintFeatureParameter ("actual base radius", aSBRRIssue.ActualBaseRadius(), "mm");
}
{
DFMMolding_SmallDraftAngleRibIssue aSDARIssue = DFMMolding_SmallDraftAngleRibIssue.Cast (theIssue);
FeatureGroupManager.PrintFeatureParameter ("expected min draft angle", ToDegrees(aSDARIssue.ExpectedMinDraftAngle()), "deg");
FeatureGroupManager.PrintFeatureParameter ("actual draft angle", ToDegrees(aSDARIssue.ActualDraftAngle()), "deg");
}
{
DFMMolding_SmallDistanceBetweenRibsIssue aSDBRIssue = DFMMolding_SmallDistanceBetweenRibsIssue.Cast (theIssue);
FeatureGroupManager.PrintFeatureParameter ("expected min distance", aSDBRIssue.ExpectedMinDistanceBetweenRibs(), "mm");
FeatureGroupManager.PrintFeatureParameter ("actual distance", aSDBRIssue.ActualDistanceBetweenRibs(), "mm");
}
{
DFMMolding_SmallHoleBaseRadiusScrewBossIssue aSHBRSBIssue = DFMMolding_SmallHoleBaseRadiusScrewBossIssue.Cast (theIssue);
FeatureGroupManager.PrintFeatureParameter ("expected min hole base radius", aSHBRSBIssue.ExpectedMinHoleBaseRadius(), "mm");
FeatureGroupManager.PrintFeatureParameter ("actual hole base radius", aSHBRSBIssue.ActualHoleBaseRadius(), "mm");
}
{
//no parameters
}
{
DFMMolding_IrregularWallThicknessIssue aIWTIIssue = DFMMolding_IrregularWallThicknessIssue.Cast (theIssue);
FeatureGroupManager.PrintFeatureParameter ("expected max thickness", aIWTIIssue.ExpectedMaxThickness(), "mm");
FeatureGroupManager.PrintFeatureParameter ("expected min thickness", aIWTIIssue.ExpectedMinThickness(), "mm");
FeatureGroupManager.PrintFeatureParameter ("actual thickness", aIWTIIssue.ActualThickness(), "mm");
}
{
DFMMolding_LargeWallThicknessIssue aLWTIIssue = DFMMolding_LargeWallThicknessIssue.Cast (theIssue);
FeatureGroupManager.PrintFeatureParameter ("expected max thickness", aLWTIIssue.ExpectedMaxThickness(), "mm");
FeatureGroupManager.PrintFeatureParameter ("actual thickness", aLWTIIssue.ActualThickness(), "mm");
}
{
DFMMolding_SmallWallThicknessIssue aSWTIIssue = DFMMolding_SmallWallThicknessIssue.Cast (theIssue);
FeatureGroupManager.PrintFeatureParameter ("expected min thickness", aSWTIIssue.ExpectedMinThickness(), "mm");
FeatureGroupManager.PrintFeatureParameter ("actual thickness", aSWTIIssue.ActualThickness(), "mm");
}
{
DFMMolding_SmallDraftAngleWallIssue aSDAWIssue = DFMMolding_SmallDraftAngleWallIssue.Cast (theIssue);
FeatureGroupManager.PrintFeatureParameter ("expected min draft angle", ToDegrees(aSDAWIssue.ExpectedMinDraftAngle()), "deg");
FeatureGroupManager.PrintFeatureParameter ("actual draft angle", ToDegrees(aSDAWIssue.ActualDraftAngle()), "deg");
}
{
DFMMolding_SmallDistanceBetweenBossesIssue aSDBBIssue = DFMMolding_SmallDistanceBetweenBossesIssue.Cast (theIssue);
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.hxx:40
Defines parameters used in injection molding design analysis.
Definition DFMMolding_AnalyzerParameters.hxx:32
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
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
double ActualDistanceBetweenBosses() const
Definition DFMMolding_SmallDistanceBetweenBossesIssue.cxx:121
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
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
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
Defines a list of features.
Definition MTKBase_FeatureList.hxx:36
size_t Size() const
Returns the number of elements in the list.
Definition MTKBase_FeatureList.cxx:88
Defines a visitor that visits each unique element only once.
Definition ModelElementVisitor.hxx:87
Provides MTK data model.
Definition Model.hxx:40
Reads STEP and native format.
Definition ModelReader.hxx:29
Provides an interface to run several analyzer tools for different types of Molding processing.
Definition Molding_Analyzer.hxx:41
Provides an interface to recognizing molding features.
Definition Molding_FeatureRecognizer.hxx:37