three-low-poly 0.9.19 → 0.9.20

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/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ import { MeshLambertMaterial } from 'three';
12
12
  import { MeshPhongMaterial } from 'three';
13
13
  import { MeshPhysicalMaterial } from 'three';
14
14
  import { MeshStandardMaterial } from 'three';
15
+ import { Object3D } from 'three';
15
16
  import { ParametricGeometry } from 'three-stdlib';
16
17
  import { PerspectiveCamera } from 'three';
17
18
  import { ShaderMaterial } from 'three';
@@ -46,6 +47,37 @@ export declare function addWaterDisplacement<T extends Material>(material: T, {
46
47
  waveAmplitude?: number | undefined;
47
48
  }): void;
48
49
 
50
+ /**
51
+ * Align a BufferGeometry to a surface by adjusting its vertices.
52
+ */
53
+ export declare function alignBufferGeometryToSurface(geometry: BufferGeometry, targetPositionY: number): void;
54
+
55
+ /**
56
+ * Align a specific instance in an InstancedMesh to a surface.
57
+ */
58
+ export declare function alignInstancedMeshIndexToSurface(instancedMesh: InstancedMesh, targetPosition: Vector3, instanceIndex: number, offset?: Vector3): void;
59
+
60
+ /**
61
+ * Align an InstancedMesh to a surface.
62
+ */
63
+ export declare function alignInstancedMeshToSurface(instancedMesh: InstancedMesh, targetPosition: Vector3, offset?: Vector3): void;
64
+
65
+ /**
66
+ * Align an Object3D to a surface by adjusting its position.
67
+ */
68
+ export declare function alignObjectToSurface(object: Object3D, targetPosition: Vector3, offset?: Vector3): void;
69
+
70
+ /**
71
+ * Aligns an array of Object3D objects (or subclasses) to a specified side
72
+ * (left, right, top, bottom, front, or back) based on their world-space bounding boxes.
73
+ */
74
+ export declare function alignToEdge<T extends Object3D>(objects: T[], side: BoxSide): void;
75
+
76
+ /**
77
+ * Aligns an array of `Object3D` objects along a specified direction with optional spacing.
78
+ */
79
+ export declare function alignToRow<T extends Object3D>(objects: T[], direction?: Vector3, spacing?: number): void;
80
+
49
81
  /**
50
82
  * Generates spherical curve profile points, for use with geometry.
51
83
  * Enables connective geometry via holes at the top and bottom of the sphere.
@@ -391,6 +423,15 @@ export declare class BookshelfGeometry extends BufferGeometry {
391
423
  });
392
424
  }
393
425
 
426
+ export declare enum BoxSide {
427
+ LEFT = "left",
428
+ RIGHT = "right",
429
+ TOP = "top",
430
+ BOTTOM = "bottom",
431
+ FRONT = "front",
432
+ BACK = "back"
433
+ }
434
+
394
435
  export declare class BubblingEffect extends InstancedMesh {
395
436
  private bubblePositions;
396
437
  private velocities;
@@ -635,34 +676,41 @@ export declare const cartesianToSpherical: (x: number, y: number, z: number) =>
635
676
  phi: number;
636
677
  };
637
678
 
638
- export declare function centerGroup<T extends Group>(group: T): void;
639
-
640
- export declare function centerGroupAtTarget<T extends Group>(group: T, target?: Vector3): void;
641
-
642
- export declare function centerInstancedMesh<T extends InstancedMesh>(mesh: T): void;
643
-
644
- /**
645
- * Centers the given mesh at the origin (0, 0, 0) of the scene by adjusting its position.
646
- * The mesh is moved so that its bounding box center is placed at the origin.
647
- */
648
- export declare function centerMesh<T extends Mesh>(mesh: T): void;
679
+ export declare const Center: {
680
+ object: typeof centerObject;
681
+ objectGeometry: typeof centerObjectGeometry;
682
+ meshGeometry: typeof centerMeshGeometry;
683
+ };
649
684
 
650
685
  /**
651
- * Centers a Mesh at the specified target position.
686
+ * Centers the geometry of a `Mesh` relative to a target position with an optional offset.
687
+ *
688
+ * This function calculates the bounding box center of the `Mesh` geometry and adjusts its
689
+ * position by translating the geometry such that it is centered at the specified target
690
+ * position, with an optional offset applied. The function modifies the geometry directly,
691
+ * leaving the `Mesh`'s transformation properties (`position`, `rotation`, `scale`) unchanged.
652
692
  */
653
- export declare function centerMeshAtTarget<T extends Mesh>(mesh: T, target?: Vector3): void;
693
+ export declare function centerMeshGeometry<T extends Mesh>(mesh: T, target?: Vector3, offset?: Vector3): void;
654
694
 
