Class PivotTransformUtil
- Namespace
- Hi.NcParsers.LogicSyntaxs
- Assembly
- HiMech.dll
Shared engine for the brand pivot-gate syntaxes
(PivotTransformationSyntax — ISO/Fanuc family,
SiemensPivotTransformationSyntax — Siemens).
Each brand syntax owns only its gate (which modal terms mean
“commanded XYZ needs the Pn→MC kinematic rigid transform”); the
endpoint-ABC resolution and the PivotTransform chain entry
composition live here so every brand writes the identical JSON
vocabulary.
public static class PivotTransformUtil
- Inheritance
-
PivotTransformUtil
- Inherited Members
Methods
ComposePivotEntry(LazyLinkedListNode<SyntaxPiece>, JsonObject, List<INcDependency>)
Composes the PivotTransformSource entry for the block's endpoint ABC — the shared body every brand gate runs after it decides the block needs the kinematic pivot. Silently no-ops when IMachineKinematics is absent (3-axis configurations without rotary kinematics). The entry's kind mirrors HasDynamicEntry(JsonObject): when no Dynamic entry exists (RTCP with stable rotary, or a tilted plane without RTCP), the kinematic pivot is contour-valid and stays Static.
public static void ComposePivotEntry(LazyLinkedListNode<SyntaxPiece> syntaxPieceNode, JsonObject json, List<INcDependency> ncDependencyList)
Parameters
syntaxPieceNodeLazyLinkedListNode<SyntaxPiece>jsonJsonObjectncDependencyListList<INcDependency>
PinTiltInMachineSpaceAcrossRotaryWords(LazyLinkedListNode<SyntaxPiece>, JsonObject, List<INcDependency>)
Pins the tilted-plane feature frame in machine space across a
rotary word: on a block that spoke A/B/C (one-shot
RotaryWords record) under an active tilt, rewrites the
block's TransformSource entry so that
Tilt(cur)·Pivot(cur) == Tilt(prev)·Pivot(prev) — the feature
point the program addresses stays where it was in machine space and
the table turns underneath it. This is the Fanuc TWP behaviour HardNc
reproduces through NcArgG68p2.PostMcAbc_rad (the delta between
the line's rotary word and the IJK solution re-anchors the feature
frame; the comment there cites CHEM20180926 N10, whose
G81 … C20./C40./… drill a bolt circle on the periphery
while the tip never leaves its machine position). Without it the
carried tilt stays attached to the table and every C-indexed hole
lands on the same spot of the part.
Silently no-ops when the block spoke no rotary word, when IMachineKinematics is absent, or when the previous block carries no PivotTransformSource entry (the tilt was not yet active there — nothing to pin). Must run before ComposePivotEntry(LazyLinkedListNode<SyntaxPiece>, JsonObject, List<INcDependency>) on the same block so the pivot it composes is the one the rewritten tilt was solved against. Brand gates decide whether their tilt vocabulary wants this (PivotTransformationSyntax applies it to G68.2 without RTCP: under G43.4 the tool centre point is tracked in the workpiece-fixed feature frame while the rotaries move — the tilted CL→NC writeback replays on that contract — so a rotary word there is contouring, not indexing, and the carried tilt stays on the table).
public static void PinTiltInMachineSpaceAcrossRotaryWords(LazyLinkedListNode<SyntaxPiece> syntaxPieceNode, JsonObject json, List<INcDependency> ncDependencyList)
Parameters
syntaxPieceNodeLazyLinkedListNode<SyntaxPiece>jsonJsonObjectncDependencyListList<INcDependency>
ResolveEndpointAbc(LazyLinkedListNode<SyntaxPiece>, IMachineAxisConfig)
Reads the current block's MC ABC, falling back per-axis to modal
lookback (via FindPreviousMcXyzabc(LazyLinkedListNode<SyntaxPiece>, IMachineAxisConfig))
for rotary axes the machine declares but the current section
does not carry — blocks like G49, comments, or pure
non-motion state changes do not rewrite ABC, yet the kinematic
rotary state is still active and must appear in the chain.
Non-rotary axes default to 0. Also used by
SiemensTraoriSyntax, whose tool-height
entry needs the same endpoint semantics.
public static Vec3d ResolveEndpointAbc(LazyLinkedListNode<SyntaxPiece> node, IMachineAxisConfig axisConfig)
Parameters
nodeLazyLinkedListNode<SyntaxPiece>axisConfigIMachineAxisConfig