Type Definitions
Axes
A helper for finding axes according to the chosen plane.
Type:
- object
Properties:
Name | Type | Description |
---|---|---|
re |
string | The axis for REal numbers. |
im |
string | The axis for IMaginary numbers. |
cr |
string | The CRoss axis. |
Bezier
An object defining a cubic Bézier curve.
Type:
- object
Properties:
Name | Type | Description |
---|---|---|
p0 |
Point | The first control point. |
p1 |
Point | The second control point. |
p2 |
Point | The third control point. |
p3 |
Point | The fourth control point. |
Error
Errors can happen in G-Code files. It can be simple warning where code is
parsed but can have a different behaviour depending on the machine, or it
can be a real error and the command is skipped.
Type:
- object
Properties:
Name | Type | Description |
---|---|---|
line |
number | The line number where the error occurs. |
message |
string | The message explaining the error. |
isSkipped |
boolean | If the command is skipped. |
Line
An object defining a line.
Type:
- object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
lineNumber |
number | The line number in the G-Code file corresponding to the line definition. | |
type |
string | The G-Code command. | |
feedrate |
number | The feed rate for doing the path defined by the line. | |
start |
Point |
<optional> |
The starting point of the line if type "G0" or "G1". |
end |
Point |
<optional> |
The ending point of the line if type "G0" or "G1". |
bez |
Array.<Bezier> |
<optional> |
The bezier curves defining the point if type "G2" or G3". |
ParsedCommand
Defines a single command parsed by the G-Code syntax parser. The definition
is not exhaustive.
Type:
- object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
type |
string | The command type. | |
x |
number |
<optional> |
The X argument. |
y |
number |
<optional> |
The Y argument. |
z |
number |
<optional> |
The Z argument. |
f |
number |
<optional> |
The F argument. |
r |
number |
<optional> |
The R argument. |
i |
number |
<optional> |
The I argument. |
j |
number |
<optional> |
The J argument. |
k |
number |
<optional> |
The K argument. |
ParsedGCode
An object defining the parsed G-Code. This is what that should be used by
the developper using this library.
Type:
- object
Properties:
Name | Type | Description |
---|---|---|
gcode |
Array.<string> | The original G-Code, each cell contains a single command. |
lines |
Array.<Lines> | The lines defining the path the bit will take. |
size |
Size | The size the job will take. |
displayInInch |
boolean | If the job shoud be display in inches. |
errorList |
Error | The error the G-Code contains. |
Point
A 3D point.
Type:
- object
Properties:
Name | Type | Description |
---|---|---|
x |
number | The x coordinate. |
y |
number | The y coordinate. |
z |
number | The z coordinate. |
Settings
Defines the settings of the G-Code. It changes constantly according to the
G-Code commands used.
Type:
- object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
crossAxe |
string |
<optional> |
"z" | The cross axe. |
feedrate |
number |
<optional> |
0 | The feed rate. |
inMm |
boolean |
<optional> |
false | If the units are in millimeters. |
position |
Point |
<optional> |
{x:0, y:0, z:0} | The last position of the bit. |
previousMoveCommand |
string |
<optional> |
"" | The previous move command ("G0", "G1", "G2", "G3"). |
relative |
boolean |
<optional> |
false | If the coordinates are relative. |
Size
An object defining the size.
Type:
- object
Properties:
Name | Type | Description |
---|---|---|
min |
Point | The lowest values in x, y and z coordinates. |
max |
Point | The highest values in x, y and z coordinates. |