MCPcopy Index your code
hub / github.com/cncjs/gcode-toolpath / Toolpath

Class Toolpath

src/Toolpath.js:18–735  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16};
17
18class Toolpath {
19 g92offset = {
20 x: 0,
21 y: 0,
22 z: 0
23 };
24
25 offsetG92 = (pos) => {
26 return {
27 x: pos.x + this.g92offset.x,
28 y: pos.y + this.g92offset.y,
29 z: pos.z + this.g92offset.z
30 };
31 }
32 offsetAddLine = (start, end) => {
33 this.fn.addLine(this.modal, this.offsetG92(start), this.offsetG92(end));
34 }
35 offsetAddArcCurve = (start, end, center) => {
36 this.fn.addArcCurve(this.modal, this.offsetG92(start), this.offsetG92(end), this.offsetG92(center));
37 }
38
39 position = {
40 x: 0,
41 y: 0,
42 z: 0
43 };
44
45 modal = {
46 // Moton Mode
47 // G0, G1, G2, G3, G38.2, G38.3, G38.4, G38.5, G80
48 motion: 'G0',
49
50 // Coordinate System Select
51 // G54, G55, G56, G57, G58, G59
52 wcs: 'G54',
53
54 // Plane Select
55 // G17: XY-plane, G18: ZX-plane, G19: YZ-plane
56 plane: 'G17',
57
58 // Units Mode
59 // G20: Inches, G21: Millimeters
60 units: 'G21',
61
62 // Distance Mode
63 // G90: Absolute, G91: Relative
64 distance: 'G90',
65
66 // Arc IJK distance mode
67 arc: 'G91.1',
68
69 // Feed Rate Mode
70 // G93: Inverse time mode, G94: Units per minute mode, G95: Units per rev mode
71 feedrate: 'G94',
72
73 // Cutter Radius Compensation
74 cutter: 'G40',
75

Callers

nothing calls this directly

Calls 12

setModalMethod · 0.95
translateXMethod · 0.95
translateYMethod · 0.95
translateZMethod · 0.95
setPositionMethod · 0.95
translateIMethod · 0.95
translateJMethod · 0.95
translateKMethod · 0.95
isXYPlaneMethod · 0.95
isZXPlaneMethod · 0.95
isYZPlaneMethod · 0.95
translateRMethod · 0.95

Tested by

no test coverage detected