makerrepo-cli 0.1.2__py3-none-any.whl → 0.1.3__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.
@@ -0,0 +1,79 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <style>
5
+ body {
6
+ margin: 0;
7
+ }
8
+ #cad_view {
9
+ width: 100vw;
10
+ height: 100vh;
11
+ }
12
+ </style>
13
+ <link rel="stylesheet" href="./three-cad-viewer-3.6.3.css" />
14
+ </head>
15
+ <body>
16
+ <div id="cad_view"></div>
17
+ <script src="./three-cad-viewer-3.6.3.js"></script>
18
+ <script src="./utils.js"></script>
19
+ <script>
20
+ const container = document.getElementById("cad_view");
21
+
22
+ let display = null;
23
+ let viewer = null;
24
+ // Load model with config from JSON
25
+ // All config keys are passed through - each component uses what it recognizes
26
+ window.loadModel = (data) => {
27
+ const modelData = data.model;
28
+ const config = data.config;
29
+
30
+ CadUtils.decode(modelData)
31
+
32
+ // Initialize display and viewer on first load
33
+ if (!display) {
34
+ display = new CadViewer.Display(container, config);
35
+ viewer = new CadViewer.Viewer(display, config, () => {});
36
+ }
37
+
38
+ viewer.render(modelData.shapes, config, config);
39
+
40
+ // Resize viewer after render (camera must exist first)
41
+ viewer.resizeCadView(
42
+ config.cadWidth,
43
+ config.treeWidth,
44
+ config.height,
45
+ config.glass
46
+ );
47
+
48
+ if (
49
+ config.tab &&
50
+ ["tree", "clip", "material", "zebra"].includes(config.tab)
51
+ ) {
52
+ viewer.display.selectTabByName(config.tab);
53
+ delete config.tab;
54
+ }
55
+
56
+ if (
57
+ config.reset_camera &&
58
+ ["iso", "left", "right", "top", "bottom", "rear", "front"].includes(config.reset_camera)
59
+ ) {
60
+ viewer.display.setView(config.reset_camera);
61
+ delete config.reset_camera;
62
+ }
63
+
64
+ if (config.render_edges === false) {
65
+ const g = viewer.nestedGroup.rootGroup.name.replace("|", "/");
66
+ viewer.setState(g, [1, 0]);
67
+ }
68
+ if (config.render_faces === false) {
69
+ const g = viewer.nestedGroup.rootGroup.name.replace("|", "/");
70
+ viewer.setState(g, [0, 1]);
71
+ }
72
+ };
73
+
74
+ window.isReady = () => viewer && viewer.ready;
75
+
76
+ window.getImage = (taskId) => viewer.getImage(taskId);
77
+ </script>
78
+ </body>
79
+ </html>