@thatopen/components 2.4.5 → 2.4.8

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.
package/README.md CHANGED
@@ -0,0 +1,92 @@
1
+ <p align="center">
2
+ <a href="https://thatopen.com/">TOC</a>
3
+ |
4
+ <a href="https://docs.thatopen.com/intro">documentation</a>
5
+ |
6
+ <a href="https://thatopen.github.io/engine_components/examples/IfcLoader/index.html">demo</a>
7
+ |
8
+ <a href="https://people.thatopen.com/">community</a>
9
+ |
10
+ <a href="https://www.npmjs.com/org/thatopen">npm package</a>
11
+ </p>
12
+
13
+ ![cover](https://thatopen.github.io/engine_components/resources/cover.png)
14
+
15
+ <h1>Open BIM Components <img src="https://thatopen.github.io/engine_components/resources/favicon.ico" width="32"/></h1>
16
+
17
+ [![NPM Package][npm]][npm-url]
18
+ [![NPM Package][npm-downloads]][npm-url]
19
+
20
+ This library is a collection of BIM tools based on [Three.js](https://github.com/mrdoob/three.js/) and other libraries. It includes pre-made features to easily build browser-based 3D BIM applications, such as postproduction, dimensions, floorplan navigation, DXF export and much more.
21
+
22
+
23
+ ## 🤝 Want our help?
24
+ Are you developing a project with our technology and would like our help?
25
+ Apply now to join [That Open Accelerator Program](https://thatopen.com/accelerator)!
26
+
27
+
28
+ ## 🧩 Integration with fragments
29
+ As you might know, we have 4 open source libraries:
30
+ - [web-ifc](https://github.com/ThatOpen/engine_web-ifc): the IFC parser and geometry engine.
31
+ - [fragments](https://github.com/ThatOpen/engine_fragment): the open source format and 3D engine.
32
+ - [components](https://github.com/ThatOpen/engine_components): a set of tools to build BIM software fast.
33
+ - [ui components](https://github.com/ThatOpen/engine_ui-components): our agnostic UI system.
34
+
35
+ Components doesn't work with this new version of Fragments yet. In the next release, at the end of Q2, all components will be updated to work with this new version of Fragments. In the meantime, you have 3 options:
36
+
37
+ - Work with Fragments and build your own BIM components from scratch.
38
+ - Work with Components (which don't use this new version of Fragments).
39
+ - Check out our [Accelerator Program](https://thatopen.com/accelerator) to get previous access to the upcoming components.
40
+
41
+ Once the release at the end of Q2 is made, Components will work natively with this new version of Fragments.
42
+
43
+ ## Packages
44
+
45
+ This library contains 2 packages:
46
+
47
+ `@thatopen/components` - The core functionality. Compatible both with browser and Node.js environments.
48
+
49
+ `@thatopen/components-front` - Features exclusive for browser environments.
50
+
51
+ ## Usage
52
+
53
+ You need to be familiar with [Three.js API](https://github.com/mrdoob/three.js/) to be able to use this library effectively. In the following example, we will create a cube in a 3D scene that can be navigated with the mouse or touch events. You can see the full example [here](https://github.com/ThatOpen/engine_components/blob/main/packages/core/src/core/Worlds/example.ts) and the deployed app [here](https://thatopen.github.io/engine_components/examples/Worlds/index.html).
54
+
55
+ ```js
56
+ /* eslint import/no-extraneous-dependencies: 0 */
57
+
58
+ import * as THREE from "three";
59
+ import * as OBC from "../..";
60
+
61
+ const container = document.getElementById("container")!;
62
+
63
+ const components = new OBC.Components();
64
+
65
+ const worlds = components.get(OBC.Worlds);
66
+
67
+ const world = worlds.create<
68
+ OBC.SimpleScene,
69
+ OBC.SimpleCamera,
70
+ OBC.SimpleRenderer
71
+ >();
72
+
73
+ world.scene = new OBC.SimpleScene(components);
74
+ world.renderer = new OBC.SimpleRenderer(components, container);
75
+ world.camera = new OBC.SimpleCamera(components);
76
+
77
+ components.init();
78
+
79
+ const material = new THREE.MeshLambertMaterial({ color: "#6528D7" });
80
+ const geometry = new THREE.BoxGeometry();
81
+ const cube = new THREE.Mesh(geometry, material);
82
+ world.scene.three.add(cube);
83
+
84
+ world.scene.setup();
85
+
86
+ world.camera.controls.setLookAt(3, 3, 3, 0, 0, 0);
87
+ ```
88
+
89
+
90
+ [npm]: https://img.shields.io/npm/v/@thatopen/components
91
+ [npm-url]: https://www.npmjs.com/package/@thatopen/components
92
+ [npm-downloads]: https://img.shields.io/npm/dw/@thatopen/components
@@ -6,7 +6,7 @@ export declare class Components implements Disposable {
6
6
  /**
7
7
  * The version of the @thatopen/components library.
8
8
  */
9
- static readonly release = "2.4.5";
9
+ static readonly release = "2.4.8";
10
10
  /** {@link Disposable.onDisposed} */
11
11
  readonly onDisposed: Event<void>;
12
12
  /**
@@ -4,11 +4,11 @@ import * as FRAGS from "@thatopen/fragments";
4
4
  export declare class CivilReader {
5
5
  defLineMat: THREE.LineBasicMaterial;
6
6
  read(webIfc: WEBIFC.IfcAPI): {
7
- alignments: Map<number, FRAGS.Alignment>;
7
+ alignments: Map<number, FRAGS.AlignmentObject>;
8
8
  coordinationMatrix: THREE.Matrix4;
9
9
  } | undefined;
10
10
  get(civilItems: any): {
11
- alignments: Map<number, FRAGS.Alignment>;
11
+ alignments: Map<number, FRAGS.AlignmentObject>;
12
12
  coordinationMatrix: THREE.Matrix4;
13
13
  } | undefined;
14
14
  private getCurves;
package/dist/index.cjs CHANGED
@@ -6312,7 +6312,7 @@ const _Components = class _Components {
6312
6312
  /**
6313
6313
  * The version of the @thatopen/components library.
6314
6314
  */
6315
- __publicField(_Components, "release", "2.4.5");
6315
+ __publicField(_Components, "release", "2.4.8");
6316
6316
  let Components = _Components;
6317
6317
  class SimpleWorld extends Base {
6318
6318
  constructor() {
@@ -15996,7 +15996,7 @@ class CivilReader {
15996
15996
  if (civilItems.IfcAlignment) {
15997
15997
  const alignments = /* @__PURE__ */ new Map();
15998
15998
  for (const ifcAlign of civilItems.IfcAlignment) {
15999
- const alignment = new FRAGS__namespace.Alignment();
15999
+ const alignment = new FRAGS__namespace.AlignmentObject();
16000
16000
  alignment.absolute = this.getCurves(ifcAlign.curve3D, alignment);
16001
16001
  alignment.horizontal = this.getCurves(ifcAlign.horizontal, alignment);
16002
16002
  alignment.vertical = this.getCurves(ifcAlign.vertical, alignment);