opengeometry 2.0.17 → 3.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.
Files changed (156) hide show
  1. package/LICENSE.md +373 -0
  2. package/README.md +187 -128
  3. package/body-registry-MbAD6Hyq.js +3159 -0
  4. package/body-registry-MbAD6Hyq.js.map +1 -0
  5. package/index.d.ts +18 -115
  6. package/index.js +1170 -11687
  7. package/index.js.map +1 -1
  8. package/opengeometry/pkg/opengeometry.d.ts +144 -1304
  9. package/opengeometry/pkg/opengeometry.js +1316 -5803
  10. package/opengeometry/pkg/opengeometry_bg.wasm +0 -0
  11. package/opengeometry/pkg/opengeometry_bg.wasm.d.ts +62 -458
  12. package/opengeometry_bg.wasm +0 -0
  13. package/opengeometry_bg.wasm.d.ts +62 -458
  14. package/package.json +54 -34
  15. package/src/bodies/body-factory.d.ts +3 -0
  16. package/src/bodies/body-options.d.ts +19 -0
  17. package/src/bodies/body-placement.d.ts +10 -0
  18. package/src/bodies/body-registry.d.ts +3 -0
  19. package/src/bodies/body.d.ts +71 -0
  20. package/src/bodies/display-clone.d.ts +10 -0
  21. package/src/bodies/node-methods.d.ts +30 -0
  22. package/src/bodies/sheet.d.ts +14 -0
  23. package/src/bodies/solid.d.ts +23 -0
  24. package/src/bodies/system-assembly.d.ts +26 -0
  25. package/src/bodies/wire.d.ts +14 -0
  26. package/src/constants/index.d.ts +4 -0
  27. package/src/constants/operations.d.ts +58 -0
  28. package/src/constants/primitives.d.ts +69 -0
  29. package/src/constants/regions.d.ts +1 -0
  30. package/src/constants/transforms.d.ts +4 -0
  31. package/src/dto/boolean-report.d.ts +24 -0
  32. package/src/dto/bounds.d.ts +1 -0
  33. package/src/dto/brep.d.ts +99 -0
  34. package/src/dto/change-set.d.ts +13 -0
  35. package/src/dto/creation.d.ts +3 -0
  36. package/src/dto/display-buffers.d.ts +14 -0
  37. package/src/dto/events.d.ts +2 -0
  38. package/src/{export/analytic-ifc.d.ts → dto/ifc-body.d.ts} +16 -18
  39. package/src/dto/mark-stats.d.ts +4 -0
  40. package/src/dto/measure.d.ts +16 -0
  41. package/src/dto/mirror.d.ts +4 -0
  42. package/src/dto/node-info.d.ts +11 -0
  43. package/src/dto/pick-result.d.ts +6 -0
  44. package/src/dto/placement.d.ts +6 -0
  45. package/src/dto/primitives.d.ts +77 -0
  46. package/src/dto/regions.d.ts +42 -0
  47. package/src/dto/step-export.d.ts +42 -0
  48. package/src/errors.d.ts +20 -0
  49. package/src/export/export-step.d.ts +10 -0
  50. package/src/export/ifc-body.d.ts +4 -0
  51. package/src/kernel/kernel-errors.d.ts +5 -0
  52. package/src/kernel/kernel-loader.d.ts +5 -0
  53. package/src/kernel/kernel-session.d.ts +2 -0
  54. package/src/limits.d.ts +12 -0
  55. package/src/marks/limbo.d.ts +6 -0
  56. package/src/marks/og-mark.d.ts +10 -0
  57. package/src/marks/transaction.d.ts +3 -0
  58. package/src/opengeometry.d.ts +69 -0
  59. package/src/operations/offsets.d.ts +5 -0
  60. package/src/operations/regions.d.ts +4 -0
  61. package/src/picking/pick-targets.d.ts +6 -0
  62. package/src/picking/resolve-hit.d.ts +3 -0
  63. package/src/rendering/deferred.d.ts +7 -0
  64. package/src/rendering/geometry/geometry-scheduler.d.ts +12 -0
  65. package/src/rendering/geometry/host-group.d.ts +10 -0
  66. package/src/rendering/geometry/render-pass.d.ts +8 -0
  67. package/src/rendering/geometry/settle.d.ts +10 -0
  68. package/src/rendering/inline-backend.d.ts +14 -0
  69. package/src/rendering/lod/body-size.d.ts +11 -0
  70. package/src/rendering/lod/camera-observer.d.ts +2 -0
  71. package/src/rendering/lod/deflection.d.ts +2 -0
  72. package/src/rendering/lod/display-bounds.d.ts +4 -0
  73. package/src/rendering/lod/displayed.d.ts +7 -0
  74. package/src/rendering/lod/host-drawn.d.ts +5 -0
  75. package/src/rendering/lod/host-groups.d.ts +28 -0
  76. package/src/rendering/lod/lod-controller.d.ts +75 -0
  77. package/src/rendering/lod/screen-metrics.d.ts +2 -0
  78. package/src/rendering/materials/material-pool.d.ts +12 -0
  79. package/src/rendering/materials/ref-counted-pool.d.ts +12 -0
  80. package/src/rendering/provider.d.ts +19 -0
  81. package/src/rendering/records/geometry-record.d.ts +21 -0
  82. package/src/rendering/records/record-pool.d.ts +29 -0
  83. package/src/rendering/records/validate-display-buffers.d.ts +2 -0
  84. package/src/rendering/tessellation-worker.d.ts +1 -0
  85. package/src/rendering/worker/job-queue.d.ts +8 -0
  86. package/src/rendering/worker/message-guards.d.ts +9 -0
  87. package/src/rendering/worker/snapshot-cache.d.ts +10 -0
  88. package/src/rendering/worker-backend.d.ts +44 -0
  89. package/src/rendering/worker-protocol.d.ts +52 -0
  90. package/src/runtime/create-runtime.d.ts +7 -0
  91. package/src/runtime/event-bus.d.ts +3 -0
  92. package/src/runtime/reset.d.ts +1 -0
  93. package/src/runtime/runtime-state.d.ts +68 -0
  94. package/src/testing/internals.d.ts +18 -0
  95. package/src/world-graph/codec.d.ts +45 -0
  96. package/src/world-graph/world-graph-client.d.ts +13 -0
  97. package/tessellation-worker.js +634 -0
  98. package/tessellation-worker.js.map +1 -0
  99. package/testing.d.ts +1 -0
  100. package/testing.js +87 -0
  101. package/testing.js.map +1 -0
  102. package/analytic-worker.js +0 -90
  103. package/src/base-types.d.ts +0 -13
  104. package/src/editor/freeform.d.ts +0 -91
  105. package/src/editor/index.d.ts +0 -6
  106. package/src/editor/parametric.d.ts +0 -15
  107. package/src/editor/types.d.ts +0 -223
  108. package/src/examples/booleans.d.ts +0 -24
  109. package/src/examples/editor-modes.d.ts +0 -20
  110. package/src/examples/index.d.ts +0 -11
  111. package/src/examples/offset-ring-variable.d.ts +0 -13
  112. package/src/examples/offset.d.ts +0 -18
  113. package/src/examples/primitives.d.ts +0 -16
  114. package/src/examples/ribbon-from-offsets.d.ts +0 -33
  115. package/src/examples/shapes.d.ts +0 -20
  116. package/src/examples/sweep.d.ts +0 -9
  117. package/src/freeform/geometry.d.ts +0 -82
  118. package/src/freeform/index.d.ts +0 -5
  119. package/src/freeform/types.d.ts +0 -36
  120. package/src/markup/spotMarker.d.ts +0 -4
  121. package/src/operations/analytic-errors.d.ts +0 -8
  122. package/src/operations/boolean-regions.d.ts +0 -20
  123. package/src/operations/boolean.d.ts +0 -16
  124. package/src/operations/editor/freeform.d.ts +0 -1
  125. package/src/operations/editor/index.d.ts +0 -1
  126. package/src/operations/editor/parametric.d.ts +0 -1
  127. package/src/operations/editor/types.d.ts +0 -1
  128. package/src/operations/extrude.d.ts +0 -9
  129. package/src/operations/index.d.ts +0 -9
  130. package/src/operations/loft.d.ts +0 -13
  131. package/src/operations/offset-regions.d.ts +0 -76
  132. package/src/primitives/analytic-curve.d.ts +0 -42
  133. package/src/primitives/arc.d.ts +0 -36
  134. package/src/primitives/curve.d.ts +0 -64
  135. package/src/primitives/elliptical_arc.d.ts +0 -38
  136. package/src/primitives/index.d.ts +0 -9
  137. package/src/primitives/line.d.ts +0 -77
  138. package/src/primitives/polyline.d.ts +0 -78
  139. package/src/primitives/rectangle.d.ts +0 -72
  140. package/src/rendering/analytic-lod.d.ts +0 -32
  141. package/src/rendering/analytic-tessellation.d.ts +0 -32
  142. package/src/shapes/analytic-pattern.d.ts +0 -36
  143. package/src/shapes/analytic-solid.d.ts +0 -304
  144. package/src/shapes/cuboid.d.ts +0 -62
  145. package/src/shapes/cylinder.d.ts +0 -36
  146. package/src/shapes/index.d.ts +0 -11
  147. package/src/shapes/opening.d.ts +0 -31
  148. package/src/shapes/outline-utils.d.ts +0 -35
  149. package/src/shapes/polygon.d.ts +0 -102
  150. package/src/shapes/solid.d.ts +0 -108
  151. package/src/shapes/sphere.d.ts +0 -27
  152. package/src/shapes/sweep.d.ts +0 -76
  153. package/src/shapes/wedge.d.ts +0 -75
  154. package/src/utils/event.d.ts +0 -29
  155. package/src/utils/randomizer.d.ts +0 -1
  156. package/src/world/world-graph.d.ts +0 -112
