Class XyzabcUtil
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
dstAnchorToSolidDictionaryDictionary<Anchor, Solid>The destination dictionary to populate
anchorsIEnumerable<Anchor>List of anchors
keyToSolidDictionary<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
xyzabcChainIXyzabcMachineToolThe 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
deviceIXyzabcAxesThe XYZABC device
mcdvec3d_tOutput 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
deviceIXyzabcAxesdevice
mcXdoublemachine coordinate X
mcYdoublemachine coordinate Y
mcZdoublemachine coordinate Z
mcAdoublemachine coordinate A (rad)
mcBdoublemachine coordinate B (rad)
mcCdoublemachine 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
deviceIXyzabcAxesdevice
mcAbc_radAbcOutput 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
deviceIXyzabcAxesThe 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
srcIXyzabcMachineToolThe chain being validated.
mountIGetAnchorThe end anchor accessor to validate.
keywordstringThe exact anchor name the chain requires,
torw.rolestringThe 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
srcIXyzabcMachineToolThe 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
deviceIXyzabcAxesdevice
mcdvec3d_tmachine coordinate
SetMc(IXyzabcAxes, vec3d_t)
Set machine coordinate.
public static void SetMc(this IXyzabcAxes device, vec3d_t mcXyz)
Parameters
deviceIXyzabcAxesdevice
mcXyzvec3d_tMachine 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
deviceIXyzabcAxesdevice
mcXdoublemachine coordinate X
mcYdoublemachine coordinate Y
mcZdoublemachine 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
deviceIXyzabcAxesdevice
mcXdoublemachine coordinate X
mcYdoublemachine coordinate Y
mcZdoublemachine coordinate Z
mcAdoublemachine coordinate A
mcBdoublemachine coordinate B
mcCdoublemachine 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
deviceIXyzabcAxesdevice
mcAbc_radvec3d_tMachine coordinate ABC in radians