Table of Contents

Class MillingTool

Namespace
Hi.Milling.MillingTools
Assembly
HiMech.dll

Represents a central stick milling tool that combines a holder and a cutter.

public class MillingTool : IMachiningTool, IDisplayee, IExpandToBox3d, ITopo, IGetAsmb, IGetAnchor, IGetTopoIndex, IGetAnchoredDisplayeeList, IGetFletchMount, IMakeXmlSource, IAbstractNote, IDuplicate, IClearCache, IGetFluteNum
Inheritance
MillingTool
Implements
Inherited Members
Extension Methods

Constructors

MillingTool()

Ctor.

public MillingTool()

MillingTool(XElement, string, string, IProgress<IMessage>)

Initializes a new instance of the MillingTool class.

public MillingTool(XElement src, string baseDirectory, string relFile, IProgress<IMessage> progress)

Parameters

src XElement

The XML element containing the tool configuration.

baseDirectory string

The base directory for resolving relative paths.

relFile string

The relative file path.

progress IProgress<IMessage>

Progress reporter for diagnostic messages emitted during construction.

Properties

AbstractNote

Gets an abstract note describing the tool's dimensions and cutter.

public string AbstractNote { get; }

Property Value

string

Asmb

Gets the assembly containing the tool components.

public Asmb Asmb { get; }

Property Value

Asmb

Cutter

Gets the cutting tool.

public ICutter Cutter { get; set; }

Property Value

ICutter

CutterFile

Gets or sets the file path of the cutter.

public string CutterFile { get; set; }

Property Value

string

ExposedCutterBendingPara_umdN

Gets the parameter for exposed cutter bending in micrometers per Newton. Pure computation — deliberately uncached: a lazy cache on this shared object races with the parallel per-step force build; per-step session paths read the pair from MillingToolPhysicsPack instead.

public double ExposedCutterBendingPara_umdN { get; }

Property Value

double

ExposedCutterHeight_mm

Gets or sets the exposed cutter height in millimeters.

public double ExposedCutterHeight_mm { get; set; }

Property Value

double

ExposedCutterZDeflectionPara_umdN

Gets the parameter for exposed cutter Z-axis deflection in micrometers per Newton. Pure computation — see ExposedCutterBendingPara_umdN.

public double ExposedCutterZDeflectionPara_umdN { get; }

Property Value

double

Holder

Gets or sets the tool holder.

public IHolder Holder { get; set; }

Property Value

IHolder

HolderFile

Gets or sets the holder file path.

public string HolderFile { get; set; }

Property Value

string

Note

Gets or sets a note for this machining tool.

public string Note { get; set; }

Property Value

string

ObservationAnchor

Gets the tool anchor reference point.

public Anchor ObservationAnchor { get; }

Property Value

Anchor

ObservationAnchorReference

Gets the tool observation anchor reference point.

public MillingToolAnchorReference ObservationAnchorReference { get; set; }

Property Value

MillingToolAnchorReference

ObservationChannels

The moment channels this tool's smart holder delivers (its strain bridges): any of Mx, My, Mz; all three by default. A declaration, not a measurement: the trainings and the setup-angle estimate refuse a selected channel the tool does not declare (Sample-Channel–NotObserved) instead of reading a missing bridge as data. Force bits are ignored. Does not enter the physics.

public SampleFlag ObservationChannels { get; set; }

Property Value

SampleFlag

ObservationHeightFromToolTip

Gets the tool observation point relative to the reference. Pure computation (an Asmb walk) — deliberately uncached; per-step session paths read the value from MillingToolPhysicsPack.

public double ObservationHeightFromToolTip { get; }

Property Value

double

PreservedDistanceBetweenFluteAndSpindleNose_mm

Gets or sets the preserved distance between flute and clamp in millimeters.

public double PreservedDistanceBetweenFluteAndSpindleNose_mm { get; set; }

Property Value

double

RelativeHeightFromObservationAnchor_mm

Gets the tool observation point relative to the reference.

public double RelativeHeightFromObservationAnchor_mm { get; set; }

Property Value

double

SetupAngle_deg

