-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCOPYWCS
More file actions
executable file
·41 lines (36 loc) · 1.33 KB
/
COPYWCS
File metadata and controls
executable file
·41 lines (36 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright 2024 Toolpath Labs Inc., Justin Gray, and Josh Smith
// COMPZEROPOINT
// Description: copy wcs B into A
// Modified 2/10/2024: Joshua Smith
// Argument A -> #1 is the work coordinate system to store offsets in. The format for extended G54 offsets would be a period followed by the offset// G54.5
// Argument B -> #2 is the override coordinate system. The format for extended G54 offsets would be a period followed by the offset// G54.5
// CALCULATE EXTENDED WCS NUMBER
// FIX is a round down function and MOD is modulo
#114 = ROUND[[#1 - FIX[#1]] * 10]
#115 = ROUND[[#2 - FIX[#2]] * 10]
// Get Argument B WCS
IF [ #2 < 53 || #2 == #0]
ALARM["ERROR: OVERRIDE WCS NOT PROVIDED"]
ELSEIF [#115 < 1]
#119 = R_G53G59_COOR[0,#2,1] // x override zero
#120 = R_G53G59_COOR[0,#2,2] // y override zero
#121 = R_G53G59_COOR[0,#2,3] // z override zero
ELSE
#119 = R_G54EXP_COOR[0,#115,1] // x work zero
#120 = R_G54EXP_COOR[0,#115,2] // y work zero
#121 = R_G54EXP_COOR[0,#115,3] // z work zero
END_IF
// Copy one wcs into another
IF [#1 < 53 || #1 == #0 || #1 == #2]
// DO NOT SET ANYTHING INTO WCS
ELSEIF [#114 < 1]
W_G53G59_COOR[0,#1,1,#119]
W_G53G59_COOR[0,#1,2,#120]
W_G53G59_COOR[0,#1,3,#121]
ELSE
W_G54EXP_COOR[0,#114,1,#119]
W_G54EXP_COOR[0,#114,2,#120]
W_G54EXP_COOR[0,#114,3,#121]
END_IF
G90
M99