Class GeneralApt
APT standard milling cutter geometry.
public class GeneralApt : IAptBased, IGetGeneralApt, IAbstractNote, IGetDiameter, IGetFluteHeight, IExpandToBox3d, IMakeXmlSource, IDuplicate, IEquatable<GeneralApt>, IAptRc, IAptRr, IAptRz, IAptAlpha, IAptBeta, IGetZrContour, IToXElement, IGenStl, IClearCache
- Inheritance
-
GeneralApt
- Implements
- Inherited Members
- Extension Methods
Constructors
GeneralApt()
Ctor.
public GeneralApt()
GeneralApt(GeneralApt)
Copy ctor.
public GeneralApt(GeneralApt src)
Parameters
srcGeneralAptsrc
GeneralApt(double, double, double, double, double, double, double)
Ctor.
public GeneralApt(double D, double R0, double Rr, double Rz, double alpha_rad, double beta_rad, double fluteH)
Parameters
Ddoublesee Diameter_mm
R0doublesee Rc_mm
Rrdoublesee Rr_mm
Rzdoublesee Rz_mm
alpha_raddoublesee Alpha_rad
beta_raddoublesee Beta_rad
fluteHdoublesee FluteHeight_mm
GeneralApt(XElement)
Ctor.
public GeneralApt(XElement src)
Parameters
srcXElementXML
Properties
AbstractNote
Gets a descriptive note or abstract about the object.
public string AbstractNote { get; }
Property Value
Alpha_deg
Alpha_rad in degree.
public double Alpha_deg { get; set; }
Property Value
Alpha_rad
The angle between horizontal plane and the cone surface of the cutter tip. The angle is downside the cutter round (if exists). If the cutter is cylindrical mill, the angle is 0. The unit is radian.
public double Alpha_rad { get; set; }
Property Value
AptDerivative
Gets the APT derivative object, creating it if it doesn't exist. null when
RefusesGeometry; the refusal is remembered, so reading the getter again
costs nothing and logs nothing until ClearCache().
public AptDerivative AptDerivative { get; }
Property Value
Beta_deg
Beta_rad in degree.
public double Beta_deg { get; set; }
Property Value
Beta_rad
The angle between stick axis and the side plane of cutter. The angle is upside the cutter round (if exists). The unit is radian.
public double Beta_rad { get; set; }
Property Value
Diameter_mm
Diameter, measured where the flank line, carried down, meets the bottom line
(the tip plane when Alpha_rad is 0). With a round corner the
flank is tangent to the round, so when the flank leans in (Beta_rad > 0)
D is smaller than twice the round's outer reach, 2 (Rr + Rc); it must be the
diameter that tangent flank gives, SelfAgreeingDiameter_mm(double, double, double, double), for the APT
to agree with itself (see SelfAgreementNote).
public double Diameter_mm { get; set; }
Property Value
FluteHeight_mm
Full Height.
public double FluteHeight_mm { get; set; }
Property Value
Rc_mm
Round radius; 0 for a sharp corner where the bottom line meets the flank line.
public double Rc_mm { get; set; }
Property Value
RefusesGeometry
Whether SelfAgreementNote refuses the flute geometry: AptDerivative
is then null, and so are GenStl(IPolarResolution2d) and GetZrContour(double).
true exactly when the note is not null.
public bool RefusesGeometry { get; }
Property Value
Rr_mm
Distance from the stick axis to the round centre (with no round: to the corner).
public double Rr_mm { get; set; }
Property Value
Rz_mm
Height of the round centre (with no round: the corner) above the tip plane.
With no round it must equal Rr tan(Alpha) for the corner to sit on the
bottom line; with a round, Rr tan(Alpha) + Rc/cos(Alpha) for the round to
touch it; see SelfAgreementNote.
public double Rz_mm { get; set; }
Property Value
SelfAgreementNote
Why the parameters do not agree with each other, or null when they do.
One English sentence per failed relation, each naming the value the relation needs.
Any failure refuses the geometry (RefusesGeometry); within the
tolerance the profile is snapped to the exact values (see AptDerivative).
Every corner: Alpha must be in [0, 90) deg, Beta below 90 deg, Rc and Rr must not be
negative (a round centre, or a corner, across the stick axis), and the flank must meet
the bottom line, Alpha + Beta below 90 deg.
Sharp corner (Rc_mm = 0): the corner (Rr, Rz) must sit on the bottom
line, Rz = Rr tan(Alpha), and D must be the diameter where the flank meets
the bottom line, D = 2 (Rr - Rz tan Beta) / (1 - tan Alpha tan Beta).
Round corner (Rc_mm > 0): the same two relations with the corner
replaced by the round's tangent points. The round must touch the bottom line,
Rz = Rr tan(Alpha) + Rc/cos(Alpha), D must be the diameter where the flank
tangent to the round meets the bottom line,
D = 2 (Rr + Rc cos Beta - (Rz - Rc sin Beta) tan Beta) / (1 - tan Alpha tan Beta)
(SelfAgreeingRz_mm(double, double, double), SelfAgreeingDiameter_mm(double, double, double, double)).
public string SelfAgreementNote { get; }
Property Value
XName
Name for XML IO.
public static string XName { get; }
Property Value
Methods
ClearCache()
Clears the internal cache: the APT derivative, its refusal and the self-agreement appraisal.
public void ClearCache()
Duplicate(params object[])
Creates a deep copy of the object, excluding any source file references.
public object Duplicate(params object[] res)
Parameters
resobject[]Optional parameters that may be needed during the duplication process
Returns
- object
A new instance that is a deep copy of the original object
Equals(GeneralApt)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(GeneralApt src)
Parameters
srcGeneralApt
Returns
Equals(object)
Determines whether the specified object is equal to the current object.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current object.
Returns
ExpandToBox3d(ref box3d_t)
Expands the destination box.
This function is usually used to compute the bounding box of elements.
box3d_t is a value type, so the destination is passed by reference
(the C++ expand_to_box3d(box3&) shape); an implementation writes
dst = dst.Expanded(...) or forwards ref dst to its parts.
public void ExpandToBox3d(ref box3d_t dst)
Parameters
dstbox3d_tDestination box, expanded in place
GenStl(IPolarResolution2d)
Generates a new STL.
public Stl GenStl(IPolarResolution2d polarResolution)
Parameters
polarResolutionIPolarResolution2d
Returns
- Stl
A newly created STL.
GetGeneralApt()
Get Apt.
public GeneralApt GetGeneralApt()
Returns
- GeneralApt
Apt
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
GetZrContour(double)
Gets Z-R contour data as a list of PairZr objects. The Z values should generally be ordered from smallest to largest.
public IList<PairZr> GetZrContour(double latitudeAngleResolution_rad)
Parameters
latitudeAngleResolution_raddoubleResolution of latitude angle in radians
Returns
MakeXmlSource(string, string, bool)
Creates an XML representation of the object. This method may also generate additional resources such as related files.
public XElement MakeXmlSource(string baseDirectory, string relFile, bool exhibitionOnly)
Parameters
baseDirectorystringThe base directory for resolving relative paths
relFilestringThe relative file path for the XML source
exhibitionOnlyboolif true, the extended file creation is suppressed.
Returns
- XElement
An XML element representing the object's state
Remarks
For the demand of easy moving source folder (especially project folder) without configuration file path corruption, the relative file path is applied.
The baseDirectory is typically the folder at the nearest configuration file folder.
Since the folder can be moving with the configuration file.
Reg(XFactory)
Registers this type's deserializer and chains Reg(factory) on dependents. Idempotent.
public static void Reg(XFactory factory = null)
Parameters
factoryXFactory
SelfAgreeingDiameter_mm(double, double, double, double)
The Diameter_mm that agrees with Rr, Rc, Alpha and Beta: where the flank
tangent to the round (with no round: through the corner), carried down, meets the bottom
line, 2 (Rr + Rc cos Beta - (Rz* - Rc sin Beta) tan Beta) / (1 - tan Alpha tan Beta)
with Rz* = SelfAgreeingRz_mm(double, double, double); 2 Rr for a sharp corner.
NaN when the flank never meets the bottom line (Alpha + Beta at or above 90 deg).
public static double SelfAgreeingDiameter_mm(double rr_mm, double rc_mm, double alpha_rad, double beta_rad)
Parameters
rr_mmdoublesee Rr_mm
rc_mmdoublesee Rc_mm
alpha_raddoublesee Alpha_rad
beta_raddoublesee Beta_rad
Returns
- double
the agreeing D in mm
SelfAgreeingRz_mm(double, double, double)
The Rz_mm that agrees with Rr, Rc and Alpha: the height at which the round
(with no round: the corner) touches the bottom line, Rr tan(Alpha) + Rc/cos(Alpha).
public static double SelfAgreeingRz_mm(double rr_mm, double rc_mm, double alpha_rad)
Parameters
Returns
- double
the agreeing Rz in mm
SelfAgreementTolerance_mm(double)
The tolerance, in mm, within which the APT's parameters count as agreeing with
each other: 1e-4 * max(|D|, 1 mm). Every relation in
SelfAgreementNote is judged against it.
public static double SelfAgreementTolerance_mm(double diameter_mm)
Parameters
diameter_mmdoublesee Diameter_mm
Returns
- double
tolerance in mm
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
ToXElement()
Get the XElement to represent the object.
public XElement ToXElement()