opengeometry 2.0.1 → 2.0.3

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 (41) hide show
  1. package/README.md +1 -1
  2. package/index.d.ts +12 -0
  3. package/index.js +627 -415
  4. package/index.js.map +1 -1
  5. package/opengeometry/pkg/opengeometry.d.ts +131 -123
  6. package/opengeometry/pkg/opengeometry.js +68 -33
  7. package/opengeometry/pkg/opengeometry_bg.wasm +0 -0
  8. package/opengeometry/pkg/opengeometry_bg.wasm.d.ts +126 -122
  9. package/opengeometry_bg.wasm +0 -0
  10. package/opengeometry_bg.wasm.d.ts +126 -122
  11. package/package.json +1 -1
  12. package/src/base-types.d.ts +7 -1
  13. package/src/editor/freeform.d.ts +63 -0
  14. package/src/editor/index.d.ts +3 -0
  15. package/src/editor/parametric.d.ts +10 -0
  16. package/src/editor/types.d.ts +72 -0
  17. package/src/examples/booleans.d.ts +2 -1
  18. package/src/freeform/geometry.d.ts +59 -0
  19. package/src/freeform/index.d.ts +3 -0
  20. package/src/freeform/types.d.ts +12 -0
  21. package/src/operations/boolean.d.ts +15 -0
  22. package/src/operations/extrude.d.ts +9 -0
  23. package/src/operations/index.d.ts +1 -0
  24. package/src/primitives/arc.d.ts +15 -0
  25. package/src/primitives/curve.d.ts +18 -0
  26. package/src/primitives/line.d.ts +15 -0
  27. package/src/primitives/polyline.d.ts +18 -0
  28. package/src/primitives/rectangle.d.ts +18 -0
  29. package/src/shapes/boolean-subtract.d.ts +9 -0
  30. package/src/shapes/cuboid.d.ts +15 -0
  31. package/src/shapes/cylinder.d.ts +15 -0
  32. package/src/shapes/extrusion.d.ts +64 -0
  33. package/src/shapes/index.d.ts +1 -1
  34. package/src/shapes/opening.d.ts +15 -0
  35. package/src/shapes/outline-utils.d.ts +21 -0
  36. package/src/shapes/polygon.d.ts +31 -7
  37. package/src/shapes/solid.d.ts +111 -0
  38. package/src/shapes/sphere.d.ts +15 -0
  39. package/src/shapes/sweep.d.ts +15 -0
  40. package/src/shapes/wedge.d.ts +15 -0
  41. package/src/shapes/extruded-shape.d.ts +0 -49
@@ -1,5 +1,8 @@
1
1
  import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
2
2
  import * as THREE from "three";
