threedviewer 2.2.0 → 2.3.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.
@@ -13,7 +13,7 @@ export interface IEnvironmentService {
13
13
  /**
14
14
  * Apply environment to scene
15
15
  */
16
- applyToScene(scene: IScene, texture: ITexture): Result<void>;
16
+ applyToScene(scene: IScene, texture: ITexture, options?: IEnvironmentApplyOptions): Result<void>;
17
17
  /**
18
18
  * Create studio environment
19
19
  */
@@ -32,3 +32,8 @@ export interface IStudioEnvironmentOptions {
32
32
  groundColor?: string;
33
33
  skyColor?: string;
34
34
  }
35
+ export interface IEnvironmentApplyOptions {
36
+ backgroundBlurriness?: number;
37
+ backgroundIntensity?: number;
38
+ environmentIntensity?: number;
39
+ }
@@ -3,6 +3,7 @@ import { IScene } from '../interfaces/IScene';
3
3
  import { IObject3D } from '../interfaces/IObject3D';
4
4
  import { ICamera } from '../interfaces/ICamera';
5
5
  import { IControls } from '../interfaces/IControls';
6
+ import { GridHelperOptions, AxesHelperOptions } from '../../types/options/HelperOptions';
6
7
  /**
7
8
  * Service for setting up scene elements like helpers, lighting, and backgrounds
8
9
  */
@@ -29,12 +30,12 @@ export interface ISceneSetupService {
29
30
  addDynamicGrid(scene: IScene, object: IObject3D, scaleFactor?: number): Result<void>;
30
31
  }
31
32
  export interface IHelperOptions {
32
- grid?: boolean;
33
+ grid?: boolean | GridHelperOptions;
33
34
  gridSize?: number;
34
35
  gridDivisions?: number;
35
36
  gridColor?: string;
36
37
  gridCenterLineColor?: string;
37
- axes?: boolean;
38
+ axes?: boolean | AxesHelperOptions;
38
39
  axesSize?: number;
39
40
  object3DHelper?: boolean;
40
41
  }
@@ -1,4 +1,4 @@
1
- import { IEnvironmentService, IEnvironmentOptions, IStudioEnvironmentOptions } from '../../core/services/IEnvironmentService';
1
+ import { IEnvironmentService, IEnvironmentOptions, IStudioEnvironmentOptions, IEnvironmentApplyOptions } from '../../core/services/IEnvironmentService';
2
2
  import { IScene, ITexture } from '../../core/interfaces/IScene';
3
3
  import { Result } from '../../utils/Result';
4
4
  export declare class ThreeEnvironmentService implements IEnvironmentService {
@@ -7,7 +7,7 @@ export declare class ThreeEnvironmentService implements IEnvironmentService {
7
7
  constructor();
8
8
  initialize(options: IEnvironmentOptions): Promise<Result<void>>;
9
9
  loadEnvironmentMap(url: string): Promise<Result<ITexture>>;
10
- applyToScene(scene: IScene, texture: ITexture): Result<void>;
10
+ applyToScene(scene: IScene, texture: ITexture, options?: IEnvironmentApplyOptions): Result<void>;
11
11
  /**
12
12
  * Get the original environment texture (for path tracing)
13
13
  */
@@ -0,0 +1,21 @@
1
+ import { IGridStyle, IGridOptions, GridType } from './IGridStyle';
2
+ import * as THREE from 'three';
3
+ export declare class GridFactory {
4
+ private static gridStyles;
5
+ /**
6
+ * Create a grid of the specified type
7
+ */
8
+ static createGrid(type: GridType, options: IGridOptions): THREE.Object3D;
9
+ /**
10
+ * Register a custom grid style
11
+ */
12
+ static registerGridStyle(type: GridType | string, style: IGridStyle): void;
13
+ /**
14
+ * Get available grid types
15
+ */
16
+ static getAvailableTypes(): string[];
17
+ /**
18
+ * Dispose of a specific grid style's resources
19
+ */
20
+ static disposeGridStyle(type: GridType): void;
21
+ }
@@ -0,0 +1,7 @@
1
+ import { IGridStyle, IGridOptions } from './IGridStyle';
2
+ import * as THREE from 'three';
3
+ export declare class HexagonalGlassGrid implements IGridStyle {
4
+ name: string;
5
+ createGrid(options: IGridOptions): THREE.Object3D;
6
+ dispose(): void;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { IGridStyle, IGridOptions } from './IGridStyle';
2
+ import * as THREE from 'three';
3
+ export declare class HexagonalWireGrid implements IGridStyle {
4
+ name: string;
5
+ createGrid(options: IGridOptions): THREE.Object3D;
6
+ dispose(): void;
7
+ }
@@ -0,0 +1,45 @@
1
+ import * as THREE from 'three';
2
+ export interface IGridStyle {
3
+ /**
4
+ * Name of the grid style
5
+ */
6
+ name: string;
7
+ /**
8
+ * Create the grid geometry and materials
9
+ */
10
+ createGrid(options: IGridOptions): THREE.Object3D;
11
+ /**
12
+ * Dispose of any resources used by this grid style
13
+ */
14
+ dispose?(): void;
15
+ }
16
+ export interface IGridOptions {
17
+ size: number;
18
+ divisions: number;
19
+ color?: string | number;
20
+ centerLineColor?: string | number;
21
+ opacity?: number;
22
+ styleOptions?: {
23
+ hexRadius?: number;
24
+ tileSize?: number;
25
+ texture?: string;
26
+ normalMap?: string;
27
+ roughnessMap?: string;
28
+ metalness?: number;
29
+ roughness?: number;
30
+ transmission?: number;
31
+ thickness?: number;
32
+ ior?: number;
33
+ height?: number;
34
+ bevelSize?: number;
35
+ randomHeight?: boolean;
36
+ randomRotation?: boolean;
37
+ };
38
+ }
39
+ export declare enum GridType {
40
+ SQUARE_WIRE = "square_wire",
41
+ HEXAGONAL_WIRE = "hexagonal_wire",
42
+ HEXAGONAL_GLASS = "hexagonal_glass",
43
+ STONE_TILES = "stone_tiles",
44
+ CUSTOM = "custom"
45
+ }
@@ -0,0 +1,7 @@
1
+ import { IGridStyle, IGridOptions } from './IGridStyle';
2
+ import * as THREE from 'three';
3
+ export declare class SquareWireGrid implements IGridStyle {
4
+ name: string;
5
+ createGrid(options: IGridOptions): THREE.Object3D;
6
+ dispose(): void;
7
+ }
@@ -0,0 +1,11 @@
1
+ import { IGridStyle, IGridOptions } from './IGridStyle';
2
+ import * as THREE from 'three';
3
+ export declare class StoneTileGrid implements IGridStyle {
4
+ name: string;
5
+ private textureLoader;
6
+ private loadedTextures;
7
+ createGrid(options: IGridOptions): THREE.Object3D;
8
+ private createStoneMaterial;
9
+ private loadTexture;
10
+ dispose(): void;
11
+ }
@@ -0,0 +1,6 @@
1
+ export * from './IGridStyle';
2
+ export * from './GridFactory';
3
+ export * from './SquareWireGrid';
4
+ export * from './HexagonalWireGrid';
5
+ export * from './HexagonalGlassGrid';
6
+ export * from './StoneTileGrid';