- #1
bsharp
- 7
- 0
I am trying to translate a file from one format to another. The file I am trying to read from gives me the coordinates of arcs like this.
A three arc circle going clockwise:
GOTO / 0.80353, -0.60825, 0.75000, 0.000000, 0.000000, 1.000000
INDIRV/ -0.86603, 0.50000, 0.00000
TLON,GOFWD/ (CIRCLE/ 0.86603, -0.50000, 0.75000,$
0.12500),ON,(LINE/ 0.86603, -0.50000, 0.75000,$
0.92853, -0.39175, 0.75000)
INDIRV/ 0.86603, -0.50000, 0.00000
TLON,GOFWD/ (CIRCLE/ 0.86603, -0.50000, 0.75000,$
0.12500),ON,(LINE/ 0.86603, -0.50000, 0.75000,$
0.97428, -0.56250, 0.75000)
INDIRV/ -0.50000, -0.86603, 0.00000
TLON,GOFWD/ (CIRCLE/ 0.86603, -0.50000, 0.75000,$
0.12500),ON,(LINE/ 0.86603, -0.50000, 0.75000,$
0.80353, -0.60825, 0.75000)
The same three arc circle going counterclockwise:
GOTO / 0.80353, -0.60825, 0.75000, 0.000000, 0.000000, 1.000000
INDIRV/ 0.86603, -0.50000, 0.00000
TLON,GOFWD/ (CIRCLE/ 0.86603, -0.50000, 0.75000,$
0.12500),ON,(LINE/ 0.86603, -0.50000, 0.75000,$
0.92853, -0.39175, 0.75000)
INDIRV/ -0.86603, 0.50000, 0.00000
TLON,GOFWD/ (CIRCLE/ 0.86603, -0.50000, 0.75000,$
0.12500),ON,(LINE/ 0.86603, -0.50000, 0.75000,$
0.75777, -0.43750, 0.75000)
INDIRV/ -0.50000, -0.86603, 0.00000
TLON,GOFWD/ (CIRCLE/ 0.86603, -0.50000, 0.75000,$
0.12500),ON,(LINE/ 0.86603, -0.50000, 0.75000,$
0.80353, -0.60825, 0.75000)
The “GOTO” command is a linear move followed by it’s cords “X,Y,Z”
The “INDRV” is from what I can figure is a direction vector “X,Y,Z”?
The TLON,GOFWD line specifies the arc center cords “X,Y,Z”
The line after specifies the radius “0.12500” and arc center cords
The next line specifies the ending cords “X,Y,Z”.
Some how I need to determine the direction of each arc. I have tried comparing the starting and ending cords but it will not always work.
If the arc is 360 deg the “INDRV” cord will be positive or negative the corresponding arc center cord.
I think I have to calculate the direction from the “INDRV” based on the starting or ending cords some how.
If you look at the last arc in each example the only thing different is the starting cords “the ending cords from the previous arc”. If some one could help me out with this it would be great.
A three arc circle going clockwise:
GOTO / 0.80353, -0.60825, 0.75000, 0.000000, 0.000000, 1.000000
INDIRV/ -0.86603, 0.50000, 0.00000
TLON,GOFWD/ (CIRCLE/ 0.86603, -0.50000, 0.75000,$
0.12500),ON,(LINE/ 0.86603, -0.50000, 0.75000,$
0.92853, -0.39175, 0.75000)
INDIRV/ 0.86603, -0.50000, 0.00000
TLON,GOFWD/ (CIRCLE/ 0.86603, -0.50000, 0.75000,$
0.12500),ON,(LINE/ 0.86603, -0.50000, 0.75000,$
0.97428, -0.56250, 0.75000)
INDIRV/ -0.50000, -0.86603, 0.00000
TLON,GOFWD/ (CIRCLE/ 0.86603, -0.50000, 0.75000,$
0.12500),ON,(LINE/ 0.86603, -0.50000, 0.75000,$
0.80353, -0.60825, 0.75000)
The same three arc circle going counterclockwise:
GOTO / 0.80353, -0.60825, 0.75000, 0.000000, 0.000000, 1.000000
INDIRV/ 0.86603, -0.50000, 0.00000
TLON,GOFWD/ (CIRCLE/ 0.86603, -0.50000, 0.75000,$
0.12500),ON,(LINE/ 0.86603, -0.50000, 0.75000,$
0.92853, -0.39175, 0.75000)
INDIRV/ -0.86603, 0.50000, 0.00000
TLON,GOFWD/ (CIRCLE/ 0.86603, -0.50000, 0.75000,$
0.12500),ON,(LINE/ 0.86603, -0.50000, 0.75000,$
0.75777, -0.43750, 0.75000)
INDIRV/ -0.50000, -0.86603, 0.00000
TLON,GOFWD/ (CIRCLE/ 0.86603, -0.50000, 0.75000,$
0.12500),ON,(LINE/ 0.86603, -0.50000, 0.75000,$
0.80353, -0.60825, 0.75000)
The “GOTO” command is a linear move followed by it’s cords “X,Y,Z”
The “INDRV” is from what I can figure is a direction vector “X,Y,Z”?
The TLON,GOFWD line specifies the arc center cords “X,Y,Z”
The line after specifies the radius “0.12500” and arc center cords
The next line specifies the ending cords “X,Y,Z”.
Some how I need to determine the direction of each arc. I have tried comparing the starting and ending cords but it will not always work.
If the arc is 360 deg the “INDRV” cord will be positive or negative the corresponding arc center cord.
I think I have to calculate the direction from the “INDRV” based on the starting or ending cords some how.
If you look at the last arc in each example the only thing different is the starting cords “the ending cords from the previous arc”. If some one could help me out with this it would be great.