Class ActMcXyzSpiralContour
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
programPosBeginvec3d_tThe beginning position in program coordinates.
programPosEndvec3d_tThe ending position in program coordinates.
programPosCenterOnBeginPlanevec3d_tThe center position of the spiral in program coordinates.
centerNormalvec3d_tThe normal vector of the center plane.
additionalCircleNumintThe number of additional circles in the spiral movement.
actDurationTimeSpanThe duration of the contour movement.
programPosToMcProgramPosToMcMapThe 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
programPosBeginvec3d_tThe beginning position in program coordinates.
programPosEndvec3d_tThe ending position in program coordinates.
programPosCenterOnBeginPlanevec3d_tThe center position of the spiral in program coordinates.
centerNormalvec3d_tThe normal vector of the center plane.
additionalCircleNumintThe number of additional circles in the spiral movement.
actDurationTimeSpanThe duration of the contour movement.
programPosToMcFuncFunc<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
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
CenterNormal
Gets or sets the normal vector of the center plane.
public vec3d_t CenterNormal { get; set; }
Property Value
ProgramPosBegin
Gets or sets the beginning position in program coordinates.
public vec3d_t ProgramPosBegin { get; set; }
Property Value
ProgramPosCenterOnBeginPlane
Gets or sets the center position of the spiral in program coordinates.
public vec3d_t ProgramPosCenterOnBeginPlane { get; set; }
Property Value
ProgramPosEnd
Gets or sets the ending position in program coordinates.
public vec3d_t ProgramPosEnd { get; set; }
Property Value
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
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
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
ncResolutionIMachiningMotionResolutionThe machining motion resolution to use for step generation.
spindleMountToToolTipLengthdoubleThe length from spindle mount to tool tip, used for computing step numbers.
coordinateConversionFailedActionAction<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
beginvec3d_tendvec3d_tcenterOnBeginPlanevec3d_tcenterNormalvec3d_tadditionalCircleNumintarrowBeginOnProjvec3d_tIn-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.
r0doubler1doubleaxialMovevec3d_tsynchronized move along the axis
angleOnProjdoubleapproxCurveLengthdoubleApproximate 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
ncBeginvec3d_tThe beginning position in NC coordinates.
ncEndvec3d_tThe ending position in NC coordinates.
ncCenterVec2dvec2d_tThe center position vector in 2D NC coordinates.
planeNormalDirintThe direction of the plane normal (0=X, 1=Y, 2=Z).
isCcwboolIndicates whether the movement is counter-clockwise.
additionalCircleNumintThe number of additional circles in the spiral movement.
arrowBeginOnProjvec3d_tThe output arrow begin position on projection.
r0doubleThe output starting radius.
r1doubleThe output ending radius.
axialMovevec3d_tThe output axial movement vector.
angleOnProjdoubleThe output angle on projection.
approxCurveLengthdoubleThe 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.