opengeometry 0.0.7 → 2.0.0
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 +106 -0
- package/index.d.ts +32 -2
- package/index.js +14750 -7338
- package/index.js.map +1 -1
- package/opengeometry_bg.wasm +0 -0
- package/opengeometry_bg.wasm.d.ts +162 -64
- package/package.json +6 -7
- package/src/examples/booleans.d.ts +22 -0
- package/src/examples/index.d.ts +9 -0
- package/src/examples/offset.d.ts +18 -0
- package/src/examples/primitives.d.ts +16 -0
- package/src/examples/shape-outline-dropdown.d.ts +23 -0
- package/src/examples/shapes.d.ts +20 -0
- package/src/examples/sweep.d.ts +9 -0
- package/src/examples/wall-from-offsets.d.ts +11 -0
- package/src/operations/boolean.d.ts +82 -0
- package/src/operations/index.d.ts +4 -0
- package/src/primitives/arc.d.ts +8 -2
- package/src/primitives/curve.d.ts +23 -0
- package/src/primitives/index.d.ts +4 -0
- package/src/primitives/line.d.ts +14 -1
- package/src/primitives/polyline.d.ts +13 -2
- package/src/primitives/rectangle.d.ts +13 -1
- package/src/shapes/boolean-subtract.d.ts +8 -0
- package/src/shapes/cuboid.d.ts +21 -2
- package/src/shapes/cylinder.d.ts +18 -1
- package/src/shapes/index.d.ts +6 -0
- package/src/shapes/opening.d.ts +25 -4
- package/src/shapes/outline-utils.d.ts +14 -0
- package/src/shapes/polygon.d.ts +24 -3
- package/src/shapes/sphere.d.ts +45 -0
- package/src/shapes/sweep.d.ts +42 -0
- package/src/shapes/swept-shape.d.ts +63 -0
- package/src/shapes/wedge.d.ts +44 -0
package/README.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://opengeometry.io">
|
|
3
|
+
<img src="https://img.shields.io/badge/OpenGeometry-4460FF?style=for-the-badge&logo=data:image/svg+xml;base64,&logoColor=white" alt="OpenGeometry" />
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<h1 align="center">OpenGeometry</h1>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<strong>Build. Design. Create. The Engine for Web-Based Design.</strong>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<a href="https://www.npmjs.com/package/opengeometry"><img src="https://img.shields.io/npm/v/opengeometry?style=flat-square&color=4460FF&label=npm" alt="npm version" /></a>
|
|
15
|
+
<a href="https://github.com/OpenGeometry-io/OpenGeometry/blob/main/LICENSE.md"><img src="https://img.shields.io/github/license/opengeometry-io/opengeometry?style=flat-square" alt="License" /></a>
|
|
16
|
+
<a href="https://discord.com/invite/cZY2Vm6E"><img src="https://img.shields.io/badge/Discord-Join%20us-5865F2?style=flat-square&logo=discord&logoColor=white" alt="Discord" /></a>
|
|
17
|
+
<a href="https://x.com/openGeometry"><img src="https://img.shields.io/badge/Twitter-Follow-1DA1F2?style=flat-square&logo=x&logoColor=white" alt="Twitter" /></a>
|
|
18
|
+
<a href="https://linkedin.com/company/openGeometry"><img src="https://img.shields.io/badge/LinkedIn-Connect-0A66C2?style=flat-square&logo=linkedin&logoColor=white" alt="LinkedIn" /></a>
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
<p align="center">
|
|
22
|
+
<a href="https://opengeometry.io">Website</a> · <a href="https://docs.opengeometry.io">Documentation</a> · <a href="https://demos.opengeometry.io">Live Demos</a> · <a href="https://blog.opengeometry.io/">Blog</a> · <a href="https://www.npmjs.com/package/opengeometry">npm</a>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
> **Actively under development.** We're building OpenGeometry in the open. APIs, examples, and package structure are evolving — breaking changes are still possible. Star the repo to follow along.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## What is OpenGeometry?
|
|
32
|
+
|
|
33
|
+
OpenGeometry is an **open-source CAD kernel** purpose-built for the browser. The geometry engine is written in **Rust**, compiled to **WebAssembly**, and ships with a **Three.js integration layer** — so you can build real CAD tools that run entirely on the web.
|
|
34
|
+
|
|
35
|
+
Whether you're building a parametric modeler, a BIM viewer, a 3D configurator, or any geometry-heavy web app, OpenGeometry gives you the primitives and operations you need without leaving JavaScript.
|
|
36
|
+
|
|
37
|
+
### What you can do today
|
|
38
|
+
|
|
39
|
+
| Category | Capabilities |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| **Primitives** | Lines, arcs, curves, polylines, rectangles |
|
|
42
|
+
| **Shapes** | Polygons, cylinders, cuboids, spheres, wedges |
|
|
43
|
+
| **Operations** | Triangulation, extrusion, sweep, offset, boolean operations |
|
|
44
|
+
| **Exports** | STL, STEP, IFC, PDF projection |
|
|
45
|
+
| **Integration** | Three.js scene management, WebAssembly-powered performance |
|
|
46
|
+
|
|
47
|
+
## Demos
|
|
48
|
+
|
|
49
|
+
See OpenGeometry in action — interactive, browser-based demos showcasing the kernel's capabilities:
|
|
50
|
+
|
|
51
|
+
**[demos.opengeometry.io](https://demos.opengeometry.io)**
|
|
52
|
+
|
|
53
|
+
Demos include primitives rendering, shape generation, sweep operations, boolean operations, file exports, and more. All running client-side via WebAssembly.
|
|
54
|
+
|
|
55
|
+
## Quick Start
|
|
56
|
+
|
|
57
|
+
Install from npm:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npm install opengeometry
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
```javascript
|
|
64
|
+
import { OpenGeometry } from "opengeometry";
|
|
65
|
+
|
|
66
|
+
const og = new OpenGeometry();
|
|
67
|
+
await og.init();
|
|
68
|
+
|
|
69
|
+
// Create a rectangle and extrude it into a 3D shape
|
|
70
|
+
const rect = og.rectangle({ width: 2, height: 1 });
|
|
71
|
+
const extruded = og.extrude(rect, { depth: 0.5 });
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
For a complete walkthrough, see the [Quick Start guide](https://docs.opengeometry.io/quickstart) or clone the [quickstart-js](https://github.com/OpenGeometry-io/quickstart-js) repo.
|
|
75
|
+
|
|
76
|
+
## Documentation
|
|
77
|
+
|
|
78
|
+
Full API reference, guides, and concepts are available at:
|
|
79
|
+
|
|
80
|
+
**[docs.opengeometry.io](https://docs.opengeometry.io)**
|
|
81
|
+
|
|
82
|
+
Key pages:
|
|
83
|
+
- [Installation](https://docs.opengeometry.io/installation)
|
|
84
|
+
- [Quick Start](https://docs.opengeometry.io/quickstart)
|
|
85
|
+
- [Architecture & Concepts](https://docs.opengeometry.io/concepts/architecture)
|
|
86
|
+
- [API Reference](https://docs.opengeometry.io/api)
|
|
87
|
+
|
|
88
|
+
## Community
|
|
89
|
+
|
|
90
|
+
We'd love to have you involved — whether you're using OpenGeometry, building on it, or just curious.
|
|
91
|
+
|
|
92
|
+
- **[Discord](https://discord.com/invite/cZY2Vm6E)** — Chat with the team and community
|
|
93
|
+
- **[Twitter / X](https://x.com/openGeometry)** — Updates and announcements
|
|
94
|
+
- **[LinkedIn](https://linkedin.com/company/openGeometry)** — Company updates
|
|
95
|
+
- **[GitHub](https://github.com/OpenGeometry-io/OpenGeometry)** — Source code and issues
|
|
96
|
+
- **[Blog](https://opengeometry.io/blog)** — Deep dives and release notes
|
|
97
|
+
|
|
98
|
+
## Contributing
|
|
99
|
+
|
|
100
|
+
OpenGeometry is open source under the [MPL-2.0 license](https://github.com/OpenGeometry-io/OpenGeometry/blob/main/LICENSE.md). Contributions are welcome — check the [issues](https://github.com/OpenGeometry-io/OpenGeometry/issues) for good starting points or open a discussion on [Discord](https://discord.com/invite/cZY2Vm6E).
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
<p align="center">
|
|
105
|
+
<sub><em>"It is my land. Who would I be if I did not try to make it better?" — A Knight.</em></sub>
|
|
106
|
+
</p>
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* OpenGeometry Three.js adapter entrypoint.
|
|
3
|
+
* @module @opengeometry/kernel-three
|
|
4
|
+
*/
|
|
5
|
+
import { OGSceneManager, Vector3 } from "../opengeometry/pkg/opengeometry";
|
|
2
6
|
import { SpotLabel } from "./src/markup/spotMarker";
|
|
3
7
|
import { OpenGeometryOptions } from "./src/base-types";
|
|
4
8
|
export type OUTLINE_TYPE = "front" | "side" | "top";
|
|
9
|
+
export interface OGStlExportResult {
|
|
10
|
+
bytes: Uint8Array;
|
|
11
|
+
reportJson: string;
|
|
12
|
+
}
|
|
13
|
+
export interface OGStepExportResult {
|
|
14
|
+
text: string;
|
|
15
|
+
reportJson: string;
|
|
16
|
+
}
|
|
17
|
+
export interface OGIfcExportResult {
|
|
18
|
+
text: string;
|
|
19
|
+
reportJson: string;
|
|
20
|
+
}
|
|
5
21
|
export declare class OpenGeometry {
|
|
6
22
|
static version: string;
|
|
7
23
|
static instance: OpenGeometry | null;
|
|
@@ -42,6 +58,20 @@ export declare class OpenGeometry {
|
|
|
42
58
|
static create(options: OpenGeometryOptions): Promise<OpenGeometry>;
|
|
43
59
|
private setup;
|
|
44
60
|
}
|
|
45
|
-
export { Vector3, SpotLabel, };
|
|
61
|
+
export { OGSceneManager, Vector3, SpotLabel, };
|
|
62
|
+
/**
|
|
63
|
+
* Primitive wrappers (line/polyline/arc/rectangle/curve).
|
|
64
|
+
*/
|
|
46
65
|
export * from './src/primitives/';
|
|
66
|
+
/**
|
|
67
|
+
* Shape wrappers (polygon/cuboid/cylinder/wedge/opening/sweep/sphere).
|
|
68
|
+
*/
|
|
47
69
|
export * from './src/shapes/';
|
|
70
|
+
/**
|
|
71
|
+
* Reusable example builders for quickly wiring demo scenes.
|
|
72
|
+
*/
|
|
73
|
+
export * from './src/examples/';
|
|
74
|
+
/**
|
|
75
|
+
* Kernel-backed modeling operations.
|
|
76
|
+
*/
|
|
77
|
+
export * from './src/operations/';
|