simview 3.2__py3-none-any.whl

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.
Files changed (163) hide show
  1. simview/__init__.py +69 -0
  2. simview/__main__.py +174 -0
  3. simview/launcher.py +109 -0
  4. simview/live.py +204 -0
  5. simview/merge.py +593 -0
  6. simview/model.py +690 -0
  7. simview/py.typed +0 -0
  8. simview/scene.py +603 -0
  9. simview/server.py +739 -0
  10. simview/state.py +190 -0
  11. simview/static/css/controls.css +36 -0
  12. simview/static/js/SimView.js +601 -0
  13. simview/static/js/components/AnimationController.js +654 -0
  14. simview/static/js/components/BatchManager.js +198 -0
  15. simview/static/js/components/InteractionController.js +446 -0
  16. simview/static/js/components/InteractionControls.js +116 -0
  17. simview/static/js/components/Scene.js +166 -0
  18. simview/static/js/components/StateStore.js +188 -0
  19. simview/static/js/config.js +233 -0
  20. simview/static/js/main.js +3 -0
  21. simview/static/js/objects/Body.js +616 -0
  22. simview/static/js/objects/StaticObject.js +181 -0
  23. simview/static/js/objects/Terrain.js +514 -0
  24. simview/static/js/objects/utils.js +378 -0
  25. simview/static/js/ui/AnalysisPanel.js +233 -0
  26. simview/static/js/ui/BatchLegend.js +207 -0
  27. simview/static/js/ui/BodyStateWindow.js +521 -0
  28. simview/static/js/ui/Controls.js +586 -0
  29. simview/static/js/ui/ErrorMetrics.js +664 -0
  30. simview/static/js/ui/Legend.js +87 -0
  31. simview/static/js/ui/PlaybackControls.js +314 -0
  32. simview/static/js/ui/ScalarPlotter.js +575 -0
  33. simview/static/js/utils/blobCodec.js +73 -0
  34. simview/static/js/utils/bodyTransforms.js +151 -0
  35. simview/static/js/utils/csv.js +46 -0
  36. simview/static/js/utils/errorMath.js +69 -0
  37. simview/static/js/utils/injectStyles.js +16 -0
  38. simview/static/js/utils/interpolate.js +65 -0
  39. simview/static/js/utils/liveFollow.js +17 -0
  40. simview/static/js/utils/loadRecordingLibs.js +34 -0
  41. simview/static/js/utils/viewState.js +226 -0
  42. simview/static/lib/chroma-js-3.1.2/index.min.js +8 -0
  43. simview/static/lib/chroma-js-3.1.2/src/Color.js +49 -0
  44. simview/static/lib/chroma-js-3.1.2/src/chroma.js +10 -0
  45. simview/static/lib/chroma-js-3.1.2/src/colors/colorbrewer.js +81 -0
  46. simview/static/lib/chroma-js-3.1.2/src/colors/w3cx11.js +164 -0
  47. simview/static/lib/chroma-js-3.1.2/src/generator/average.js +88 -0
  48. simview/static/lib/chroma-js-3.1.2/src/generator/bezier.js +86 -0
  49. simview/static/lib/chroma-js-3.1.2/src/generator/blend.js +57 -0
  50. simview/static/lib/chroma-js-3.1.2/src/generator/cubehelix.js +87 -0
  51. simview/static/lib/chroma-js-3.1.2/src/generator/mix.js +19 -0
  52. simview/static/lib/chroma-js-3.1.2/src/generator/random.js +12 -0
  53. simview/static/lib/chroma-js-3.1.2/src/generator/scale.js +394 -0
  54. simview/static/lib/chroma-js-3.1.2/src/interpolator/_hsx.js +59 -0
  55. simview/static/lib/chroma-js-3.1.2/src/interpolator/hcg.js +12 -0
  56. simview/static/lib/chroma-js-3.1.2/src/interpolator/hsi.js +12 -0
  57. simview/static/lib/chroma-js-3.1.2/src/interpolator/hsl.js +12 -0
  58. simview/static/lib/chroma-js-3.1.2/src/interpolator/hsv.js +12 -0
  59. simview/static/lib/chroma-js-3.1.2/src/interpolator/index.js +1 -0
  60. simview/static/lib/chroma-js-3.1.2/src/interpolator/lab.js +19 -0
  61. simview/static/lib/chroma-js-3.1.2/src/interpolator/lch.js +13 -0
  62. simview/static/lib/chroma-js-3.1.2/src/interpolator/lrgb.js +19 -0
  63. simview/static/lib/chroma-js-3.1.2/src/interpolator/num.js +15 -0
  64. simview/static/lib/chroma-js-3.1.2/src/interpolator/oklab.js +19 -0
  65. simview/static/lib/chroma-js-3.1.2/src/interpolator/oklch.js +12 -0
  66. simview/static/lib/chroma-js-3.1.2/src/interpolator/rgb.js +18 -0
  67. simview/static/lib/chroma-js-3.1.2/src/io/cmyk/cmyk2rgb.js +16 -0
  68. simview/static/lib/chroma-js-3.1.2/src/io/cmyk/index.js +27 -0
  69. simview/static/lib/chroma-js-3.1.2/src/io/cmyk/rgb2cmyk.js +17 -0
  70. simview/static/lib/chroma-js-3.1.2/src/io/css/css2rgb.js +238 -0
  71. simview/static/lib/chroma-js-3.1.2/src/io/css/hsl2css.js +26 -0
  72. simview/static/lib/chroma-js-3.1.2/src/io/css/index.js +27 -0
  73. simview/static/lib/chroma-js-3.1.2/src/io/css/lab2css.js +24 -0
  74. simview/static/lib/chroma-js-3.1.2/src/io/css/lch2css.js +24 -0
  75. simview/static/lib/chroma-js-3.1.2/src/io/css/oklab2css.js +16 -0
  76. simview/static/lib/chroma-js-3.1.2/src/io/css/oklch2css.js +16 -0
  77. simview/static/lib/chroma-js-3.1.2/src/io/css/rgb2css.js +61 -0
  78. simview/static/lib/chroma-js-3.1.2/src/io/gl/index.js +22 -0
  79. simview/static/lib/chroma-js-3.1.2/src/io/hcg/hcg2rgb.js +55 -0
  80. simview/static/lib/chroma-js-3.1.2/src/io/hcg/index.js +27 -0
  81. simview/static/lib/chroma-js-3.1.2/src/io/hcg/rgb2hcg.js +23 -0
  82. simview/static/lib/chroma-js-3.1.2/src/io/hex/hex2rgb.js +56 -0
  83. simview/static/lib/chroma-js-3.1.2/src/io/hex/index.js +29 -0
  84. simview/static/lib/chroma-js-3.1.2/src/io/hex/rgb2hex.js +29 -0
  85. simview/static/lib/chroma-js-3.1.2/src/io/hsi/hsi2rgb.js +45 -0
  86. simview/static/lib/chroma-js-3.1.2/src/io/hsi/index.js +27 -0
  87. simview/static/lib/chroma-js-3.1.2/src/io/hsi/rgb2hsi.js +31 -0
  88. simview/static/lib/chroma-js-3.1.2/src/io/hsl/hsl2rgb.js +35 -0
  89. simview/static/lib/chroma-js-3.1.2/src/io/hsl/index.js +27 -0
  90. simview/static/lib/chroma-js-3.1.2/src/io/hsl/rgb2hsl.js +45 -0
  91. simview/static/lib/chroma-js-3.1.2/src/io/hsv/hsv2rgb.js +47 -0
  92. simview/static/lib/chroma-js-3.1.2/src/io/hsv/index.js +27 -0
  93. simview/static/lib/chroma-js-3.1.2/src/io/hsv/rgb2hsv.js +32 -0
  94. simview/static/lib/chroma-js-3.1.2/src/io/input.js +4 -0
  95. simview/static/lib/chroma-js-3.1.2/src/io/lab/index.js +28 -0
  96. simview/static/lib/chroma-js-3.1.2/src/io/lab/lab-constants.js +120 -0
  97. simview/static/lib/chroma-js-3.1.2/src/io/lab/lab2rgb.js +101 -0
  98. simview/static/lib/chroma-js-3.1.2/src/io/lab/rgb2lab.js +67 -0
  99. simview/static/lib/chroma-js-3.1.2/src/io/lch/hcl2rgb.js +9 -0
  100. simview/static/lib/chroma-js-3.1.2/src/io/lch/index.js +35 -0
  101. simview/static/lib/chroma-js-3.1.2/src/io/lch/lab2lch.js +12 -0
  102. simview/static/lib/chroma-js-3.1.2/src/io/lch/lch2lab.js +18 -0
  103. simview/static/lib/chroma-js-3.1.2/src/io/lch/lch2rgb.js +13 -0
  104. simview/static/lib/chroma-js-3.1.2/src/io/lch/rgb2lch.js +12 -0
  105. simview/static/lib/chroma-js-3.1.2/src/io/named/index.js +30 -0
  106. simview/static/lib/chroma-js-3.1.2/src/io/num/index.js +32 -0
  107. simview/static/lib/chroma-js-3.1.2/src/io/num/num2rgb.js +13 -0
  108. simview/static/lib/chroma-js-3.1.2/src/io/num/rgb2num.js +8 -0
  109. simview/static/lib/chroma-js-3.1.2/src/io/oklab/index.js +27 -0
  110. simview/static/lib/chroma-js-3.1.2/src/io/oklab/oklab2rgb.js +34 -0
  111. simview/static/lib/chroma-js-3.1.2/src/io/oklab/rgb2oklab.js +37 -0
  112. simview/static/lib/chroma-js-3.1.2/src/io/oklch/index.js +27 -0
  113. simview/static/lib/chroma-js-3.1.2/src/io/oklch/oklch2rgb.js +13 -0
  114. simview/static/lib/chroma-js-3.1.2/src/io/oklch/rgb2oklch.js +12 -0
  115. simview/static/lib/chroma-js-3.1.2/src/io/rgb/index.js +44 -0
  116. simview/static/lib/chroma-js-3.1.2/src/io/temp/index.js +22 -0
  117. simview/static/lib/chroma-js-3.1.2/src/io/temp/rgb2temperature.js +30 -0
  118. simview/static/lib/chroma-js-3.1.2/src/io/temp/temperature2rgb.js +39 -0
  119. simview/static/lib/chroma-js-3.1.2/src/ops/alpha.js +13 -0
  120. simview/static/lib/chroma-js-3.1.2/src/ops/clipped.js +5 -0
  121. simview/static/lib/chroma-js-3.1.2/src/ops/darken.js +17 -0
  122. simview/static/lib/chroma-js-3.1.2/src/ops/get.js +13 -0
  123. simview/static/lib/chroma-js-3.1.2/src/ops/luminance.js +54 -0
  124. simview/static/lib/chroma-js-3.1.2/src/ops/mix.js +10 -0
  125. simview/static/lib/chroma-js-3.1.2/src/ops/premultiply.js +12 -0
  126. simview/static/lib/chroma-js-3.1.2/src/ops/saturate.js +15 -0
  127. simview/static/lib/chroma-js-3.1.2/src/ops/set.js +43 -0
  128. simview/static/lib/chroma-js-3.1.2/src/ops/shade.js +11 -0
  129. simview/static/lib/chroma-js-3.1.2/src/utils/analyze.js +191 -0
  130. simview/static/lib/chroma-js-3.1.2/src/utils/clip_rgb.js +15 -0
  131. simview/static/lib/chroma-js-3.1.2/src/utils/contrast.js +12 -0
  132. simview/static/lib/chroma-js-3.1.2/src/utils/contrastAPCA.js +68 -0
  133. simview/static/lib/chroma-js-3.1.2/src/utils/delta-e.js +62 -0
  134. simview/static/lib/chroma-js-3.1.2/src/utils/distance.js +17 -0
  135. simview/static/lib/chroma-js-3.1.2/src/utils/index.js +27 -0
  136. simview/static/lib/chroma-js-3.1.2/src/utils/last.js +8 -0
  137. simview/static/lib/chroma-js-3.1.2/src/utils/limit.js +5 -0
  138. simview/static/lib/chroma-js-3.1.2/src/utils/multiply-matrices.js +36 -0
  139. simview/static/lib/chroma-js-3.1.2/src/utils/scales.js +15 -0
  140. simview/static/lib/chroma-js-3.1.2/src/utils/type.js +18 -0
  141. simview/static/lib/chroma-js-3.1.2/src/utils/unpack.js +17 -0
  142. simview/static/lib/chroma-js-3.1.2/src/utils/valid.js +11 -0
  143. simview/static/lib/chroma-js-3.1.2/src/version.js +2 -0
  144. simview/static/lib/download.js +132 -0
  145. simview/static/lib/js-colormaps.js +19335 -0
  146. simview/static/lib/tar.js +334 -0
  147. simview/static/lib/three-0.174.0/addons/controls/OrbitControls.js +1556 -0
  148. simview/static/lib/three-0.174.0/addons/libs/lil-gui.module.min.js +8 -0
  149. simview/static/lib/three-0.174.0/three.core.js +48830 -0
  150. simview/static/lib/three-0.174.0/three.module.js +17313 -0
  151. simview/static/lib/uPlot.esm.js +6140 -0
  152. simview/static/lib/uPlot.min.css +2 -0
  153. simview/static/textures/contacts/red-cross0.png +0 -0
  154. simview/static/textures/points/ball0.png +0 -0
  155. simview/static/textures/points/ball1.png +0 -0
  156. simview/templates/index.html +81 -0
  157. simview/utils.py +41 -0
  158. simview-3.2.dist-info/METADATA +552 -0
  159. simview-3.2.dist-info/RECORD +163 -0
  160. simview-3.2.dist-info/WHEEL +5 -0
  161. simview-3.2.dist-info/entry_points.txt +2 -0
  162. simview-3.2.dist-info/licenses/LICENSE +28 -0
  163. simview-3.2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,334 @@