3
+ /**
4
+ * Construction options for a rectangle profile wrapper.
5
+ */
3
6
  export interface IRectangleOptions {
4
7
  ogid?: string;
5
8
  center: Vector3;
@@ -12,18 +15,33 @@ export interface IRectangleOptions {
12
15
  rotation?: Vector3;
13
16
  scale?: Vector3;
14
17
  }
18
+ /**
19
+ * Placement updates accepted by `Rectangle`.
20
+ */
15
21
  export interface RectanglePlacementOptions {
16
22
  translation?: Vector3;
17
23
  rotation?: Vector3;
18
24
  scale?: Vector3;
19
25
  }
26
+ /**
27
+ * Partial config payload accepted by `Rectangle.setConfig(...)`.
28
+ */
20
29
  export type RectangleConfigUpdate = Partial<Omit<IRectangleOptions, "translation" | "rotation" | "scale">>;
30
+ /**
31
+ * Alias for `Rectangle` placement updates.
32
+ */
21
33
  export type RectanglePlacementUpdate = RectanglePlacementOptions;
34
+ /**
35
+ * Offset result returned by `Rectangle.offset(...)`.
36
+ */
22
37
  export interface IRectangleOffsetResult {
23
38
  points: Vector3[];
24
39
  beveledVertexIndices: number[];
25
40
  isClosed: boolean;
26
41
  }
42
+ /**
43
+ * Rectangle wrapper backed by the kernel OGRectangle primitive.
44
+ */
27
45
  export declare class Rectangle extends THREE.Line {
28
46
  ogid: string;
29
47
  options: IRectangleOptions;
@@ -1,6 +1,15 @@
1
1
  import type { BooleanExecutionOptions, BooleanOperand, BooleanResult } from "../operations/boolean.js";
2
+ /**
3
+ * Operand types accepted by shape instance `.subtract(...)` helpers.
4
+ */
2
5
  export type ShapeSubtractOperand = BooleanOperand;
6
+ /**
7
+ * Options accepted by shape instance `.subtract(...)` helpers.
8
+ */
3
9
  export type ShapeSubtractOptions = BooleanExecutionOptions;
10
+ /**
11
+ * Return type for shape instance `.subtract(...)` helpers.
12
+ */
4
13
  export type ShapeSubtractResult = BooleanResult;
5
14
  /**
6
15
  * Executes a kernel-backed subtraction for a shape wrapper against another boolean operand.
@@ -2,11 +2,17 @@ import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
2
2
  import * as THREE from "three";
3
3
  import { ShapeOutlineMesh } from "./outline-utils.js";
4
4
  import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
5
+ /**
6
+ * Placement updates accepted by `Cuboid`.
7
+ */
5
8
  export interface CuboidPlacementOptions {
6
9
  translation?: Vector3;
7
10
  rotation?: Vector3;
8
11
  scale?: Vector3;
9
12
  }
13
+ /**
14
+ * Construction options for a cuboid shape.
15
+ */
10
16
  export interface ICuboidOptions extends CuboidPlacementOptions {
11
17
  ogid?: string;
12
18
  center: Vector3;
@@ -17,8 +23,17 @@ export interface ICuboidOptions extends CuboidPlacementOptions {
17
23
  fatOutlines?: boolean;
18
24
  outlineWidth?: number;
19
25
  }
26
+ /**
27
+ * Partial config payload accepted by `Cuboid.setConfig(...)`.
28
+ */
20
29
  export type CuboidConfigUpdate = Partial<Omit<ICuboidOptions, "translation" | "rotation" | "scale">>;
30
+ /**
31
+ * Alias for `Cuboid` placement updates.
32
+ */
21
33
  export type CuboidPlacementUpdate = CuboidPlacementOptions;
34
+ /**
35
+ * Box-shaped solid wrapper backed by the kernel cuboid primitive.
36
+ */
22
37
  export declare class Cuboid extends THREE.Mesh {
23
38
  #private;
24
39
  ogid: string;
@@ -1,6 +1,9 @@
1
1
  import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
2
2
  import * as THREE from "three";
3
3
  import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
4
+ /**
5
+ * Construction options for a cylinder shape.
6
+ */
4
7
  export interface ICylinderOptions {
5
8
  ogid?: string;
6
9
  center: Vector3;
@@ -15,13 +18,25 @@ export interface ICylinderOptions {
15
18
  rotation?: Vector3;
16
19
  scale?: Vector3;
17
20
  }
21
+ /**
22
+ * Placement updates accepted by `Cylinder`.
23
+ */
18
24
  export interface CylinderPlacementOptions {
19
25
  translation?: Vector3;
20
26
  rotation?: Vector3;
21
27
  scale?: Vector3;
22
28
  }
29
+ /**
30
+ * Partial config payload accepted by `Cylinder.setConfig(...)`.
31
+ */
23
32
  export type CylinderConfigUpdate = Partial<Omit<ICylinderOptions, "translation" | "rotation" | "scale">>;
33
+ /**
34
+ * Alias for `Cylinder` placement updates.
35
+ */
24
36
  export type CylinderPlacementUpdate = CylinderPlacementOptions;
37
+ /**
38
+ * Cylinder wrapper backed by the kernel cylindrical primitive.
39
+ */
25
40
  export declare class Cylinder extends THREE.Mesh {
26
41
  #private;
27
42
  ogid: string;
@@ -0,0 +1,64 @@
1
+ import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
2
+ import * as THREE from "three";
3
+ import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
4
+ export interface IExtrusionOptions {
5
+ ogid?: string;
6
+ vertices: Vector3[];
7
+ holes?: Vector3[][];
8
+ height: number;
9
+ color: number;
10
+ fatOutlines?: boolean;
11
+ outlineWidth?: number;
12
+ translation?: Vector3;
13
+ rotation?: Vector3;
14
+ scale?: Vector3;
15
+ }
16
+ export interface ExtrusionPlacementOptions {
17
+ translation?: Vector3;
18
+ rotation?: Vector3;
19
+ scale?: Vector3;
20
+ }
21
+ export type ExtrusionConfigUpdate = Partial<Omit<IExtrusionOptions, "translation" | "rotation" | "scale">>;
22
+ export type ExtrusionPlacementUpdate = ExtrusionPlacementOptions;
23
+ export declare class Extrusion extends THREE.Mesh {
24
+ #private;
25
+ ogid: string;
26
+ options: IExtrusionOptions;
27
+ private extrusion;
28
+ private _outlineEnabled;
29
+ private _fatOutlines;
30
+ private _outlineWidth;
31
+ private _outlineColor;
32
+ set color(color: number);
33
+ constructor(options?: IExtrusionOptions);
34
+ validateOptions(): void;
35
+ setConfig(options: ExtrusionConfigUpdate): void;
36
+ getConfig(): IExtrusionOptions;
37
+ getAnchor(): Vector3;
38
+ setAnchor(anchor: Vector3): void;
39
+ resetAnchor(): void;
40
+ setPlacement(placement: ExtrusionPlacementUpdate): void;
41
+ setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
42
+ setTranslation(translation: Vector3): void;
43
+ setRotation(rotation: Vector3): void;
44
+ setScale(scale: Vector3): void;
45
+ getPlacement(): import("../editor.js").ParametricPlacement;
46
+ getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
47
+ canConvertToFreeform(): boolean;
48
+ toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
49
+ cleanGeometry(): void;
50
+ generateGeometry(): void;
51
+ getBrepData(): any;
52
+ subtract(operand: ShapeSubtractOperand, options?: ShapeSubtractOptions): ShapeSubtractResult;
53
+ set outlineColor(color: number);
54
+ get outlineColor(): number;
55
+ set outline(enable: boolean);
56
+ get outline(): boolean;
57
+ set fatOutlines(value: boolean);
58
+ get fatOutlines(): boolean;
59
+ set outlineWidth(value: number);
60
+ get outlineWidth(): number;
61
+ clearOutlineMesh(): void;
62
+ discardGeometry(): void;
63
+ private writePositionsToGeometry;
64
+ }
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * High-level 3D shape wrappers backed by the OpenGeometry kernel.
3
3
  */
4
- export * from './extruded-shape.js';
5
4
  export * from './polygon.js';
5
+ export * from './solid.js';
6
6
  export * from './cylinder.js';
7
7
  export * from './cuboid.js';
8
8
  export * from './opening.js';
@@ -2,6 +2,9 @@ import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
2
2
  import * as THREE from "three";
3
3
  import { ShapeOutlineMesh } from "./outline-utils.js";
4
4
  import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
5
+ /**
6
+ * Construction options for an architectural opening volume.
7
+ */
5
8
  export interface IOpeningOptions {
6
9
  ogid?: string;
7
10
  center: Vector3;
@@ -15,13 +18,25 @@ export interface IOpeningOptions {
15
18
  rotation?: Vector3;
16
19
  scale?: Vector3;
17
20
  }
21
+ /**
22
+ * Placement updates accepted by `Opening`.
23
+ */
18
24
  export interface OpeningPlacementOptions {
19
25
  translation?: Vector3;
20
26
  rotation?: Vector3;
21
27
  scale?: Vector3;
22
28
  }
29
+ /**
30
+ * Partial config payload accepted by `Opening.setConfig(...)`.
31
+ */
23
32
  export type OpeningConfigUpdate = Partial<Omit<IOpeningOptions, "translation" | "rotation" | "scale">>;
33
+ /**
34
+ * Alias for `Opening` placement updates.
35
+ */
24
36
  export type OpeningPlacementUpdate = OpeningPlacementOptions;
37
+ /**
38
+ * Opening wrapper used as a subtractive solid in architectural workflows.
39
+ */
25
40
  export declare class Opening extends THREE.Mesh {
26
41
  #private;
27
42
  ogid: string;
@@ -1,14 +1,35 @@
1
1
  import * as THREE from "three";
2
2
  import { LineSegments2 } from "three/examples/jsm/lines/LineSegments2.js";
3
+ /**
4
+ * Outline mesh variants used by shape wrappers.
5
+ */
3
6
  export type ShapeOutlineMesh = THREE.LineSegments | LineSegments2;
7
+ /**
8
+ * Options for building a shape outline mesh.
9
+ */
4
10
  export interface ShapeOutlineMeshOptions {
5
11
  positions: number[];
6
12
  color?: number;
7
13
  fatOutlines?: boolean;
8
14
  outlineWidth?: number;
9
15
  }
16
+ /**
17
+ * Clamps outline width inputs to the supported positive finite range.
18
+ */
10
19
  export declare function sanitizeOutlineWidth(width?: number): number;
20
+ /**
21
+ * Creates either a thin or fat outline mesh from line segment positions.
22
+ */
11
23
  export declare function createShapeOutlineMesh({ positions, color, fatOutlines, outlineWidth, }: ShapeOutlineMeshOptions): ShapeOutlineMesh;
24
+ /**
25
+ * Disposes the geometry and material owned by an outline mesh.
26
+ */
12
27
  export declare function disposeShapeOutlineMesh(mesh: ShapeOutlineMesh | null): void;
28
+ /**
29
+ * Updates the color of an existing outline mesh in place.
30
+ */
13
31
  export declare function setShapeOutlineColor(mesh: ShapeOutlineMesh | null, color: number): void;
32
+ /**
33
+ * Reads the current outline color, falling back when no outline exists.
34
+ */
14
35
  export declare function getShapeOutlineColor(mesh: ShapeOutlineMesh | null, fallback?: number): number;
@@ -1,8 +1,10 @@
1
1
  import * as THREE from "three";
2
- import * as OGKernel from "../../opengeometry/pkg/opengeometry.js";
3
2
  import { OGPolygon, Vector3 } from "../../opengeometry/pkg/opengeometry.js";
4
- import { ExtrudedShape } from "./extruded-shape.js";
3
+ import { Solid } from "./solid.js";
5
4
  import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
5
+ /**
6
+ * Construction options for a planar polygon.
7
+ */
6
8
  export interface IPolygonOptions {
7
9
  ogid?: string;
8
10
  vertices: Vector3[];
@@ -19,8 +21,17 @@ export interface PolygonPlacementOptions {
19
21
  rotation?: Vector3;
20
22
  scale?: Vector3;
21
23
  }
24
+ /**
25
+ * Partial polygon config updates that regenerate the profile when geometry changes.
26
+ */
22
27
  export type PolygonConfigUpdate = Partial<Omit<IPolygonOptions, "translation" | "rotation" | "scale">>;
28
+ /**
29
+ * Placement updates accepted by `Polygon`.
30
+ */
23
31
  export type PolygonPlacementUpdate = PolygonPlacementOptions;
32
+ /**
33
+ * Planar polygon mesh with support for holes, booleans, and extrusion to `Solid`.
34
+ */
24
35
  export declare class Polygon extends THREE.Mesh {
25
36
  #private;
26
37
  ogid: string;
@@ -30,15 +41,13 @@ export declare class Polygon extends THREE.Mesh {
30
41
  private _fatOutlines;
31
42
  private _outlineWidth;
32
43
  private _outlineColor;
33
- transformationMatrix: THREE.Matrix4;
34
44
  set color(color: number);
35
45
  get color(): number;
36
- private _geometryCenterOffset;
37
46
  constructor(options?: IPolygonOptions);
38
47
  validateOptions(): void;
39
48
  setConfig(options: PolygonConfigUpdate): void;
40
49
  getConfig(): IPolygonOptions;
41
- getAnchor(): OGKernel.Vector3;
50
+ getAnchor(): Vector3;
42
51
  setAnchor(anchor: Vector3): void;
43
52
  resetAnchor(): void;
44
53
  setPlacement(placement: PolygonPlacementUpdate): void;
@@ -47,15 +56,29 @@ export declare class Polygon extends THREE.Mesh {
47
56
  setRotation(rotation: Vector3): void;
48
57
  setScale(scale: Vector3): void;
49
58
  getPlacement(): import("../editor.js").ParametricPlacement;
59
+ /**
60
+ * Returns the editing capability payload advertised by parametric wrappers.
61
+ */
50
62
  getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
63
+ /**
64
+ * Polygon always supports conversion into the freeform editing wrapper.
65
+ */
51
66
  canConvertToFreeform(): boolean;
67
+ /**
68
+ * Returns a freeform wrapper for direct BRep editing of this polygon.
69
+ */
52
70
  toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
53
71
  cleanGeometry(): void;
54
72
  generateGeometry(): void;
55
73
  addVertices(vertices: Vector3[]): void;
56
- saveTransformationToBREP(): void;
57
74
  addHole(holeVertices: Vector3[]): void;
58
- extrude(height?: number, faceId?: number): ExtrudedShape;
75
+ /**
76
+ * Builds a kernel-backed `Solid` by extruding this polygon face by `height`.
77
+ */
78
+ extrude(height: number): Solid;
79
+ /**
80
+ * Returns the serialized BRep payload for this polygon.
81
+ */
59
82
  getBrepData(): string | null;
60
83
  /**
61
84
  * Subtracts another boolean operand from this polygon.
@@ -73,4 +96,5 @@ export declare class Polygon extends THREE.Mesh {
73
96
  private clearOutlineMesh;
74
97
  dispose(): void;
75
98
  private writePositionsToGeometry;
99
+ private disposeResources;
76
100
  }
@@ -0,0 +1,111 @@
1
+ import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
2
+ import * as THREE from "three";
3
+ import { type FreeformGeometry } from "../freeform.js";
4
+ import type { FreeformSource } from "../freeform/types.js";
5
+ import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
6
+ /**
7
+ * Construction options for a generic BRep-backed solid.
8
+ */
9
+ export interface ISolidOptions {
10
+ ogid?: string;
11
+ brep: FreeformSource;
12
+ color: number;
13
+ fatOutlines?: boolean;
14
+ outlineWidth?: number;
15
+ anchor?: Vector3;
16
+ translation?: Vector3;
17
+ rotation?: Vector3;
18
+ scale?: Vector3;
19
+ }
20
+ /**
21
+ * Placement updates accepted by `Solid`.
22
+ */
23
+ export interface SolidPlacementOptions {
24
+ translation?: Vector3;
25
+ rotation?: Vector3;
26
+ scale?: Vector3;
27
+ }
28
+ /**
29
+ * Additional options accepted when creating a `Solid` through face extrusion.
30
+ */
31
+ export interface ExtrudeSolidOptions extends Omit<ISolidOptions, "brep" | "ogid" | "anchor" | "translation" | "rotation" | "scale"> {
32
+ ogid?: string;
33
+ anchor?: Vector3;
34
+ translation?: Vector3;
35
+ rotation?: Vector3;
36
+ scale?: Vector3;
37
+ }
38
+ /**
39
+ * Generic renderable BRep-backed solid used for extrusion outputs and other
40
+ * kernel results that are not dedicated parametric shapes.
41
+ */
42
+ export declare class Solid extends THREE.Mesh {
43
+ #private;
44
+ ogid: string;
45
+ options: ISolidOptions;
46
+ private solid;
47
+ private _outlineEnabled;
48
+ private _fatOutlines;
49
+ private _outlineWidth;
50
+ private _outlineColor;
51
+ set color(color: number);
52
+ get color(): number;
53
+ constructor(options: ISolidOptions);
54
+ /**
55
+ * Extrudes a face-like BRep source and wraps the result as a renderable solid.
56
+ */
57
+ static extrude(source: FreeformSource, height: number, options: ExtrudeSolidOptions): Solid;
58
+ /**
59
+ * Returns the current placement values as cloned vectors.
60
+ */
61
+ getPlacement(): import("../editor.js").ParametricPlacement;
62
+ /**
63
+ * Applies translation, rotation, and scale updates to the wrapped BRep.
64
+ */
65
+ setPlacement(placement: SolidPlacementOptions): void;
66
+ setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
67
+ setTranslation(translation: Vector3): void;
68
+ setRotation(rotation: Vector3): void;
69
+ setScale(scale: Vector3): void;
70
+ getAnchor(): Vector3;
71
+ setAnchor(anchor: Vector3): void;
72
+ /**
73
+ * Solid is always convertible back to the freeform editing wrapper.
74
+ */
75
+ canConvertToFreeform(): boolean;
76
+ /**
77
+ * Returns a freeform wrapper for direct editing of this solid's BRep.
78
+ */
79
+ toFreeform(id?: string): FreeformGeometry;
80
+ /**
81
+ * Returns the world-space serialized BRep payload for this solid.
82
+ */
83
+ getBrepSerialized(): string;
84
+ /**
85
+ * Returns the local-space serialized BRep payload for this solid.
86
+ */
87
+ getLocalBrepSerialized(): string;
88
+ /**
89
+ * Returns the parsed world-space BRep object for this solid.
90
+ */
91
+ getBrepData(): any;
92
+ /**
93
+ * Subtracts another boolean operand from this solid.
94
+ */
95
+ subtract(operand: ShapeSubtractOperand, options?: ShapeSubtractOptions): ShapeSubtractResult;
96
+ /**
97
+ * Rebuilds the visible mesh and outline from the current freeform geometry.
98
+ */
99
+ generateGeometry(): void;
100
+ set outlineColor(color: number);
101
+ get outlineColor(): number;
102
+ set outline(enable: boolean);
103
+ get outline(): boolean;
104
+ set fatOutlines(value: boolean);
105
+ get fatOutlines(): boolean;
106
+ set outlineWidth(value: number);
107
+ get outlineWidth(): number;
108
+ clearOutlineMesh(): void;
109
+ private getPlacementTransform;
110
+ private writePositionsToGeometry;
111
+ }
@@ -3,6 +3,9 @@ import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
3
3
  import * as THREE from "three";
4
4
  import { ShapeOutlineMesh } from "./outline-utils.js";
5
5
  import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
6
+ /**
7
+ * Construction options for a sphere shape.
8
+ */
6
9
  export interface ISphereOptions {
7
10
  ogid?: string;
8
11
  center: Vector3;
@@ -16,13 +19,25 @@ export interface ISphereOptions {
16
19
  rotation?: Vector3;
17
20
  scale?: Vector3;
18
21
  }
22
+ /**
23
+ * Placement updates accepted by `Sphere`.
24
+ */
19
25
  export interface SpherePlacementOptions {
20
26
  translation?: Vector3;
21
27
  rotation?: Vector3;
22
28
  scale?: Vector3;
23
29
  }
30
+ /**
31
+ * Partial config payload accepted by `Sphere.setConfig(...)`.
32
+ */
24
33
  export type SphereConfigUpdate = Partial<Omit<ISphereOptions, "translation" | "rotation" | "scale">>;
34
+ /**
35
+ * Alias for `Sphere` placement updates.
36
+ */
25
37
  export type SpherePlacementUpdate = SpherePlacementOptions;
38
+ /**
39
+ * Sphere wrapper backed by the kernel sphere primitive.
40
+ */
26
41
  export declare class Sphere extends THREE.Mesh {
27
42
  #private;
28
43
  ogid: string;
@@ -2,6 +2,9 @@ import * as OGKernel from "../../opengeometry/pkg/opengeometry.js";
2
2
  import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
3
3
  import * as THREE from "three";
4
4
  import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
5
+ /**
6
+ * Construction options for a swept solid.
7
+ */
5
8
  export interface ISweepOptions {
6
9
  ogid?: string;
7
10
  path: Vector3[];
@@ -15,13 +18,25 @@ export interface ISweepOptions {
15
18
  rotation?: Vector3;
16
19
  scale?: Vector3;
17
20
  }
21
+ /**
22
+ * Placement updates accepted by `Sweep`.
23
+ */
18
24
  export interface SweepPlacementOptions {
19
25
  translation?: Vector3;
20
26
  rotation?: Vector3;
21
27
  scale?: Vector3;
22
28
  }
29
+ /**
30
+ * Partial config payload accepted by `Sweep.setConfig(...)`.
31
+ */
23
32
  export type SweepConfigUpdate = Partial<Omit<ISweepOptions, "translation" | "rotation" | "scale">>;
33
+ /**
34
+ * Alias for `Sweep` placement updates.
35
+ */
24
36
  export type SweepPlacementUpdate = SweepPlacementOptions;
37
+ /**
38
+ * Sweep wrapper backed by the kernel sweep primitive.
39
+ */
25
40
  export declare class Sweep extends THREE.Mesh {
26
41
  #private;
27
42
  ogid: string;
@@ -2,6 +2,9 @@ import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
2
2
  import * as THREE from "three";
3
3
  import { ShapeOutlineMesh } from "./outline-utils.js";
4
4
  import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
5
+ /**
6
+ * Construction options for a wedge/prism shape.
7
+ */
5
8
  export interface IWedgeOptions {
6
9
  ogid?: string;
7
10
  center: Vector3;
@@ -15,13 +18,25 @@ export interface IWedgeOptions {
15
18
  rotation?: Vector3;
16
19
  scale?: Vector3;
17
20
  }
21
+ /**
22
+ * Placement updates accepted by `Wedge`.
23
+ */
18
24
  export interface WedgePlacementOptions {
19
25
  translation?: Vector3;
20
26
  rotation?: Vector3;
21
27
  scale?: Vector3;
22
28
  }
29
+ /**
30
+ * Partial config payload accepted by `Wedge.setConfig(...)`.
31
+ */
23
32
  export type WedgeConfigUpdate = Partial<Omit<IWedgeOptions, "translation" | "rotation" | "scale">>;
33
+ /**
34
+ * Alias for `Wedge` placement updates.
35
+ */
24
36
  export type WedgePlacementUpdate = WedgePlacementOptions;
37
+ /**
38
+ * Wedge wrapper backed by the kernel wedge primitive.
39
+ */
25
40
  export declare class Wedge extends THREE.Mesh {
26
41
  #private;
27
42
  ogid: string;
@@ -1,49 +0,0 @@
1
- import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
2
- import * as THREE from "three";
3
- import type { ObjectTransformation } from "../freeform/types.js";
4
- import { type BooleanExecutionOptions, type BooleanOperand, type BooleanResult } from "../operations/boolean.js";
5
- export interface ExtrudedShapeOptions {
6
- ogid?: string;
7
- color?: number;
8
- outline?: boolean;
9
- fatOutlines?: boolean;
10
- outlineWidth?: number;
11
- outlineColor?: number;
12
- placement?: Partial<ObjectTransformation>;
13
- }
14
- export type ExtrudedShapePlacementUpdate = Partial<ObjectTransformation>;
15
- export declare class ExtrudedShape extends THREE.Mesh {
16
- #private;
17
- ogid: string;
18
- private readonly freeform;
19
- private _outlineEnabled;
20
- private _fatOutlines;
21
- private _outlineWidth;
22
- private _outlineColor;
23
- private _color;
24
- constructor(localBrepSerialized: string, options?: ExtrudedShapeOptions);
25
- set color(color: number);
26
- get color(): number;
27
- getBrepSerialized(): string;
28
- getPlacement(): ObjectTransformation;
29
- setPlacement(placement: ExtrudedShapePlacementUpdate): void;
30
- setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
31
- setTranslation(translation: Vector3): void;
32
- setRotation(rotation: Vector3): void;
33
- setScale(scale: Vector3): void;
34
- union(operand: BooleanOperand, options?: BooleanExecutionOptions): BooleanResult;
35
- intersection(operand: BooleanOperand, options?: BooleanExecutionOptions): BooleanResult;
36
- subtract(operand: BooleanOperand, options?: BooleanExecutionOptions): BooleanResult;
37
- set outlineColor(color: number);
38
- get outlineColor(): number;
39
- set outline(enable: boolean);
40
- get outline(): boolean;
41
- set fatOutlines(value: boolean);
42
- get fatOutlines(): boolean;
43
- set outlineWidth(value: number);
44
- get outlineWidth(): number;
45
- dispose(): void;
46
- private generateGeometry;
47
- private clearOutlineMesh;
48
- private writePositionsToGeometry;
49
- }