Table of Contents

Class ActMcXyzSpiralContour

Namespace
Hi.Numerical.Acts
Assembly
HiMech.dll

Represents a spiral contour movement in machine XYZ coordinates.

public class ActMcXyzSpiralContour : IActDuration, IActMcXyzabcContour, IAct
Inheritance
ActMcXyzSpiralContour
Implements
Inherited Members
Extension Methods

Constructors

ActMcXyzSpiralContour(vec3d_t, vec3d_t, vec3d_t, vec3d_t, int, TimeSpan, ProgramPosToMcMap)

Initializes a new instance of the ActMcXyzSpiralContour class with the flat program-to-machine map: the act keeps the map in ProgramPosToMcMap, so its record for core.dll carries the closure's transformation and ABC and the act expands natively; ProgramPosToMcFunc is the map's Map.

public ActMcXyzSpiralContour(vec3d_t programPosBegin, vec3d_t programPosEnd, vec3d_t programPosCenterOnBeginPlane, vec3d_t centerNormal, int additionalCircleNum, TimeSpan actDuration, ProgramPosToMcMap programPosToMc)

Parameters

programPosBegin vec3d_t

The beginning position in program coordinates.

programPosEnd vec3d_t

The ending position in program coordinates.

programPosCenterOnBeginPlane vec3d_t

The center position of the spiral in program coordinates.

centerNormal vec3d_t

The normal vector of the center plane.

additionalCircleNum int

The number of additional circles in the spiral movement.

actDuration TimeSpan

The duration of the contour movement.

programPosToMc ProgramPosToMcMap

The program-to-machine map: XYZ through its transformation, the constant ABC.

ActMcXyzSpiralContour(vec3d_t, vec3d_t, vec3d_t, vec3d_t, int, TimeSpan, Func<vec3d_t, dvec3d_t>)

Initializes a new instance of the ActMcXyzSpiralContour class with the specified parameters.

public ActMcXyzSpiralContour(vec3d_t programPosBegin, vec3d_t programPosEnd, vec3d_t programPosCenterOnBeginPlane, vec3d_t centerNormal, int additionalCircleNum, TimeSpan actDuration, Func<vec3d_t, dvec3d_t> programPosToMcFunc)

Parameters

programPosBegin vec3d_t

The beginning position in program coordinates.

programPosEnd vec3d_t

The ending position in program coordinates.

programPosCenterOnBeginPlane vec3d_t

The center position of the spiral in program coordinates.

centerNormal vec3d_t

The normal vector of the center plane.

additionalCircleNum int

The number of additional circles in the spiral movement.

actDuration TimeSpan

The duration of the contour movement.

programPosToMcFunc Func<vec3d_t, dvec3d_t>

The function to convert program position to machine coordinates.

Properties

ActDuration

Gets or sets the duration of the action.

public TimeSpan ActDuration { get; set; }

Property Value

TimeSpan

Remarks

The duration represents:

  • The time required to complete the action
  • Should be positive and finite
  • Zero duration indicates an instantaneous action
  • Used for scheduling and timing calculations

AdditionalCircleNum

Gets or sets the number of additional circles in the spiral movement.

public int AdditionalCircleNum { get; set; }

Property Value

int

CenterNormal

Gets or sets the normal vector of the center plane.

public vec3d_t CenterNormal { get; set; }

Property Value

vec3d_t

ProgramPosBegin

Gets or sets the beginning position in program coordinates.

public vec3d_t ProgramPosBegin { get; set; }

Property Value

vec3d_t

ProgramPosCenterOnBeginPlane

Gets or sets the center position of the spiral in program coordinates.

public vec3d_t ProgramPosCenterOnBeginPlane { get; set; }

Property Value

vec3d_t

ProgramPosEnd

Gets or sets the ending position in program coordinates.

public vec3d_t ProgramPosEnd { get; set; }

Property Value

vec3d_t

ProgramPosToMcFunc

Gets or sets the function to convert program position to machine coordinates. Setting it clears ProgramPosToMcMap: an opaque closure has no record for core.dll, so the act then expands through its managed enumerator.

public Func<vec3d_t, dvec3d_t> ProgramPosToMcFunc { get; set; }

Property Value

Func<vec3d_t, dvec3d_t>

ProgramPosToMcMap

