@duet3d/gcodeviewer 3.7.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/GCodeCommands/blank.d.ts +3 -0
- package/dist/GCodeCommands/g0g1.d.ts +3 -0
- package/dist/GCodeCommands/g10.d.ts +3 -0
- package/dist/GCodeCommands/g11.d.ts +3 -0
- package/dist/GCodeCommands/g20.d.ts +3 -0
- package/dist/GCodeCommands/g21.d.ts +3 -0
- package/dist/GCodeCommands/g28.d.ts +3 -0
- package/dist/GCodeCommands/g29.d.ts +3 -0
- package/dist/GCodeCommands/g2g3.d.ts +3 -0
- package/dist/GCodeCommands/g90.d.ts +3 -0
- package/dist/GCodeCommands/g91.d.ts +3 -0
- package/dist/GCodeCommands/index.d.ts +19 -0
- package/dist/GCodeCommands/m3m4.d.ts +3 -0
- package/dist/GCodeCommands/m5.d.ts +3 -0
- package/dist/GCodeCommands/m567.d.ts +3 -0
- package/dist/GCodeCommands/m600.d.ts +3 -0
- package/dist/GCodeCommands/processline.d.ts +3 -0
- package/dist/GCodeCommands/stepper.d.ts +7 -0
- package/dist/GCodeCommands/t.d.ts +3 -0
- package/dist/GCodeCommands/temperature.d.ts +6 -0
- package/dist/GCodeCommands/workplace.d.ts +3 -0
- package/dist/GCodeLines/arcmove.d.ts +17 -0
- package/dist/GCodeLines/base.d.ts +8 -0
- package/dist/GCodeLines/command.d.ts +6 -0
- package/dist/GCodeLines/comment.d.ts +7 -0
- package/dist/GCodeLines/index.d.ts +7 -0
- package/dist/GCodeLines/mcode.d.ts +6 -0
- package/dist/GCodeLines/move.d.ts +33 -0
- package/dist/GCodeLines/move_thin.d.ts +14 -0
- package/dist/GCodeParsers/cura.d.ts +52 -0
- package/dist/GCodeParsers/genericbase.d.ts +3 -0
- package/dist/GCodeParsers/ideamaker.d.ts +97 -0
- package/dist/GCodeParsers/kirimoto.d.ts +52 -0
- package/dist/GCodeParsers/orcaslicer.d.ts +72 -0
- package/dist/GCodeParsers/prusaslicer.d.ts +97 -0
- package/dist/GCodeParsers/slicerbase.d.ts +15 -0
- package/dist/GCodeParsers/slicerfactory.d.ts +1 -0
- package/dist/GCodeParsers/superslicer.d.ts +97 -0
- package/dist/Renderables/axes.d.ts +16 -0
- package/dist/Renderables/bed.d.ts +53 -0
- package/dist/Renderables/buildobjects.d.ts +35 -0
- package/dist/Renderables/nozzle.d.ts +81 -0
- package/dist/Renderables/textplane.d.ts +3 -0
- package/dist/Renderables/viewbox.d.ts +27 -0
- package/dist/gpupicker.d.ts +22 -0
- package/dist/index.cjs.js +432 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +431 -0
- package/dist/lineshader.d.ts +30 -0
- package/dist/modelmaterial.d.ts +24 -0
- package/dist/processor.d.ts +96 -0
- package/dist/processorproperties.d.ts +64 -0
- package/dist/rendershaders.d.ts +2 -0
- package/dist/tools.d.ts +9 -0
- package/dist/util.d.ts +17 -0
- package/dist/viewer-direct.d.ts +21 -0
- package/dist/viewer-proxy.d.ts +73 -0
- package/dist/viewer.d.ts +87 -0
- package/dist/viewer.worker.d.ts +1 -0
- package/dist/wasmprocessor.d.ts +37 -0
- package/package.json +38 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { default as ProcessorProperties } from '../processorproperties';
|
|
2
|
+
import { default as SlicerBase } from './slicerbase';
|
|
3
|
+
export default class SuperSlicer extends SlicerBase {
|
|
4
|
+
featureList: {
|
|
5
|
+
PERIMETER: {
|
|
6
|
+
color: number[];
|
|
7
|
+
perimeter: boolean;
|
|
8
|
+
support: boolean;
|
|
9
|
+
};
|
|
10
|
+
'EXTERNAL PERIMETER': {
|
|
11
|
+
color: number[];
|
|
12
|
+
perimeter: boolean;
|
|
13
|
+
support: boolean;
|
|
14
|
+
};
|
|
15
|
+
'INTERNAL INFILL': {
|
|
16
|
+
color: number[];
|
|
17
|
+
perimeter: boolean;
|
|
18
|
+
support: boolean;
|
|
19
|
+
};
|
|
20
|
+
'SOLID INFILL': {
|
|
21
|
+
color: number[];
|
|
22
|
+
perimeter: boolean;
|
|
23
|
+
support: boolean;
|
|
24
|
+
};
|
|
25
|
+
'TOP SOLID INFILL': {
|
|
26
|
+
color: number[];
|
|
27
|
+
perimeter: boolean;
|
|
28
|
+
support: boolean;
|
|
29
|
+
};
|
|
30
|
+
'BRIDGE INFILL': {
|
|
31
|
+
color: number[];
|
|
32
|
+
perimeter: boolean;
|
|
33
|
+
support: boolean;
|
|
34
|
+
};
|
|
35
|
+
'GAP FILL': {
|
|
36
|
+
color: number[];
|
|
37
|
+
perimeter: boolean;
|
|
38
|
+
support: boolean;
|
|
39
|
+
};
|
|
40
|
+
SKIRT: {
|
|
41
|
+
color: number[];
|
|
42
|
+
perimeter: boolean;
|
|
43
|
+
support: boolean;
|
|
44
|
+
};
|
|
45
|
+
'SKIRT/BRIM': {
|
|
46
|
+
color: number[];
|
|
47
|
+
perimeter: boolean;
|
|
48
|
+
support: boolean;
|
|
49
|
+
};
|
|
50
|
+
'SUPPORTED MATERIAL': {
|
|
51
|
+
color: number[];
|
|
52
|
+
perimeter: boolean;
|
|
53
|
+
support: boolean;
|
|
54
|
+
};
|
|
55
|
+
'SUPPORTED MATERIAL INTERFACE': {
|
|
56
|
+
color: number[];
|
|
57
|
+
perimeter: boolean;
|
|
58
|
+
support: boolean;
|
|
59
|
+
};
|
|
60
|
+
CUSTOM: {
|
|
61
|
+
color: number[];
|
|
62
|
+
perimeter: boolean;
|
|
63
|
+
support: boolean;
|
|
64
|
+
};
|
|
65
|
+
UNKNOWN: {
|
|
66
|
+
color: number[];
|
|
67
|
+
perimeter: boolean;
|
|
68
|
+
support: boolean;
|
|
69
|
+
};
|
|
70
|
+
'SUPPORT MATERIAL': {
|
|
71
|
+
color: number[];
|
|
72
|
+
perimeter: boolean;
|
|
73
|
+
support: boolean;
|
|
74
|
+
};
|
|
75
|
+
'SUPPORT MATERIAL INTERFACE': {
|
|
76
|
+
color: number[];
|
|
77
|
+
perimeter: boolean;
|
|
78
|
+
support: boolean;
|
|
79
|
+
};
|
|
80
|
+
'OVERHANG PERIMETER': {
|
|
81
|
+
color: number[];
|
|
82
|
+
perimeter: boolean;
|
|
83
|
+
support: boolean;
|
|
84
|
+
};
|
|
85
|
+
'WIPE TOWER': {
|
|
86
|
+
color: number[];
|
|
87
|
+
perimeter: boolean;
|
|
88
|
+
support: boolean;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
constructor();
|
|
92
|
+
processComment(comment: string): void;
|
|
93
|
+
getFeatureColor(): number[];
|
|
94
|
+
isPerimeter(): boolean;
|
|
95
|
+
isSupport(): boolean;
|
|
96
|
+
processHeader(file: string[], props: ProcessorProperties): void;
|
|
97
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Scene } from '@babylonjs/core/scene';
|
|
2
|
+
import { Mesh } from '@babylonjs/core/Meshes/mesh';
|
|
3
|
+
import { Vector3 } from '@babylonjs/core/Maths/math.vector';
|
|
4
|
+
export default class Axes {
|
|
5
|
+
visible: boolean;
|
|
6
|
+
size: number;
|
|
7
|
+
debug: boolean;
|
|
8
|
+
registerClipIgnore: (mesh: Mesh) => void;
|
|
9
|
+
private scene;
|
|
10
|
+
private axesMesh;
|
|
11
|
+
constructor(scene: Scene);
|
|
12
|
+
show(visible: boolean): void;
|
|
13
|
+
resize(size: number): void;
|
|
14
|
+
render(position?: Vector3): void;
|
|
15
|
+
dispose(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Scene } from '@babylonjs/core/scene';
|
|
2
|
+
import { Mesh } from '@babylonjs/core/Meshes/mesh';
|
|
3
|
+
import { Color4 } from '@babylonjs/core/Maths/math.color';
|
|
4
|
+
import { GridMaterial } from '@babylonjs/materials/grid/gridMaterial';
|
|
5
|
+
export declare enum RenderBedMode {
|
|
6
|
+
bed = 0,
|
|
7
|
+
box = 1
|
|
8
|
+
}
|
|
9
|
+
export interface AxisRange {
|
|
10
|
+
min: number;
|
|
11
|
+
max: number;
|
|
12
|
+
}
|
|
13
|
+
export interface BuildVolume {
|
|
14
|
+
x: AxisRange;
|
|
15
|
+
y: AxisRange;
|
|
16
|
+
z: AxisRange;
|
|
17
|
+
}
|
|
18
|
+
export default class Bed {
|
|
19
|
+
buildVolume: BuildVolume;
|
|
20
|
+
renderMode: RenderBedMode;
|
|
21
|
+
isDelta: boolean;
|
|
22
|
+
debug: boolean;
|
|
23
|
+
registerClipIgnore: (mesh: Mesh) => void;
|
|
24
|
+
private scene;
|
|
25
|
+
private bedMesh;
|
|
26
|
+
private bedLineColor;
|
|
27
|
+
private planeMaterial;
|
|
28
|
+
private boxMaterial;
|
|
29
|
+
private highlightLayer;
|
|
30
|
+
constructor(scene: Scene);
|
|
31
|
+
setRenderMode(renderBedMode: RenderBedMode): void;
|
|
32
|
+
buildBed(): Mesh;
|
|
33
|
+
setDelta(isDelta: boolean): void;
|
|
34
|
+
buildFlatBed(): void;
|
|
35
|
+
getCenter(): {
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
z: number;
|
|
39
|
+
};
|
|
40
|
+
getSize(): {
|
|
41
|
+
x: number;
|
|
42
|
+
y: number;
|
|
43
|
+
z: number;
|
|
44
|
+
};
|
|
45
|
+
buildBox(): void;
|
|
46
|
+
setVisibility(visibility: boolean): void;
|
|
47
|
+
commitBedSize(): void;
|
|
48
|
+
buildGridMaterial(): GridMaterial;
|
|
49
|
+
getBedColor(): string;
|
|
50
|
+
setBedColor(color: string): void;
|
|
51
|
+
getBedColor4(): Color4;
|
|
52
|
+
dispose(): void;
|
|
53
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Scene } from '@babylonjs/core/scene';
|
|
2
|
+
import { Color3 } from '@babylonjs/core/Maths/math.color';
|
|
3
|
+
import { Mesh } from '@babylonjs/core/Meshes/mesh';
|
|
4
|
+
import { StandardMaterial } from '@babylonjs/core/Materials/standardMaterial';
|
|
5
|
+
import { PickingInfo } from '@babylonjs/core/Collisions/pickingInfo';
|
|
6
|
+
export default class BuildObjects {
|
|
7
|
+
scene: Scene;
|
|
8
|
+
buildObjectMeshes: Mesh[];
|
|
9
|
+
labels: Mesh[];
|
|
10
|
+
baseMaterial: StandardMaterial;
|
|
11
|
+
highlightMaterial: StandardMaterial;
|
|
12
|
+
cancelledMaterial: StandardMaterial;
|
|
13
|
+
cancelledHighlightMaterial: StandardMaterial;
|
|
14
|
+
showCancelObjects: boolean;
|
|
15
|
+
showLabel: boolean;
|
|
16
|
+
alphaLevel: number;
|
|
17
|
+
objectCallback: (metadata: any) => void;
|
|
18
|
+
renderFailedCallback: () => void;
|
|
19
|
+
labelCallback: (name: string) => void;
|
|
20
|
+
registerClipIgnore: (mesh: Mesh) => void;
|
|
21
|
+
getMaxHeight: () => number;
|
|
22
|
+
private observableControls;
|
|
23
|
+
constructor(scene: Scene);
|
|
24
|
+
setBuildMaterial(name: string, color: Color3, alpha?: number): StandardMaterial;
|
|
25
|
+
rebuildMaterials(): void;
|
|
26
|
+
private buildXMarkTexture;
|
|
27
|
+
loadObjectBoundaries(boundaryObjects: any[]): void;
|
|
28
|
+
buildObservables(): void;
|
|
29
|
+
clearObservables(): void;
|
|
30
|
+
showObjectSelection(visible: boolean): void;
|
|
31
|
+
setObjectTexture(mesh: Mesh): void;
|
|
32
|
+
handleClick(pickInfo: PickingInfo): void;
|
|
33
|
+
handlePointerMove(pickInfo: PickingInfo): void;
|
|
34
|
+
showLabels(visible: boolean): void;
|
|
35
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Scene } from '@babylonjs/core/scene';
|
|
2
|
+
import { Color3 } from '@babylonjs/core/Maths/math.color';
|
|
3
|
+
import { Move } from '../GCodeLines';
|
|
4
|
+
export interface NozzlePosition {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
z: number;
|
|
8
|
+
}
|
|
9
|
+
export interface NozzleMovement {
|
|
10
|
+
startPos: NozzlePosition;
|
|
11
|
+
endPos: NozzlePosition;
|
|
12
|
+
feedRate: number;
|
|
13
|
+
duration: number;
|
|
14
|
+
isExtruding: boolean;
|
|
15
|
+
}
|
|
16
|
+
export default class Nozzle {
|
|
17
|
+
private scene;
|
|
18
|
+
private nozzleGroup;
|
|
19
|
+
private nozzleTip;
|
|
20
|
+
private nozzleBody;
|
|
21
|
+
private hotEnd;
|
|
22
|
+
private material;
|
|
23
|
+
nozzleDiameter: number;
|
|
24
|
+
nozzleColor: Color3;
|
|
25
|
+
hotEndColor: Color3;
|
|
26
|
+
private isVisible;
|
|
27
|
+
private currentPosition;
|
|
28
|
+
private currentTween;
|
|
29
|
+
private isAnimating;
|
|
30
|
+
private animationSpeed;
|
|
31
|
+
private tweenGroup;
|
|
32
|
+
constructor(scene: Scene, diameter?: number);
|
|
33
|
+
private createNozzleGeometry;
|
|
34
|
+
private setupMaterial;
|
|
35
|
+
setDiameter(diameter: number): void;
|
|
36
|
+
setColor(color: Color3): void;
|
|
37
|
+
show(): void;
|
|
38
|
+
hide(): void;
|
|
39
|
+
toggle(): void;
|
|
40
|
+
isNozzleVisible(): boolean;
|
|
41
|
+
setPosition(position: NozzlePosition): void;
|
|
42
|
+
getCurrentPosition(): NozzlePosition;
|
|
43
|
+
/**
|
|
44
|
+
* Calculate movement duration based on feedrate
|
|
45
|
+
* @param movement The movement to calculate duration for
|
|
46
|
+
* @returns Duration in milliseconds
|
|
47
|
+
*/
|
|
48
|
+
private calculateMovementDuration;
|
|
49
|
+
/**
|
|
50
|
+
* Create a movement from a G-code Move object
|
|
51
|
+
*/
|
|
52
|
+
createMovementFromGCode(move: Move, startPos: NozzlePosition): NozzleMovement;
|
|
53
|
+
/**
|
|
54
|
+
* Animate nozzle movement with tweening
|
|
55
|
+
*/
|
|
56
|
+
moveToPosition(movement: NozzleMovement): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Stop current animation
|
|
59
|
+
*/
|
|
60
|
+
stopAnimation(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Force position update (for skipping during animation)
|
|
63
|
+
*/
|
|
64
|
+
forcePosition(position: NozzlePosition): void;
|
|
65
|
+
/**
|
|
66
|
+
* Set animation speed multiplier
|
|
67
|
+
*/
|
|
68
|
+
setAnimationSpeed(speed: number): void;
|
|
69
|
+
getAnimationSpeed(): number;
|
|
70
|
+
isCurrentlyAnimating(): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Update tweens (call this in render loop)
|
|
73
|
+
*/
|
|
74
|
+
update(): void;
|
|
75
|
+
/**
|
|
76
|
+
* Clean up resources
|
|
77
|
+
*/
|
|
78
|
+
dispose(): void;
|
|
79
|
+
getDiameter(): number;
|
|
80
|
+
toString(): string;
|
|
81
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Engine } from '@babylonjs/core/Engines/engine';
|
|
2
|
+
import { ArcRotateCamera } from '@babylonjs/core/Cameras/arcRotateCamera';
|
|
3
|
+
export interface ViewBoxDirection {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
z: number;
|
|
7
|
+
}
|
|
8
|
+
export default class ViewBox {
|
|
9
|
+
private static readonly FACE_NAMES;
|
|
10
|
+
private scene;
|
|
11
|
+
private camera;
|
|
12
|
+
private mainCamera;
|
|
13
|
+
private edgeMaterial;
|
|
14
|
+
visible: boolean;
|
|
15
|
+
onDirectionSelected: ((direction: ViewBoxDirection) => void) | null;
|
|
16
|
+
constructor(engine: Engine, mainCamera: ArcRotateCamera);
|
|
17
|
+
pick(x: number, y: number): ViewBoxDirection | null;
|
|
18
|
+
private buildPlane;
|
|
19
|
+
private buildCorner;
|
|
20
|
+
private buildEdge;
|
|
21
|
+
render(): void;
|
|
22
|
+
private lastRenderWidth;
|
|
23
|
+
private lastRenderHeight;
|
|
24
|
+
private updateViewport;
|
|
25
|
+
show(visible: boolean): void;
|
|
26
|
+
dispose(): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Engine } from '@babylonjs/core/Engines/engine';
|
|
2
|
+
import { Mesh } from '@babylonjs/core/Meshes/mesh';
|
|
3
|
+
import { Scene } from '@babylonjs/core/scene';
|
|
4
|
+
import { RenderTargetTexture } from '@babylonjs/core/Materials/Textures/renderTargetTexture';
|
|
5
|
+
import { ShaderMaterial } from '@babylonjs/core/Materials/shaderMaterial';
|
|
6
|
+
export default class GPUPicker {
|
|
7
|
+
scene: Scene;
|
|
8
|
+
engine: Engine;
|
|
9
|
+
renderTarget: RenderTargetTexture;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
colorTestCallBack: any;
|
|
13
|
+
currentPosition: number;
|
|
14
|
+
renderTargetMeshs: Mesh[];
|
|
15
|
+
shaderMaterial: ShaderMaterial;
|
|
16
|
+
constructor(scene: Scene, engine: Engine, width: number, height: number);
|
|
17
|
+
readTexturePixels(gl: any, texture: any, x: any, y: any, w: any, h: any): Uint8Array<ArrayBuffer>;
|
|
18
|
+
updateRenderTargetSize(width: any, height: any): void;
|
|
19
|
+
clearRenderList(): void;
|
|
20
|
+
addToRenderList(mesh: Mesh): void;
|
|
21
|
+
updateCurrentPosition(currentPosition: number): void;
|
|
22
|
+
}
|