Gets or sets the setup angle in degrees: how far the cutter is turned in the holder about the tool axis, i.e. the angle from the holder's (spindle rotation frame) X axis to the cutter's own angular datum. It belongs to the clamping, like ExposedCutterHeight_mm; where each flute sits on the cutter body is FluteOffsetAngle_deg. The milling physics places every flute at flute offset angle + setup angle (GetFluteContourList(IFluting, double)); the cutter geometry, the assembly and the display are not turned.

public double SetupAngle_deg { get; set; }

Property Value

double

SetupAngle_rad

Gets the setup angle in radians. See SetupAngle_deg.

public double SetupAngle_rad { get; }

Property Value

double

SpindleMount

Gets the motor-side mount.

public Anchor SpindleMount { get; }

Property Value

Anchor

SpindleMountToToolTipLength

Height For NC Compensation table and step number computation. Pure computation (an Asmb walk) — deliberately uncached: a lazy cache on this shared object races with concurrent readers; the CL parsing reads it through a run-scoped memo. MillingToolPhysicsPack carries a copy, but no step-physics path reads it from there — a change of this length moves the tool tip in machine space, a replay-level change.

public double SpindleMountToToolTipLength { get; }

Property Value

double

ToolTip

Gets the tool tip anchor point from the cutter.

public Anchor ToolTip { get; }

Property Value

Anchor

XName

Initializes a new instance of the StickMachiningTool class from XML data.

public static string XName { get; }

Property Value

string

Methods

AlignAnchorByExposedCutterHeight()

Aligns the anchor by the exposed cutter height.

public void AlignAnchorByExposedCutterHeight()

ClearCache()

Clears any cached data held by the implementing object.

public void ClearCache()

Display(Bind)

Display function called in DispEngine rendering loop.

public void Display(Bind bind)

Parameters

bind Bind

Bind with DispEngine. See Bind.

Duplicate(params object[])

Creates a deep copy of the object, excluding any source file references.

public object Duplicate(params object[] res)

Parameters

res object[]

Optional parameters that may be needed during the duplication process

Returns

object

A new instance that is a deep copy of the original object

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

dst box3d_t

Destination box, expanded in place

Remarks

For display

GetAnchor()

Get key anchor. (i.e. root anchor)

public Anchor GetAnchor()

Returns

Anchor

key anchor

GetAnchoredDisplayeeList()

Gets a list of anchored displayable objects.

public List<IAnchoredDisplayee> GetAnchoredDisplayeeList()

Returns

List<IAnchoredDisplayee>

A list of IAnchoredDisplayee objects

GetAsmb()

Gets the key asmb.

public Asmb GetAsmb()

Returns

Asmb

The key asmb.

GetFletchMount()

Get fletch mount anchor. the anchor that generally connect to fixed part such as ground and triggering(motor)-side.

public Anchor GetFletchMount()

Returns

Anchor

mount anchor

GetFluteNum()

Gets the number of flutes.

public int GetFluteNum()

Returns

int

GetSilhouette()

What the tool looks like from the side, to scale: the outlines of the flute, of the cutter body above it and of the holder in the tool-tip frame, with the heights of the holder nose and of the spindle gauge line (MillingToolSilhouette). A tool with no cutter has no tip, and its silhouette stands the holder on its nose at Z 0. Pure computation over the live assembly and the shapes themselves – deliberately uncached, like SpindleMountToToolTipLength, so an edit of the holder, the cutter or the clamping needs no cache to clear. A shape with a Z-R profile (a Cylindroid, an APT flute, an ExtendedCylinder upper beam, either of them wrapped in a move along the tool axis) is read from that profile; any other shape, from its mesh at the geometry's default resolution, which a free-form holder of many triangles makes the costly part.

public MillingToolSilhouette GetSilhouette()

Returns

MillingToolSilhouette

The silhouette; a part the tool lacks, or one with nothing to draw, is null.

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

baseDirectory string

The base directory for resolving relative paths

relFile string

The relative file path for the XML source

exhibitionOnly bool

if 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 with the given XFactory and chains Reg(factory) on dependents. Idempotent.

public static void Reg(XFactory factory = null)

Parameters

factory XFactory