Skip to content

Commit

Permalink
Merge pull request #21 from remcoder/develop
Browse files Browse the repository at this point in the history
Release v2.3.0
  • Loading branch information
remcoder authored Jun 5, 2021
2 parents f058802 + e733f78 commit 9fe576d
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 30 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ or

#### Javascript
```
import * as GCodePreview from "gcode-preview";
const gcode = 'G0 X0 Y0 Z0.2\nG1 X42 Y42'; // draw a diagonal line
const preview = new WebGLPreview({
const preview = new GCodePreview.WebGLPreview({
targetId: 'gcode-preview',
});
Expand Down
2 changes: 1 addition & 1 deletion demo/dist/gcode-preview.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/gcode-parser.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export declare class MoveCommand extends GCodeCommand {
params: MoveCommandParams;
constructor(gcode: string, params: MoveCommandParams, comment?: string);
}
declare type MoveCommandParamName = 'x' | 'y' | 'z' | 'e';
declare type MoveCommandParamName = 'x' | 'y' | 'z' | 'e' | 'f';
declare type MoveCommandParams = {
[key in MoveCommandParamName]?: number;
};
Expand Down
2 changes: 1 addition & 1 deletion dist/gcode-preview.es.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/gcode-preview.js

Large diffs are not rendered by default.

48 changes: 27 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gcode-preview",
"version": "2.2.0",
"version": "2.3.0",
"description": "Preview a 3d print from a gcode file",
"author": "[email protected]",
"license": "MIT",
Expand Down Expand Up @@ -40,7 +40,7 @@
"deploy": "firebase deploy --only hosting"
},
"dependencies": {
"three": "^0.123.0",
"three": "^0.125.0",
"three-orbitcontrols": "^2.110.3"
}
}
4 changes: 2 additions & 2 deletions src/gcode-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class MoveCommand extends GCodeCommand {
super(gcode, comment);
}
}
type MoveCommandParamName = 'x' | 'y' | 'z' | 'e';
type MoveCommandParamName = 'x' | 'y' | 'z' | 'e' | 'f';
type MoveCommandParams = {
[key in MoveCommandParamName]?: number;
};
Expand Down Expand Up @@ -49,7 +49,7 @@ export class Parser {
parseMove(params: string[]): MoveCommandParams {
return params.reduce((acc: MoveCommandParams, cur: string) => {
const key = cur.charAt(0).toLowerCase();
if (key == 'x' || key == 'y' || key == 'z' || key == 'e')
if (key == 'x' || key == 'y' || key == 'z' || key == 'e' || key == 'f')
acc[key] = parseFloat(cur.slice(1));
return acc;
}, {});
Expand Down

0 comments on commit 9fe576d

Please sign in to comment.