655
695
  /**
656
- * Centers the geometry of the Mesh at the local origin (0, 0, 0) by modifying the geometry vertices.
657
- * This method moves the geometry itself so that its center is at the local origin,
658
- * without affecting the position, rotation, or scale of the mesh.
696
+ * Centers an `Object3D` relative to a specified target position with an optional offset.
697
+ *
698
+ * This function calculates the bounding box center of the given `Object3D` and adjusts
699
+ * its position so that it is centered at the specified target position, with an optional
700
+ * offset applied. The centering respects the object's current transformation, including
701
+ * its scale and rotation.
659
702
  */
660
- export declare function centerMeshGeometry<T extends Mesh>(mesh: T): void;
703
+ export declare function centerObject<T extends Object3D>(object: T, target?: Vector3, offset?: Vector3): void;
661
704
 
662
705
  /**
663
- * Centers the geometry of a Mesh at the specified target position.
706
+ * Centers the geometry of an `Object3D` relative to a target position with an optional offset.
707
+ *
708
+ * This function calculates the bounding box center of the given `Object3D` and adjusts its
709
+ * geometry's position by translating it such that the geometry is centered at the specified
710
+ * target position, with an optional offset applied. Unlike modifying the `position` property,
711
+ * this function directly translates the geometry within the object's local space.
664
712
  */
665
- export declare function centerMeshGeometryAtTarget<T extends Mesh>(mesh: T, target?: Vector3): void;
713
+ export declare function centerObjectGeometry<T extends Object3D>(object: T, target?: Vector3, offset?: Vector3): void;
666
714
 
667
715
  /**
668
716
  * Create a checkerboard texture
@@ -687,8 +735,9 @@ export declare const ColorPalette: {
687
735
  CHERRY_RED: number;
688
736
  CRIMSON: number;
689
737
  ALIZARIN_CRIMSON: number;
690
- RUST: number;
691
738
  DARK_RED: number;
739
+ RUST: number;
740
+ CORAL_ORANGE: number;
692
741
  TANGERINE: number;
693
742
  ORANGE_PEEL: number;
694
743
  CADMIUM_ORANGE: number;
@@ -708,6 +757,7 @@ export declare const ColorPalette: {
708
757
  MINT_GREEN: number;
709
758
  AQUAMARINE: number;
710
759
  PHTHALO_BLUE: number;
760
+ AETHER_BLUE: number;
711
761
  SKY_BLUE: number;
712
762
  CERULEAN_BLUE: number;
713
763
  AZURE: number;
@@ -1051,8 +1101,41 @@ export declare class DeskGeometry extends BufferGeometry {
1051
1101
  constructor();
1052
1102
  }
1053
1103
 
1104
+ /**
1105
+ * A diorama with a floor and walls.
1106
+ *
1107
+ * Material indices:
1108
+ * 0: Interior walls
1109
+ * 1: Floor
1110
+ * 2: Exterior walls
1111
+ */
1112
+ export declare class Diorama extends Mesh<DioramaGeometry, MeshStandardMaterial[]> {
1113
+ constructor({ width, height, depth, wallThickness, interiorColor, floorColor, exteriorColor, }?: {
1114
+ width?: number | undefined;
1115
+ height?: number | undefined;
1116
+ depth?: number | undefined;
1117
+ wallThickness?: number | undefined;
1118
+ interiorColor?: number | undefined;
1119
+ floorColor?: number | undefined;
1120
+ exteriorColor?: number | undefined;
1121
+ });
1122
+ }
1123
+
1124
+ /**
1125
+ * Geometry for a diorama with a floor and walls.
1126
+ *
1127
+ * Group indices:
1128
+ * 0: Interior walls
1129
+ * 1: Floor
1130
+ * 2: Exterior walls
1131
+ */
1054
1132
  export declare class DioramaGeometry extends BufferGeometry {
1055
- constructor(width?: number, height?: number, depth?: number, wallThickness?: number);
1133
+ constructor({ width, height, depth, wallThickness }?: {
1134
+ width?: number | undefined;
1135
+ height?: number | undefined;
1136
+ depth?: number | undefined;
1137
+ wallThickness?: number | undefined;
1138
+ });
1056
1139
  }
1057
1140
 
1058
1141
  /**
@@ -1851,6 +1934,13 @@ export declare interface PanelOptions {
1851
1934
 
1852
1935
  export declare const parabolicCurve: (t: number, a?: number, b?: number, c?: number) => number;
1853
1936
 
1937
+ /**
1938
+ * Prismatic parallelogram, with horizontal skew (offset in X for the slant).
1939
+ */
1940
+ export declare class ParallelogramBoxGeometry extends BufferGeometry {
1941
+ constructor(width?: number, height?: number, depth?: number, angle?: number);
1942
+ }
1943
+
1854
1944
  export declare const ParametricCurve: {
1855
1945
  CUBIC: (t: number, p0: number, p1: number, p2: number, p3: number) => number;
1856
1946
  DAMPED: (t: number, damping?: number) => number;