Table of Contents

Class CodeXyzabcChain

Namespace
Hi.Numerical.Xyzabc
Assembly
HiMech.dll

IXyzabcChain Composed by ChainCode. On purpose of easy XML hand management.

public class CodeXyzabcChain : IXyzabcChain, IGetXyzabcChain, IMachiningChain, IGetAsmb, IGetAnchor, IGetTopoIndex, IGetAnchorToSolidDictionary, IGetAnchoredDisplayeeList, IExpandToBox3d, IMakeXmlSource
Inheritance
CodeXyzabcChain
Implements
Inherited Members
Extension Methods

Constructors

CodeXyzabcChain(string, bool)

Initializes a new instance of the CodeXyzabcChain class.

public CodeXyzabcChain(string chainCode = "[O][Z][C][w];[O][Y][X][B][S][t]", bool isVertical = true)

Parameters

chainCode string

Chain code of machine tool. Must contain at least base, tool buckle and table buckle, where the code is O,t and w, respectively. The other available members: S is spindle. X,Y and Z are translational motion component. A,B and C are rotational motion component. The codes should be all uppercases.

isVertical bool

Whether the machine is in vertical configuration

Examples

The chain code of a three axis machine tool can be defined by "[O][Z][w];[O][Y][X][S][t]". The chain code of a five axis machine tool can be defined by "[O][Z][C][w];[O][Y][X][B][S][t]".

CodeXyzabcChain(XElement, string, string)

Initializes a new instance of the CodeXyzabcChain class from XML.

public CodeXyzabcChain(XElement src, string baseDirectory, string relFile)

Parameters

src XElement

The XML source element.

baseDirectory string

The base directory for resolving relative paths.

relFile string

The relative file path.

Properties

AnchorToSolid

Gets or sets the dictionary mapping anchors to solids for display purposes.

public Dictionary<Anchor, Solid> AnchorToSolid { get; set; }

Property Value

Dictionary<Anchor, Solid>

Asmb

Gets the assembly instance.

public Asmb Asmb { get; }

Property Value

Asmb

ChainBegin

Gets the chain begin anchor.

public Anchor ChainBegin { get; }

Property Value

Anchor

ChainCode

ChainCode is the chain code of machine tool. Each machine tool component is represented by a word embraced by brackets. Must contain at least base, tool buckle and table buckle, where the code is O,t and w, respectively.

The other available members: S is spindle. X,Y and Z are translational motion component. A,B and C are rotational motion component.

public string ChainCode { get; }

Property Value

string

ChainEnd

Gets the chain end anchor.

public Anchor ChainEnd { get; }

Property Value

Anchor

CodeToAnc

Gets the dictionary mapping component codes to anchors.

public Dictionary<string, Anchor> CodeToAnc { get; }

Property Value

Dictionary<string, Anchor>

ComponentCodes_O2T

Gets the list of component codes from root to tool buckle.

public List<string> ComponentCodes_O2T { get; }

Property Value

List<string>

ComponentCodes_O2W

Gets the list of component codes from root to table buckle.

public List<string> ComponentCodes_O2W { get; }

Property Value

List<string>

IsVertical

Set the machine to vertical; otherwise, set to horizontal.

public bool IsVertical { get; }

Property Value

bool

McCodes

Gets the machine coordinate code sequence for decoding the MC array.

public string[] McCodes { get; }

Property Value

string[]

McTransformers

Gets the machine coordinate transformers.

public IDynamicRegular[] McTransformers { get; }

Property Value

IDynamicRegular[]

RootAnchor

Gets the root anchor of the XYZABC chain.

public Anchor RootAnchor { get; }

Property Value

Anchor

TableBuckleTransformer

Gets the table buckle transformer.

public IStaticTransformer TableBuckleTransformer { get; set; }

Property Value

IStaticTransformer

ToolBuckleTransformer

Gets or sets the static transformer for the tool buckle.

public IStaticTransformer ToolBuckleTransformer { get; set; }

Property Value

IStaticTransformer

TransformerA

Gets the A-axis transformer.

public DynamicRotation TransformerA { get; }

Property Value

DynamicRotation

TransformerB

Gets the B-axis transformer.

public DynamicRotation TransformerB { get; }

Property Value

DynamicRotation

TransformerC

Gets the C-axis transformer.

public DynamicRotation TransformerC { get; }

Property Value

DynamicRotation

TransformerX

Gets the X-axis transformer.

public DynamicTranslation TransformerX { get; }

Property Value

DynamicTranslation

TransformerY

Gets the Y-axis transformer.

public DynamicTranslation TransformerY { get; }

Property Value

DynamicTranslation

TransformerZ

Gets the Z-axis transformer.

public DynamicTranslation TransformerZ { get; }

Property Value

DynamicTranslation

XName

Gets the XML element name for serialization.

public static string XName { get; }

Property Value

string

Methods

ExpandToBox3d(Box3d)

Expands the destination box. This function is usually used to compute the bounding box of elements.

public void ExpandToBox3d(Box3d dst)

Parameters

dst Box3d

Destination box

GetAnchor()

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

public Anchor GetAnchor()

Returns

Anchor

key anchor

GetAnchorToSolidDictionary()

Gets a dictionary that maps Anchor objects to their corresponding Solid objects.

public Dictionary<Anchor, Solid> GetAnchorToSolidDictionary()

Returns

Dictionary<Anchor, Solid>

A dictionary where keys are anchors and values are their associated solids.

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.

GetTableBuckle()

Gets the table buckle anchor point.

public IGetAnchor GetTableBuckle()

Returns

IGetAnchor

The table buckle anchor point.

GetToolBuckle()

Gets the tool buckle anchor point.

public IGetAnchor GetToolBuckle()

Returns

IGetAnchor

The tool buckle anchor point.

GetTransformerA()

Get transformer A.

public DynamicRotation GetTransformerA()

Returns

DynamicRotation

transformer A

GetTransformerB()

Get transformer B.

public DynamicRotation GetTransformerB()

Returns

DynamicRotation

transformer B

GetTransformerC()

Get transformer C.

public DynamicRotation GetTransformerC()

Returns

DynamicRotation

transformer C

GetTransformerX()

Get transformer X.

public DynamicTranslation GetTransformerX()

Returns

DynamicTranslation

transformer X

GetTransformerY()

Get transformer Y.

public DynamicTranslation GetTransformerY()

Returns

DynamicTranslation

transformer Y

GetTransformerZ()

Get transformer Z.

public DynamicTranslation GetTransformerZ()

Returns

DynamicTranslation

transformer Z

GetXyzabcChain()

public IXyzabcChain GetXyzabcChain()

Returns

IXyzabcChain

IXyzabcChain

MakeXmlSource(string, string)

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)

Parameters

baseDirectory string

The base directory for resolving relative paths

relFile string

The relative file path for the XML source

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.