Table of Contents

Class MotionUtil

Namespace
Hi.Motion
Assembly
HiMech.dll

Cutter location utility.

public static class MotionUtil
Inheritance
MotionUtil
Inherited Members

Remarks

Every member forwards to the native mech::motion module (core.dll, motion_util__* in Hi.Motion.NativeMotion); the math has no managed copy.

Methods

GetLinearRatio(vec3d_t, vec3d_t, vec3d_t)

Get linear ratio, which is cos(theta) square. Theta is the clamping angle between (v1-v0) and (v2-v1).

public static double GetLinearRatio(vec3d_t v0, vec3d_t v1, vec3d_t v2)

Parameters

v0 vec3d_t
v1 vec3d_t
v2 vec3d_t

Returns

double

InterpolateClMat(mat4d_t, dvec3d_t)

Interpolates the cutter location mat by cutter location and orientation.

public static IEnumerable<mat4d_t> InterpolateClMat(mat4d_t clMat0, dvec3d_t targetCl)

Parameters

clMat0 mat4d_t

current cutter location mat, at begining position

targetCl dvec3d_t

The target cl, at end position

Returns

IEnumerable<mat4d_t>

InterpolateClRotMatByClNormal(mat4d_t, vec3d_t)

Interpolates the cutter location mat by cutter orientation.

public static IEnumerable<mat4d_t> InterpolateClRotMatByClNormal(mat4d_t clMat0, vec3d_t targetClNormal)

Parameters

clMat0 mat4d_t

current cutter location mat, at begining position

targetClNormal vec3d_t

The target cl.n, at end position

Returns

IEnumerable<mat4d_t>

Interpolation(mat4d_t, mat4d_t, double)

Interpolate by rotation and translation: the pose alpha of the way from m0 to m1 along the shortest rotation between the two, the position linear between the two (the same result as GetInterpolation(double)).

public static mat4d_t Interpolation(mat4d_t m0, mat4d_t m1, double alpha)

Parameters

m0 mat4d_t

m0

m1 mat4d_t

m1

alpha double

ratio between m0 and m1.

Returns

mat4d_t

interpolated matrix

IsMcLinear(dvec3d_t, dvec3d_t, dvec3d_t, double)

Determines if three machine coordinate points form a linear path.

public static bool IsMcLinear(dvec3d_t mc0, dvec3d_t mc1, dvec3d_t mc2, double linearGap = 0.9999999)

Parameters

mc0 dvec3d_t

The first machine coordinate point.

mc1 dvec3d_t

The second machine coordinate point.

mc2 dvec3d_t

The third machine coordinate point.

linearGap double

The threshold for linearity determination. Default is (1 - 1e-7).

Returns

bool

True if the points form a linear path; otherwise, false.