Table of Contents

Class XyzabcUtil

Namespace
Hi.Numerical.Xyzabc
Assembly
HiMech.dll

Utility of XYZABC device. The machine-coordinate getters and setters take any IXyzabcAxes; the topology queries (collision pairs, end-anchor checks) need the whole IXyzabcMachineTool.

public static class XyzabcUtil
Inheritance
XyzabcUtil
Inherited Members

Methods

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

Builds a dictionary mapping anchors to solids.

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

Parameters

dstAnchorToSolidDictionary Dictionary<Anchor, Solid>

The destination dictionary to populate

anchors IEnumerable<Anchor>

List of anchors

keyToSolid Dictionary<string, Solid>

Dictionary mapping anchor names to solids

GenerateCollisionIndexPairs(IXyzabcMachineTool)

Generate collision index pairs for the XYZABC chain.

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

Parameters

xyzabcChain IXyzabcMachineTool

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(IXyzabcMachineTool) with the keyword named. The two end anchors themselves are never components, whatever their spelling; the ground O and base are dropped by their exact names.

Exceptions

InvalidOperationException

An end anchor is missing.

GetMc(IXyzabcAxes, out dvec3d_t)

Get machine coordinates. The six steps are read natively in one call (topo__get_steps over the axes' branches): no shadow value of a bound axis is read.

public static void GetMc(this IXyzabcAxes device, out dvec3d_t mc)

Parameters

device IXyzabcAxes

The XYZABC device

mc dvec3d_t

Output machine coordinate as dvec3d_t

GetMc(IXyzabcAxes, 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. The six steps are read natively in one call (topo__get_steps over the axes' branches): no shadow value of a bound axis is read.

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

Parameters

device IXyzabcAxes

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(IXyzabcAxes, out Abc)

Get machine coordinates. The output value set to NAN if the corresponding transformer does not exist. The six steps are read natively in one call (topo__get_steps over the axes' branches): no shadow value of a bound axis is read.

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

Parameters

device IXyzabcAxes

device

mcAbc_rad Abc

Output machine coordinates ABC in radians

GetMcXyzabc(IXyzabcAxes)

Get machine coordinates as dvec3d_t. The six steps are read natively in one call (topo__get_steps over the axes' branches): no shadow value of a bound axis is read.

public static dvec3d_t GetMcXyzabc(this IXyzabcAxes device)

Parameters

device IXyzabcAxes

The XYZABC device

Returns

dvec3d_t

Machine coordinate as dvec3d_t. ABC in rad.

RequireEndAnchor(IXyzabcMachineTool, 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 IXyzabcMachineTool src, IGetAnchor mount, string keyword, string role)

Parameters

src IXyzabcMachineTool

The chain being validated.

mount 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

GeneralXyzabcMachineTool takes a direct child anchor named exactly w / t as its end anchor, or else the one direct child anchor matching the keyword ignoring letter case; an end anchor is missing here when no anchor matches, or when several do only ignoring letter case, or when the only match sits in a nested assembly. The letter-case variants the mechanism carries are named in the message, because nothing else in the application points at them. Every consumer that dereferences a mount unconditionally should pass through here first: GenerateCollisionIndexPairs(IXyzabcMachineTool), XyzabcSolver (its constructor and Rebuild()) and the start of every run.

Exceptions

InvalidOperationException

The chain carries no such end anchor.

RequireEndAnchors(IXyzabcMachineTool)

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

public static void RequireEndAnchors(this IXyzabcMachineTool src)

Parameters

src IXyzabcMachineTool

The chain being validated.

Exceptions

InvalidOperationException

Either end anchor is missing.

SetMc(IXyzabcAxes, dvec3d_t)

Set machine coordinate.

public static void SetMc(this IXyzabcAxes device, dvec3d_t mc)

Parameters

device IXyzabcAxes

device

mc dvec3d_t

machine coordinate

SetMc(IXyzabcAxes, vec3d_t)

Set machine coordinate.

public static void SetMc(this IXyzabcAxes device, vec3d_t mcXyz)

Parameters

device IXyzabcAxes

device

mcXyz vec3d_t

Machine coordinate XYZ

SetMc(IXyzabcAxes, double, double, double)

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

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

Parameters

device IXyzabcAxes

device

mcX double

machine coordinate X

mcY double

machine coordinate Y

mcZ double

machine coordinate Z

Remarks

Every value is written as given, a value that is not a number included: an axis on the chain between the workpiece and the tool then makes the cutter location not finite, and the step pipeline reports it (Step-CutterLocation–NonFinite) instead of building a step.

SetMc(IXyzabcAxes, 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 IXyzabcAxes device, double mcX, double mcY, double mcZ, double mcA, double mcB, double mcC)

Parameters

device IXyzabcAxes

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

Remarks

Every value is written as given, a value that is not a number included: an axis on the chain between the workpiece and the tool then makes the cutter location not finite, and the step pipeline reports it (Step-CutterLocation–NonFinite) instead of building a step.

SetMcAbc_rad(IXyzabcAxes, vec3d_t)

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

public static void SetMcAbc_rad(this IXyzabcAxes device, vec3d_t mcAbc_rad)

Parameters

device IXyzabcAxes

device

mcAbc_rad vec3d_t

Machine coordinate ABC in radians