&ACCESS RVO1
&COMMENT Modul (src/dat) with no content
DEF GeneralEllipsoid ( )

DECL INT _i
DECL REAL _X, _Y, _dX, _dY

;FOLD Ellipse Spiral Points Generation
; Generates an ellipse or ellipsoidal spiral parametrically.
; 'Circles' is the number of 360deg sweeps to make.
; 'TotalIndex' is the total number of steps to divide the entire operation into
; 'XRadius' is the max radius of the ellipse along Tool X axis
; 'YRadius' is the max radius of the ellipse along Tool Y axis
; 'XStart' is the inner radius limit of the X radius, in case you don't want to start at center
; 'YStart' is the inner radius limit of the Y radius, in case you don't want to start at center
; If Start and Radius are equal, there is no spiral, merely the ellipse
; If both radii are equal, the ellipse is a circle 
; Making Start larger than Radius will reverse cw/ccw direction of spiral and draw from outside inwards
WAIT FOR TRUE
CircleCenter = $NULLFRAME ; if using $POS_ACT as a Base at the center of the ellipse
;CircleCenter = xCenter ; if using a programmed point for the center of the ellipse
AngleIncrement = Circles * 360 / TotalIndex
_dX = (XRadius - XStart) / TotalIndex ; X increase per step
_dY = (YRadius - YStart) / TotalIndex ; Y increase per step
FOR RepeatIndex = 1 to TotalIndex
  Clock = (RepeatIndex * AngleIncrement)
  NextPos[RepeatIndex] = $NULLFRAME
  _X = (COS(Clock) * (XStart + (_dX * RepeatIndex)))
  _Y = (SIN(Clock) * (YStart + (_dY * RepeatIndex)))
  NextPos[RepeatIndex].X = NextPos[RepeatIndex].X + _X
  NextPos[RepeatIndex].Y = NextPos[RepeatIndex].Y + _Y
  NextPos[RepeatIndex] = CircleCenter : NextPos[RepeatIndex]
ENDFOR
;ENDFOLD Ellipse Points Generation

FOR _i = 1 TO 300 ; need to parameterize this
  LIN NextPos [_i] C_VEL
ENDFOR


END