1
+ (function () {
2
+ "use strict";
3
+
4
+ var lookup = [
5
+ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
6
+ 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
7
+ 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
8
+ 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
9
+ 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
10
+ 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
11
+ 'w', 'x', 'y', 'z', '0', '1', '2', '3',
12
+ '4', '5', '6', '7', '8', '9', '+', '/'
13
+ ];
14
+ function clean(length) {
15
+ var i, buffer = new Uint8Array(length);
16
+ for (i = 0; i < length; i += 1) {
17
+ buffer[i] = 0;
18
+ }
19
+ return buffer;
20
+ }
21
+
22
+ function extend(orig, length, addLength, multipleOf) {
23
+ var newSize = length + addLength,
24
+ buffer = clean((parseInt(newSize / multipleOf) + 1) * multipleOf);
25
+
26
+ buffer.set(orig);
27
+
28
+ return buffer;
29
+ }
30
+
31
+ function pad(num, bytes, base) {
32
+ num = num.toString(base || 8);
33
+ return "000000000000".substr(num.length + 12 - bytes) + num;
34
+ }
35
+
36
+ function stringToUint8 (input, out, offset) {
37
+ var i, length;
38
+
39
+ out = out || clean(input.length);
40
+
41
+ offset = offset || 0;
42
+ for (i = 0, length = input.length; i < length; i += 1) {
43
+ out[offset] = input.charCodeAt(i);
44
+ offset += 1;
45
+ }
46
+
47
+ return out;
48
+ }
49
+
50
+ function uint8ToBase64(uint8) {
51
+ var i,
52
+ extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes
53
+ output = "",
54
+ temp, length;
55
+
56
+ function tripletToBase64 (num) {
57
+ return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F];
58
+ };
59
+
60
+ // go through the array every three bytes, we'll deal with trailing stuff later
61
+ for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {
62
+ temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]);
63
+ output += tripletToBase64(temp);
64
+ }
65
+
66
+ // this prevents an ERR_INVALID_URL in Chrome (Firefox okay)
67
+ switch (output.length % 4) {
68
+ case 1:
69
+ output += '=';
70
+ break;
71
+ case 2:
72
+ output += '==';
73
+ break;
74
+ default:
75
+ break;
76
+ }
77
+
78
+ return output;
79
+ }
80
+
81
+ window.utils = {}
82
+ window.utils.clean = clean;
83
+ window.utils.pad = pad;
84
+ window.utils.extend = extend;
85
+ window.utils.stringToUint8 = stringToUint8;
86
+ window.utils.uint8ToBase64 = uint8ToBase64;
87
+ }());
88
+
89
+ (function () {
90
+ "use strict";
91
+
92
+ /*
93
+ struct posix_header { // byte offset
94
+ char name[100]; // 0
95
+ char mode[8]; // 100
96
+ char uid[8]; // 108
97
+ char gid[8]; // 116
98
+ char size[12]; // 124
99
+ char mtime[12]; // 136
100
+ char chksum[8]; // 148
101
+ char typeflag; // 156
102
+ char linkname[100]; // 157
103
+ char magic[6]; // 257
104
+ char version[2]; // 263
105
+ char uname[32]; // 265
106
+ char gname[32]; // 297
107
+ char devmajor[8]; // 329
108
+ char devminor[8]; // 337
109
+ char prefix[155]; // 345
110
+ // 500
111
+ };
112
+ */
113
+
114
+ var utils = window.utils,
115
+ headerFormat;
116
+
117
+ headerFormat = [
118
+ {
119
+ 'field': 'fileName',
120
+ 'length': 100
121
+ },
122
+ {
123
+ 'field': 'fileMode',
124
+ 'length': 8
125
+ },
126
+ {
127
+ 'field': 'uid',
128
+ 'length': 8
129
+ },
130
+ {
131
+ 'field': 'gid',
132
+ 'length': 8
133
+ },
134
+ {
135
+ 'field': 'fileSize',
136
+ 'length': 12
137
+ },
138
+ {
139
+ 'field': 'mtime',
140
+ 'length': 12
141
+ },
142
+ {
143
+ 'field': 'checksum',
144
+ 'length': 8
145
+ },
146
+ {
147
+ 'field': 'type',
148
+ 'length': 1
149
+ },
150
+ {
151
+ 'field': 'linkName',
152
+ 'length': 100
153
+ },
154
+ {
155
+ 'field': 'ustar',
156
+ 'length': 8
157
+ },
158
+ {
159
+ 'field': 'owner',
160
+ 'length': 32
161
+ },
162
+ {
163
+ 'field': 'group',
164
+ 'length': 32
165
+ },
166
+ {
167
+ 'field': 'majorNumber',
168
+ 'length': 8
169
+ },
170
+ {
171
+ 'field': 'minorNumber',
172
+ 'length': 8
173
+ },
174
+ {
175
+ 'field': 'filenamePrefix',
176
+ 'length': 155
177
+ },
178
+ {
179
+ 'field': 'padding',
180
+ 'length': 12
181
+ }
182
+ ];
183
+
184
+ function formatHeader(data, cb) {
185
+ var buffer = utils.clean(512),
186
+ offset = 0;
187
+
188
+ headerFormat.forEach(function (value) {
189
+ var str = data[value.field] || "",
190
+ i, length;
191
+
192
+ for (i = 0, length = str.length; i < length; i += 1) {
193
+ buffer[offset] = str.charCodeAt(i);
194
+ offset += 1;
195
+ }
196
+
197
+ offset += value.length - i; // space it out with nulls
198
+ });
199
+
200
+ if (typeof cb === 'function') {
201
+ return cb(buffer, offset);
202
+ }
203
+ return buffer;
204
+ }
205
+
206
+ window.header = {}
207
+ window.header.structure = headerFormat;
208
+ window.header.format = formatHeader;
209
+ }());
210
+
211
+ (function () {
212
+ "use strict";
213
+
214
+ var header = window.header,
215
+ utils = window.utils,
216
+ recordSize = 512,
217
+ blockSize;
218
+
219
+ function Tar(recordsPerBlock) {
220
+ this.written = 0;
221
+ blockSize = (recordsPerBlock || 20) * recordSize;
222
+ this.out = utils.clean(blockSize);
223
+ this.blocks = [];
224
+ this.length = 0;
225
+ }
226
+
227
+ Tar.prototype.append = function (filepath, input, opts, callback) {
228
+ var data,
229
+ checksum,
230
+ mode,
231
+ mtime,
232
+ uid,
233
+ gid,
234
+ headerArr;
235
+
236
+ if (typeof input === 'string') {
237
+ input = utils.stringToUint8(input);
238
+ } else if (input.constructor !== Uint8Array.prototype.constructor) {
239
+ throw 'Invalid input type. You gave me: ' + input.constructor.toString().match(/function\s*([$A-Za-z_][0-9A-Za-z_]*)\s*\(/)[1];
240
+ }
241
+
242
+ if (typeof opts === 'function') {
243
+ callback = opts;
244
+ opts = {};
245
+ }
246
+
247
+ opts = opts || {};
248
+
249
+ mode = opts.mode || parseInt('777', 8) & 0xfff;
250
+ mtime = opts.mtime || Math.floor(+new Date() / 1000);
251
+ uid = opts.uid || 0;
252
+ gid = opts.gid || 0;
253
+
254
+ data = {
255
+ fileName: filepath,
256
+ fileMode: utils.pad(mode, 7),
257
+ uid: utils.pad(uid, 7),
258
+ gid: utils.pad(gid, 7),
259
+ fileSize: utils.pad(input.length, 11),
260
+ mtime: utils.pad(mtime, 11),
261
+ checksum: ' ',
262
+ type: '0', // just a file
263
+ ustar: 'ustar ',
264
+ owner: opts.owner || '',
265
+ group: opts.group || ''
266
+ };
267
+
268
+ // calculate the checksum
269
+ checksum = 0;
270
+ Object.keys(data).forEach(function (key) {
271
+ var i, value = data[key], length;
272
+
273
+ for (i = 0, length = value.length; i < length; i += 1) {
274
+ checksum += value.charCodeAt(i);
275
+ }
276
+ });
277
+
278
+ data.checksum = utils.pad(checksum, 6) + "\u0000 ";
279
+
280
+ headerArr = header.format(data);
281
+
282
+ var headerLength = Math.ceil( headerArr.length / recordSize ) * recordSize;
283
+ var inputLength = Math.ceil( input.length / recordSize ) * recordSize;
284
+
285
+ this.blocks.push( { header: headerArr, input: input, headerLength: headerLength, inputLength: inputLength } );
286
+
287
+ };
288
+
289
+ Tar.prototype.save = function() {
290
+
291
+ var buffers = [];
292
+ var chunks = [];
293
+ var length = 0;
294
+ var max = Math.pow( 2, 20 );
295
+
296
+ var chunk = [];
297
+ this.blocks.forEach( function( b ) {
298
+ if( length + b.headerLength + b.inputLength > max ) {
299
+ chunks.push( { blocks: chunk, length: length } );
300
+ chunk = [];
301
+ length = 0;
302
+ }
303
+ chunk.push( b );
304
+ length += b.headerLength + b.inputLength;
305
+ } );
306
+ chunks.push( { blocks: chunk, length: length } );
307
+
308
+ chunks.forEach( function( c ) {
309
+
310
+ var buffer = new Uint8Array( c.length );
311
+ var written = 0;
312
+ c.blocks.forEach( function( b ) {
313
+ buffer.set( b.header, written );
314
+ written += b.headerLength;
315
+ buffer.set( b.input, written );
316
+ written += b.inputLength;
317
+ } );
318
+ buffers.push( buffer );
319
+
320
+ } );
321
+
322
+ buffers.push( new Uint8Array( 2 * recordSize ) );
323
+
324
+ return new Blob( buffers, { type: 'octet/stream' } );
325
+
326
+ };
327
+
328
+ Tar.prototype.clear = function () {
329
+ this.written = 0;
330
+ this.out = utils.clean(blockSize);
331
+ };
332
+
333
+ window.Tar = Tar;
334
+ }());