package/package.json CHANGED
@@ -1,54 +1,74 @@
1
1
  {
2
2
  "name": "opengeometry",
3
- "version": "2.0.17",
4
- "description": "CAD geometry kernel for the web built with Rust, WebAssembly, and Three.js.",
5
- "author": "Vishwajeet Vinayak Mane",
6
- "license": "MPL-2.0",
7
- "type": "module",
8
- "main": "./index.js",
9
- "types": "./index.d.ts",
10
- "exports": {
11
- ".": {
12
- "types": "./index.d.ts",
13
- "import": "./index.js",
14
- "default": "./index.js"
15
- },
16
- "./opengeometry/pkg/opengeometry": {
17
- "types": "./opengeometry/pkg/opengeometry.d.ts",
18
- "import": "./opengeometry/pkg/opengeometry.js",
19
- "default": "./opengeometry/pkg/opengeometry.js"
20
- },
21
- "./opengeometry_bg.wasm": "./opengeometry_bg.wasm",
22
- "./analytic-worker.js": "./analytic-worker.js",
23
- "./package.json": "./package.json"
24
- },
3
+ "version": "3.0.0",
4
+ "description": "Open-source CAD kernel for the web and Node.js: exact B-rep solids, booleans, extrude, sweep, revolve, shell and STEP export, in Rust and WebAssembly with a TypeScript SDK for Three.js. For configurators, mechanical parts, buildings, robotics and AI agents.",
25
5
  "keywords": [
26
6
  "opengeometry",
27
7
  "cad",
28
8
  "cad-kernel",
29
- "browser-cad",
9
+ "geometry-kernel",
10
+ "brep",
11
+ "b-rep",
12
+ "solid-modeling",
13
+ "parametric",
14
+ "parametric-modeling",
15
+ "procedural-modeling",
16
+ "boolean",
17
+ "boolean-operations",
18
+ "csg",
19
+ "extrude",
20
+ "sweep",
21
+ "revolve",
22
+ "shell",
23
+ "step",
24
+ "step-export",
25
+ "stp",
30
26
  "threejs",
31
- "three.js",
32
- "geometry",
27
+ "three",
33
28
  "webassembly",
34
29
  "wasm",
30
+ "rust",
31
+ "typescript",
32
+ "browser",
33
+ "browser-cad",
34
+ "nodejs",
35
+ "3d",
36
+ "configurator",
37
+ "product-configurator",
38
+ "mechanical-design",
39
+ "manufacturing",
40
+ "architecture",
41
+ "aec",
35
42
  "ifc",
36
- "step",
37
- "stl",
38
- "parametric-modeling"
43
+ "robotics",
44
+ "ai-cad",
45
+ "text-to-cad",
46
+ "ai-agents",
47
+ "llm"
39
48
  ],
49
+ "homepage": "https://opengeometry.io?utm_source=npm",
40
50
  "repository": {
41
51
  "type": "git",
42
- "url": "git+https://github.com/OpenGeometry-io/OpenGeometry.git"
52
+ "url": "git+https://github.com/OpenGeometry-io/OpenGeometry.git",
53
+ "directory": "main"
43
54
  },
44
55
  "bugs": {
45
56
  "url": "https://github.com/OpenGeometry-io/OpenGeometry/issues"
46
57
  },
47
- "homepage": "https://docs.opengeometry.io",
48
- "peerDependencies": {
49
- "three": ">=0.168.0"
58
+ "license": "MPL-2.0",
59
+ "type": "module",
60
+ "main": "./index.js",
61
+ "types": "./index.d.ts",
62
+ "exports": {
63
+ ".": {
64
+ "types": "./index.d.ts",
65
+ "import": "./index.js"
66
+ },
67
+ "./tessellation-worker.js": "./tessellation-worker.js",
68
+ "./opengeometry_bg.wasm": "./opengeometry_bg.wasm",
69
+ "./package.json": "./package.json"
50
70
  },
51
- "dependencies": {
52
- "uuid": "^10.0.0"
71
+ "peerDependencies": {
72
+ "three": ">=0.168.0 <0.185.0"
53
73
  }
54
74
  }
@@ -0,0 +1,3 @@
1
+ import type { BodyOptions } from './body-options.js';
2
+ export declare function existingParams(ogId: string): Record<string, unknown>;
3
+ export declare function createBody(kind: string, params: Record<string, unknown>, options: BodyOptions, bodyType: 'Wire' | 'Sheet' | 'Solid'): string;
@@ -0,0 +1,19 @@
1
+ import type { SystemAssembly } from './system-assembly.js';
2
+ export type BodyOptions = {
3
+ ogId?: string;
4
+ parent?: SystemAssembly;
5
+ plane?: {
6
+ origin?: [number, number, number];
7
+ normal?: [number, number, number];
8
+ xDirection?: [number, number, number];
9
+ };
10
+ appearance?: Partial<Appearance>;
11
+ };
12
+ export type Appearance = {
13
+ color: number;
14
+ opacity: number;
15
+ outline: boolean;
16
+ pickOutline: boolean;
17
+ deflection?: number;
18
+ smoothAngle?: number;
19
+ };
@@ -0,0 +1,10 @@
1
+ import * as THREE from 'three';
2
+ export type PoseMemory = {
3
+ position: THREE.Vector3;
4
+ quaternion: THREE.Quaternion;
5
+ scale: THREE.Vector3;
6
+ parentWorld: THREE.Matrix4;
7
+ };
8
+ export declare function poseMemory(): PoseMemory;
9
+ export declare function derivePose(memory: PoseMemory, object: THREE.Object3D): void;
10
+ export declare function keepPose(memory: PoseMemory, object: THREE.Object3D, ogId: string): void;
@@ -0,0 +1,3 @@
1
+ import type { Body } from './body.js';
2
+ export declare function register(body: Body): void;
3
+ export declare function unregister(body: Body): void;
@@ -0,0 +1,71 @@
1
+ import * as THREE from 'three';
2
+ import type { Brep } from '../dto/brep.js';
3
+ import type { Measure, Validity } from '../dto/measure.js';
4
+ import type { MirrorPlane } from '../dto/mirror.js';
5
+ import type { NodeInfo } from '../dto/node-info.js';
6
+ import type { Placement } from '../dto/placement.js';
7
+ import type { GeometryRecord } from '../rendering/records/geometry-record.js';
8
+ import type { Appearance, BodyOptions } from './body-options.js';
9
+ import type { PointClassification } from './node-methods.js';
10
+ import type { SystemAssembly } from './system-assembly.js';
11
+ export type BodyEventMap = THREE.Object3DEventMap & {
12
+ geometrychanged: object;
13
+ placementchanged: object;
14
+ };
15
+ export declare abstract class Body extends THREE.Group<BodyEventMap> {
16
+ readonly ogId: string;
17
+ readonly handle: number;
18
+ readonly generation: number;
19
+ readonly surface: THREE.Mesh;
20
+ readonly outline: THREE.LineSegments;
21
+ readonly bodyType: 'Wire' | 'Sheet' | 'Solid';
22
+ appearance: Appearance;
23
+ lastInfo: NodeInfo;
24
+ record?: GeometryRecord;
25
+ inLimbo: boolean;
26
+ private surfaceKey;
27
+ private lineKey;
28
+ private readonly epoch;
29
+ private readonly pose;
30
+ protected constructor(ogId: string, bodyType: 'Wire' | 'Sheet' | 'Solid', options: BodyOptions);
31
+ protected check(call: string): void;
32
+ applyWorldMatrix(values: ArrayLike<number>): void;
33
+ updateMatrixWorld(force?: boolean): void;
34
+ swapReadyRecord(): void;
35
+ install(record: GeometryRecord): void;
36
+ setAppearance(partial: Partial<Appearance>): void;
37
+ transform(kind: string, params: Record<string, unknown>): void;
38
+ getPlacement(): Placement;
39
+ getWorldPlacement(): Placement;
40
+ addChild(children: (Body | SystemAssembly)[], options?: {
41
+ keepWorld?: boolean;
42
+ }): void;
43
+ removeChild(child: Body | SystemAssembly, options?: {
44
+ keepWorld?: boolean;
45
+ }): void;
46
+ getChildren(): string[];
47
+ getParent(): string | null;
48
+ getBounds(): [number, number, number, number, number, number] | null;
49
+ getBrep(): Brep;
50
+ getWorldBrep(): Brep;
51
+ faceNormalAt(faceId: number, point: [number, number, number]): [number, number, number];
52
+ classifyPoint(point: [number, number, number]): PointClassification;
53
+ measure(options?: {
54
+ deflection?: number;
55
+ }): Measure;
56
+ mirror(plane: MirrorPlane, options?: {
57
+ instances?: 'all';
58
+ }): void;
59
+ validity(): Validity;
60
+ getInstanceCount(): number;
61
+ makeUnique(): void;
62
+ rebuild(kind: string, params: Record<string, unknown>, options?: {
63
+ instances?: 'all';
64
+ }): void;
65
+ hideForDispose(): void;
66
+ reviveIfRestored(): void;
67
+ finalize(): void;
68
+ dispose(): void;
69
+ clone(): this;
70
+ copy(): this;
71
+ }
@@ -0,0 +1,10 @@
1
+ import * as THREE from 'three';
2
+ import type { GeometryRecord } from '../rendering/records/geometry-record.js';
3
+ export declare class DisplayClone extends THREE.Group {
4
+ readonly sourceRecord: GeometryRecord | undefined;
5
+ readonly mesh: THREE.Mesh<THREE.BufferGeometry, THREE.Material>;
6
+ readonly lines: THREE.LineSegments<THREE.BufferGeometry, THREE.Material>;
7
+ constructor(sourceRecord: GeometryRecord | undefined, mesh: THREE.Mesh<THREE.BufferGeometry, THREE.Material>, lines: THREE.LineSegments<THREE.BufferGeometry, THREE.Material>);
8
+ dispose(): void;
9
+ clone(): this;
10
+ }
@@ -0,0 +1,30 @@
1
+ import type { Bounds } from '../dto/bounds.js';
2
+ import type { Brep } from '../dto/brep.js';
3
+ import type { Measure, Validity } from '../dto/measure.js';
4
+ import type { MirrorPlane } from '../dto/mirror.js';
5
+ import type { Placement } from '../dto/placement.js';
6
+ export declare function checkNode(label: string, noun: string, epoch: number, handle: number, generation: number): void;
7
+ export declare function getPlacement(owner: string, ogId: string): Placement;
8
+ export declare function getWorldPlacement(owner: string, ogId: string): Placement;
9
+ export declare function transformNode(owner: string, ogId: string, kind: string, params: Record<string, unknown>): void;
10
+ export declare function addChild(owner: string, ogId: string, children: {
11
+ ogId: string;
12
+ }[], keepWorld: boolean): void;
13
+ export declare function removeChild(owner: string, ogId: string, childId: string, keepWorld: boolean): void;
14
+ export declare function getChildren(owner: string, ogId: string): string[];
15
+ export declare function getParent(owner: string, ogId: string): string | null;
16
+ export declare function getBounds(owner: string, ogId: string): Bounds | null;
17
+ export declare function localBounds(label: string, ogId: string): Bounds | null;
18
+ export declare function getBrep(owner: string, ogId: string): Brep;
19
+ export declare function getWorldBrep(owner: string, ogId: string): Brep;
20
+ export declare function faceNormalAt(owner: string, ogId: string, faceId: number, point: [number, number, number]): [number, number, number];
21
+ export type PointClassification = 'Inside' | 'Outside' | 'Boundary' | 'Unknown';
22
+ export declare function classifyPoint(owner: string, ogId: string, point: [number, number, number]): PointClassification;
23
+ export declare function getInstanceCount(owner: string, ogId: string): number;
24
+ export declare function measure(owner: string, ogId: string, options: {
25
+ deflection?: number;
26
+ }): Measure;
27
+ export declare function validity(owner: string, ogId: string): Validity;
28
+ export declare function mirror(owner: string, ogId: string, plane: MirrorPlane, options: {
29
+ instances?: 'all';
30
+ }): void;
@@ -0,0 +1,14 @@
1
+ import { Body } from './body.js';
2
+ import type { BodyOptions } from './body-options.js';
3
+ import type { SystemAssembly } from './system-assembly.js';
4
+ export declare class Sheet extends Body {
5
+ constructor(kind: string, params: Record<string, unknown>, options?: BodyOptions);
6
+ instance(options?: {
7
+ ogId?: string;
8
+ parent?: SystemAssembly;
9
+ }): Sheet;
10
+ duplicate(options?: {
11
+ ogId?: string;
12
+ parent?: SystemAssembly;
13
+ }): Sheet;
14
+ }
@@ -0,0 +1,23 @@
1
+ import type { ShapeReport } from '../dto/boolean-report.js';
2
+ import { Body } from './body.js';
3
+ import type { BodyOptions } from './body-options.js';
4
+ import type { SystemAssembly } from './system-assembly.js';
5
+ export declare class Solid extends Body {
6
+ constructor(kind: string, params: Record<string, unknown>, options?: BodyOptions);
7
+ operate(kind: string, options: {
8
+ tools: Solid[];
9
+ instances?: 'all';
10
+ } | {
11
+ thickness: number;
12
+ instances?: 'all';
13
+ }): void;
14
+ getReport(): ShapeReport | null;
15
+ instance(options?: {
16
+ ogId?: string;
17
+ parent?: SystemAssembly;
18
+ }): Solid;
19
+ duplicate(options?: {
20
+ ogId?: string;
21
+ parent?: SystemAssembly;
22
+ }): Solid;
23
+ }
@@ -0,0 +1,26 @@
1
+ import type { Placement } from '../dto/placement.js';
2
+ import type { Body } from './body.js';
3
+ export declare class SystemAssembly {
4
+ readonly ogId: string;
5
+ readonly handle: number;
6
+ readonly generation: number;
7
+ private readonly epoch;
8
+ constructor(options?: {
9
+ ogId?: string;
10
+ parent?: SystemAssembly;
11
+ });
12
+ protected check(call: string): void;
13
+ transform(kind: string, params: Record<string, unknown>): void;
14
+ getPlacement(): Placement;
15
+ getWorldPlacement(): Placement;
16
+ addChild(children: (Body | SystemAssembly)[], options?: {
17
+ keepWorld?: boolean;
18
+ }): void;
19
+ removeChild(child: Body | SystemAssembly, options?: {
20
+ keepWorld?: boolean;
21
+ }): void;
22
+ getChildren(): string[];
23
+ getParent(): string | null;
24
+ getBounds(): [number, number, number, number, number, number] | null;
25
+ dispose(): void;
26
+ }
@@ -0,0 +1,14 @@
1
+ import { Body } from './body.js';
2
+ import type { BodyOptions } from './body-options.js';
3
+ import type { SystemAssembly } from './system-assembly.js';
4
+ export declare class Wire extends Body {
5
+ constructor(kind: string, params: Record<string, unknown>, options?: BodyOptions);
6
+ instance(options?: {
7
+ ogId?: string;
8
+ parent?: SystemAssembly;
9
+ }): Wire;
10
+ duplicate(options?: {
11
+ ogId?: string;
12
+ parent?: SystemAssembly;
13
+ }): Wire;
14
+ }
@@ -0,0 +1,4 @@
1
+ export * from './primitives.js';
2
+ export * from './operations.js';
3
+ export * from './transforms.js';
4
+ export * from './regions.js';
@@ -0,0 +1,58 @@
1
+ export declare const OG_OPERATION_EXTRUDE: "Extrude";
2
+ export declare const OG_OPERATION_SWEEP: "Sweep";
3
+ export declare const OG_OPERATION_REVOLVE: "Revolve";
4
+ export declare const OG_OPERATION_UNION: "Union";
5
+ export declare const OG_OPERATION_SUBTRACT: "Subtract";
6
+ export declare const OG_OPERATION_INTERSECT: "Intersect";
7
+ export declare const OG_OPERATION_SHELL: "Shell";
8
+ export declare const OG_OPERATION_PARAMS_EXTRUDE: (value: {
9
+ profile: {
10
+ ogId: string;
11
+ };
12
+ holes?: {
13
+ ogId: string;
14
+ }[];
15
+ distance: number;
16
+ }) => {
17
+ profile: {
18
+ ogId: string;
19
+ };
20
+ holes?: {
21
+ ogId: string;
22
+ }[];
23
+ distance: number;
24
+ };
25
+ export declare const OG_OPERATION_PARAMS_SWEEP: (value: {
26
+ profile: {
27
+ ogId: string;
28
+ };
29
+ path: {
30
+ ogId: string;
31
+ };
32
+ caps?: boolean;
33
+ }) => {
34
+ profile: {
35
+ ogId: string;
36
+ };
37
+ path: {
38
+ ogId: string;
39
+ };
40
+ caps?: boolean;
41
+ };
42
+ export declare const OG_OPERATION_PARAMS_REVOLVE: (value: {
43
+ profile: {
44
+ ogId: string;
45
+ };
46
+ axis?: {
47
+ point: [number, number];
48
+ direction: [number, number];
49
+ };
50
+ }) => {
51
+ profile: {
52
+ ogId: string;
53
+ };
54
+ axis?: {
55
+ point: [number, number];
56
+ direction: [number, number];
57
+ };
58
+ };
@@ -0,0 +1,69 @@
1
+ import type { ArcParams, ConeParams, CylinderSectorParams, PolyhedronParams, ProfileParams, SphereParams, TorusParams, SlotPrismParams, RoundedBoxParams, PipeSegmentParams, PolysolidParams, RegularPolygonParams, SlotParams, RoundedRectangleParams } from '../dto/primitives.js';
2
+ export declare const OG_PRIMITIVE_RECTANGLE: "Rectangle";
3
+ export declare const OG_PRIMITIVE_CIRCLE: "Circle";
4
+ export declare const OG_PRIMITIVE_POLYLINE: "Polyline";
5
+ export declare const OG_PRIMITIVE_CUBOID: "Cuboid";
6
+ export declare const OG_PRIMITIVE_CYLINDER: "Cylinder";
7
+ export declare const OG_PRIMITIVE_CYLINDER_SECTOR: "CylinderSector";
8
+ export declare const OG_PRIMITIVE_POLYHEDRON: "Polyhedron";
9
+ export declare const OG_PRIMITIVE_SPHERE: "Sphere";
10
+ export declare const OG_PRIMITIVE_CONE: "Cone";
11
+ export declare const OG_PRIMITIVE_TORUS: "Torus";
12
+ export declare const OG_PRIMITIVE_PROFILE: "Profile";
13
+ export declare const OG_PRIMITIVE_ARC: "Arc";
14
+ export declare const OG_PRIMITIVE_SLOT_PRISM: "SlotPrism";
15
+ export declare const OG_PRIMITIVE_ROUNDED_BOX: "RoundedBox";
16
+ export declare const OG_PRIMITIVE_PIPE_SEGMENT: "PipeSegment";
17
+ export declare const OG_PRIMITIVE_POLYSOLID: "Polysolid";
18
+ export declare const OG_PRIMITIVE_REGULAR_POLYGON: "RegularPolygon";
19
+ export declare const OG_PRIMITIVE_SLOT: "Slot";
20
+ export declare const OG_PRIMITIVE_ROUNDED_RECTANGLE: "RoundedRectangle";
21
+ export declare const OG_PRIMITIVE_PARAMS_RECTANGLE: (value: {
22
+ width: number;
23
+ breadth: number;
24
+ }) => {
25
+ width: number;
26
+ breadth: number;
27
+ };
28
+ export declare const OG_PRIMITIVE_PARAMS_CIRCLE: (value: {
29
+ radius: number;
30
+ }) => {
31
+ radius: number;
32
+ };
33
+ export declare const OG_PRIMITIVE_PARAMS_POLYLINE: (value: {
34
+ points: [number, number, number][];
35
+ closed?: boolean;
36
+ }) => {
37
+ points: [number, number, number][];
38
+ closed?: boolean;
39
+ };
40
+ export declare const OG_PRIMITIVE_PARAMS_CUBOID: (value: {
41
+ width: number;
42
+ height: number;
43
+ depth: number;
44
+ }) => {
45
+ width: number;
46
+ height: number;
47
+ depth: number;
48
+ };
49
+ export declare const OG_PRIMITIVE_PARAMS_CYLINDER: (value: {
50
+ radius: number;
51
+ height: number;
52
+ }) => {
53
+ radius: number;
54
+ height: number;
55
+ };
56
+ export declare const OG_PRIMITIVE_PARAMS_PROFILE: (value: ProfileParams) => ProfileParams;
57
+ export declare const OG_PRIMITIVE_PARAMS_ARC: (value: ArcParams) => ArcParams;
58
+ export declare const OG_PRIMITIVE_PARAMS_CYLINDER_SECTOR: (value: CylinderSectorParams) => CylinderSectorParams;
59
+ export declare const OG_PRIMITIVE_PARAMS_POLYHEDRON: (value: PolyhedronParams) => PolyhedronParams;
60
+ export declare const OG_PRIMITIVE_PARAMS_SPHERE: (value: SphereParams) => SphereParams;
61
+ export declare const OG_PRIMITIVE_PARAMS_CONE: (value: ConeParams) => ConeParams;
62
+ export declare const OG_PRIMITIVE_PARAMS_TORUS: (value: TorusParams) => TorusParams;
63
+ export declare const OG_PRIMITIVE_PARAMS_SLOT_PRISM: (value: SlotPrismParams) => SlotPrismParams;
64
+ export declare const OG_PRIMITIVE_PARAMS_ROUNDED_BOX: (value: RoundedBoxParams) => RoundedBoxParams;
65
+ export declare const OG_PRIMITIVE_PARAMS_PIPE_SEGMENT: (value: PipeSegmentParams) => PipeSegmentParams;
66
+ export declare const OG_PRIMITIVE_PARAMS_POLYSOLID: (value: PolysolidParams) => PolysolidParams;
67
+ export declare const OG_PRIMITIVE_PARAMS_REGULAR_POLYGON: (value: RegularPolygonParams) => RegularPolygonParams;
68
+ export declare const OG_PRIMITIVE_PARAMS_SLOT: (value: SlotParams) => SlotParams;
69
+ export declare const OG_PRIMITIVE_PARAMS_ROUNDED_RECTANGLE: (value: RoundedRectangleParams) => RoundedRectangleParams;
@@ -0,0 +1 @@
1
+ export declare const OG_REGION_TOLERANCE: 0.000001;
@@ -0,0 +1,4 @@
1
+ export declare const OG_TRANSFORM_TRANSLATE: "Translate";
2
+ export declare const OG_TRANSFORM_ROTATE: "Rotate";
3
+ export declare const OG_TRANSFORM_SCALE: "Scale";
4
+ export declare const OG_TRANSFORM_PLACE: "Place";
@@ -0,0 +1,24 @@
1
+ import type { FaceSource, GeometryQuality } from './brep.js';
2
+ export type FaceMapping = {
3
+ source: FaceSource;
4
+ result_faces: number[];
5
+ };
6
+ export type BooleanReport = {
7
+ operation: 'union' | 'intersection' | 'subtraction';
8
+ quality: GeometryQuality;
9
+ contacts: [number, number, number][];
10
+ coincident: boolean;
11
+ face_mappings: FaceMapping[];
12
+ };
13
+ export type ShapeReport = {
14
+ report: BooleanReport;
15
+ handlers: string[];
16
+ revision: number;
17
+ };
18
+ export type OperateErrorDetails = {
19
+ handlers: string[];
20
+ attempted: string[];
21
+ families?: [string, string];
22
+ toolIndex: number;
23
+ ogIds: string[];
24
+ };
@@ -0,0 +1 @@
1
+ export type Bounds = [number, number, number, number, number, number];
@@ -0,0 +1,99 @@
1
+ export type GeometryQuality = {
2
+ kind: 'Analytic';
3
+ } | {
4
+ kind: 'Approximate';
5
+ max_error: number;
6
+ };
7
+ export type FaceSource = {
8
+ entity: string;
9
+ body: string;
10
+ key: string;
11
+ face: number;
12
+ };
13
+ export type BrepVertex = {
14
+ id: number;
15
+ position: [number, number, number];
16
+ outgoing_halfedge: number | null;
17
+ tolerance: number;
18
+ };
19
+ export type BrepEdge = {
20
+ id: number;
21
+ geometry: unknown;
22
+ halfedge: number;
23
+ twin_halfedge: number | null;
24
+ tolerance: number;
25
+ chart_seam: boolean;
26
+ };
27
+ export type BrepHalfedge = {
28
+ id: number;
29
+ from: number;
30
+ to: number;
31
+ twin: number | null;
32
+ next: number | null;
33
+ prev: number | null;
34
+ edge: number;
35
+ face: number | null;
36
+ loop_ref: number | null;
37
+ wire_ref: number | null;
38
+ geometry_use: unknown;
39
+ };
40
+ export type BrepLoop = {
41
+ id: number;
42
+ start_halfedge: number;
43
+ face_ref: number;
44
+ is_hole: boolean;
45
+ };
46
+ export type BrepFace = {
47
+ id: number;
48
+ key: string;
49
+ surface: number;
50
+ sense: 'Forward' | 'Reverse';
51
+ trim: unknown;
52
+ shell_ref: number | null;
53
+ provenance: {
54
+ sources: FaceSource[];
55
+ role: 'Authored' | 'Preserved' | 'Split' | 'Cut' | 'Coincident';
56
+ reversed: boolean;
57
+ };
58
+ };
59
+ export type BrepWire = {
60
+ id: number;
61
+ start_halfedge: number;
62
+ is_closed: boolean;
63
+ };
64
+ export type BrepShell = {
65
+ id: number;
66
+ faces: number[];
67
+ is_closed: boolean;
68
+ };
69
+ export type Brep = {
70
+ schema_version: number;
71
+ id: string;
72
+ revision: number;
73
+ geometry: {
74
+ surfaces: unknown[];
75
+ curves: unknown[];
76
+ pcurves: unknown[];
77
+ intersections: unknown[];
78
+ };
79
+ topology: {
80
+ vertices: BrepVertex[];
81
+ edges: BrepEdge[];
82
+ halfedges: BrepHalfedge[];
83
+ loops: BrepLoop[];
84
+ faces: BrepFace[];
85
+ wires: BrepWire[];
86
+ shells: BrepShell[];
87
+ };
88
+ solids: {
89
+ outer_shell: number;
90
+ cavity_shells: number[];
91
+ }[];
92
+ accuracy: {
93
+ geometric: number;
94
+ intersection: number;
95
+ tessellation: number;
96
+ exchange: number;
97
+ };
98
+ quality: GeometryQuality;
99
+ };
@@ -0,0 +1,13 @@
1
+ export type NodeChange = {
2
+ ogId: string;
3
+ handle: number;
4
+ generation: number;
5
+ shapeId: string | null;
6
+ shapeRevision: number | null;
7
+ };
8
+ export type ChangeSet = {
9
+ revision: number;
10
+ added: NodeChange[];
11
+ changed: NodeChange[];
12
+ removed: NodeChange[];
13
+ };
@@ -0,0 +1,3 @@
1
+ export type Creation = {
2
+ ogId: string;
3
+ };
@@ -0,0 +1,14 @@
1
+ export type DisplayBuffers = {
2
+ positions: Float32Array;
3
+ normals: Float32Array;
4
+ indices: Uint32Array;
5
+ faceRanges: Uint32Array;
6
+ outline: Float32Array;
7
+ edgeIds: Uint32Array;
8
+ smoothEdges: Uint8Array;
9
+ origin: Float64Array;
10
+ revision: number;
11
+ bucket: number;
12
+ achievedDeflection: number;
13
+ triangles: number;
14
+ };
@@ -0,0 +1,2 @@
1
+ export type Events = 'geometry' | 'warning' | 'error' | 'fatal';
2
+ export type Listener = (event: unknown) => void;