@@ -11,6 +11,94 @@ This application renders interactive 3D plane-mesh wireframe structures with clo
1111- Responsive design for various screen sizes
1212- Performance-optimized rendering
1313
14+ ## Using as a Package
15+
16+ ### Import from Git (Recommended for Development)
17+
18+ You can import this package directly from Git without publishing to npm:
19+
20+ ``` bash
21+ npm install git+https://github.com/yourusername/toroid-wireframe-clouds.git
22+ ```
23+
24+ Or add to your ` package.json ` :
25+
26+ ``` json
27+ {
28+ "dependencies" : {
29+ "toroid-wireframe-clouds" : " git+https://github.com/yourusername/toroid-wireframe-clouds.git"
30+ }
31+ }
32+ ```
33+
34+ ### Usage Examples
35+
36+ #### Basic Scene Component
37+
38+ ``` tsx
39+ import { MainScene } from ' toroid-wireframe-clouds' ;
40+
41+ function App() {
42+ return <MainScene />;
43+ }
44+ ```
45+
46+ #### Custom Three.js Scene
47+
48+ ``` tsx
49+ import { ThreeScene , type SceneParameters } from ' toroid-wireframe-clouds' ;
50+
51+ function MyScene() {
52+ const parameters: SceneParameters = {
53+ gridWidth: 10 ,
54+ gridHeight: 10 ,
55+ arcReach: 0.5 ,
56+ twistX: 45 ,
57+ twistY: 30 ,
58+ twistZ: 15 ,
59+ twistNoise: 0.2 ,
60+ cameraPositionX: 0 ,
61+ cameraPositionY: 0 ,
62+ cameraPositionZ: 10 ,
63+ cameraTargetX: 0 ,
64+ cameraTargetY: 0 ,
65+ cameraTargetZ: 0 ,
66+ };
67+
68+ return (
69+ <ThreeScene
70+ parameters = { parameters }
71+ onCameraStateChange = { (cameraState ) => console .log (' Camera:' , cameraState )}
72+ />
73+ );
74+ }
75+ ```
76+
77+ #### Programmatic Scene Creation
78+
79+ ``` tsx
80+ import { createScene , type SceneSetup } from ' toroid-wireframe-clouds' ;
81+
82+ const container = document .getElementById (' scene-container' );
83+ const sceneSetup: SceneSetup = createScene (container );
84+
85+ // Start animation loop
86+ function animate() {
87+ sceneSetup .animate ();
88+ requestAnimationFrame (animate );
89+ }
90+ animate ();
91+
92+ // Cleanup when done
93+ sceneSetup .cleanup ();
94+ ```
95+
96+ ### Available Exports
97+
98+ - ** Components** : ` MainScene ` , ` ThreeScene ` , ` SceneForm ` , ` StatsOverlay ` , ` DrawCallsOverlay `
99+ - ** Functions** : ` createScene `
100+ - ** Types** : ` SceneParameters ` , ` CameraState ` , ` SceneSetup `
101+
14102## Getting Started
15103
16104### Prerequisites
@@ -40,6 +128,12 @@ This application renders interactive 3D plane-mesh wireframe structures with clo
40128npm run build
41129```
42130
131+ ### Building Library Distribution
132+
133+ ``` bash
134+ npm run build:lib
135+ ```
136+
43137The built files will be in the ` dist ` directory, ready for deployment.
44138
45139## Project Structure
0 commit comments