okgeometry-api 0.2.12 → 0.2.14

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 (73) hide show
  1. package/dist/Arc.d.ts +52 -2
  2. package/dist/Arc.d.ts.map +1 -1
  3. package/dist/Arc.js +50 -1
  4. package/dist/Arc.js.map +1 -1
  5. package/dist/BufferCodec.d.ts +118 -0
  6. package/dist/BufferCodec.d.ts.map +1 -0
  7. package/dist/BufferCodec.js +171 -0
  8. package/dist/BufferCodec.js.map +1 -0
  9. package/dist/Circle.d.ts +66 -12
  10. package/dist/Circle.d.ts.map +1 -1
  11. package/dist/Circle.js +64 -8
  12. package/dist/Circle.js.map +1 -1
  13. package/dist/Line.d.ts +53 -1
  14. package/dist/Line.d.ts.map +1 -1
  15. package/dist/Line.js +51 -0
  16. package/dist/Line.js.map +1 -1
  17. package/dist/Mesh.d.ts +167 -20
  18. package/dist/Mesh.d.ts.map +1 -1
  19. package/dist/Mesh.js +187 -70
  20. package/dist/Mesh.js.map +1 -1
  21. package/dist/NurbsCurve.d.ts +78 -8
  22. package/dist/NurbsCurve.d.ts.map +1 -1
  23. package/dist/NurbsCurve.js +76 -7
  24. package/dist/NurbsCurve.js.map +1 -1
  25. package/dist/NurbsSurface.d.ts +64 -14
  26. package/dist/NurbsSurface.d.ts.map +1 -1
  27. package/dist/NurbsSurface.js +65 -25
  28. package/dist/NurbsSurface.js.map +1 -1
  29. package/dist/Point.d.ts +65 -12
  30. package/dist/Point.d.ts.map +1 -1
  31. package/dist/Point.js +61 -2
  32. package/dist/Point.js.map +1 -1
  33. package/dist/PolyCurve.d.ts +4 -6
  34. package/dist/PolyCurve.d.ts.map +1 -1
  35. package/dist/PolyCurve.js +31 -16
  36. package/dist/PolyCurve.js.map +1 -1
  37. package/dist/Polygon.d.ts +35 -3
  38. package/dist/Polygon.d.ts.map +1 -1
  39. package/dist/Polygon.js +33 -2
  40. package/dist/Polygon.js.map +1 -1
  41. package/dist/Polyline.d.ts +67 -2
  42. package/dist/Polyline.d.ts.map +1 -1
  43. package/dist/Polyline.js +86 -13
  44. package/dist/Polyline.js.map +1 -1
  45. package/dist/Ray.d.ts +45 -0
  46. package/dist/Ray.d.ts.map +1 -0
  47. package/dist/Ray.js +68 -0
  48. package/dist/Ray.js.map +1 -0
  49. package/dist/Vec3.d.ts +76 -0
  50. package/dist/Vec3.d.ts.map +1 -1
  51. package/dist/Vec3.js +76 -0
  52. package/dist/Vec3.js.map +1 -1
  53. package/dist/engine.d.ts.map +1 -1
  54. package/dist/engine.js +3 -2
  55. package/dist/engine.js.map +1 -1
  56. package/dist/index.d.ts +6 -4
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +8 -2
  59. package/dist/index.js.map +1 -1
  60. package/dist/types.d.ts +67 -0
  61. package/dist/types.d.ts.map +1 -0
  62. package/dist/types.js +7 -0
  63. package/dist/types.js.map +1 -0
  64. package/dist/wasm-base64.d.ts +1 -1
  65. package/dist/wasm-base64.d.ts.map +1 -1
  66. package/dist/wasm-base64.js +1 -1
  67. package/dist/wasm-base64.js.map +1 -1
  68. package/package.json +1 -1
  69. package/wasm/okgeometrycore.d.ts +27 -0
  70. package/wasm/okgeometrycore.js +1 -1
  71. package/wasm/okgeometrycore_bg.js +81 -0
  72. package/wasm/okgeometrycore_bg.wasm +0 -0
  73. package/wasm/okgeometrycore_bg.wasm.d.ts +4 -0
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Shared type definitions for OkGeometry API.
3
+ * This module consolidates types used across multiple files.
4
+ * @module types
5
+ */
6
+ import type { Line } from "./Line.js";
7
+ import type { Circle } from "./Circle.js";
8
+ import type { Arc } from "./Arc.js";
9
+ import type { Polyline } from "./Polyline.js";
10
+ import type { Polygon } from "./Polygon.js";
11
+ import type { NurbsCurve } from "./NurbsCurve.js";
12
+ import type { PolyCurve } from "./PolyCurve.js";
13
+ import type { Vec3 } from "./Vec3.js";
14
+ /**
15
+ * Any curve type that sweep/loft operations can accept.
16
+ * All these types support pointAt(), sample(), and length() methods.
17
+ */
18
+ export type SweepableCurve = Line | Circle | Arc | Polyline | Polygon | NurbsCurve | PolyCurve;
19
+ /**
20
+ * Alias for SweepableCurve - any curve type that loft operations can accept.
21
+ * Provided for semantic clarity in loft-specific contexts.
22
+ */
23
+ export type LoftableCurve = SweepableCurve;
24
+ /**
25
+ * Rotation axis specification.
26
+ * - Vec3: Rotation around axis through origin
27
+ * - Line: Rotation around arbitrary axis in space
28
+ */
29
+ export type RotationAxis = Vec3 | Line;
30
+ /**
31
+ * Curve segment types used in PolyCurve.
32
+ * A PolyCurve is composed of sequential Line and Arc segments.
33
+ */
34
+ export type CurveSegment = Line | Arc;
35
+ /**
36
+ * Curve type codes for WASM buffer encoding.
37
+ * Used by Mesh.encodeCurve() for sweep_curves WASM function.
38
+ *
39
+ * Buffer formats:
40
+ * - Line (0): [0, sx,sy,sz, ex,ey,ez] - 7 floats
41
+ * - Circle (1): [1, cx,cy,cz, nx,ny,nz, r, ux?,uy?,uz?] - 8 or 11 floats
42
+ * - Arc (2): [2, cx,cy,cz, nx,ny,nz, r, startAngle, endAngle] - 10 floats
43
+ * - Polyline (3): [3, count, x1,y1,z1, ...] - 2 + count*3 floats
44
+ * - NurbsCurve (4): [4, degree, count, xyz..., weights..., knots...]
45
+ * - PolyCurve (5): [5, numSegs, segType, segData..., ...]
46
+ */
47
+ export declare const enum CurveTypeCode {
48
+ Line = 0,
49
+ Circle = 1,
50
+ Arc = 2,
51
+ Polyline = 3,
52
+ NurbsCurve = 4,
53
+ PolyCurve = 5
54
+ }
55
+ /**
56
+ * Segment type codes for PolyCurve WASM encoding.
57
+ * Used when encoding/decoding PolyCurve segments.
58
+ *
59
+ * Buffer formats:
60
+ * - Line (0): [sx,sy,sz, ex,ey,ez] - 6 floats
61
+ * - Arc (1): [cx,cy,cz, nx,ny,nz, r, startAngle, endAngle] - 9 floats
62
+ */
63
+ export declare const enum SegmentTypeCode {
64
+ Line = 0,
65
+ Arc = 1
66
+ }
67
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAItC;;;GAGG;AACH,MAAM,MAAM,cAAc,GACtB,IAAI,GACJ,MAAM,GACN,GAAG,GACH,QAAQ,GACR,OAAO,GACP,UAAU,GACV,SAAS,CAAC;AAEd;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC;AAE3C;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,CAAC;AAEvC;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,GAAG,CAAC;AAItC;;;;;;;;;;;GAWG;AACH,0BAAkB,aAAa;IAC7B,IAAI,IAAI;IACR,MAAM,IAAI;IACV,GAAG,IAAI;IACP,QAAQ,IAAI;IACZ,UAAU,IAAI;IACd,SAAS,IAAI;CACd;AAED;;;;;;;GAOG;AACH,0BAAkB,eAAe;IAC/B,IAAI,IAAI;IACR,GAAG,IAAI;CACR"}
package/dist/types.js ADDED
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Shared type definitions for OkGeometry API.
3
+ * This module consolidates types used across multiple files.
4
+ * @module types
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}