Table of Contents

Class NcKinematicsDependency

Namespace
Hi.NcParsers.Dependencys.Generic
Assembly
HiMech.dll

Provides IMachineKinematics as an INcDependency for SoftNcRunner.NcDependencyList.

The actual kinematics instance is resolved at runtime via KinematicsProvider. This supports scenarios where the machine tool is loaded or changed after the runner is configured (e.g., XML config loaded first, kinematics assigned later).

Consumed by G53p1RotaryPositionSyntax, IsoG68p2TiltSyntax, and McLinearMotionSemantic via dependencyList.OfType<IMachineKinematics>().

public class NcKinematicsDependency : INcDependency, IMakeXmlSource, IMachineKinematics
Inheritance
NcKinematicsDependency
Implements
Inherited Members
Extension Methods

Constructors

NcKinematicsDependency()

public NcKinematicsDependency()

NcKinematicsDependency(Func<IMachineKinematics>)

public NcKinematicsDependency(Func<IMachineKinematics> provider)

Parameters

provider Func<IMachineKinematics>

Properties

KinematicsProvider

Runtime provider for the kinematics instance. Null provider or null return means kinematics is not yet available.

public Func<IMachineKinematics> KinematicsProvider { get; set; }

Property Value

Func<IMachineKinematics>

XName

public static string XName { get; }

Property Value

string

Methods

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.

McAbcToMat(Vec3d)

Converts machine ABC coordinates to a tilt matrix. the tilt matrix is the transformation matrix from table to attacher.

public Mat4d McAbcToMat(Vec3d mcAbc_rad)

Parameters

mcAbc_rad Vec3d

The machine ABC coordinates in radians

Returns

Mat4d

The tilt matrix

McToMat(DVec3d)

Converts machine coordinates to an attacher matrix.

public Mat4d McToMat(DVec3d mcXyzabc)

Parameters

mcXyzabc DVec3d

The machine coordinates

Returns

Mat4d

The attacher matrix

McToPn(DVec3d)

Machine coordinate to tool attacher Pn (Point and Normal). The Pn is from table buckle to tool attacher.

public DVec3d McToPn(DVec3d mcXyzabc)

Parameters

mcXyzabc DVec3d

machine coordinate. ABC is in radian.

Returns

DVec3d

tool attacher Pn (Point and Normal)

OrientationToMcAbc(Mat4d, out Vec3d)

Converts a tilt matrix to machine ABC coordinates. the tilt matrix is the transformation matrix from table to attacher. the solution only fit the orientation part of the tiltMat.

public bool OrientationToMcAbc(Mat4d tiltMat, out Vec3d mcAbc_rad)

Parameters

tiltMat Mat4d

The tilt matrix to convert

mcAbc_rad Vec3d

Output parameter that will contain the machine ABC coordinates in radians

Returns

bool

Whether the conversion was successful

PnToMc(DVec3d, out DVec3d)

Tool attacher Pn (Point and Normal) to machine coordinate. The Pn is from table buckle to tool attacher.

public bool PnToMc(DVec3d pn, out DVec3d mcXyzabc_rad)

Parameters

pn DVec3d

tool attacher Pn (Point and Normal)

mcXyzabc_rad DVec3d

machine coordinate (ABC in radian)

Returns

bool

whether conversion succeeded