Skip to content

Commit a7b7587

Browse files
committed
chore: set up README in packages
1 parent 57862a8 commit a7b7587

File tree

7 files changed

+189
-5
lines changed

7 files changed

+189
-5
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,20 @@
1919

2020
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.
2121

22-
### Packages
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+
## Packages
2328

2429
This library contains 2 packages:
2530

2631
`@thatopen/components` - The core functionality. Compatible both with browser and Node.js environments.
2732

2833
`@thatopen/components-front` - Features exclusive for browser environments.
2934

30-
### Usage
35+
## Usage
3136

3237
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).
3338

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"build-front": "yarn workspace @thatopen/components-front build",
1313
"build-libraries": "yarn build-core && yarn build-front",
1414
"build-examples": "vite build --config ./vite.config-examples.ts",
15-
"build": "yarn build-libraries && yarn build-examples",
15+
"build": "yarn copy-readme && yarn build-libraries && yarn build-examples",
16+
"copy-readme": "node resources/readme-copier.mjs",
1617
"test": "echo 'test to be implemented!'",
1718
"publish-repo": "yarn workspace @thatopen/components publish-repo && yarn workspace @thatopen/components-front publish-repo",
1819
"reset-release-please": "git commit --allow-empty -m \"chore: release 2.0.0\" -m \"Release-As: 2.0.0\""

packages/core/README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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+
## Packages
28+
29+
This library contains 2 packages:
30+
31+
`@thatopen/components` - The core functionality. Compatible both with browser and Node.js environments.
32+
33+
`@thatopen/components-front` - Features exclusive for browser environments.
34+
35+
## Usage
36+
37+
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).
38+
39+
```js
40+
/* eslint import/no-extraneous-dependencies: 0 */
41+
42+
import * as THREE from "three";
43+
import * as OBC from "../..";
44+
45+
const container = document.getElementById("container")!;
46+
47+
const components = new OBC.Components();
48+
49+
const worlds = components.get(OBC.Worlds);
50+
51+
const world = worlds.create<
52+
OBC.SimpleScene,
53+
OBC.SimpleCamera,
54+
OBC.SimpleRenderer
55+
>();
56+
57+
world.scene = new OBC.SimpleScene(components);
58+
world.renderer = new OBC.SimpleRenderer(components, container);
59+
world.camera = new OBC.SimpleCamera(components);
60+
61+
components.init();
62+
63+
const material = new THREE.MeshLambertMaterial({ color: "#6528D7" });
64+
const geometry = new THREE.BoxGeometry();
65+
const cube = new THREE.Mesh(geometry, material);
66+
world.scene.three.add(cube);
67+
68+
world.scene.setup();
69+
70+
world.camera.controls.setLookAt(3, 3, 3, 0, 0, 0);
71+
```
72+
73+
74+
[npm]: https://img.shields.io/npm/v/@thatopen/components
75+
[npm-url]: https://www.npmjs.com/package/@thatopen/components
76+
[npm-downloads]: https://img.shields.io/npm/dw/@thatopen/components

packages/core/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"module": "dist/index.mjs",
1919
"types": "dist/index.d.ts",
2020
"files": [
21-
"dist"
21+
"dist",
22+
"README.md"
2223
],
2324
"repository": {
2425
"type": "git",

packages/front/README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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+
## Packages
28+
29+
This library contains 2 packages:
30+
31+
`@thatopen/components` - The core functionality. Compatible both with browser and Node.js environments.
32+
33+
`@thatopen/components-front` - Features exclusive for browser environments.
34+
35+
## Usage
36+
37+
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).
38+
39+
```js
40+
/* eslint import/no-extraneous-dependencies: 0 */
41+
42+
import * as THREE from "three";
43+
import * as OBC from "../..";
44+
45+
const container = document.getElementById("container")!;
46+
47+
const components = new OBC.Components();
48+
49+
const worlds = components.get(OBC.Worlds);
50+
51+
const world = worlds.create<
52+
OBC.SimpleScene,
53+
OBC.SimpleCamera,
54+
OBC.SimpleRenderer
55+
>();
56+
57+
world.scene = new OBC.SimpleScene(components);
58+
world.renderer = new OBC.SimpleRenderer(components, container);
59+
world.camera = new OBC.SimpleCamera(components);
60+
61+
components.init();
62+
63+
const material = new THREE.MeshLambertMaterial({ color: "#6528D7" });
64+
const geometry = new THREE.BoxGeometry();
65+
const cube = new THREE.Mesh(geometry, material);
66+
world.scene.three.add(cube);
67+
68+
world.scene.setup();
69+
70+
world.camera.controls.setLookAt(3, 3, 3, 0, 0, 0);
71+
```
72+
73+
74+
[npm]: https://img.shields.io/npm/v/@thatopen/components
75+
[npm-url]: https://www.npmjs.com/package/@thatopen/components
76+
[npm-downloads]: https://img.shields.io/npm/dw/@thatopen/components

packages/front/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"main": "dist/index.js",
1818
"types": "dist/index.d.ts",
1919
"files": [
20-
"dist"
20+
"dist",
21+
"README.md"
2122
],
2223
"repository": {
2324
"type": "git",

resources/readme-copier.mjs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import fs from "fs";
2+
import path from "path";
3+
import { fileURLToPath } from "url";
4+
5+
const targetPackages = ["core", "front"];
6+
7+
const __filename = fileURLToPath(import.meta.url);
8+
const __dirname = path.dirname(__filename);
9+
10+
for (const dir of targetPackages) {
11+
// Get paths relative to this script
12+
const rootDir = path.resolve(__dirname, "..");
13+
const sourceReadme = path.join(rootDir, "README.md");
14+
const targetReadme = path.join(rootDir, "packages", dir, "README.md");
15+
16+
// Copy the README file
17+
try {
18+
fs.copyFileSync(sourceReadme, targetReadme);
19+
console.log(`README.md successfully copied to packages/${dir}/`);
20+
} catch (err) {
21+
console.error("Error copying README.md:", err);
22+
process.exit(1);
23+
}
24+
}

0 commit comments

Comments
 (0)