Table of Contents

Class XyzabcUtil

Namespace
Hi.Numerical.Xyzabc
Assembly
HiMech.dll

Utility of XYZABC device.

public static class XyzabcUtil
Inheritance
XyzabcUtil
Inherited Members

Methods

BuildAnchorToSolid(Dictionary<Anchor, Solid>, List<Anchor>, Dictionary<string, Solid>)

Builds a dictionary mapping anchors to solids.

public static void BuildAnchorToSolid(this Dictionary<Anchor, Solid> dstAnchorToSolidDictionary, List<Anchor> anchors, Dictionary<string, Solid> keyToSolid)

Parameters

dstAnchorToSolidDictionary Dictionary<Anchor, Solid>

The destination dictionary to populate

anchors List<Anchor>

List of anchors

keyToSolid Dictionary<string, Solid>

Dictionary mapping anchor names to solids

GenerateCollisionIndexPairs(IXyzabcChain)

Generate collision index pairs for the XYZABC chain.

public static List<CollisionIndexPair> GenerateCollisionIndexPairs(this IXyzabcChain xyzabcChain)

Parameters

xyzabcChain IXyzabcChain

The XYZABC chain

Returns

List<CollisionIndexPair>

List of collision index pairs

Remarks

The pairs are read off the two anchor chains from the ground anchor to the tool end and to the worktable end, so both end anchors must resolve; a chain missing one fails through RequireEndAnchors(IXyzabcChain) with the keyword named. This is the first consumer on the machine-file load path when the file says AutoGenerate.

Exceptions

InvalidOperationException

An end anchor is missing.

GetMc(IXyzabcChain, out DVec3d)

Get machine coordinates.

public static void GetMc(this IXyzabcChain device, out DVec3d mc)

Parameters

device IXyzabcChain

The XYZABC device

mc DVec3d

Output machine coordinate as DVec3d

GetMc(IXyzabcChain, out double, out double, out double, out double, out double, out double)

Get machine coordinates. The output value set to NAN if the corresponding transformer does not exist.

public static void GetMc(this IXyzabcChain device, out double mcX, out double mcY, out double mcZ, out double mcA, out double mcB, out double mcC)

Parameters

device IXyzabcChain

device

mcX double

machine coordinate X

mcY double

machine coordinate Y

mcZ double

machine coordinate Z

mcA double

machine coordinate A (rad)

mcB double

machine coordinate B (rad)

mcC double

machine coordinate C (rad)

GetMcAbc_rad(IXyzabcChain, out Abc)

Get machine coordinates. The output value set to NAN if the corresponding transformer does not exist.

public static void GetMcAbc_rad(this IXyzabcChain device, out Abc mcAbc_rad)

Parameters

device IXyzabcChain

device

mcAbc_rad Abc

Output machine coordinates ABC in radians

GetMcXyzabc(IXyzabcChain)

Get machine coordinates as DVec3d.

public static DVec3d GetMcXyzabc(this IXyzabcChain device)

Parameters

device IXyzabcChain

The XYZABC device

Returns

DVec3d

Machine coordinate as DVec3d. ABC in rad.

GetNp(IXyzabcChain)

Get normal and position from Hi.Numerical.Xyzabc.IXyzabcChain.GetChainBegin to Hi.Numerical.Xyzabc.IXyzabcChain.GetChainEnd.

public static DVec3d GetNp(this IXyzabcChain src)

Parameters

src IXyzabcChain

src

Returns

DVec3d

normal and position

GetTransformationMat4d(IXyzabcChain)

Get transformation matrix from Hi.Numerical.Xyzabc.IXyzabcChain.GetChainBegin to Hi.Numerical.Xyzabc.IXyzabcChain.GetChainEnd.

public static Mat4d GetTransformationMat4d(this IXyzabcChain src)

Parameters

src IXyzabcChain

src

Returns

Mat4d

transformation matrix

RequireEndAnchor(IXyzabcChain, IGetAnchor, string, string)

Fails with the name of the missing end anchor instead of with a NullReferenceException somewhere past it.

public static void RequireEndAnchor(this IXyzabcChain src, IGetAnchor buckle, string keyword, string role)

Parameters

src IXyzabcChain

The chain being validated.

buckle IGetAnchor

The end anchor accessor to validate.

keyword string

The exact anchor name the chain requires, t or w.

role string

The end's role, for the message.

Remarks

The topology keyword vocabulary is matched exactly — see UpdateByMechanism() — so a chain whose end anchor is spelled in another letter case has no end anchor at all. That is the one cause worth naming outright, because nothing else in the application points at letter case. Every consumer that dereferences a buckle unconditionally should pass through here first; the two today are GenerateCollisionIndexPairs(IXyzabcChain) (the machine-file load path, where AutoGenerate collision pairs walk from the ground anchor to each end) and ReflectedXyzabcChain (the solver).

Exceptions

InvalidOperationException

The chain carries no such end anchor.

RequireEndAnchors(IXyzabcChain)

Requires both end anchors — the worktable end w and the tool end t — with RequireEndAnchor(IXyzabcChain, IGetAnchor, string, string).

public static void RequireEndAnchors(this IXyzabcChain src)

Parameters

src IXyzabcChain

The chain being validated.

Exceptions

InvalidOperationException

Either end anchor is missing.

SetMc(IXyzabcChain, DVec3d)

Set machine coordinate.

public static void SetMc(this IXyzabcChain device, DVec3d mc)

Parameters

device IXyzabcChain

device

mc DVec3d

machine coordinate

SetMc(IXyzabcChain, Vec3d)

Set machine coordinate.

public static void SetMc(this IXyzabcChain device, Vec3d mcXyz)

Parameters

device IXyzabcChain

device

mcXyz Vec3d

Machine coordinate XYZ

SetMc(IXyzabcChain, double, double, double)

Set machine coordinate. The input value do no effect if the corresponding transformer does not exist.

public static void SetMc(this IXyzabcChain device, double mcX, double mcY, double mcZ)

Parameters

device IXyzabcChain

device

mcX double

machine coordinate X

mcY double

machine coordinate Y

mcZ double

machine coordinate Z

SetMc(IXyzabcChain, double, double, double, double, double, double)

Set machine coordinate. The input value do no effect if the corresponding transformer does not exist.

public static void SetMc(this IXyzabcChain device, double mcX, double mcY, double mcZ, double mcA, double mcB, double mcC)

Parameters

device IXyzabcChain

device

mcX double

machine coordinate X

mcY double

machine coordinate Y

mcZ double

machine coordinate Z

mcA double

machine coordinate A

mcB double

machine coordinate B

mcC double

machine coordinate C

SetMcAbc_rad(IXyzabcChain, Vec3d)

Set machine coordinate. The input value do no effect if the corresponding transformer does not exist.

public static void SetMcAbc_rad(this IXyzabcChain device, Vec3d mcAbc_rad)

Parameters

device IXyzabcChain

device

mcAbc_rad Vec3d

Machine coordinate ABC in radians