opengeometry 2.0.0 → 2.0.1
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/README.md +77 -14
- package/index.d.ts +15 -7
- package/index.js +6158 -16678
- package/index.js.map +1 -1
- package/opengeometry/pkg/opengeometry.d.ts +1103 -0
- package/opengeometry/pkg/opengeometry.js +5663 -0
- package/opengeometry/pkg/opengeometry_bg.wasm +0 -0
- package/opengeometry/pkg/opengeometry_bg.wasm.d.ts +423 -0
- package/opengeometry_bg.wasm +0 -0
- package/opengeometry_bg.wasm.d.ts +291 -122
- package/package.json +22 -33
- package/src/editor/freeform.d.ts +28 -0
- package/src/editor/index.d.ts +3 -0
- package/src/editor/parametric.d.ts +5 -0
- package/src/editor/types.d.ts +151 -0
- package/src/examples/booleans.d.ts +2 -2
- package/src/examples/editor-modes.d.ts +24 -0
- package/src/examples/index.d.ts +7 -6
- package/src/examples/offset.d.ts +7 -7
- package/src/examples/primitives.d.ts +5 -5
- package/src/examples/shapes.d.ts +7 -7
- package/src/examples/sweep.d.ts +3 -3
- package/src/examples/wall-from-offsets.d.ts +4 -4
- package/src/freeform/geometry.d.ts +21 -0
- package/src/freeform/index.d.ts +2 -0
- package/src/freeform/types.d.ts +24 -0
- package/src/operations/boolean.d.ts +7 -0
- package/src/operations/editor/freeform.d.ts +1 -0
- package/src/operations/editor/index.d.ts +1 -0
- package/src/operations/editor/parametric.d.ts +1 -0
- package/src/operations/editor/types.d.ts +1 -0
- package/src/operations/index.d.ts +1 -1
- package/src/primitives/arc.d.ts +22 -2
- package/src/primitives/curve.d.ts +25 -2
- package/src/primitives/index.d.ts +5 -5
- package/src/primitives/line.d.ts +25 -2
- package/src/primitives/polyline.d.ts +25 -2
- package/src/primitives/rectangle.d.ts +22 -2
- package/src/shapes/boolean-subtract.d.ts +1 -1
- package/src/shapes/cuboid.d.ts +22 -8
- package/src/shapes/cylinder.d.ts +24 -3
- package/src/shapes/extruded-shape.d.ts +49 -0
- package/src/shapes/index.d.ts +8 -7
- package/src/shapes/opening.d.ts +25 -5
- package/src/shapes/polygon.d.ts +29 -3
- package/src/shapes/sphere.d.ts +26 -4
- package/src/shapes/sweep.d.ts +27 -3
- package/src/shapes/wedge.d.ts +25 -4
- package/src/examples/shape-outline-dropdown.d.ts +0 -23
- package/src/shapes/swept-shape.d.ts +0 -63
package/src/shapes/cuboid.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { Vector3 } from "
|
|
1
|
+
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
2
|
import * as THREE from "three";
|
|
3
|
-
import { ShapeOutlineMesh } from "./outline-utils";
|
|
4
|
-
import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract";
|
|
5
|
-
export interface
|
|
3
|
+
import { ShapeOutlineMesh } from "./outline-utils.js";
|
|
4
|
+
import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
|
|
5
|
+
export interface CuboidPlacementOptions {
|
|
6
|
+
translation?: Vector3;
|
|
7
|
+
rotation?: Vector3;
|
|
8
|
+
scale?: Vector3;
|
|
9
|
+
}
|
|
10
|
+
export interface ICuboidOptions extends CuboidPlacementOptions {
|
|
6
11
|
ogid?: string;
|
|
7
12
|
center: Vector3;
|
|
8
13
|
width: number;
|
|
@@ -12,7 +17,8 @@ export interface ICuboidOptions {
|
|
|
12
17
|
fatOutlines?: boolean;
|
|
13
18
|
outlineWidth?: number;
|
|
14
19
|
}
|
|
15
|
-
export type CuboidConfigUpdate = Partial<ICuboidOptions
|
|
20
|
+
export type CuboidConfigUpdate = Partial<Omit<ICuboidOptions, "translation" | "rotation" | "scale">>;
|
|
21
|
+
export type CuboidPlacementUpdate = CuboidPlacementOptions;
|
|
16
22
|
export declare class Cuboid extends THREE.Mesh {
|
|
17
23
|
#private;
|
|
18
24
|
ogid: string;
|
|
@@ -21,14 +27,12 @@ export declare class Cuboid extends THREE.Mesh {
|
|
|
21
27
|
private _outlineEnabled;
|
|
22
28
|
private _fatOutlines;
|
|
23
29
|
private _outlineWidth;
|
|
24
|
-
private _geometryCenterOffset;
|
|
25
30
|
set width(value: number);
|
|
26
31
|
set color(color: number);
|
|
27
32
|
constructor(options?: ICuboidOptions);
|
|
28
|
-
validateOptions(): void;
|
|
29
33
|
getConfig(): ICuboidOptions;
|
|
34
|
+
getPlacement(): import("../editor.js").ParametricPlacement;
|
|
30
35
|
setConfig(options: CuboidConfigUpdate): void;
|
|
31
|
-
cleanGeometry(): void;
|
|
32
36
|
generateGeometry(): void;
|
|
33
37
|
getBrepData(): any;
|
|
34
38
|
/**
|
|
@@ -42,6 +46,16 @@ export declare class Cuboid extends THREE.Mesh {
|
|
|
42
46
|
set outlineWidth(value: number);
|
|
43
47
|
get outlineWidth(): number;
|
|
44
48
|
get outlineMesh(): ShapeOutlineMesh | null;
|
|
49
|
+
getAnchor(): Vector3;
|
|
50
|
+
setPlacement(placement: CuboidPlacementUpdate): void;
|
|
51
|
+
setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
|
|
52
|
+
setTranslation(translation: Vector3): void;
|
|
53
|
+
setRotation(rotation: Vector3): void;
|
|
54
|
+
setScale(scale: Vector3): void;
|
|
55
|
+
getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
|
|
56
|
+
canConvertToFreeform(): boolean;
|
|
57
|
+
toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
|
|
45
58
|
private clearOutlineMesh;
|
|
46
59
|
discardGeometry(): void;
|
|
60
|
+
private writePositionsToGeometry;
|
|
47
61
|
}
|
package/src/shapes/cylinder.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Vector3 } from "
|
|
1
|
+
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
2
|
import * as THREE from "three";
|
|
3
|
-
import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract";
|
|
3
|
+
import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
|
|
4
4
|
export interface ICylinderOptions {
|
|
5
5
|
ogid?: string;
|
|
6
6
|
center: Vector3;
|
|
@@ -11,8 +11,17 @@ export interface ICylinderOptions {
|
|
|
11
11
|
color: number;
|
|
12
12
|
fatOutlines?: boolean;
|
|
13
13
|
outlineWidth?: number;
|
|
14
|
+
translation?: Vector3;
|
|
15
|
+
rotation?: Vector3;
|
|
16
|
+
scale?: Vector3;
|
|
14
17
|
}
|
|
15
|
-
export
|
|
18
|
+
export interface CylinderPlacementOptions {
|
|
19
|
+
translation?: Vector3;
|
|
20
|
+
rotation?: Vector3;
|
|
21
|
+
scale?: Vector3;
|
|
22
|
+
}
|
|
23
|
+
export type CylinderConfigUpdate = Partial<Omit<ICylinderOptions, "translation" | "rotation" | "scale">>;
|
|
24
|
+
export type CylinderPlacementUpdate = CylinderPlacementOptions;
|
|
16
25
|
export declare class Cylinder extends THREE.Mesh {
|
|
17
26
|
#private;
|
|
18
27
|
ogid: string;
|
|
@@ -26,6 +35,17 @@ export declare class Cylinder extends THREE.Mesh {
|
|
|
26
35
|
constructor(options?: ICylinderOptions);
|
|
27
36
|
validateOptions(): void;
|
|
28
37
|
setConfig(options: CylinderConfigUpdate): void;
|
|
38
|
+
getConfig(): ICylinderOptions;
|
|
39
|
+
getAnchor(): Vector3;
|
|
40
|
+
setPlacement(placement: CylinderPlacementUpdate): 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;
|
|
29
49
|
cleanGeometry(): void;
|
|
30
50
|
generateGeometry(): void;
|
|
31
51
|
getBrep(): any;
|
|
@@ -41,4 +61,5 @@ export declare class Cylinder extends THREE.Mesh {
|
|
|
41
61
|
get outlineWidth(): number;
|
|
42
62
|
private clearOutlineMesh;
|
|
43
63
|
discardGeometry(): void;
|
|
64
|
+
private writePositionsToGeometry;
|
|
44
65
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
}
|
package/src/shapes/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* High-level 3D shape wrappers backed by the OpenGeometry kernel.
|
|
3
3
|
*/
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './
|
|
4
|
+
export * from './extruded-shape.js';
|
|
5
|
+
export * from './polygon.js';
|
|
6
|
+
export * from './cylinder.js';
|
|
7
|
+
export * from './cuboid.js';
|
|
8
|
+
export * from './opening.js';
|
|
9
|
+
export * from './sphere.js';
|
|
10
|
+
export * from './wedge.js';
|
|
11
|
+
export * from './sweep.js';
|
package/src/shapes/opening.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Vector3 } from "
|
|
1
|
+
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
2
|
import * as THREE from "three";
|
|
3
|
-
import { ShapeOutlineMesh } from "./outline-utils";
|
|
4
|
-
import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract";
|
|
3
|
+
import { ShapeOutlineMesh } from "./outline-utils.js";
|
|
4
|
+
import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
|
|
5
5
|
export interface IOpeningOptions {
|
|
6
6
|
ogid?: string;
|
|
7
7
|
center: Vector3;
|
|
@@ -11,8 +11,17 @@ export interface IOpeningOptions {
|
|
|
11
11
|
color: number;
|
|
12
12
|
fatOutlines?: boolean;
|
|
13
13
|
outlineWidth?: number;
|
|
14
|
+
translation?: Vector3;
|
|
15
|
+
rotation?: Vector3;
|
|
16
|
+
scale?: Vector3;
|
|
14
17
|
}
|
|
15
|
-
export
|
|
18
|
+
export interface OpeningPlacementOptions {
|
|
19
|
+
translation?: Vector3;
|
|
20
|
+
rotation?: Vector3;
|
|
21
|
+
scale?: Vector3;
|
|
22
|
+
}
|
|
23
|
+
export type OpeningConfigUpdate = Partial<Omit<IOpeningOptions, "translation" | "rotation" | "scale">>;
|
|
24
|
+
export type OpeningPlacementUpdate = OpeningPlacementOptions;
|
|
16
25
|
export declare class Opening extends THREE.Mesh {
|
|
17
26
|
#private;
|
|
18
27
|
ogid: string;
|
|
@@ -21,7 +30,6 @@ export declare class Opening extends THREE.Mesh {
|
|
|
21
30
|
private _outlineEnabled;
|
|
22
31
|
private _fatOutlines;
|
|
23
32
|
private _outlineWidth;
|
|
24
|
-
private _geometryCenterOffset;
|
|
25
33
|
set width(value: number);
|
|
26
34
|
set height(value: number);
|
|
27
35
|
set depth(value: number);
|
|
@@ -33,6 +41,17 @@ export declare class Opening extends THREE.Mesh {
|
|
|
33
41
|
constructor(options?: IOpeningOptions);
|
|
34
42
|
validateOptions(): void;
|
|
35
43
|
setConfig(options: OpeningConfigUpdate): void;
|
|
44
|
+
getConfig(): IOpeningOptions;
|
|
45
|
+
getAnchor(): Vector3;
|
|
46
|
+
setPlacement(placement: OpeningPlacementUpdate): void;
|
|
47
|
+
setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
|
|
48
|
+
setTranslation(translation: Vector3): void;
|
|
49
|
+
setRotation(rotation: Vector3): void;
|
|
50
|
+
setScale(scale: Vector3): void;
|
|
51
|
+
getPlacement(): import("../editor.js").ParametricPlacement;
|
|
52
|
+
getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
|
|
53
|
+
canConvertToFreeform(): boolean;
|
|
54
|
+
toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
|
|
36
55
|
cleanGeometry(): void;
|
|
37
56
|
generateGeometry(): void;
|
|
38
57
|
getBrepData(): any;
|
|
@@ -53,4 +72,5 @@ export declare class Opening extends THREE.Mesh {
|
|
|
53
72
|
get outlineMesh(): ShapeOutlineMesh | null;
|
|
54
73
|
private clearOutlineMesh;
|
|
55
74
|
discardGeometry(): void;
|
|
75
|
+
private writePositionsToGeometry;
|
|
56
76
|
}
|
package/src/shapes/polygon.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as THREE from "three";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import * as OGKernel from "../../opengeometry/pkg/opengeometry.js";
|
|
3
|
+
import { OGPolygon, Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
4
|
+
import { ExtrudedShape } from "./extruded-shape.js";
|
|
5
|
+
import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
|
|
4
6
|
export interface IPolygonOptions {
|
|
5
7
|
ogid?: string;
|
|
6
8
|
vertices: Vector3[];
|
|
@@ -8,8 +10,17 @@ export interface IPolygonOptions {
|
|
|
8
10
|
color: number;
|
|
9
11
|
fatOutlines?: boolean;
|
|
10
12
|
outlineWidth?: number;
|
|
13
|
+
translation?: Vector3;
|
|
14
|
+
rotation?: Vector3;
|
|
15
|
+
scale?: Vector3;
|
|
11
16
|
}
|
|
12
|
-
export
|
|
17
|
+
export interface PolygonPlacementOptions {
|
|
18
|
+
translation?: Vector3;
|
|
19
|
+
rotation?: Vector3;
|
|
20
|
+
scale?: Vector3;
|
|
21
|
+
}
|
|
22
|
+
export type PolygonConfigUpdate = Partial<Omit<IPolygonOptions, "translation" | "rotation" | "scale">>;
|
|
23
|
+
export type PolygonPlacementUpdate = PolygonPlacementOptions;
|
|
13
24
|
export declare class Polygon extends THREE.Mesh {
|
|
14
25
|
#private;
|
|
15
26
|
ogid: string;
|
|
@@ -26,11 +37,25 @@ export declare class Polygon extends THREE.Mesh {
|
|
|
26
37
|
constructor(options?: IPolygonOptions);
|
|
27
38
|
validateOptions(): void;
|
|
28
39
|
setConfig(options: PolygonConfigUpdate): void;
|
|
40
|
+
getConfig(): IPolygonOptions;
|
|
41
|
+
getAnchor(): OGKernel.Vector3;
|
|
42
|
+
setAnchor(anchor: Vector3): void;
|
|
43
|
+
resetAnchor(): void;
|
|
44
|
+
setPlacement(placement: PolygonPlacementUpdate): void;
|
|
45
|
+
setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
|
|
46
|
+
setTranslation(translation: Vector3): void;
|
|
47
|
+
setRotation(rotation: Vector3): void;
|
|
48
|
+
setScale(scale: Vector3): void;
|
|
49
|
+
getPlacement(): import("../editor.js").ParametricPlacement;
|
|
50
|
+
getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
|
|
51
|
+
canConvertToFreeform(): boolean;
|
|
52
|
+
toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
|
|
29
53
|
cleanGeometry(): void;
|
|
30
54
|
generateGeometry(): void;
|
|
31
55
|
addVertices(vertices: Vector3[]): void;
|
|
32
56
|
saveTransformationToBREP(): void;
|
|
33
57
|
addHole(holeVertices: Vector3[]): void;
|
|
58
|
+
extrude(height?: number, faceId?: number): ExtrudedShape;
|
|
34
59
|
getBrepData(): string | null;
|
|
35
60
|
/**
|
|
36
61
|
* Subtracts another boolean operand from this polygon.
|
|
@@ -47,4 +72,5 @@ export declare class Polygon extends THREE.Mesh {
|
|
|
47
72
|
disposeGeometryMaterial(): void;
|
|
48
73
|
private clearOutlineMesh;
|
|
49
74
|
dispose(): void;
|
|
75
|
+
private writePositionsToGeometry;
|
|
50
76
|
}
|
package/src/shapes/sphere.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as OGKernel from "../../opengeometry/pkg/opengeometry.js";
|
|
2
|
+
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
3
|
import * as THREE from "three";
|
|
3
|
-
import { ShapeOutlineMesh } from "./outline-utils";
|
|
4
|
-
import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract";
|
|
4
|
+
import { ShapeOutlineMesh } from "./outline-utils.js";
|
|
5
|
+
import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
|
|
5
6
|
export interface ISphereOptions {
|
|
6
7
|
ogid?: string;
|
|
7
8
|
center: Vector3;
|
|
@@ -11,8 +12,17 @@ export interface ISphereOptions {
|
|
|
11
12
|
color: number;
|
|
12
13
|
fatOutlines?: boolean;
|
|
13
14
|
outlineWidth?: number;
|
|
15
|
+
translation?: Vector3;
|
|
16
|
+
rotation?: Vector3;
|
|
17
|
+
scale?: Vector3;
|
|
14
18
|
}
|
|
15
|
-
export
|
|
19
|
+
export interface SpherePlacementOptions {
|
|
20
|
+
translation?: Vector3;
|
|
21
|
+
rotation?: Vector3;
|
|
22
|
+
scale?: Vector3;
|
|
23
|
+
}
|
|
24
|
+
export type SphereConfigUpdate = Partial<Omit<ISphereOptions, "translation" | "rotation" | "scale">>;
|
|
25
|
+
export type SpherePlacementUpdate = SpherePlacementOptions;
|
|
16
26
|
export declare class Sphere extends THREE.Mesh {
|
|
17
27
|
#private;
|
|
18
28
|
ogid: string;
|
|
@@ -26,6 +36,17 @@ export declare class Sphere extends THREE.Mesh {
|
|
|
26
36
|
constructor(options?: ISphereOptions);
|
|
27
37
|
validateOptions(): void;
|
|
28
38
|
setConfig(options: SphereConfigUpdate): void;
|
|
39
|
+
getConfig(): ISphereOptions;
|
|
40
|
+
getAnchor(): OGKernel.Vector3;
|
|
41
|
+
setPlacement(placement: SpherePlacementUpdate): void;
|
|
42
|
+
setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
|
|
43
|
+
setTranslation(translation: Vector3): void;
|
|
44
|
+
setRotation(rotation: Vector3): void;
|
|
45
|
+
setScale(scale: Vector3): void;
|
|
46
|
+
getPlacement(): import("../editor.js").ParametricPlacement;
|
|
47
|
+
getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
|
|
48
|
+
canConvertToFreeform(): boolean;
|
|
49
|
+
toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
|
|
29
50
|
cleanGeometry(): void;
|
|
30
51
|
generateGeometry(): void;
|
|
31
52
|
getBrep(): any;
|
|
@@ -42,4 +63,5 @@ export declare class Sphere extends THREE.Mesh {
|
|
|
42
63
|
get outlineMesh(): ShapeOutlineMesh | null;
|
|
43
64
|
private clearOutlineMesh;
|
|
44
65
|
discardGeometry(): void;
|
|
66
|
+
private writePositionsToGeometry;
|
|
45
67
|
}
|
package/src/shapes/sweep.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as OGKernel from "../../opengeometry/pkg/opengeometry.js";
|
|
2
|
+
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
3
|
import * as THREE from "three";
|
|
3
|
-
import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract";
|
|
4
|
+
import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
|
|
4
5
|
export interface ISweepOptions {
|
|
5
6
|
ogid?: string;
|
|
6
7
|
path: Vector3[];
|
|
@@ -10,8 +11,17 @@ export interface ISweepOptions {
|
|
|
10
11
|
capEnd?: boolean;
|
|
11
12
|
fatOutlines?: boolean;
|
|
12
13
|
outlineWidth?: number;
|
|
14
|
+
translation?: Vector3;
|
|
15
|
+
rotation?: Vector3;
|
|
16
|
+
scale?: Vector3;
|
|
13
17
|
}
|
|
14
|
-
export
|
|
18
|
+
export interface SweepPlacementOptions {
|
|
19
|
+
translation?: Vector3;
|
|
20
|
+
rotation?: Vector3;
|
|
21
|
+
scale?: Vector3;
|
|
22
|
+
}
|
|
23
|
+
export type SweepConfigUpdate = Partial<Omit<ISweepOptions, "translation" | "rotation" | "scale">>;
|
|
24
|
+
export type SweepPlacementUpdate = SweepPlacementOptions;
|
|
15
25
|
export declare class Sweep extends THREE.Mesh {
|
|
16
26
|
#private;
|
|
17
27
|
ogid: string;
|
|
@@ -24,6 +34,19 @@ export declare class Sweep extends THREE.Mesh {
|
|
|
24
34
|
constructor(options?: ISweepOptions);
|
|
25
35
|
validateOptions(): void;
|
|
26
36
|
setConfig(options: SweepConfigUpdate): void;
|
|
37
|
+
getConfig(): ISweepOptions;
|
|
38
|
+
getAnchor(): OGKernel.Vector3;
|
|
39
|
+
setAnchor(anchor: Vector3): void;
|
|
40
|
+
resetAnchor(): void;
|
|
41
|
+
setPlacement(placement: SweepPlacementUpdate): void;
|
|
42
|
+
setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
|
|
43
|
+
setTranslation(translation: Vector3): void;
|
|
44
|
+
setRotation(rotation: Vector3): void;
|
|
45
|
+
setScale(scale: Vector3): void;
|
|
46
|
+
getPlacement(): import("../editor.js").ParametricPlacement;
|
|
47
|
+
getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
|
|
48
|
+
canConvertToFreeform(): boolean;
|
|
49
|
+
toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
|
|
27
50
|
cleanGeometry(): void;
|
|
28
51
|
generateGeometry(): void;
|
|
29
52
|
getBrep(): any;
|
|
@@ -39,4 +62,5 @@ export declare class Sweep extends THREE.Mesh {
|
|
|
39
62
|
get outlineWidth(): number;
|
|
40
63
|
private clearOutlineMesh;
|
|
41
64
|
discardGeometry(): void;
|
|
65
|
+
private writePositionsToGeometry;
|
|
42
66
|
}
|
package/src/shapes/wedge.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Vector3 } from "
|
|
1
|
+
import { Vector3 } from "../../opengeometry/pkg/opengeometry.js";
|
|
2
2
|
import * as THREE from "three";
|
|
3
|
-
import { ShapeOutlineMesh } from "./outline-utils";
|
|
4
|
-
import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract";
|
|
3
|
+
import { ShapeOutlineMesh } from "./outline-utils.js";
|
|
4
|
+
import type { ShapeSubtractOperand, ShapeSubtractOptions, ShapeSubtractResult } from "./boolean-subtract.js";
|
|
5
5
|
export interface IWedgeOptions {
|
|
6
6
|
ogid?: string;
|
|
7
7
|
center: Vector3;
|
|
@@ -11,8 +11,17 @@ export interface IWedgeOptions {
|
|
|
11
11
|
color: number;
|
|
12
12
|
fatOutlines?: boolean;
|
|
13
13
|
outlineWidth?: number;
|
|
14
|
+
translation?: Vector3;
|
|
15
|
+
rotation?: Vector3;
|
|
16
|
+
scale?: Vector3;
|
|
14
17
|
}
|
|
15
|
-
export
|
|
18
|
+
export interface WedgePlacementOptions {
|
|
19
|
+
translation?: Vector3;
|
|
20
|
+
rotation?: Vector3;
|
|
21
|
+
scale?: Vector3;
|
|
22
|
+
}
|
|
23
|
+
export type WedgeConfigUpdate = Partial<Omit<IWedgeOptions, "translation" | "rotation" | "scale">>;
|
|
24
|
+
export type WedgePlacementUpdate = WedgePlacementOptions;
|
|
16
25
|
export declare class Wedge extends THREE.Mesh {
|
|
17
26
|
#private;
|
|
18
27
|
ogid: string;
|
|
@@ -25,6 +34,17 @@ export declare class Wedge extends THREE.Mesh {
|
|
|
25
34
|
constructor(options?: IWedgeOptions);
|
|
26
35
|
validateOptions(): void;
|
|
27
36
|
setConfig(options: WedgeConfigUpdate): void;
|
|
37
|
+
getConfig(): IWedgeOptions;
|
|
38
|
+
getAnchor(): Vector3;
|
|
39
|
+
setPlacement(placement: WedgePlacementUpdate): void;
|
|
40
|
+
setTransform(translation: Vector3, rotation: Vector3, scale: Vector3): void;
|
|
41
|
+
setTranslation(translation: Vector3): void;
|
|
42
|
+
setRotation(rotation: Vector3): void;
|
|
43
|
+
setScale(scale: Vector3): void;
|
|
44
|
+
getPlacement(): import("../editor.js").ParametricPlacement;
|
|
45
|
+
getEditCapabilities(): import("../editor.js").ParametricEditCapabilities;
|
|
46
|
+
canConvertToFreeform(): boolean;
|
|
47
|
+
toFreeform(id?: string): import("../freeform.js").FreeformGeometry;
|
|
28
48
|
cleanGeometry(): void;
|
|
29
49
|
generateGeometry(): void;
|
|
30
50
|
getBrepData(): any;
|
|
@@ -41,4 +61,5 @@ export declare class Wedge extends THREE.Mesh {
|
|
|
41
61
|
get outlineMesh(): ShapeOutlineMesh | null;
|
|
42
62
|
private clearOutlineMesh;
|
|
43
63
|
discardGeometry(): void;
|
|
64
|
+
private writePositionsToGeometry;
|
|
44
65
|
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as THREE from "three";
|
|
2
|
-
import type { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
|
|
3
|
-
export type OutlineRefreshMode = "live" | "on-stop" | "manual";
|
|
4
|
-
type ShapeKey = "polygon" | "cuboid" | "cylinder" | "wedge" | "opening" | "sweep" | "sphere";
|
|
5
|
-
export interface ShapeOutlineDropdownOptions {
|
|
6
|
-
scene: THREE.Scene;
|
|
7
|
-
camera: THREE.PerspectiveCamera;
|
|
8
|
-
renderer: THREE.WebGLRenderer;
|
|
9
|
-
controls: OrbitControls;
|
|
10
|
-
initialShape?: ShapeKey;
|
|
11
|
-
initialRefreshMode?: OutlineRefreshMode;
|
|
12
|
-
initialOutlineEnabled?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export interface ShapeOutlineDropdownHandle {
|
|
15
|
-
dispose: () => void;
|
|
16
|
-
refresh: () => void;
|
|
17
|
-
}
|
|
18
|
-
export declare function createShapeOutlineDropdownExample(options: ShapeOutlineDropdownOptions): ShapeOutlineDropdownHandle;
|
|
19
|
-
export declare function getAvailableOutlineShapes(): ReadonlyArray<{
|
|
20
|
-
key: ShapeKey;
|
|
21
|
-
label: string;
|
|
22
|
-
}>;
|
|
23
|
-
export {};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import * as THREE from "three";
|
|
2
|
-
import { OGSweptShape, Vector3 } from "../../../opengeometry/pkg/opengeometry";
|
|
3
|
-
interface ISweptShapeOptions {
|
|
4
|
-
ogid?: string;
|
|
5
|
-
color?: number;
|
|
6
|
-
profileVertices?: Vector3[];
|
|
7
|
-
pathPoints?: Vector3[];
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* SweptShape class that extends THREE.Mesh
|
|
11
|
-
* Creates a 3D shape by sweeping a 2D profile along a 3D path
|
|
12
|
-
*/
|
|
13
|
-
export declare class SweptShape extends THREE.Mesh {
|
|
14
|
-
#private;
|
|
15
|
-
ogid: string;
|
|
16
|
-
options: ISweptShapeOptions;
|
|
17
|
-
sweptShape: OGSweptShape;
|
|
18
|
-
transformationMatrix: THREE.Matrix4;
|
|
19
|
-
get color(): number;
|
|
20
|
-
set color(color: number);
|
|
21
|
-
constructor(options?: ISweptShapeOptions);
|
|
22
|
-
validateOptions(): void;
|
|
23
|
-
setConfig(options?: ISweptShapeOptions): void;
|
|
24
|
-
/**
|
|
25
|
-
* Generate geometry from the swept shape
|
|
26
|
-
*/
|
|
27
|
-
generateGeometry(): void;
|
|
28
|
-
/**
|
|
29
|
-
* Set the profile vertices for the sweep operation
|
|
30
|
-
*/
|
|
31
|
-
setProfileVertices(vertices: Vector3[]): void;
|
|
32
|
-
/**
|
|
33
|
-
* Set the path points for the sweep operation
|
|
34
|
-
*/
|
|
35
|
-
setPathPoints(points: Vector3[]): void;
|
|
36
|
-
/**
|
|
37
|
-
* Create a swept shape from a profile and path
|
|
38
|
-
*/
|
|
39
|
-
sweepAlongPath(profileVertices: Vector3[], pathPoints: Vector3[]): void;
|
|
40
|
-
/**
|
|
41
|
-
* Get the B-Rep data from the swept shape
|
|
42
|
-
*/
|
|
43
|
-
getBrepData(): string | null;
|
|
44
|
-
/**
|
|
45
|
-
* Clear the swept shape data
|
|
46
|
-
*/
|
|
47
|
-
clearSweptShape(): void;
|
|
48
|
-
/**
|
|
49
|
-
* Dispose of geometry and material resources
|
|
50
|
-
*/
|
|
51
|
-
disposeGeometry(): void;
|
|
52
|
-
/**
|
|
53
|
-
* Enable/disable outline rendering
|
|
54
|
-
*/
|
|
55
|
-
set outline(enable: boolean);
|
|
56
|
-
get outline(): boolean;
|
|
57
|
-
get outlineMesh(): THREE.Line | null;
|
|
58
|
-
/**
|
|
59
|
-
* Dispose of all resources when the object is destroyed
|
|
60
|
-
*/
|
|
61
|
-
dispose(): void;
|
|
62
|
-
}
|
|
63
|
-
export {};
|