The flat form of ProgramPosToMcFunc when the act was built with one (the constructor overload taking a ProgramPosToMcMap): the closure's transformation and ABC, what the act's record for core.dll carries. Null for an opaque closure (the Func<T, TResult> constructor, or ProgramPosToMcFunc set afterwards), which keeps the act on its managed enumerator.

public ProgramPosToMcMap? ProgramPosToMcMap { get; }

Property Value

ProgramPosToMcMap?

Methods

GetActMcXyzabcSteps(IMachiningMotionResolution, double, Action<object>)

Gets the machine XYZABC steps for this contour.

public IEnumerable<ActMcXyzabcStep> GetActMcXyzabcSteps(IMachiningMotionResolution ncResolution, double spindleMountToToolTipLength, Action<object> coordinateConversionFailedAction)

Parameters

ncResolution IMachiningMotionResolution

The machining motion resolution to use for step generation.

spindleMountToToolTipLength double

The length from spindle mount to tool tip, used for computing step numbers.

coordinateConversionFailedAction Action<object>

Called when attacher NP to MC conversion fails; the argument is the failed dvec3d_t (attacher NP).

Returns

IEnumerable<ActMcXyzabcStep>

A collection of machine XYZABC steps.

Remarks

Lazy (play-core migration P11): the map (ProgramPosToMcMap) and the contour are read at the first MoveNext; the steps come from core.dll while the map is set and the resolution is exactly one of the three resolution classes, from the managed enumerator over ProgramPosToMcFunc otherwise, bit for bit the same.

GetDerivative(vec3d_t, vec3d_t, vec3d_t, vec3d_t, int, out vec3d_t, out double, out double, out vec3d_t, out double, out double)

Get derivatives.

An end on the center (a radius below 1e-7) leaves no direction to turn from. Within TypicalControllerTolerance_mm of radius difference a control still runs such a block (Fanuc: along a spiral), and here it degenerates to the straight line from begin to end — travel along the plane normal included, e.g. a G17 arc whose ends share X and Y. Past the tolerance a control refuses the block and the spiral has no defined path, so the block gets no length and its act is dropped (ArcRadialClosure reports it). A spiral with no turn at all (both ends on one ray from the center) is the straight line too.

public static void GetDerivative(vec3d_t begin, vec3d_t end, vec3d_t centerOnBeginPlane, vec3d_t centerNormal, int additionalCircleNum, out vec3d_t arrowBeginOnProj, out double r0, out double r1, out vec3d_t axialMove, out double angleOnProj, out double approxCurveLength)

Parameters

begin vec3d_t
end vec3d_t
centerOnBeginPlane vec3d_t
centerNormal vec3d_t
additionalCircleNum int
arrowBeginOnProj vec3d_t

In-plane arrow from the center to the begin point; when the begin point is on the center, the arrow to the end point (the direction the degenerate spiral leaves along), zero when both are.

r0 double
r1 double
axialMove vec3d_t

synchronized move along the axis

angleOnProj double
approxCurveLength double

Approximate path length; 0 when the block produces no motion.

GetNcDerivative(vec3d_t, vec3d_t, vec2d_t, int, bool, int, out vec3d_t, out double, out double, out vec3d_t, out double, out double)

Calculates the derivative parameters for numerical control spiral movement.

public static void GetNcDerivative(vec3d_t ncBegin, vec3d_t ncEnd, vec2d_t ncCenterVec2d, int planeNormalDir, bool isCcw, int additionalCircleNum, out vec3d_t arrowBeginOnProj, out double r0, out double r1, out vec3d_t axialMove, out double angleOnProj, out double approxCurveLength)

Parameters

ncBegin vec3d_t

The beginning position in NC coordinates.

ncEnd vec3d_t

The ending position in NC coordinates.

ncCenterVec2d vec2d_t

The center position vector in 2D NC coordinates.

planeNormalDir int

The direction of the plane normal (0=X, 1=Y, 2=Z).

isCcw bool

Indicates whether the movement is counter-clockwise.

additionalCircleNum int

The number of additional circles in the spiral movement.

arrowBeginOnProj vec3d_t

The output arrow begin position on projection.

r0 double

The output starting radius.

r1 double

The output ending radius.

axialMove vec3d_t

The output axial movement vector.

angleOnProj double

The output angle on projection.

approxCurveLength double

The output approximate curve length.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.