okgeometry-api 1.1.5 → 1.1.7
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/dist/Arc.js +1 -1
- package/dist/Arc.js.map +1 -1
- package/dist/Circle.js +1 -1
- package/dist/Circle.js.map +1 -1
- package/dist/Line.js +1 -1
- package/dist/Line.js.map +1 -1
- package/dist/Mesh.d.ts +104 -7
- package/dist/Mesh.d.ts.map +1 -1
- package/dist/Mesh.js +106 -8
- package/dist/Mesh.js.map +1 -1
- package/dist/NurbsCurve.js +1 -1
- package/dist/NurbsCurve.js.map +1 -1
- package/dist/NurbsSurface.d.ts.map +1 -1
- package/dist/NurbsSurface.js +10 -7
- package/dist/NurbsSurface.js.map +1 -1
- package/dist/PolyCurve.js +1 -1
- package/dist/PolyCurve.js.map +1 -1
- package/dist/Polyline.js +1 -1
- package/dist/Polyline.js.map +1 -1
- package/dist/Ray.js +1 -1
- package/dist/Ray.js.map +1 -1
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +1 -3
- package/dist/engine.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/wasm-base64.d.ts +1 -1
- package/dist/wasm-base64.d.ts.map +1 -1
- package/dist/wasm-base64.js +1 -1
- package/dist/wasm-base64.js.map +1 -1
- package/package.json +7 -5
- package/src/Arc.ts +117 -117
- package/src/Circle.ts +153 -153
- package/src/Line.ts +144 -144
- package/src/Mesh.ts +663 -444
- package/src/NurbsCurve.ts +240 -240
- package/src/NurbsSurface.ts +249 -245
- package/src/PolyCurve.ts +306 -306
- package/src/Polyline.ts +153 -153
- package/src/Ray.ts +90 -90
- package/src/engine.ts +9 -11
- package/src/index.ts +6 -0
- package/src/wasm-base64.ts +1 -1
- package/wasm/README.md +0 -104
- package/wasm/okgeometrycore.d.ts +0 -754
- package/wasm/okgeometrycore.js +0 -2005
- package/wasm/okgeometrycore_bg.d.ts +0 -3
- package/wasm/okgeometrycore_bg.js +0 -1686
- package/wasm/okgeometrycore_bg.wasm +0 -0
- package/wasm/okgeometrycore_bg.wasm.d.ts +0 -100
- package/wasm/package.json +0 -19
package/wasm/README.md
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
# OkGeometryCore
|
|
2
|
-
|
|
3
|
-
A production-grade geometry engine written in Rust, compiled to WebAssembly. Built for [OkNodes](https://orkestra.online), a visual programming tool for the AEC (Architecture, Engineering, Construction) industry.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
### Mesh Primitives
|
|
8
|
-
- Box, Cylinder, Sphere, Prism, Cone, Torus
|
|
9
|
-
|
|
10
|
-
### Mesh Operations
|
|
11
|
-
- **Transforms** - translate, rotate, scale, mirror, arbitrary matrix
|
|
12
|
-
- **Extrude** - linear extrusion with optional end caps
|
|
13
|
-
- **Loft** - surface generation between multiple curves
|
|
14
|
-
- **Sweep** - curve along path
|
|
15
|
-
- **Boolean** - union, intersection, subtraction (~95% reliable on manifold meshes)
|
|
16
|
-
- **Subdivision** - Catmull-Clark (quad meshes) and Loop (triangle meshes)
|
|
17
|
-
- **Offset / Shell** - inward/outward mesh offset
|
|
18
|
-
- **Bevel / Chamfer** - flat bevel on all edges or selected edges
|
|
19
|
-
- **Triangulation** - ear clipping and fan triangulation
|
|
20
|
-
|
|
21
|
-
### Curve Primitives
|
|
22
|
-
- Line, Arc, Circle, Polyline, Polycurve (mixed segments)
|
|
23
|
-
|
|
24
|
-
### Curve Operations
|
|
25
|
-
- Evaluate, tangent, length, closest point, bounds
|
|
26
|
-
- Chamfer corners, fillet corners (arc), offset polyline
|
|
27
|
-
|
|
28
|
-
### Intersection
|
|
29
|
-
- Line-Line, Line-Plane, Line-Circle, Circle-Circle
|
|
30
|
-
- Ray-Mesh (BVH-accelerated), closest point on mesh
|
|
31
|
-
|
|
32
|
-
### Spatial Indexing
|
|
33
|
-
- BVH (Bounding Volume Hierarchy) for O(log n) ray casting and proximity queries
|
|
34
|
-
|
|
35
|
-
### I/O
|
|
36
|
-
- OBJ import/export
|
|
37
|
-
|
|
38
|
-
## Architecture
|
|
39
|
-
|
|
40
|
-
```
|
|
41
|
-
OkNodes (TypeScript)
|
|
42
|
-
| ArrayBuffer / TypedArray
|
|
43
|
-
v
|
|
44
|
-
OkGeometryCore (Rust -> WASM)
|
|
45
|
-
|- math/ Vector3, Matrix4, Quaternion, Plane, Ray, AABB
|
|
46
|
-
|- curves/ Line, Arc, Circle, Polyline, Polycurve
|
|
47
|
-
|- intersection/ Curve-curve intersections
|
|
48
|
-
|- mesh/ Half-edge data structure, primitives
|
|
49
|
-
|- ops/ Boolean, extrude, loft, sweep, subdivide, bevel...
|
|
50
|
-
|- spatial/ BVH, ray casting, closest point
|
|
51
|
-
|- io/ OBJ format
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
The engine uses an **index-based half-edge mesh** data structure for cache-friendly traversal and easy WASM serialization. All data crosses the WASM boundary as flat typed arrays to minimize overhead.
|
|
55
|
-
|
|
56
|
-
## Building
|
|
57
|
-
|
|
58
|
-
### Prerequisites
|
|
59
|
-
- [Rust](https://rustup.rs/)
|
|
60
|
-
- [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/)
|
|
61
|
-
|
|
62
|
-
### Build WASM
|
|
63
|
-
```bash
|
|
64
|
-
wasm-pack build --target web
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### Run tests
|
|
68
|
-
```bash
|
|
69
|
-
cargo test
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### Viewer
|
|
73
|
-
The `okgeometry-viewer/` directory contains interactive Three.js viewers for visual verification:
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
# Serve the viewer directory with any static file server, e.g.:
|
|
77
|
-
npx serve okgeometry-viewer
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
Available viewers:
|
|
81
|
-
- **Curves** - Line, Circle, Arc, Polyline visualization
|
|
82
|
-
- **Intersections** - All curve-curve intersection scenarios
|
|
83
|
-
- **Meshes** - Primitives, wireframe, OBJ import/export
|
|
84
|
-
- **Booleans** - Union, intersection, subtraction with position controls
|
|
85
|
-
- **Subdivision** - Catmull-Clark and Loop with iteration slider
|
|
86
|
-
- **Ray Casting** - Interactive ray cast and closest point queries
|
|
87
|
-
- **Bevel / Chamfer** - Flat bevel on box, cylinder, prism
|
|
88
|
-
|
|
89
|
-
## Dependencies
|
|
90
|
-
|
|
91
|
-
| Crate | Purpose |
|
|
92
|
-
|-------|---------|
|
|
93
|
-
| `wasm-bindgen` | Rust-WASM interop |
|
|
94
|
-
| `js-sys` / `web-sys` | Browser API access |
|
|
95
|
-
| `robust` | Exact geometric predicates (orient2d, orient3d, incircle) |
|
|
96
|
-
| `spade` | Constrained Delaunay triangulation |
|
|
97
|
-
| `serde` | Serialization |
|
|
98
|
-
| `nalgebra` | Linear algebra (optional feature) |
|
|
99
|
-
|
|
100
|
-
## License
|
|
101
|
-
|
|
102
|
-
Copyright Mostafa El Ayoubi / Orkestra Online. All rights reserved.
|
|
103
|
-
|
|
104
|
-
Boolean-kernel structural ports inspired by Manifold are tracked in [`MANIFOLD_PORT_ATTRIBUTION.md`](./MANIFOLD_PORT_ATTRIBUTION.md).
|