Table of Contents

Class OrientationVectorResolveSyntax

Namespace
Hi.NcParsers.LogicSyntaxs
Assembly
HiMech.dll

Shared vector-orientation resolve — the brand-independent half of tool-axis-vector 5-axis programming (Heidenhain LN TX/TY/TZ; the Fanuc/Syntec/Mazak G43.5 I/J/K and Siemens A3=/B3=/C3= slots when their adapters land). Consumes the ToolOrientationKey section a brand adapter wrote — { “Vector”: {X,Y,Z}, “Term”: “<brand word>” }, unit vector in program coordinates — and resolves it into rotary-axis degrees on MachineCoordinateState via OrientationToMcAbc(Vec3d, out Vec3d) (axial-only: rotation about the tool axis is free). Everything downstream is the existing RTCP pipeline untouched: the brand RTCP syntax sees the endpoint ABC, marks the tool-height entry KindDynamic on a rotary change, and LinearMotionSyntax routes the block to ClLinear per-step IK.

Branch continuity is seeded explicitly: before solving, the chain is set to the previous block's rotary state (McAbcToMat(Vec3d) on the per-axis MC lookback) so the solver follows the current solution branch deterministically — the implicit chain state cannot be trusted under lazy or out-of-order rebuilds — and the solved angles are unwrapped to the nearest ±360° window of that anchor.

Must run after McAbcSyntax (explicit rotary words and lookback land first; a vector on the same block overrides them) and before the brand RTCP syntax and McXyzSyntax (the section is created rotary-only, so the XYZ derivation still runs — the McAbcSyntax rotary-only discipline). Registered per brand list by the brand that has a vector adapter.

Degradation is diagnosed, never silent: no IMachineKinematicsOrientation-Vector--NoKinematics; no rotary axes → Orientation-Vector--NoRotaryAxes; solver failure → Orientation-Vector--IkFailed. In every case the XYZ motion proceeds and the posture holds at its previous value (deliberately unlike the CLSF path, which drops the motion on IK failure — divergence recorded on the plan card). The section itself stays on the block as the semantic record.

public class OrientationVectorResolveSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
Inheritance
OrientationVectorResolveSyntax
Implements
Inherited Members
Extension Methods

Examples

No-kinematics degradation — the error diagnostic is emitted, no MC write happens, and the section survives as the semantic record (the conformance check verifies only the JSON shape): #BeforeBuild:

{
  "ToolOrientation": {
    "Vector": { "X": 0.5, "Y": 0, "Z": 0.8660254 }, "Term": "TX/TY/TZ"
  }
}

#AfterBuild:

{
  "ToolOrientation": {
    "Vector": { "X": 0.5, "Y": 0, "Z": 0.8660254 }, "Term": "TX/TY/TZ"
  }
}

Constructors

OrientationVectorResolveSyntax()

Initializes a new instance with default settings.

public OrientationVectorResolveSyntax()

OrientationVectorResolveSyntax(XElement)

Initializes a new instance by deserializing from the given XML element.

public OrientationVectorResolveSyntax(XElement src)

Parameters

src XElement

Source XML element.

Fields

SurfaceNormalKey

Block-root section carrying the surface-normal vector — the 3D tool-compensation direction, parse-and-carry (compensation along the normal is recognized, not simulated). Same Vector/Term shape as ToolOrientationKey.

public const string SurfaceNormalKey = "SurfaceNormal"

Field Value

string

TermKey

Term key naming the brand word the vector came from.

public const string TermKey = "Term"

Field Value

string

ToolOrientationKey

Block-root section carrying the commanded tool-axis direction: { “Vector”: {X,Y,Z}, “Term”: “<brand word>” }. Written by a brand adapter (unit vector, program coordinates), consumed here, and left on the block as the semantic record.

public const string ToolOrientationKey = "ToolOrientation"

Field Value

string

VectorKey

Vector sub-object key shared by both sections.

public const string VectorKey = "Vector"

Field Value

string

Properties

Name

Syntax kind name (typically the concrete type name).

public string Name { get; }

Property Value

string

XName

XML element name used to register this syntax with XFactory.

public static string XName { get; }

Property Value

string

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

syntaxPieceNode LazyLinkedListNode<SyntaxPiece>
ncDependencyList List<INcDependency>
ncDiagnosticProgress NcDiagnosticProgress

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

baseDirectory string

The base directory for resolving relative paths

relFile string

The relative file path for the XML source

exhibitionOnly bool

if 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.

ReadVector(JsonObject)

Reads the Vector sub-object of section as a Vec3d; null when absent or non-numeric.

public static Vec3d ReadVector(JsonObject section)

Parameters

section JsonObject

Returns

Vec3d

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

factory XFactory