@@ -4,48 +4,16 @@ import GcodeAPI from "./src/API/GcodeApi/GcodeAPI_main/GcodeAPI";
4
4
import G0 from "./src/API/GcodeApi/Gcommands/G/G0" ;
5
5
import Gcss from "./src/API/GcodeApi/Gsimulator/Gcss/Gcss.js" ;
6
6
7
- let a = new G0 ( { } ) ;
7
+ let a = new G0 ( { x : 250 , y : 250 } ) ;
8
8
9
- for ( let i = 0 ; i < 3 ; i ++ ) {
10
- a . moveTo ( { left : 10 , top : 30 } ) ;
11
- }
12
-
13
- for ( let i = 0 ; i < 3 ; i ++ ) {
14
- a . moveTo ( { left : 100 } ) ;
15
- }
16
-
17
- for ( let i = 0 ; i < 3 ; i ++ ) {
18
- a . moveTo ( {
19
- bottom : 50 ,
20
- } ) ;
21
- }
9
+ for ( let i = 0 ; i < 20 ; i ++ ) {
10
+ let x = [ "left" , "right" ] [ Math . round ( Math . random ( ) ) ] ;
11
+ let y = [ "top" , "bottom" ] [ Math . round ( Math . random ( ) ) ] ;
22
12
23
- for ( let i = 0 ; i < 3 ; i ++ ) {
24
13
a . moveTo ( {
25
- right : 100 ,
26
- } ) ;
27
- }
28
-
29
- for ( let i = 0 ; i < 3 ; i ++ ) {
30
- a . moveTo ( {
31
- bottom : 50 ,
32
- right : 50 ,
33
- } ) ;
34
- }
35
-
36
- for ( let i = 0 ; i < 3 ; i ++ ) {
37
- a . moveTo ( {
38
- top : 50 ,
39
- right : 20 ,
40
- } ) ;
41
- }
42
-
43
- for ( let i = 0 ; i < 4 ; i ++ ) {
44
- a . moveTo ( { left : 50 } ) ;
45
- }
46
-
47
- for ( let i = 0 ; i < 3 ; i ++ ) {
48
- a . moveTo ( { bottom : 30 , left : 50 } ) ;
14
+ [ x ] : Math . random ( ) * 50 ,
15
+ [ y ] : Math . random ( ) * 50
16
+ } )
49
17
}
50
18
51
19
let g = new Gcss ( {
@@ -58,20 +26,3 @@ g.generate();
58
26
59
27
const t1 = performance . now ( ) ;
60
28
console . log ( `Call to doSomething took ${ t1 - t0 } milliseconds.` ) ;
61
- // console.table(GcodeAPI.array);
62
-
63
- // let btn = document.querySelector("#btn")
64
-
65
- // btn.addEventListener("click", btnGenerate, { once: true });
66
-
67
- // function btnGenerate() {
68
- // let g = new Gcss({
69
- // width: 500,
70
- // height: 500,
71
- // parentHtmlContainer: document.querySelector("section"),
72
- // });
73
-
74
- // g.generate();
75
-
76
- // btn.disabled = true;
77
- // }
0 commit comments