opengeometry 0.0.2 → 0.0.4
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/index.d.ts +49 -6
- package/index.js +1329 -177
- package/index.js.map +1 -1
- package/opengeometry_bg.wasm +0 -0
- package/opengeometry_bg.wasm.d.ts +135 -80
- package/package.json +7 -4
- package/src/base-types.d.ts +4 -2
- package/src/pencil.d.ts +1 -0
- package/src/primitives/base-primitive.d.ts +11 -0
- package/src/primitives/poly-line.d.ts +6 -1
- package/src/primitives/rectangle.d.ts +8 -9
- package/src/shapes/cylinder.d.ts +23 -0
- package/src/shapes/index.d.ts +2 -0
- package/src/shapes/polygon.d.ts +27 -0
- package/README.md +0 -16
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Vector3D, BasePolygon } from "../opengeometry/pkg/opengeometry";
|
|
1
|
+
import { Vector3D, BasePolygon, OGPolygon } from "../opengeometry/pkg/opengeometry";
|
|
2
2
|
import * as THREE from "three";
|
|
3
3
|
import { CSS2DRenderer } from "three/examples/jsm/renderers/CSS2DRenderer.js";
|
|
4
4
|
import { Pencil } from "./src/pencil";
|
|
@@ -14,13 +14,53 @@ export declare class OpenGeometry {
|
|
|
14
14
|
protected container: HTMLElement | undefined;
|
|
15
15
|
private _pencil;
|
|
16
16
|
private _labelRenderer;
|
|
17
|
+
private _enableDebug;
|
|
18
|
+
set enablePencil(value: boolean);
|
|
19
|
+
get pencil(): Pencil | undefined;
|
|
20
|
+
get labelRenderer(): CSS2DRenderer | undefined;
|
|
21
|
+
get enableDebug(): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Enables or disables debug mode for OpenGeometry.
|
|
24
|
+
* When enabled, it logs debug information to the console.
|
|
25
|
+
* Addtionally,
|
|
26
|
+
* 1. The geometry will be rendered with a semi-transparent material.
|
|
27
|
+
* 2. The faces will be rendered with a random color.
|
|
28
|
+
* 3. The normals will be rendered for better visualization.
|
|
29
|
+
* @param value - A boolean indicating whether to enable or disable debug mode.
|
|
30
|
+
*/
|
|
31
|
+
set enableDebug(value: boolean);
|
|
17
32
|
constructor(container: HTMLElement, threeScene: THREE.Scene, camera: THREE.Camera);
|
|
33
|
+
/**
|
|
34
|
+
* Asynchronously creates and initializes an instance of OpenGeometry.
|
|
35
|
+
*
|
|
36
|
+
* This factory method sets up the OpenGeometry engine by linking it with the
|
|
37
|
+
* rendering context and the WebAssembly module. It ensures all required
|
|
38
|
+
* options are provided and prepares the instance for 3D geometry operations.
|
|
39
|
+
*
|
|
40
|
+
* @param options - Configuration object for initializing OpenGeometry.
|
|
41
|
+
* @returns A promise that resolves to a fully initialized OpenGeometry instance.
|
|
42
|
+
* @throws If any of the required options (`container`, `scene`, or `camera`) are missing.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const openGeometry = await OpenGeometry.create({
|
|
47
|
+
* container: document.getElementById('myContainer')!,
|
|
48
|
+
* scene: threeScene,
|
|
49
|
+
* camera: threeCamera,
|
|
50
|
+
* wasmURL: '/assets/opengeometry.wasm'
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
18
54
|
static create(options: OpenGeometryOptions): Promise<OpenGeometry>;
|
|
19
55
|
private setup;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
56
|
+
private setuplabelRenderer;
|
|
57
|
+
private setupEvent;
|
|
58
|
+
/**
|
|
59
|
+
* Updates the label renderer to render the scene with the given camera.
|
|
60
|
+
* This method should be called in the animation loop or render loop of your application.
|
|
61
|
+
* @param scene - The Three.js scene containing the objects to be rendered.
|
|
62
|
+
* @param camera - The Three.js camera used for rendering the scene.
|
|
63
|
+
*/
|
|
24
64
|
update(scene: THREE.Scene, camera: THREE.Camera): void;
|
|
25
65
|
}
|
|
26
66
|
export declare class BasePoly extends THREE.Mesh {
|
|
@@ -40,7 +80,7 @@ export declare class BasePoly extends THREE.Mesh {
|
|
|
40
80
|
}
|
|
41
81
|
export declare class CirclePoly extends THREE.Mesh {
|
|
42
82
|
ogid: string;
|
|
43
|
-
polygon:
|
|
83
|
+
polygon: OGPolygon | null;
|
|
44
84
|
baseCircle: BaseCircle;
|
|
45
85
|
isExtruded: boolean;
|
|
46
86
|
constructor(baseCircle: BaseCircle);
|
|
@@ -49,8 +89,10 @@ export declare class CirclePoly extends THREE.Mesh {
|
|
|
49
89
|
addFlushBufferToScene(): void;
|
|
50
90
|
clearGeometry(): void;
|
|
51
91
|
extrude(height: number): void;
|
|
92
|
+
getBrepData(): void;
|
|
52
93
|
getOutline(type: OUTLINE_TYPE): THREE.Line<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.MeshBasicMaterial, THREE.Object3DEventMap> | undefined;
|
|
53
94
|
generateExtrudedGeometry(extruded_buff: string): void;
|
|
95
|
+
dispose(): void;
|
|
54
96
|
}
|
|
55
97
|
export declare class RectanglePoly extends THREE.Mesh {
|
|
56
98
|
ogid: string;
|
|
@@ -74,3 +116,4 @@ export declare class FlatMesh extends THREE.Mesh {
|
|
|
74
116
|
}
|
|
75
117
|
export { Vector3D, SpotLabel, };
|
|
76
118
|
export * from './src/primitives/';
|
|
119
|
+
export * from './src/shapes/';
|