forked from goessner/mec2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDemoMec3Element.html
156 lines (138 loc) · 5.61 KB
/
DemoMec3Element.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<head>
<meta charset='utf-8'>
</head>
<script src="https://requirejs.org/docs/release/2.3.5/minified/require.js"></script>
<script src="https://cdn.jsdelivr.net/gh/goessner/g2/dist/g2.js"></script>
<script src="https://cdn.jsdelivr.net/gh/Pasquale19/customG2@master/release/g2Extension.min.js"></script>
<script async src="https://cdn.jsdelivr.net/gh/Pasquale19/mec2@master/release/mec3V2.html.js"></script>
<!--<canvas onclick="clickCanvas()" style="border: 1px; border-color: black; width: 100px; height: 100px; background-color: aqua;" ></canvas>-->
</br>
<mec-3 style="width:900px !important; height:300px !important; border:1px solid #000000;"
x0="100" y0="50" cartesian constraintlabels nodelabels pause
>
{
"nodes": [
{ "id": "A0", "x": 75, "y": 50, "base": true ,"idloc":"w","optic":"FG"},
{ "id": "A", "x": 75, "y": 100 },
{ "id": "B", "x": 275, "y": 170 },
{ "id": "B0", "x": 275, "y": 50, "base": true ,"idloc":"w","optic":"FG"},
{ "id": "C", "x": 125, "y": 225 }
],
"constraints": [
{
"id": "a", "p1": "A0", "p2": "A", "len": { "type":"const" },
"ori": { "type": "drive","Dt": 2, "Dw": 6.28 ,"repeat":100}
}, {
"id": "b", "p1": "A", "p2": "B", "len": { "type":"const" }
}, {
"id": "c", "p1": "B0", "p2": "B", "len": { "type":"const" }
}, {
"id": "d", "p1": "B", "p2": "C", "len": { "type":"const" },
"ori": { "ref": "b", "type": "const" }
}
],
"views": [
{
"show": "pos", "of": "C", "as": "trace", "Dt":2.1,
"mode":"preview", "fill":"orange"
}, {
"show": "vel", "of": "C", "as": "vector"
}, {
"as": "chart", "x": 340, "y": 75,"b":200,"h":150, "Dt": 1.9,
"show": "w", "of": "b", "against":{"show":"w", "of":"a"}
}
],
"shapes": [
{ "type": "Ecke", "p1": "C", "p2":"B", "p3":"A" }
]
}
</mec-3>
<h2>Schubkurbel</h2>
<mec-3 style="width:900px !important; height:300px !important; border:1px solid #000000;"
x0="10" y0="10" cartesian constraintlabels nodelabels
>{
"id":"slider-crank",
"nodes": [
{ "id":"A0","x":100,"y":100,"base":true,"optic":"FG", "idloc":"w" },
{ "id":"A","x":100,"y":170 },
{ "id":"B","x":350,"y":80 },
{ "id":"B0","x":220,"y":80,"base":true, "hid":"true" }
],
"constraints": [
{ "id":"b","p1":"A","p2":"B","len":{ "type":"const" },"txt":"3" ,"idloc":1},
{ "id":"c","p1":"B0","p2":"B","ori":{ "type":"const" },"hid":"true" },
{ "id":"a","p1":"A0","p2":"A","len":{ "type":"const" },"txt":"2","ori":{ "type":"drive","Dt":5,"Dw":6.283185307179586 ,"repeat":100}, "idloc":-1 }
],
"shapes": [
{ "type": "slider", "p": "B", "wref":"c"},
{ "type": "line", "p1": "B0", "p2":"B", "len":270, "lintype":"grd2"}
]
}
</mec-3>
<!--Kurbelschleife-->
<h2>Kurbelschleife</h2>
<mec-3 style="width:900px !important; height:600px !important; border:1px solid #000000;"
x0="200" y0="250" cartesian constraintlabels nodelabels
>{
"id":"Kurbelschleife",
"nodes": [
{ "id":"A0","x":1,"y":0,"base":true, "idloc":"w", "optic":"FG" },
{ "id":"B0","x":50,"y":0,"base":true, "idloc":"e", "optic":"FG" },
{ "id":"A","x":100,"y":0 },
{ "id":"C","x":220,"y":0, "hid":true }
],
"constraints": [
{ "id":"4","p1":"B0","p2":"A", "idloc":1 },
{ "id":"3","p1":"B0","p2":"C", "idloc":1,"len":{ "type":"const" } ,"ori":{ "type":"const","ref":"4" }, "txt":" "},
{ "id":"2","p1":"A0","p2":"A", "idloc":1,"len":{ "type":"const" },"ori":{ "type":"drive","Dt":10,"Dw":6.283185307179586, "repeat":100 } }
],
"shapes": [
{ "type": "Schieber", "p": "A", "wref":"4"},
{ "type": "line", "p1": "B0", "p2":"A", "len":270}
]
}
</mec-3>
<!--ANA077-->
<h2>ANA077</h2>
<mec-3 style="width:900px !important; height:600px !important; border:1px solid #000000;"
x0="00" y0="0" cartesian constraintlabels nodelabels pause
>{
"id":"Kurbelschleife",
"nodes": [
{ "id" :"A0" ,"x":498,"y":150,"base":true, "optic":"FG" , "idloc":"w" },
{ "id" :"A" ,"x":552,"y":149.1, "idloc":"w" },
{ "id" :"B" ,"x":478.8,"y":291.6, "idloc":"e" },
{ "id" :"B0" ,"x":694.2,"y":353.7,"base":true, "optic":"FG" , "idloc":"e" },
{ "id" :"C" ,"x":393.6,"y":267, "idloc":"e" },
{ "id" :"D" ,"x":368.1,"y":330, "idloc":"e" },
{ "id" :"D0" ,"x":308.7,"y":267.3,"base":true, "optic":"FG" , "idloc":"e" },
{ "id" :"E" ,"x":340.2,"y":398.4, "idloc":"e" },
{ "id" :"F" ,"x":150.3,"y":349.5, "idloc":"n" },
{ "id" :"F0" ,"x":18,"y":349.5,"base":true, "optic":"FG" , "hid":"true" , "idloc":"e" }
]
,
"constraints": [
{ "id":"2","p1":"A0","p2":"A", "idloc":1,"len":{ "type":"const" } ,"ori":{ "type":"drive","Dt":5,"Dw":6.283185307179586, "repeat":100 }},
{ "id":"4","p1":"B0","p2":"B", "idloc":1,"len":{ "type":"const" } },
{ "id":"3","p1":"A","p2":"B", "idloc":1,"len":{ "type":"const" } },
{ "id":"l3_2","p1":"B","p2":"C", "idloc":1,"len":{ "type":"const" },"ori":{ "type":"const","wref":"4" },"txt":" " },
{ "id":"5","p1":"C","p2":"D", "idloc":1,"len":{ "type":"const" } },
{ "id":"6","p1":"D0","p2":"D", "idloc":1,"len":{ "type":"const" } },
{ "id":"l5_2","p1":"D","p2":"E", "idloc":1,"len":{ "type":"const" } ,"ori":{ "type":"const","wref":"5" },"txt":" "},
{ "id":"9","p1":"E","p2":"F", "idloc":1,"len":{ "type":"const" } },
{ "id":"sF","p1":"F0","p2":"F", "idloc":1,"ori":{ "type":"const" } ,"txt":" "}
],
"shapes": [
{ "type": "Schieber", "p": "F", "wref":"sF"},
{ "type": "line", "p1": "F0","wref":"sF", "len":270, "lintype":"grd2"}
]
}
</mec-3>
,
"views": [
{
"show": "pos", "of": "C", "as": "trace", "Dt":2.1,
"mode":"preview", "fill":"orange"
}, {
"show": "vel", "of": "C", "as": "vector"
}