summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
Diffstat (limited to 'res')
-rw-r--r--res/nist/canned-cycles.nc50
-rw-r--r--res/nist/expressions.nc48
-rw-r--r--res/nist/simple.nc62
-rw-r--r--res/shapes/circle.nc11
-rw-r--r--res/shapes/square.nc41
5 files changed, 212 insertions, 0 deletions
diff --git a/res/nist/canned-cycles.nc b/res/nist/canned-cycles.nc
new file mode 100644
index 0000000..ce50390
--- /dev/null
+++ b/res/nist/canned-cycles.nc
@@ -0,0 +1,50 @@
1n0010 g20 (cycle test)
2n0020 g17 g43 h1 m3 s1234 f16 (start in XY-plane)
3n0030 g81 x3 y4 r0.2 z-1.1
4n0040 x1 y0 r0 g91 l3 (three more g81’s an inch apart)
5n0050 y-2 r0.1 (one more g81)
6n0060 g82 g90 x4 y5 r0.2 z-1.1 p0.6
7n0070 x2 z-3.0 (one more G82)
8n0080 g91 x-2 y2 r0 l4 (four more g82’s)
9n0090 g83 g90 x5 y6 r0.2 z-1.1 q0.21
10n0100 g84 x6 y7 r0.2 z-1.1
11n0110 g85 x7 y8 r0.2 z-1.1
12n0120 g86 x8 y9 r0.2 z-1.1 p902.61
13n0130 g87 x9 y10 r0.2 z-1.1 i0.231 j-0 k-3
14n0135 g91 x1 r0.2 z-1.1 i0.231 j-0 k-3
15n0140 g88 x10 y11 r0.2 z-1.1 p0.3333
16n0150 g89 x11 y12 r0.2 z-1.1 p1.272
17n0160 m4 (run spindle counterclockwise)
18n0170 g86 x8 y9 r0.2 z-1.1 p902.61
19n0180 g87 x9 y10 r0.2 z-1.1 i0.231 j-0 k-3
20n0190 g88 x10 y11 r0.2 z-1.1 p0.3333
21
22n0220 g18 m3 (now run all cycles in the XZ-plane)
23n0230 g81 z3 x4 r0.2 y-1.1
24n0240 g91 z1 x0 r0 l3
25n0260 g82 g90 z4 x5 r0.2 y-1.1 p0.6
26n0280 g91 z-2 x2 r0 l4
27n0290 g83 g90 z5 x6 r0.2 y-1.1 q0.21
28n0300 g84 z6 x7 r0.2 y-1.1
29n0310 g85 z7 x8 r0.2 y-1.1
30n0320 g86 z8 x9 r0.2 y-1.1 p902.61
31n0330 g87 z9 x10 r0.2 y-1.1 k0.231 i-0 j-3
32n0335 g91 z1 r0.2 y-1.1 k0.231 i-0 j-3
33n0340 g88 z10 x11 r0.2 y-1.1 p0.3333
34n0350 g89 z11 x12 r0.2 y-1.1 p1.272
35
36n0420 g19 (now run all cycles in the YZ-plane)
37n0430 g81 y3 z4 r0.2 x-1.1
38n0440 g91 y1 z0 r0 l3
39n0460 g82 g90 y4 z5 r0.2 x-1.1 p0.6
40n0480 g91 y-2 z2 r0 l4
41n0490 g83 g90 y5 z6 r0.2 x-1.1 q0.21
42n0500 g84 y6 z7 r0.2 x-1.1
43n0510 g85 y7 z8 r0.2 x-1.1
44n0520 g86 y8 z9 r0.2 x-1.1 p902.61
45n0530 g87 y9 z10 r0.2 x-1.1 j0.231 k-0 i-3
46n0535 g91 y1 r0.2 x-1.1 j0.231 k-0 i-3
47n0540 g88 y10 z11 r0.2 x-1.1 p0.3333
48n0550 g89 y11 z12 r0.2 x-1.1 p1.272
49
50n1000 m2 (the end)
diff --git a/res/nist/expressions.nc b/res/nist/expressions.nc
new file mode 100644
index 0000000..68e7c16
--- /dev/null
+++ b/res/nist/expressions.nc
@@ -0,0 +1,48 @@
1n0010 g21 g1 x3 f20 (expression test)
2n0020 x [1 + 2] (x should be 3)
3n0030 x [1 - 2] (x should be -1)
4n0040 x [1 --3] (x should be 4)
5n0050 x [2/5] (x should be 0.40)
6n0060 x [3.0 * 5] (x should be 15)
7n0070 x [0 OR 0] (x should be 0)
8n0080 x [0 OR 1] (x should be 1)
9n0090 x [2 or 2] (x should be 1)
10n0100 x [0 AND 0] (x should be 0)
11n0110 x [0 AND 1] (x should be 0)
12n0120 x [2 and 2] (x should be 1)
13n0130 x [0 XOR 0] (x should be 0)
14n0140 x [0 XOR 1] (x should be 1)
15n0150 x [2 xor 2] (x should be 0)
16n0160 x [15 MOD 4.0] (x should be 3)
17n0170 x [1 + 2 * 3 - 4 / 5] (x should be 6.2)
18n0180 x sin[30] (x should be 0.5)
19n0190 x cos[0.0] (x should be 1.0)
20n0200 x tan[60.0] (x should be 1.7321)
21n0210 x sqrt[3] (x should be 1.7321)
22n0220 x atan[1.7321]/[1.0] (x should be 60.0)
23n0230 x asin[1.0] (x should be 90.0)
24n0240 x acos[0.707107] (x should be 45.0000)
25n0250 x abs[20.0] (x should be 20)
26n0260 x abs[-1.23] (x should be 1.23)
27n0270 x round[-0.499] (x should be 0)
28n0280 x round[-0.5001] (x should be -1.0)
29n0290 x round[2.444] (x should be 2)
30n0300 x round[9.975] (x should be 10)
31n0310 x fix[-0.499] (x should be -1.0)
32n0320 x fix[-0.5001] (x should be -1.0)
33n0330 x fix[2.444] (x should be 2)
34n0340 x fix[9.975] (x should be 9)
35n0350 x fup[-0.499] (x should be 0.0)
36n0360 x fup[-0.5001] (x should be 0.0)
37n0370 x fup[2.444] (x should be 3)
38n0380 x fup[9.975] (x should be 10)
39n0390 x exp[2.3026] (x should be 10)
40n0400 x ln[10.0] (x should be 2.3026)
41n0410 x [2 ** 3.0] #1=2.0 (x should be 8.0)
42n0420 ##1 = 0.375 (#1 is 2, so parameter 2 is set to 0.375)
43n0430 x #2 (x should be 0.375) #3=7.0
44n0440 #3=5.0 x #3 (parameters set in parallel, so x should be 7, not 5)
45n0450 x #3 #3=1.1 (parameters set in parallel, so x should be 5, not 1.1)
46n0460 x [2 + asin[1/2.1+-0.345] / [atan[fix[4.4] * 2.1 * sqrt[16.8]] /[-18]]**2]
47n0470 x sqrt[3**2 + 4**2] (x should be 5.0)
48n0480 m2
diff --git a/res/nist/simple.nc b/res/nist/simple.nc
new file mode 100644
index 0000000..31af719
--- /dev/null
+++ b/res/nist/simple.nc
@@ -0,0 +1,62 @@
1(this program mills “Hello world” between X=0 and X=81 millimeters)
2n0010 g21 g0 x0 y0 z50 (top of part should be on XY plane)
3n0020 t1 m6 m3 f20 s4000 (use an engraver or small ball-nose endmill)
4n0030 g0 x0 y0 z2
5n0040 g1 z-0.5 (start H)
6n0050 y10
7n0060 g0 z2
8n0070 y5
9n0080 g1 z-0.5
10n0090 x 7
11n0100 g0 z2
12n0110 y0
13n0120 g1 z-0.5
14n0130 y10
15n0140 g0 z2
16n0150 x11 y2.5
17n0160 g1 z-0.5 (start e)
18n0170 x16
19n0190 g3 x13.5 y0 i-2.5
20n0200 g1 x16
21n0210 g0 z2
22n0220 x20 y0
23n0230 g1 z-0.5 (start l)
24n0240 y9
25n0250 g0 z2
26n0260 x26
27n0270 g1 z-0.5 (start l)
28n0280 y0
29n0290 g0 z2
30n0300 x32.5
31n0310 g1 z-0.5 (start o)
32n0320 g2 x32.5 j2.5
33n0330 g0 z2
34n0340 x45 y5
35n0350 g1 z-0.5 (start w)
36n0360 x47 y0
37n0370 x48.5 y3
38n0380 x50 y0
39n0390 x52 y5
40n0400 g0 z2
41n0410 x57.5 y0
42n0420 g1 z-0.5 (start o)
43n0430 g2 x57.5 j2.5
44n0440 g0 z2
45n0450 x64
46n0460 g1 z-0.5 (start r)
47n0470 y5
48n0480 y4
49n0490 g2 x69 r4
50n0500 g0 z2
51n0510 x73 y0
52n0520 g1 z-0.5 (start l)
53n0530 y9
54n0540 g0 z2
55n0550 x81
56n0560 g1 z-0.5 (start d)
57n0570 y0
58n0580 x79.5
59n0590 g2 j2.5 y5
60n0600 g1 x81
61n0610 g0 z50
62n0620 m2
diff --git a/res/shapes/circle.nc b/res/shapes/circle.nc
new file mode 100644
index 0000000..9d7a755
--- /dev/null
+++ b/res/shapes/circle.nc
@@ -0,0 +1,11 @@
1G17 G20 G90 G94 G54
2G0 Z0.25
3X-0.5 Y0.
4Z0.1
5G01 Z0. F5.
6G02 X0. Y0.5 I0.5 J0. F2.5
7X0.5 Y0. I0. J-0.5
8X0. Y-0.5 I-0.5 J0.
9X-0.5 Y0. I0. J0.5
10G01 Z0.1 F5.
11G00 X0. Y0. Z0.25
diff --git a/res/shapes/square.nc b/res/shapes/square.nc
new file mode 100644
index 0000000..bfcc24f
--- /dev/null
+++ b/res/shapes/square.nc
@@ -0,0 +1,41 @@
1(Exported by FreeCAD)
2(Post Processor: linuxcnc_post)
3(Output Time:2026-02-17 23:27:08.902610)
4/(begin preamble)
5G17 G54 G40 G49 G80 G90
6G21
7(begin operation: Fixture)
8(machine units: mm/min)
9G54
10(finish operation: Fixture)
11(begin operation: TC: Default Tool)
12(machine units: mm/min)
13(TC: Default Tool)
14M5
15M6 T1
16G43 H1
17(finish operation: TC: Default Tool)
18(begin operation: Profile)
19(machine units: mm/min)
20(Profile)
21(Compensated Tool Path. Diameter: 5.0)
22G0 Z15.000
23G0 X51.768 Y51.768
24G0 Z13.000
25G1 X51.768 Y51.768 Z0.000
26G2 X52.500 Y50.000 Z0.000 I-1.768 J-1.768
27G1 X52.500 Y0.000 Z0.000
28G2 X50.000 Y-2.500 Z0.000 I-2.500 J0.000
29G1 X0.000 Y-2.500 Z0.000
30G2 X-2.500 Y0.000 Z0.000 I0.000 J2.500
31G1 X-2.500 Y50.000 Z0.000
32G2 X0.000 Y52.500 Z0.000 I2.500 J-0.000
33G1 X50.000 Y52.500 Z0.000
34G2 X51.768 Y51.768 Z0.000 I-0.000 J-2.500
35G0 Z15.000
36G0 Z15.000
37(finish operation: Profile)
38(begin postamble)
39M05
40G17 G54 G90 G80 G40
41M2