Class IsoG68p2TiltSyntax
- Namespace
- Hi.NcParsers.LogicSyntaxs
- Assembly
- HiMech.dll
ISO/Fanuc: resolves G68.2 (tilted work plane) and G69 (cancel). Computes a tilt Mat4d from I/J/K euler angles (Fanuc ZXZ convention) and composes it into ProgramToMcTransform.
Managed commands: G68.2, G69 (idempotent with IsoG68RotationSyntax). Siemens equivalent: CYCLE800 (separate syntax). Heidenhain equivalent: PLANE SPATIAL (separate syntax).
public class IsoG68p2TiltSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
IsoG68p2TiltSyntax
- Implements
- Inherited Members
- Extension Methods
Examples
G69 cancel via TryHandleG69(JsonObject, JsonObject) — the kinematics-free short-circuit path that writes the identity tilt.
Standalone G69 — the flag is consumed,
TiltTransform is written with Term: "G69",
and an identity Mat4d entry is added to
ProgramToMcTransform so any
previously composed tilt rotation is reset:
{ "Parsing": { "Flags": ["G69"] } }
#AfterBuild:
{
"TiltTransform": { "Term": "G69" },
"ProgramToMcTransform": [
{
"Source": "TiltTransform",
"Kind": "Static",
"Mat4d": [1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1]
}
]
}
G68.2 with IJK = (0, 30, 0) and no kinematics dep — exercises the
pure ZXZ Fanuc euler math
(Rz(K=0) * Rx(J=30°) * Rz(I=0) * Translate(0) = Rx(30°))
without any IK refinement. The TiltTransform section
retains the G68.2 ctor params for debug; the chain entry's Mat4d
is the rotation matrix:
#BeforeBuild:
{ "Parsing": { "G68.2": { "X": 0, "Y": 0, "Z": 0, "I": 0, "J": 30, "K": 0 } } }
#AfterBuild:
{
"TiltTransform": { "Term": "G68.2", "X": 0, "Y": 0, "Z": 0, "I": 0, "J": 30, "K": 0 },
"ProgramToMcTransform": [
{
"Source": "TiltTransform",
"Kind": "Static",
"Mat4d": [
1, 0, 0, 0,
0, 0.8660254037844387, 0.49999999999999994, 0,
0, -0.49999999999999994, 0.8660254037844387, 0,
0, 0, 0, 1
]
}
]
}
Same G68.2 IJK with a real
XyzabcSolver (table-A / head-B
5-axis layout) — hasPostAbc is false but the kinematics
solves OrientationToMcAbc(tiltByIjk) successfully, so the
refinement path
ijkAbcOrientation * orientationDelta * Translate(origin)
runs. The resulting Mat4d preserves the IJK orientation but
aligns it with the kinematic ABC solution:
#BeforeBuild:
{ "Parsing": { "G68.2": { "X": 0, "Y": 0, "Z": 0, "I": 0, "J": 30, "K": 0 } } }
#AfterBuild:
{
"TiltTransform": { "Term": "G68.2", "X": 0, "Y": 0, "Z": 0, "I": 0, "J": 30, "K": 0 },
"ProgramToMcTransform": [
{
"Source": "TiltTransform",
"Kind": "Static",
"Mat4d": [
1, 0, 0, 0,
0, 0.8660254037844388, 0.5, 0,
0, -0.5, 0.8660254037844388, 0,
0, 0, 0, 1
]
}
]
}
G68.2 IJK with explicit post-processor rotary hints A=0, B=30 —
hasPostAbc is true, kinematics first solves
tiltByIjk → ijkMcAbc, then overrides A/B with the explicit
values to form postMcAbc; the final Mat4d combines
postAbcOrient * orientationDeltaIjkToPost * Translate(origin).
The TiltTransform section gains the consumed
A and B entries:
#BeforeBuild:
{
"Parsing": {
"G68.2": { "X": 0, "Y": 0, "Z": 0, "I": 0, "J": 30, "K": 0 },
"A": 0,
"B": 30
}
}
#AfterBuild:
{
"TiltTransform": {
"Term": "G68.2",
"X": 0, "Y": 0, "Z": 0,
"I": 0, "J": 30, "K": 0,
"A": 0, "B": 30
},
"ProgramToMcTransform": [
{
"Source": "TiltTransform",
"Kind": "Static",
"Mat4d": [
0.8660254037844387, 0.0002477343364339079, -0.4999999386276948, 0,
0, 0.9999998772553897, 0.0004954686728678159, 0,
0.49999999999999994, -0.00042908845748289027, 0.8660252974844881, 0,
0, 0, 0, 1
]
}
]
}
Remarks
G68.2 optionally uses IMachineKinematics dependency for IK refinement.
The ZXZ euler convention is Fanuc-specific:
Rz(K) * Rx(J) * Rz(I) * Translate(origin).
Optional A/B/C parameters are post-processor rotary axis hints.
When present and IMachineKinematics is available,
the tilt is computed as:
kinematicRotation(postAbc) * orientationDelta * Translate(origin)
where orientationDelta = kinematicRotation(ijkAbc).Inverse * ijkRotation
preserves the exact IJK orientation while aligning with the post-processor's solution.
Constructors
IsoG68p2TiltSyntax()
Initializes a new instance with default settings.
public IsoG68p2TiltSyntax()
IsoG68p2TiltSyntax(XElement)
Initializes a new instance by deserializing from the given XML element.
public IsoG68p2TiltSyntax(XElement src)
Parameters
srcXElementSource XML element.
Properties
Name
Syntax kind name (typically the concrete type name).
public string Name { get; }
Property Value
XName
XML element name used to register this syntax with XFactory.
public static string XName { get; }
Property Value
Methods
Build(LazyLinkedListNode<SyntaxPiece>, List<INcDependency>, NcDiagnosticProgress)
Build syntax arrangement into the
syntaxPieceNode in-place.
public void Build(LazyLinkedListNode<SyntaxPiece> syntaxPieceNode, List<INcDependency> ncDependencyList, NcDiagnosticProgress ncDiagnosticProgress)
Parameters
syntaxPieceNodeLazyLinkedListNode<SyntaxPiece>ncDependencyListList<INcDependency>ncDiagnosticProgressNcDiagnosticProgress
MakeXmlSource(string, string, bool)
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, bool exhibitionOnly)
Parameters
baseDirectorystringThe base directory for resolving relative paths
relFilestringThe relative file path for the XML source
exhibitionOnlyboolif true, the extended file creation is suppressed.
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.
Reg(XFactory)
Registers this type's deserializer with the given XFactory
(or Default when factory is
null). Idempotent.
public static void Reg(XFactory factory = null)
Parameters
factoryXFactory