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.
Files changed (52) hide show
  1. package/dist/Arc.js +1 -1
  2. package/dist/Arc.js.map +1 -1
  3. package/dist/Circle.js +1 -1
  4. package/dist/Circle.js.map +1 -1
  5. package/dist/Line.js +1 -1
  6. package/dist/Line.js.map +1 -1
  7. package/dist/Mesh.d.ts +104 -7
  8. package/dist/Mesh.d.ts.map +1 -1
  9. package/dist/Mesh.js +106 -8
  10. package/dist/Mesh.js.map +1 -1
  11. package/dist/NurbsCurve.js +1 -1
  12. package/dist/NurbsCurve.js.map +1 -1
  13. package/dist/NurbsSurface.d.ts.map +1 -1
  14. package/dist/NurbsSurface.js +10 -7
  15. package/dist/NurbsSurface.js.map +1 -1
  16. package/dist/PolyCurve.js +1 -1
  17. package/dist/PolyCurve.js.map +1 -1
  18. package/dist/Polyline.js +1 -1
  19. package/dist/Polyline.js.map +1 -1
  20. package/dist/Ray.js +1 -1
  21. package/dist/Ray.js.map +1 -1
  22. package/dist/engine.d.ts.map +1 -1
  23. package/dist/engine.js +1 -3
  24. package/dist/engine.js.map +1 -1
  25. package/dist/index.d.ts +1 -1
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js.map +1 -1
  28. package/dist/wasm-base64.d.ts +1 -1
  29. package/dist/wasm-base64.d.ts.map +1 -1
  30. package/dist/wasm-base64.js +1 -1
  31. package/dist/wasm-base64.js.map +1 -1
  32. package/package.json +7 -5
  33. package/src/Arc.ts +117 -117
  34. package/src/Circle.ts +153 -153
  35. package/src/Line.ts +144 -144
  36. package/src/Mesh.ts +663 -444
  37. package/src/NurbsCurve.ts +240 -240
  38. package/src/NurbsSurface.ts +249 -245
  39. package/src/PolyCurve.ts +306 -306
  40. package/src/Polyline.ts +153 -153
  41. package/src/Ray.ts +90 -90
  42. package/src/engine.ts +9 -11
  43. package/src/index.ts +6 -0
  44. package/src/wasm-base64.ts +1 -1
  45. package/wasm/README.md +0 -104
  46. package/wasm/okgeometrycore.d.ts +0 -754
  47. package/wasm/okgeometrycore.js +0 -2005
  48. package/wasm/okgeometrycore_bg.d.ts +0 -3
  49. package/wasm/okgeometrycore_bg.js +0 -1686
  50. package/wasm/okgeometrycore_bg.wasm +0 -0
  51. package/wasm/okgeometrycore_bg.wasm.d.ts +0 -100
  52. 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).