@inweb/viewer-three 25.3.15

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 (38) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +63 -0
  3. package/dist/viewer-three.js +42841 -0
  4. package/dist/viewer-three.js.map +1 -0
  5. package/dist/viewer-three.min.js +6 -0
  6. package/dist/viewer-three.module.js +1102 -0
  7. package/dist/viewer-three.module.js.map +1 -0
  8. package/lib/ThreejsViewer/IComponent.d.ts +3 -0
  9. package/lib/ThreejsViewer/ThreejsViewer.d.ts +54 -0
  10. package/lib/ThreejsViewer/components/BackgroundComponent.d.ts +10 -0
  11. package/lib/ThreejsViewer/components/DefaultCameraPositionComponent.d.ts +9 -0
  12. package/lib/ThreejsViewer/components/LightComponent.d.ts +10 -0
  13. package/lib/ThreejsViewer/components/ObjectSelectionComponent.d.ts +16 -0
  14. package/lib/ThreejsViewer/components/RenderLoopComponent.d.ts +9 -0
  15. package/lib/ThreejsViewer/components/ResizeCanvasComponent.d.ts +9 -0
  16. package/lib/ThreejsViewer/draggers/ClippingPlaneDragger.d.ts +17 -0
  17. package/lib/ThreejsViewer/draggers/OrbitDragger.d.ts +10 -0
  18. package/lib/ThreejsViewer/draggers/PanDragger.d.ts +5 -0
  19. package/lib/ThreejsViewer/draggers/WalkDragger.d.ts +39 -0
  20. package/lib/ThreejsViewer/draggers/ZoomDragger.d.ts +5 -0
  21. package/lib/ThreejsViewer/loaders/GLTFLoadingManager.d.ts +11 -0
  22. package/lib/index.d.ts +2 -0
  23. package/package.json +42 -0
  24. package/src/ThreejsViewer/IComponent.ts +3 -0
  25. package/src/ThreejsViewer/ThreejsViewer.ts +369 -0
  26. package/src/ThreejsViewer/components/BackgroundComponent.ts +57 -0
  27. package/src/ThreejsViewer/components/DefaultCameraPositionComponent.ts +66 -0
  28. package/src/ThreejsViewer/components/LightComponent.ts +48 -0
  29. package/src/ThreejsViewer/components/ObjectSelectionComponent.ts +105 -0
  30. package/src/ThreejsViewer/components/RenderLoopComponent.ts +44 -0
  31. package/src/ThreejsViewer/components/ResizeCanvasComponent.ts +53 -0
  32. package/src/ThreejsViewer/draggers/ClippingPlaneDragger.ts +120 -0
  33. package/src/ThreejsViewer/draggers/OrbitDragger.ts +61 -0
  34. package/src/ThreejsViewer/draggers/PanDragger.ts +34 -0
  35. package/src/ThreejsViewer/draggers/WalkDragger.ts +260 -0
  36. package/src/ThreejsViewer/draggers/ZoomDragger.ts +34 -0
  37. package/src/ThreejsViewer/loaders/GLTFLoadingManager.ts +69 -0
  38. package/src/index.ts +25 -0
package/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (C) 2002-2021, Open Design Alliance (the "Alliance").
2
+ All rights reserved.
3
+
4
+ This software and its documentation and related materials are owned by
5
+ the Alliance. The software may only be incorporated into application
6
+ programs owned by members of the Alliance, subject to a signed
7
+ Membership Agreement and Supplemental Software License Agreement with the
8
+ Alliance. The structure and organization of this software are the valuable
9
+ trade secrets of the Alliance and its suppliers. The software is also
10
+ protected by copyright law and international treaty provisions. Application
11
+ programs incorporating this software must include the following statement
12
+ with their copyright notices:
13
+
14
+ This application incorporates Open Design Alliance software pursuant to a
15
+ license agreement with Open Design Alliance.
16
+ Open Design Alliance Copyright (C) 2002-2021 by Open Design Alliance.
17
+ All rights reserved.
18
+
19
+ By use of this software, its documentation or related materials, you
20
+ acknowledge and accept the above terms.
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # Viewer.three
2
+
3
+ `Viewer.three` is a JavaScript library powered by [Three.js](https://threejs.org/) for in-browser visualization of 3D CAD and BIM data from `glTF` files stored on the [Open Cloud Server](https://cloud.opendesign.com/docs/index.html#/opencloud_server), on the web, or on your local computer.
4
+
5
+ This library enables you to easily integrate advanced visualization capabilities into your web applications, including user interaction with scenes and objects, markups, and collaboration using the [inWEB Open Cloud](https://www.opendesign.com/products/open-cloud) platform.
6
+
7
+ > `glTF` is a [royalty-free](https://www.khronos.org/gltf) file format commonly used in 3D applications.
8
+
9
+ ## Installation
10
+
11
+ ### CDN or static hosting
12
+
13
+ For CDN, you can use [unpkg](https://unpkg.com/) or [jsDelivr](https://www.jsdelivr.com/) (replace `25.3` with a version you need):
14
+
15
+ ```html
16
+ <script src="https://unpkg.com/@inweb/viewer-three@25.3/dist/viewer-three.js"></script>
17
+ ```
18
+
19
+ The global namespace for `Viewer.three` is `ODA.Three`.
20
+
21
+ ### Install via [npm](https://npmjs.org)
22
+
23
+ Open a terminal in your project folder and run:
24
+
25
+ ```sh
26
+ npm install @inweb/viewer-three
27
+ ```
28
+
29
+ The `Viewer.three` package will be downloaded and installed. Then you're ready to import it in your code:
30
+
31
+ ```javascript
32
+ import { Viewer } from "@inweb/viewer-three";
33
+ ```
34
+
35
+ ## Example
36
+
37
+ Download and render file from the `Open Cloud Server`:
38
+
39
+ ```html
40
+ <script src="https://unpkg.com/@inweb/client@25.3/dist/client.js"></script>
41
+ <script src="https://unpkg.com/@inweb/viewer-three@25.3/dist/viewer-three.js"></script>
42
+
43
+ <script>
44
+ const client = new ODA.Api.Client({ serverUrl: "https://cloud.opendesign.com/api" });
45
+ const viewer = new ODA.Three.Viewer(client);
46
+
47
+ init();
48
+
49
+ async function init() {
50
+ await client.signInWithEmail("email", "password");
51
+ const files = await client.getFiles();
52
+ await viewer.initialize(canvas);
53
+ await viewer.open(files.result[0]);
54
+ viewer.setActiveDragger("Orbit");
55
+ }
56
+ </script>
57
+ ```
58
+
59
+ To learn more, see [First application guide](https://cloud.opendesign.com/docs/index.html#/guide).
60
+
61
+ ## Copyright and license
62
+
63
+ Code and documentation copyright 2002-2024 the [Open Design Alliance](https://opendesign.com). Code is distributed under a proprietary license, see [LICENSE](./LICENSE) for more information.