three-low-poly 0.9.21 → 0.9.23

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.
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.umd.js","sources":["../src/animators/cameraDollyAnimation.ts","../src/animators/cameraFlythroughAnimation.ts","../src/animators/cameraOrbitAnimation.ts","../src/animators/cameraPendulumAnimation.ts","../src/animators/cameraSpiralAscentionAnimation.ts","../src/animators/cameraWobbleAnimation.ts","../src/animators/cameraZoomInAnimation.ts","../src/animators/EmissivePulseAnimation.ts","../src/utils/RandomNumberUtils.ts","../src/animators/LightFlickerAnimation.ts","../src/utils/RandomTimer.ts","../src/animators/LightningAnimation.ts","../src/constants/Direction.ts","../src/constants/Falloff.ts","../src/brushes/DisplacementBrush.ts","../src/brushes/FlattenBrush.ts","../src/brushes/NoiseBrush.ts","../src/brushes/SmoothBrush.ts","../src/brushes/SpikeBrush.ts","../src/brushes/TwistBrush.ts","../src/constants/Axis.ts","../src/constants/BoxSide.ts","../src/constants/ColorPalette.ts","../src/constants/Easing.ts","../src/constants/ParametricCurve.ts","../src/effects/BubblingEffect.ts","../src/geometry/leafs/EllipticLeafGeometry.ts","../src/effects/LeafEffect.ts","../node_modules/three-stdlib/utils/BufferGeometryUtils.js","../node_modules/three-stdlib/geometries/ParametricGeometry.js","../src/geometry/books/BookGeometry.ts","../src/factory/BookFactory.ts","../src/factory/HexagonalTileFactory.ts","../src/geometry/architecture/BifurcatedStaircaseGeometry.ts","../src/geometry/architecture/DioramaGeometry.ts","../src/geometry/architecture/LShapedStaircaseGeometry.ts","../src/geometry/architecture/SpiralStaircaseGeometry.ts","../src/geometry/architecture/StaircaseGeometry.ts","../src/geometry/bottles/JarGeometry.ts","../src/utils/LineEquations.ts","../src/geometry/bottles/PotionBottleGeometry.ts","../src/geometry/bottles/WineBottleGeometry.ts","../src/geometry/cemetery/CrossHeadstoneGeometry.ts","../src/geometry/cemetery/MausoleumGeometry.ts","../src/geometry/cemetery/ObeliskHeadstoneGeometry.ts","../src/geometry/cemetery/RoundedHeadstoneGeometry.ts","../src/geometry/cemetery/SquareHeadstoneGeometry.ts","../src/geometry/fence/StoneFencePostGeometry.ts","../src/geometry/fence/WroughtIronBarGeometry.ts","../src/geometry/fence/WroughtIronFenceGeometry.ts","../src/geometry/furniture/BookshelfGeometry.ts","../src/geometry/furniture/DeskGeometry.ts","../src/geometry/lighting/FlameGeometry.ts","../src/geometry/lighting/CandleGeometry.ts","../src/geometry/primitives/ParallelogramBoxGeometry.ts","../src/geometry/rocks/MossyRocksGeometry.ts","../src/utils/VertexUtils.ts","../src/geometry/rocks/RockGeometry.ts","../src/geometry/rocks/RocksGeometry.ts","../src/geometry/skeleton/BoneGeometry.ts","../src/geometry/science/ErlenmeyerFlaskGeometry.ts","../src/utils/SphericalGeometryUtils.ts","../src/utils/SphericalCurve.ts","../src/geometry/science/FlorenceFlaskGeometry.ts","../src/geometry/science/MortarGeometry.ts","../src/geometry/science/StandGeometry.ts","../src/geometry/science/TeslaCoilGeometry.ts","../src/geometry/science/TestTubeGeometry.ts","../src/geometry/terrain/HillGeometry.ts","../src/geometry/terrain/MoundGeometry.ts","../src/geometry/trees/TreeGeometry.ts","../src/models/architecture/Diorama.ts","../src/shaders/moonShader.ts","../src/models/astronomy/Moon.ts","../src/models/books/Book.ts","../src/models/bottles/Jar.ts","../src/models/bottles/PotionBottle.ts","../src/models/bottles/WineBottle.ts","../src/models/cemetery/CrossHeadstone.ts","../src/models/cemetery/Mausoleum.ts","../src/models/cemetery/ObeliskHeadstone.ts","../src/models/cemetery/RoundedHeadstone.ts","../src/models/cemetery/SquareHeadstone.ts","../src/models/fence/StoneFencePost.ts","../src/models/fence/WroughtIronBar.ts","../src/models/fence/WroughtIronFence.ts","../src/models/furniture/Bookshelf.ts","../src/models/furniture/Desk.ts","../src/models/lighting/Candle.ts","../src/models/lighting/Flame.ts","../src/models/lighting/Lantern.ts","../src/models/rocks/MossyRocks.ts","../src/models/rocks/Rock.ts","../src/models/rocks/Rocks.ts","../src/models/science/BunsenBurner.ts","../src/models/science/ElectricPanel.ts","../src/models/science/ErlenmeyerFlask.ts","../src/models/science/FlorenceFlask.ts","../src/models/science/LeverPanel.ts","../src/models/science/Microscope.ts","../src/models/science/MortarAndPestle.ts","../src/models/science/Panel.ts","../src/models/science/PanelLight.ts","../src/models/science/SpiralTube.ts","../src/models/science/Stand.ts","../src/models/science/TeslaCoil.ts","../src/models/science/TestTube.ts","../src/models/science/TestTubeRack.ts","../src/shapes/BurstShape.ts","../src/models/shapes/Burst.ts","../src/shapes/GearShape.ts","../src/models/shapes/Gear.ts","../src/shapes/HeartShape.ts","../src/models/shapes/Heart.ts","../src/shapes/StarShape.ts","../src/models/shapes/Star.ts","../src/models/skeleton/Bone.ts","../src/models/trees/Tree.ts","../src/models/terrain/Hill.ts","../src/models/terrain/Mound.ts","../src/shaders/addWaterDisplacement.ts","../src/shaders/addNoiseDisplacement.ts","../src/shaders/atmosphericShader.ts","../src/shaders/daySkyShader.ts","../src/shaders/fadeShader.ts","../src/shaders/nightSkyShader.ts","../src/skybox/AtmosphericSkybox.ts","../src/skybox/DaySkybox.ts","../src/skybox/NightSkybox.ts","../src/textures/checkerboard.ts","../src/utils/AlignToEdge.ts","../src/utils/AlignToRow.ts","../src/utils/AlignToSurface.ts","../src/utils/Center.ts","../src/utils/ColorUtils.ts","../src/utils/FindClosestPoint.ts","../src/utils/InterpolateCurve.ts","../src/utils/ParametricCurveUtils.ts","../src/utils/QuadUtils.ts","../src/utils/UVUtils.ts"],"sourcesContent":["import { Camera, Vector3 } from \"three\";\n\n/**\n * Dolly backward\n *\n * Example:\n * ```\n * dollyAnimation(camera, 5, 3000, () => {\n * console.log(\"Dolly animation complete\");\n * });\n * ```\n */\nexport function cameraDollyAnimation(\n camera: Camera,\n distance: number,\n duration: number,\n onComplete?: () => void, // Optional callback\n): void {\n const startPos = camera.position.clone();\n const endPos = startPos.clone().add(camera.getWorldDirection(new Vector3()).multiplyScalar(-distance));\n let startTime: number | null = null;\n\n function animate(time: number): void {\n if (startTime === null) startTime = time;\n const elapsed = time - startTime;\n const progress = elapsed / duration;\n\n if (progress >= 1) {\n camera.position.copy(endPos);\n if (onComplete) onComplete();\n return;\n }\n\n // Interpolate position\n camera.position.lerpVectors(startPos, endPos, progress);\n\n requestAnimationFrame(animate);\n }\n\n requestAnimationFrame(animate);\n}\n","import { Camera, Vector3 } from \"three\";\n\n/**\n * The camera flies through a sequence of points, ideal for showcasing specific elements in the scene.\n *\n * Example:\n * ```\n * flythroughAnimation(\n * camera,\n * [\n * new THREE.Vector3(0, 5, 5),\n * new THREE.Vector3(0, 5, -25.5),\n * new THREE.Vector3(-20.5, 5, 0),\n * ],\n * 6000,\n * () => {\n * console.log(\"Flythrough animation complete\");\n * }\n * );\n * ```\n */\nexport function cameraFlythroughAnimation(camera: Camera, waypoints: Vector3[], duration: number, onComplete?: () => void): void {\n const totalSegments = waypoints.length - 1;\n let startTime: number | null = null;\n\n function animate(time: number): void {\n if (startTime === null) startTime = time;\n const elapsed = time - startTime;\n const totalProgress = elapsed / duration;\n\n if (totalProgress >= 1) {\n camera.position.copy(waypoints[waypoints.length - 1]);\n if (onComplete) onComplete();\n return;\n }\n\n // Determine current segment and progress within it\n const segmentProgress = totalProgress * totalSegments;\n const segmentIndex = Math.floor(segmentProgress);\n const segmentFraction = segmentProgress - segmentIndex;\n\n const start = waypoints[segmentIndex];\n const end = waypoints[segmentIndex + 1];\n\n camera.position.lerpVectors(start, end, segmentFraction);\n camera.lookAt(end);\n\n requestAnimationFrame(animate);\n }\n\n requestAnimationFrame(animate);\n}\n","import { Camera, Vector3 } from \"three\";\n\n/**\n * Orbit around a target\n *\n * Example:\n * ```\n * orbitAnimation(camera, new THREE.Vector3(0, 0, 0), 10, 5000, () => {\n * console.log(\"Orbit animation complete\");\n * });\n * ```\n */\nexport function cameraOrbitAnimation(camera: Camera, target: Vector3, radius: number, duration: number, onComplete?: () => void) {\n let startTime: number | null = null\n\n function animate(time: number) {\n if (!startTime) startTime = time;\n const elapsed = time - startTime;\n const progress = elapsed / duration;\n\n // Clamp progress to [0, 1]\n if (progress >= 1) {\n if (onComplete) onComplete();\n return;\n }\n\n // Calculate angle based on progress\n const angle = progress * Math.PI * 2; // Full circle\n const x = target.x + radius * Math.cos(angle);\n const z = target.z + radius * Math.sin(angle);\n\n camera.position.set(x, camera.position.y, z);\n camera.lookAt(target);\n\n requestAnimationFrame(animate);\n }\n\n requestAnimationFrame(animate);\n}\n","import { Camera, Vector3 } from \"three\";\n\n/**\n * The camera swings back and forth like a pendulum.\n *\n * Example:\n * ```\n * pendulumAnimation(camera, new THREE.Vector3(0, 5, 5), 0.5, 9000, 3, () => {\n * console.log(\"Pendulum animation complete\");\n * });\n * ```\n */\nexport function cameraPendulumAnimation(\n camera: Camera,\n center: Vector3,\n radius: number,\n duration: number,\n oscillations: number,\n onComplete?: () => void,\n): void {\n let startTime: number | null = null;\n let oscillationCount = 0;\n\n function animate(time: number): void {\n if (startTime === null) startTime = time;\n const elapsed = time - startTime;\n\n // Calculate progress through a single oscillation\n const oscillationDuration = duration / oscillations;\n const progress = (elapsed % oscillationDuration) / oscillationDuration;\n\n // Calculate pendulum angle\n const angle = (Math.sin(progress * Math.PI * 2) * Math.PI) / 6; // Swing between -30° and +30°\n const x = center.x + radius * Math.sin(angle);\n const z = center.z + radius * Math.cos(angle);\n\n camera.position.set(x, camera.position.y, z);\n camera.lookAt(center);\n\n // Increment oscillation count when completing a cycle\n if (elapsed >= (oscillationCount + 1) * oscillationDuration) {\n oscillationCount++;\n }\n\n // Stop after the specified number of oscillations\n if (oscillationCount >= oscillations) {\n if (onComplete) onComplete();\n return;\n }\n\n requestAnimationFrame(animate);\n }\n\n requestAnimationFrame(animate);\n}\n","import { Camera, Vector3 } from \"three\";\n\n/**\n * The camera spirals upward, perfect for revealing a large scene or structure.\n *\n * Example:\n * ```\n * spiralAscensionAnimation(camera, new THREE.Vector3(0, 0, 0), 10, 300, 7, 12000, () => {\n * console.log(\"Spiral ascension animation complete\");\n * });\n * ```\n */\nexport function cameraSpiralAscensionAnimation(\n camera: Camera,\n center: Vector3,\n radius: number,\n height: number,\n revolutions: number,\n duration: number,\n onComplete?: () => void,\n): void {\n let startTime: number | null = null;\n\n function animate(time: number): void {\n if (startTime === null) startTime = time;\n const elapsed = time - startTime;\n const progress = elapsed / duration;\n\n if (progress >= 1) {\n if (onComplete) onComplete();\n return;\n }\n\n const angle = progress * Math.PI * 2 * revolutions; // Total angle covered\n const x = center.x + radius * Math.cos(angle);\n const z = center.z + radius * Math.sin(angle);\n const y = center.y + height * progress;\n\n camera.position.set(x, y, z);\n camera.lookAt(center);\n\n requestAnimationFrame(animate);\n }\n\n requestAnimationFrame(animate);\n}\n","import { Camera, Vector3 } from \"three\";\n\n/**\n * Add a slight random wobble for intensity or realism (e.g., during an explosion).\n *\n * Example:\n * ```\n * wobbleAnimation(camera, 0.5, 1000, () => {\n * console.log(\"Wobble animation complete\");\n * });\n * ```\n */\nexport function cameraWobbleAnimation(camera: Camera, intensity: number, duration: number, onComplete?: () => void): void {\n const originalPosition = camera.position.clone();\n let startTime: number | null = null;\n\n function animate(time: number): void {\n if (startTime === null) startTime = time;\n const elapsed = time - startTime;\n const progress = elapsed / duration;\n\n if (progress >= 1) {\n camera.position.copy(originalPosition);\n if (onComplete) onComplete();\n return;\n }\n\n // Add random offset\n const offset = new Vector3(\n (Math.random() - 0.5) * intensity,\n (Math.random() - 0.5) * intensity,\n (Math.random() - 0.5) * intensity,\n );\n camera.position.copy(originalPosition).add(offset);\n\n requestAnimationFrame(animate);\n }\n\n requestAnimationFrame(animate);\n}\n","import { MathUtils, PerspectiveCamera, Vector3 } from \"three\";\n\n/**\n * The camera smoothly zooms in toward a target, focusing attention on a specific point,\n * and resets to its original FOV after completion.\n *\n * Example:\n * ```\n * zoomInAnimation(camera, new THREE.Vector3(0, 0, 0), 120, 75, 2000, () => {\n * console.log(\"Zoom in animation complete\");\n * });\n * ```\n */\nexport function cameraZoomInAnimation(\n camera: PerspectiveCamera,\n target: Vector3,\n startFov: number,\n endFov: number,\n duration: number,\n onComplete?: () => void,\n): void {\n const initialFov = camera.fov; // Store the initial FOV\n camera.fov = startFov;\n camera.updateProjectionMatrix();\n let startTime: number | null = null;\n\n function animate(time: number): void {\n if (startTime === null) startTime = time;\n const elapsed = time - startTime;\n const progress = elapsed / duration;\n\n if (progress >= 1) {\n camera.fov = endFov;\n camera.updateProjectionMatrix();\n camera.lookAt(target);\n\n // Reset FOV to its original value\n camera.fov = initialFov;\n camera.updateProjectionMatrix();\n if (onComplete) onComplete();\n return;\n }\n\n camera.fov = MathUtils.lerp(startFov, endFov, progress);\n camera.updateProjectionMatrix();\n camera.lookAt(target);\n\n requestAnimationFrame(animate);\n }\n\n requestAnimationFrame(animate);\n}\n","import { MeshLambertMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial } from \"three\";\n\nexport interface EmissivePulseEffectOptions {\n speed?: number;\n maxIntensity?: number;\n minIntensity?: number;\n material: MeshStandardMaterial | MeshPhysicalMaterial | MeshLambertMaterial | MeshPhongMaterial;\n}\n\n/**\n * Emissive pulse animation, producing a flickering light effect for materials that have emissive properties.\n * The emissive intensity of the material will oscillate between `minIntensity` and `maxIntensity`.\n *\n * Oscillation time = 2π / speed\n * - Low speed values (e.g., 0.5) will result in a slow pulse\n * - High speed values (e.g., 10) will result in a rapid flicker\n *\n * Requires `update()` frame handler with `clock.getElapsedTime()` for animation.\n *\n * Example usage:\n * ```\n * const pulseAnimation = new EmissivePulseAnimation();\n * const clock = new THREE.Clock();\n *\n * function animate() {\n * pulseAnimation.update(clock.getElapsedTime());\n * }\n * ```\n */\nexport class EmissivePulseAnimation {\n public speed: number;\n public maxIntensity: number;\n public minIntensity: number;\n public material: MeshStandardMaterial | MeshPhysicalMaterial | MeshLambertMaterial | MeshPhongMaterial;\n\n constructor(options: EmissivePulseEffectOptions) {\n const {\n speed = 2, //\n maxIntensity = 0.8,\n minIntensity = 0.2,\n } = options;\n\n this.speed = speed;\n this.maxIntensity = maxIntensity;\n this.minIntensity = minIntensity;\n this.material = options.material;\n }\n\n /**\n * Update the emissive intensity of the material.\n *\n * Use Three.Clock getElapsedTime()\n *\n * Example:\n * ```\n * const clock = new THREE.Clock();\n * effect.update(clock.getElapsedTime());\n * ```\n */\n public update(elapsedTime: number = 0) {\n this.material.emissiveIntensity = this.minIntensity + Math.abs(Math.sin(elapsedTime * this.speed)) * (this.maxIntensity - this.minIntensity);\n }\n}\n","/**\n * Generates a random number between `min` and `max`.\n */\nexport function randomFloat(min = 0, max = 1) {\n return Math.random() * (max - min) + min;\n}\n\n/**\n * Generates a random integer between `min` and `max`.\n */\nexport function randomInteger(min = 0, max = 1) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}\n\n/**\n * Generates a random number skewed towards the maximum value.\n *\n * @param {number} [exponent=0.5] - Controls the skew of the distribution.\n * A smaller value (e.g., 0.3) skews the values towards the max.\n * A larger value (e.g., 0.8) creates a more even distribution.\n * @param {number} [min=0] - Minimum value of the range.\n * @param {number} [max=1] - Maximum value of the range.\n * @returns {number} A random number between `min` and `max`, skewed towards `max`.\n */\nexport function logarithmicRandomMax(exponent = 0.5, min = 0, max = 1) {\n return min + (max - min) * Math.pow(Math.random(), exponent);\n}\n\n/**\n * Generates a random number skewed towards the minimum value.\n *\n * @param {number} [exponent=0.5] - Controls the skew of the distribution.\n * A smaller value (e.g., 0.3) skews the values towards the min.\n * A larger value (e.g., 0.8) creates a more even distribution.\n * @param {number} [min=0] - Minimum value of the range.\n * @param {number} [max=1] - Maximum value of the range.\n * @returns {number} A random number between `min` and `max`, skewed towards `min`.\n */\nexport function logarithmicRandomMin(exponent = 0.5, min = 0, max = 1) {\n return min + (max - min) * Math.pow(1 - Math.random(), exponent);\n}\n\n/**\n * Generates a random number with an inverse logarithmic distribution, biased towards the maximum value.\n *\n * @param {number} [min=0] - Minimum value of the range.\n * @param {number} [max=1] - Maximum value of the range.\n * @returns {number} A random number between `min` and `max`, skewed towards the maximum.\n */\n\nfunction inverseLogarithmicRandomMax(min = 0, max = 1) {\n // Generate the inverse-logarithmic skewed value between 0 and 1\n const randomValue = 1 - Math.log(1 - Math.random()) / Math.log(2);\n\n // Scale it to the desired range [min, max]\n return min + (max - min) * randomValue;\n}\n\n/**\n * Generates a random number with an inverse logarithmic distribution, biased towards the minimum value.\n *\n * @param {number} [min=0] - Minimum value of the range.\n * @param {number} [max=1] - Maximum value of the range.\n * @returns {number} A random number between `min` and `max`, skewed towards the minimum.\n */\nfunction inverseLogarithmicRandomMin(min = 0, max = 1) {\n // Generate the inverse-logarithmic skewed value between 0 and 1, but reverse it to bias towards the minimum\n const randomValue = Math.log(1 - Math.random()) / Math.log(2);\n const adjustedValue = -randomValue;\n\n // Clamp the adjusted value between 0 and 1 to prevent out-of-range values\n const clampedValue = Math.min(Math.max(adjustedValue, 0), 1);\n\n // Scale it to the desired range [min, max]\n return min + (max - min) * clampedValue;\n}\n","import { Light } from \"three\";\nimport { randomFloat } from \"../utils/RandomNumberUtils\";\n\nexport interface LightFlickerAnimationOptions {\n light?: Light;\n minIntensity: number;\n maxIntensity: number;\n x: number;\n y: number;\n z: number;\n jitterX: number;\n jitterY: number;\n jitterZ: number;\n}\n\n/**\n * Create a light flicker animation that will randomly change the intensity and position of a light.\n * Effect resembles a flickering flame of candlelight.\n *\n * Example usage:\n * ```\n * // Create a candle\n * const candle = new Candle({\n * height: 1,\n * flameHeight: 0.25,\n * });\n * scene.add(candle);\n *\n * // Create a point light\n * const candleLight = new THREE.PointLight(0xffa500, 1, 5);\n * scene.add(candleLight);\n *\n * // Apply the animator to the light\n * const lightAnimation = new LightFlickerAnimation({\n * light: candleLight,\n * maxIntensity: 2.2,\n * x: candle.position.x,\n * y: candle.position.y + 1 + 0.125, // height + half flame height\n * z: candle.position.z,\n * });\n * animations.push(lightAnimation);\n *\n * // Update the light animation in the render loop\n * renderer.setAnimationLoop(() => {\n * lightAnimation.update();\n * });\n * ```\n */\nexport class LightFlickerAnimation {\n private light?: Light;\n public minIntensity: number;\n public maxIntensity: number;\n public x: number;\n public y: number;\n public z: number;\n public jitterX: number;\n public jitterY: number;\n public jitterZ: number;\n\n constructor({\n light,\n minIntensity = 0.8,\n maxIntensity = 1.2,\n x = 0,\n y = 0,\n z = 0,\n jitterX = 0.02,\n jitterY = 0.0,\n jitterZ = 0.02,\n }: Partial<LightFlickerAnimationOptions> = {}) {\n this.light = light;\n this.minIntensity = minIntensity;\n this.maxIntensity = maxIntensity;\n this.x = x;\n this.y = y;\n this.z = z;\n this.jitterX = jitterX;\n this.jitterY = jitterY;\n this.jitterZ = jitterZ;\n }\n\n public update(): void {\n if (this.light) {\n this.light.intensity = randomFloat(this.minIntensity, this.maxIntensity);\n this.light.position.x = Math.random() * this.jitterX - this.jitterX / 2 + this.x;\n this.light.position.y = Math.random() * this.jitterY - this.jitterY / 2 + this.y;\n this.light.position.z = Math.random() * this.jitterZ - this.jitterZ / 2 + this.z;\n }\n }\n}\n","/**\n * Set a random timeout that will call the callback function with a random delay between minDelay and maxDelay.\n *\n * Example usage:\n * ```\n * setRandomTimeout(() => {\n * console.log(`Callback ${i} executed!`);\n * }, 100, 500); // Random timeout between 100ms and 500ms\n * ```\n */\nexport function setRandomTimeout(callback: () => void, minDelay: number, maxDelay: number) {\n const delay = minDelay + Math.random() * (maxDelay - minDelay);\n\n return setTimeout(callback, delay);\n}\n\n/**\n * Set a random interval that will call the callback function with a random delay between minDelay and maxDelay.\n *\n * Example usage:\n * ```\n * const clearRandomInterval = setRandomInterval(() => {\n * console.log('Random interval executed!');\n * }, 500, 1500); // Random delay between 500ms and 1500ms\n * ```\n */\nexport function setRandomInterval(callback: () => void, minDelay: number, maxDelay: number): () => void {\n let timeoutId: ReturnType<typeof setTimeout>;\n\n function scheduleNext() {\n const delay = minDelay + Math.random() * (maxDelay - minDelay);\n timeoutId = setTimeout(() => {\n callback();\n scheduleNext(); // Schedule the next execution\n }, delay);\n }\n\n scheduleNext();\n\n // Return a function to allow clearing the interval\n return () => clearTimeout(timeoutId);\n}\n","import { Light } from \"three\";\nimport { randomFloat } from \"../utils/RandomNumberUtils\";\nimport { setRandomTimeout } from \"../utils/RandomTimer\";\n\nexport interface LightningEffectOptions {\n light?: Light;\n minIntensity?: number;\n maxIntensity?: number;\n minDuration?: number;\n maxDuration?: number;\n}\n\n/**\n * A lightning animation that can be used to simulate a lightning storm.\n * This effect is applied to a light source.\n *\n * Example usage:\n * ```\n * const lightning = new THREE.DirectionalLight(0xffffff, 0);\n * scene.add(lightning);\n * lightning.position.set(5, 10, -5);\n *\n * const lightningAnimation = new LightningAnimation();\n *\n * setRandomInterval(() => {\n * lightningEffect.triggerLightning();\n * }, 250, 1250);\n * ```\n */\nexport class LightningAnimation {\n private light?: Light;\n public minIntensity: number;\n public maxIntensity: number;\n public minDuration: number;\n public maxDuration: number;\n\n constructor({\n light, //\n minIntensity = 15,\n maxIntensity = 20,\n minDuration = 50,\n maxDuration = 250,\n }: LightningEffectOptions = {}) {\n this.light = light;\n this.minIntensity = minIntensity;\n this.maxIntensity = maxIntensity;\n this.minDuration = minDuration;\n this.maxDuration = maxDuration;\n }\n\n public triggerLightning(): void {\n if (this.light) this.light.intensity = randomFloat(this.minIntensity, this.maxIntensity);\n\n setRandomTimeout(\n () => {\n if (this.light) this.light.intensity = 0;\n },\n this.minDuration,\n this.maxDuration,\n );\n }\n\n public update(): void {\n if (Math.random() > 0.98) {\n this.triggerLightning();\n }\n }\n}\n","import { Vector3 } from \"three\";\n\n/**\n * Movement or orientation in a specific direction.\n *\n * Example usages:\n *\n * Moving an Object Along a Direction\n * ```\n * const speed = 1; // Movement speed\n * const direction = Direction.FORWARD; // Choose a direction\n *\n * object.position.add(direction.clone().multiplyScalar(speed * deltaTime));\n * ```\n *\n * Snapping Positions to a Direction\n * ```\n * const targetPosition = new Vector3(5, 0, 3);\n * const snapDirection = Direction.UP; // Align upwards\n *\n * object.position.copy(targetPosition.clone().add(snapDirection.clone().multiplyScalar(10)));\n * ```\n *\n * Animating Along a Direction\n * ```\n * const distance = 10; // Total distance to travel\n * const duration = 2; // Animation duration in seconds\n * const startPosition = object.position.clone();\n * const targetPosition = startPosition.clone().add(Direction.BACKWARD.clone().multiplyScalar(distance));\n *\n * let elapsed = 0;\n * function animate(deltaTime) {\n * elapsed += deltaTime;\n * const t = Math.min(elapsed / duration, 1); // Normalize time to [0, 1]\n * object.position.lerpVectors(startPosition, targetPosition, t);\n * }\n * ```\n *\n * Shader Uniforms\n * ```\n * material.uniforms.uDirection.value = Direction.FORWARD; // Use as light or flow direction\n * ```\n *\n * Particle Systems\n * ```\n * particles.forEach(particle => {\n * particle.velocity.add(Direction.FORWARD.clone().multiplyScalar(0.1));\n * });\n * ```\n *\n * Directional Raycasting\n * ```\n * const rayOrigin = new Vector3(0, 0, 0);\n * const rayDirection = Direction.FORWARD;\n * const raycaster = new THREE.Raycaster(rayOrigin, rayDirection);\n *\n * // Find intersected objects\n * const intersects = raycaster.intersectObjects(scene.children);\n * ```\n *\n * Physics Forces\n * ```\n * const forceDirection = Direction.UP; // Push upwards\n * const forceMagnitude = 50;\n *\n * rigidBody.applyForce(forceDirection.clone().multiplyScalar(forceMagnitude));\n * ```\n */\nexport const Direction = {\n UP: new Vector3(0, 1, 0),\n DOWN: new Vector3(0, -1, 0),\n LEFT: new Vector3(-1, 0, 0),\n RIGHT: new Vector3(1, 0, 0),\n FORWARD: new Vector3(0, 0, 1),\n BACKWARD: new Vector3(0, 0, -1),\n};\n","export const Falloff = {\n LINEAR: (distance: number, radius: number): number => 1 - distance / radius,\n QUADRATIC: (distance: number, radius: number): number => Math.pow(1 - distance / radius, 2),\n SQUARE_ROOT: (distance: number, radius: number): number => Math.pow(1 - distance / radius, 0.5),\n LOGARITHMIC: (distance: number, radius: number): number => Math.log(1 + (radius - distance)) / Math.log(1 + radius),\n SINE: (distance: number, radius: number): number => Math.cos(((distance / radius) * Math.PI) / 2),\n EXPONENTIAL: (distance: number, radius: number): number => Math.exp(-distance / radius),\n CUBIC: (distance: number, radius: number): number => Math.pow(1 - distance / radius, 3),\n GAUSSIAN: (distance: number, radius: number): number => Math.exp(-Math.pow(distance, 2) / (2 * Math.pow(radius / 3, 2))),\n INVERSE: (distance: number, radius: number): number => radius / (radius + distance),\n SMOOTHSTEP: (distance: number, radius: number): number => {\n const t = Math.max(0, Math.min(1, 1 - distance / radius));\n return t * t * (3 - 2 * t);\n },\n};\n","import { BufferGeometry, Vector3 } from \"three\";\nimport { Direction } from \"../constants/Direction\";\nimport { Falloff } from \"../constants/Falloff\";\n\n/**\n * Moves vertices within a specified radius around a target position along a given direction\n */\nexport const displacementBrush = <T extends BufferGeometry>(\n geometry: T,\n position: Vector3,\n radius: number,\n strength: number,\n direction: Vector3 = Direction.UP,\n falloffFn: (distance: number, radius: number) => number = Falloff.LINEAR,\n): void => {\n const positions = geometry.attributes.position;\n for (let i = 0; i < positions.count; i++) {\n const vertex = new Vector3();\n vertex.fromBufferAttribute(positions, i);\n\n const distance = vertex.distanceTo(position);\n\n if (distance < radius) {\n // Calculate falloff\n const falloff = falloffFn(distance, radius);\n const influence = falloff * strength;\n\n // Apply the effect (e.g., pulling the vertex upwards)\n vertex.add(direction.clone().multiplyScalar(influence));\n\n // Update the vertex position\n positions.setXYZ(i, vertex.x, vertex.y, vertex.z);\n }\n }\n positions.needsUpdate = true;\n};\n","import { BufferGeometry, Vector3 } from \"three\";\nimport { Direction } from \"../constants/Direction\";\nimport { Falloff } from \"../constants/Falloff\";\n\n/**\n * Flattens vertices to a given plane defined by a target height or normal direction.\n */\nexport const flattenBrush = <T extends BufferGeometry>(\n geometry: T,\n position: Vector3,\n radius: number,\n targetHeight: number,\n strength: number,\n direction: Vector3 = Direction.UP,\n falloffFn: (distance: number, radius: number) => number = Falloff.LINEAR\n): void => {\n const positions = geometry.attributes.position;\n for (let i = 0; i < positions.count; i++) {\n const vertex = new Vector3();\n vertex.fromBufferAttribute(positions, i);\n const distance = vertex.distanceTo(position);\n\n if (distance < radius) {\n const falloff = falloffFn(distance, radius);\n const influence = falloff * strength;\n\n // Project vertex onto flatten plane\n const projectedHeight = vertex.dot(direction.normalize());\n const delta = targetHeight - projectedHeight;\n\n vertex.add(direction.clone().multiplyScalar(delta * influence));\n positions.setXYZ(i, vertex.x, vertex.y, vertex.z);\n }\n }\n positions.needsUpdate = true;\n};\n","import { BufferGeometry, MathUtils, Vector3 } from \"three\";\nimport { Direction } from \"../constants/Direction\";\nimport { Falloff } from \"../constants/Falloff\";\n\n/**\n * Adds random noise to the vertices within the specified radius to create a more rugged or natural look.\n */\nexport const noiseBrush = <T extends BufferGeometry>(\n geometry: T,\n position: Vector3,\n radius: number,\n strength: number,\n direction: Vector3 = Direction.UP,\n falloffFn: (distance: number, radius: number) => number = Falloff.LINEAR\n): void => {\n const positions = geometry.attributes.position;\n for (let i = 0; i < positions.count; i++) {\n const vertex = new Vector3();\n vertex.fromBufferAttribute(positions, i);\n const distance = vertex.distanceTo(position);\n\n if (distance < radius) {\n const falloff = falloffFn(distance, radius);\n const noiseStrength = strength * falloff;\n\n // Generate random noise in the direction specified\n const noise = direction.clone().normalize();\n vertex.x += MathUtils.randFloatSpread(noiseStrength) * noise.x;\n vertex.y += MathUtils.randFloatSpread(noiseStrength) * noise.y;\n vertex.z += MathUtils.randFloatSpread(noiseStrength) * noise.z;\n\n positions.setXYZ(i, vertex.x, vertex.y, vertex.z);\n }\n }\n positions.needsUpdate = true;\n};\n","import { BufferGeometry, Vector3 } from \"three\";\n\n/**\n * Smooths out the vertices by averaging their positions with neighboring vertices within a given radius.\n */\nexport const smoothBrush = <T extends BufferGeometry>(\n geometry: T,\n position: Vector3,\n radius: number,\n strength: number\n): void => {\n const positions = geometry.attributes.position;\n const tempPosition = new Vector3();\n for (let i = 0; i < positions.count; i++) {\n const vertex = new Vector3();\n vertex.fromBufferAttribute(positions, i);\n const distance = vertex.distanceTo(position);\n\n if (distance < radius) {\n let averagePosition = new Vector3();\n let count = 0;\n\n // Average position of nearby vertices\n for (let j = 0; j < positions.count; j++) {\n tempPosition.fromBufferAttribute(positions, j);\n if (tempPosition.distanceTo(vertex) < radius) {\n averagePosition.add(tempPosition);\n count++;\n }\n }\n\n if (count > 0) {\n averagePosition.divideScalar(count);\n vertex.lerp(averagePosition, strength); // Blend between current and average\n positions.setXYZ(i, vertex.x, vertex.y, vertex.z);\n }\n }\n }\n positions.needsUpdate = true;\n};\n","import { BufferGeometry, Vector3 } from \"three\";\nimport { Falloff } from \"../constants/Falloff\";\n\n/**\n * Creates spikes or depressions centered on the target position, pushing vertices away or pulling them towards the center.\n */\nexport const spikeBrush = <T extends BufferGeometry>(\n geometry: T,\n position: Vector3,\n radius: number,\n strength: number,\n inward: boolean = false,\n falloffFn: (distance: number, radius: number) => number = Falloff.LINEAR\n): void => {\n const positions = geometry.attributes.position;\n for (let i = 0; i < positions.count; i++) {\n const vertex = new Vector3();\n vertex.fromBufferAttribute(positions, i);\n const distance = vertex.distanceTo(position);\n\n if (distance < radius) {\n // Calculate falloff\n const falloff = falloffFn(distance, radius);\n const influence = falloff * strength * (inward ? -1 : 1);\n\n // Move the vertex along the direction from the center\n const direction = vertex.clone().sub(position).normalize();\n vertex.add(direction.multiplyScalar(influence));\n\n positions.setXYZ(i, vertex.x, vertex.y, vertex.z);\n }\n }\n positions.needsUpdate = true;\n};\n","import { BufferGeometry, Quaternion, Vector3 } from \"three\";\nimport { Direction } from \"../constants/Direction\";\nimport { Falloff } from \"../constants/Falloff\";\n\n/**\n * Applies a twisting force to the vertices, rotating them around the direction defined by the target position.\n */\nexport const twistBrush = <T extends BufferGeometry>(\n geometry: T,\n position: Vector3,\n radius: number,\n strength: number,\n direction: Vector3 = Direction.UP,\n falloffFn: (distance: number, radius: number) => number = Falloff.LINEAR\n): void => {\n const positions = geometry.attributes.position;\n const quaternion = new Quaternion();\n\n for (let i = 0; i < positions.count; i++) {\n const vertex = new Vector3();\n vertex.fromBufferAttribute(positions, i);\n const distance = vertex.distanceTo(position);\n\n if (distance < radius) {\n // Calculate falloff and rotation angle\n const falloff = falloffFn(distance, radius);\n const angle = falloff * strength;\n\n // Create quaternion for rotation around the axis\n quaternion.setFromAxisAngle(direction, angle);\n\n // Apply twist rotation\n vertex.sub(position).applyQuaternion(quaternion).add(position);\n positions.setXYZ(i, vertex.x, vertex.y, vertex.z);\n }\n }\n positions.needsUpdate = true;\n};\n","import { Vector3 } from \"three\";\n\n/**\n * Geometric and mathematical role of the vectors as axes in 3D space.\n *\n * Example usages:\n *\n * Defining a geometry's up vector:\n * ```\n * const upVector = Axis.Z; // Set the Z-axis as the \"up\" direction\n * object.up.copy(upVector);\n * ```\n *\n * Rotating or Orienting an Object\n * ```\n * const axis = Axis.XY; // Diagonal upward\n * object.lookAt(object.position.clone().add(axis));\n * ```\n *\n * Rotate around axis:\n * ```\n * const angle = Math.PI / 4; // 45-degree rotation\n * const rotationAxis = Axis.Y; // Rotate around the Y-axis\n *\n * object.rotateOnAxis(rotationAxis, angle);\n * ```\n *\n * Scaling along an axis:\n * ```\n * const scalingAxis = Axis.XZ; // Scale equally along X and Z\n * const scaleFactor = 2;\n *\n * object.scale.multiply(scalingAxis.clone().multiplyScalar(scaleFactor));\n * ```\n *\n * Aligning a Camera\n * ```\n * const cameraAxis = Axis.XZ; // Align the camera diagonally on the XZ plane\n *\n * camera.lookAt(camera.position.clone().add(cameraAxis));\n * ```\n *\n * Directional lighting\n * ```\n * const lightDirection = Axis.YZ; // Diagonal light along Y and Z axes\n * directionalLight.position.copy(lightDirection.clone().multiplyScalar(10));\n * ```\n *\n * Aligning an Object\n * ```\n * const axis = Axis.X; // Align object to the X-axis\n * object.lookAt(object.position.clone().add(axis));\n * ```\n *\n * Spawning objects along an axis\n * ```\n * const spawnAxis = Axis.XZ; // Arrange objects diagonally on XZ\n * const count = 10;\n * const spacing = 5;\n *\n * for (let i = 0; i < count; i++) {\n * const position = spawnAxis.clone().multiplyScalar(i * spacing);\n * const newObject = object.clone();\n * newObject.position.copy(position);\n * scene.add(newObject);\n * }\n * ```\n *\n * Vector projections\n * ```\n * const vector = new Vector3(3, 5, 7);\n * const projectionAxis = Axis.Z; // Project the vector onto the Z-axis\n *\n * const projection = vector.clone().projectOnVector(projectionAxis);\n * ```\n *\n * Plane definitions\n * ```\n * const normal = Axis.Y; // Y-axis is the normal for a horizontal plane\n * const distanceFromOrigin = 5;\n *\n * const plane = new THREE.Plane(normal, distanceFromOrigin);\n * ```\n *\n * Plane intersections\n * ```\n * const planeNormal = Axis.Y; // Define a plane normal (horizontal plane)\n * const plane = new THREE.Plane(planeNormal);\n *\n * const rayDirection = Axis.Z; // Ray pointing along Z-axis\n * const rayOrigin = new Vector3(0, 5, 0);\n * const ray = new THREE.Ray(rayOrigin, rayDirection);\n *\n * // Find intersection point\n * const intersectionPoint = new Vector3();\n * plane.intersectLine(new THREE.Line3(rayOrigin, rayOrigin.clone().add(rayDirection)), intersectionPoint);\n * ```\n *\n * Defining bounds\n * ```\n * const boundsAxis = Axis.XY; // Restrict an object’s movement within XY bounds\n * const maxBounds = 10;\n *\n * object.position.clamp(\n * new Vector3(-maxBounds, -maxBounds, -Infinity),\n * new Vector3(maxBounds, maxBounds, Infinity)\n * );\n * ```\n *\n * Procedural Geometry\n * ```\n * const vertex = new Vector3(0, 0, 0);\n * const axis = Axis.XZ; // Diagonal axis on XZ plane\n *\n * const offset = axis.clone().multiplyScalar(5);\n * vertex.add(offset); // Move vertex in axis\n * geometry.vertices.push(vertex);\n * ```\n */\nexport const Axis = {\n X: new Vector3(1, 0, 0),\n Y: new Vector3(0, 1, 0),\n Z: new Vector3(0, 0, 1),\n XY: new Vector3(1, 1, 0).normalize(),\n XZ: new Vector3(1, 0, 1).normalize(),\n YZ: new Vector3(0, 1, 1).normalize(),\n XYZ: new Vector3(1, 1, 1).normalize(),\n};\n","export enum BoxSide {\n LEFT = \"left\",\n RIGHT = \"right\",\n TOP = \"top\",\n BOTTOM = \"bottom\",\n FRONT = \"front\",\n BACK = \"back\",\n}\n","export const ColorPalette = {\n // Red\n CADMIUM_RED: 0xe60026, // Cadmium Red or Bright Red. Vivid, bold red shade with warm undertones.\n CARDINAL_RED: 0xc61416, // Bright Crimson or Cardinal Red. It’s a vivid, bold red shade with warm undertones.\n CHERRY_RED: 0xd82424, // Bold red with slightly warm undertones.\n CRIMSON: 0xc62828, // Crimson Red or Firebrick Red. It’s a bold, deep red with a slightly cool undertone.\n ALIZARIN_CRIMSON: 0xb22222, // Deep, rich red with cool undertones.\n DARK_RED: 0x8b0000, // Dark Red. It’s a deep, rich red shade resembling the color of garnets or dried blood.\n RUST: 0xc2452d, // Red clay or Brick Red. It’s a warm, earthy red-orange shade, often associated with weathered metal, autumn leaves, or natural clay tones.\n\n // Orange\n CORAL_ORANGE: 0xff5733, // Bold red-orange hue.\n TANGERINE: 0xff5500, // Tangerine or Bright Orange-Red. It’s a vibrant, warm shade of orange with red undertones with a tropical feel.\n ORANGE_PEEL: 0xff6600, // Orange Peel or Bright Orange. It’s a vivid, energetic orange.\n CADMIUM_ORANGE: 0xff7f24, // warm orange with strong red undertones, giving it a slightly richer and darker appearance.\n ORANGE: 0xffa500, // Bright, vibrant hue associated with sunsets, citrus fruits, and autumn tones.\n\n // Yellow\n AMBER: 0xffaa00, // Bright Orange. It’s a warm, vibrant shade of orange with golden-yellow undertones, associated with autumn hues.\n CADMIUM_YELLOW: 0xffd700, // Bright golden yellow with warm undertones.\n GOLD: 0xffd700, // Rich, vibrant yellow with warm undertones, resembling the color of metallic gold.\n YELLOW: 0xffff00, // Bright, pure yellow shade.\n\n // Green\n LIME_GREEN: 0xa4c400, // Lime Green or Bright Chartreuse. It’s a vivid, energetic yellow-green shade\n SPRING_GREEN: 0x88cc55, // Fresh, vibrant appearance, resembling new leaves or spring foliage\n MOSS_GREEN: 0x88aa33, // Medium-light shade of green with yellow undertones, often seen in natural foliage.\n FERN_GREEN: 0x4b8b3b, // It's a natural, medium-dark green with slightly muted tones, resembling the lush greenery of ferns or foliage.\n FOREST_GREEN: 0x228b22, // Rich, deep green shade, often associated with dense woodland and nature.\n SAP_GREEN: 0x507d2a, // Natural green with a muted tone.\n OLIVE_DRAB: 0x556b2f, // Muted earthy green with brownish undertones.\n VIRIDIAN_GREEN: 0x00a86b, // Vibrant cool green.\n MINT_GREEN: 0x88ccaa, // Mint Green or Light Jade. It’s a soft, pastel green with subtle blue undertones.\n AQUAMARINE: 0x00ffaa, // Aquamarine or Mint Green. It’s a bright, vibrant turquoise shade that blends green and blue.\n\n // Blue\n PHTHALO_BLUE: 0x000f89, // Phthalo Blue or Bright Navy. Intense, rich blue with a slightly greenish cool undertone.\n AETHER_BLUE: 0x3498db, // Bright and vivid shade of blue, sitting between the airy Sky Blue and rich Cerulean.\n SKY_BLUE: 0x88ccff, // Sky Blue or Baby Blue. It’s a light, cheerful shade of blue with a slightly soft and pastel tone.\n CERULEAN_BLUE: 0x5dade2, // Cerulean Blue or Sky Blue. It’s a bright, vivid shade of blue with a slightly cool undertone.\n AZURE: 0x0077ff, // Azure Blue or Bright Blue. It’s a vibrant, rich shade of blue with a cool undertone.\n OCEAN_BLUE: 0x0077be, // Ocean Blue or Azure Blue. It’s a vibrant medium blue shade with a slight teal undertone.\n ROYAL_BLUE: 0x5555ff, // Royal Blue or Bright Indigo. It’s a vibrant medium blue shade with a slightly cool and saturated tone.\n MIDNIGHT_BLUE: 0x000033, // A very deep, dark blue shade that evokes the feeling of a starless night sky or deep ocean depths, with subtle blue undertones.\n ULTRAMARINE_BLUE: 0x3f51b5, // Deep, rich blue with a slightly cool undertone.\n\n\n // Purple\n COBALT_VIOLET: 0x6a0dad, // Soft, purple tone.\n DEEP_VIOLET: 0xaa00ff, // Electric Purple or Deep Violet. It’s a bright, vibrant shade of purple with a strong blue undertone.\n CORAL_PINK: 0xff3366, // Bright Rose or Coral Pink. It’s a vivid, bold pinkish-red shade with warm undertones.\n VIVID_MAGENTA: 0xff22ff, // It's an intense, electric shade of pink with equal parts red and blue.\n MAGENTA: 0xff00ff, // Bright, vivid hue that is a mix of equal parts red and blue, sometimes called Fuchsia.\n HOT_PINK: 0xff00aa, // Hot Pink or Fuchsia Rose. It’s a vivid and bold pink with a magenta undertone.\n PINK_SHERBET: 0xff99cc, // Pink Sherbet or Light Pink. It’s a soft, playful pink shade with a hint of warmth.\n SOFT_PINK: 0xffc7c7, // Blush Pink or Soft Pink. It’s a pale, delicate pink with warm undertones.\n\n // Brown\n BURNT_SIENNA: 0xe97451, // warm, earthy brown with reddish undertones.\n BURNT_UMBER: 0x8a3324, // Dark brown with red undertones.\n SIENNA: 0x8b5a2b, // Dark Goldenrod Brown. It’s a warm, earthy brown with reddish and golden undertones, often associated with natural clay or autumn leaves.\n SADDLE_BROWN: 0x8b4513, // Rich, earthy brown with reddish undertones, often associated with leather, wood, or other natural materials.\n COFFEE_BROWN: 0x5c4033, // Rich, earthy tone with hints of red and gray, resembling the color of natural wood or dark leather.\n DARK_UMBER: 0x4b3621, // Coffee Brown or Dark Umber. It’s a deep, rich brown with warm, earthy undertones, often resembling dark wood or roasted coffee beans.\n RAW_UMBER: 0x826644, // Cool, muted brown.\n YELLOW_OCHRE: 0xc5a16f, // Warm, muted yellow-brown\n RAW_SIENNA: 0xd2b48c, // Light, golden brown.\n TAUPE: 0x8b7d7b, // Rosy Brown or Taupe Gray. It’s a muted, earthy tone with a mix of brown and gray.\n\n // Gray\n ONYX: 0x030303, // Extremely deep, almost black shade with a neutral tone.\n CARBON: 0x2e2e2e, // Deep, neutral gray.\n CHARCOAL: 0x333333, // Rich, neutral gray.\n SLATE_GRAY: 0x404040, // Medium-dark shade of gray\n ASH_GRAY: 0x444444, // Ash Gray or Dark Slate Gray.\n GRAPHITE: 0x505050, // Medium-dark, neutral Graphite Gray or Smoky Gray shadowy muted depth.\n STEEL_GRAY: 0x555555, // Medium Gray or Steel Gray.\n DIM_GRAY: 0x696969, // Medium-dark neutral gray with a muted, balanced tone\n IRON: 0x777777, // It’s a medium gray neutral.\n GRAY: 0x808080, // It is a neutral, medium-gray tone that sits exactly halfway between black and white.\n STONE: 0x888888, // It’s a medium-light neutral.\n SILVER: 0xaaaaaa, // Light Gray. It’s a soft, pale gray shade with a slightly metallic undertone.\n LIGHT_GRAY: 0xcccccc, // Light, neutral Gray, sits between medium grays and white.\n PALE_GRAY: 0xeeeeee, // Very Light Gray or Soft Gray. It’s a pale, almost white shade of gray.\n WHITE_SMOKE: 0xf5f5f5, // White Smoke or Light Gray. It’s a soft, pale gray shade with a hint of warmth.\n TITANIUM_WHITE: 0xffffff, // Pure white, the brightest color possible.\n };\n","export const sineEaseIn = (t:number) => 1 - Math.cos((t * Math.PI) / 2);\nexport const sineEaseOut = (t:number) => Math.sin((t * Math.PI) / 2);\nexport const sineEaseInOut = (t:number) => -0.5 * (Math.cos(Math.PI * t) - 1);\n\nexport const quadraticEaseIn = (t:number) => t * t;\nexport const quadraticEaseOut = (t:number) => 1 - Math.pow(1 - t, 2);\nexport const quadraticEaseInOut = (t:number) => (t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2);\n\nexport const cubicEaseIn = (t:number) => t * t * t;\nexport const cubicEaseOut = (t:number) => 1 - Math.pow(1 - t, 3);\nexport const cubicEaseInOut = (t:number) => (t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2);\n\nexport const quarticEaseIn = (t:number) => t * t * t * t;\nexport const quarticEaseOut = (t:number) => 1 - Math.pow(1 - t, 4);\nexport const quarticEaseInOut = (t:number) => (t < 0.5 ? 8 * t * t * t * t : 1 - Math.pow(-2 * t + 2, 4) / 2);\n\nexport const quinticEaseIn = (t:number) => t * t * t * t * t;\nexport const quinticEaseOut = (t:number) => 1 - Math.pow(1 - t, 5);\nexport const quinticEaseInOut = (t:number) => (t < 0.5 ? 16 * t * t * t * t * t : 1 - Math.pow(-2 * t + 2, 5) / 2);\n\nexport const exponentialEaseIn = (t:number) => (t === 0 ? 0 : Math.pow(2, 10 * t - 10));\nexport const exponentialEaseOut = (t:number) => (t === 1 ? 1 : 1 - Math.pow(2, -10 * t));\nexport const exponentialEaseInOut = (t:number) => {\n if (t === 0) return 0;\n if (t === 1) return 1;\n return t < 0.5 ? Math.pow(2, 20 * t - 10) / 2 : (2 - Math.pow(2, -20 * t + 10)) / 2;\n};\n\nexport const circularEaseIn = (t:number) => 1 - Math.sqrt(1 - Math.pow(t, 2));\nexport const circularEaseOut = (t:number) => Math.sqrt(1 - Math.pow(t - 1, 2));\nexport const circularEaseInOut = (t:number) =>\n t < 0.5 ? (1 - Math.sqrt(1 - Math.pow(2 * t, 2))) / 2 : (Math.sqrt(1 - Math.pow(-2 * t + 2, 2)) + 1) / 2;\n\nexport const linear = (t:number) => t;\nexport const smoothstep = (t:number) => t * t * (3 - 2 * t);\nexport const concave = (t:number) => 1 - Math.pow(1 - t, 0.3);\nexport const convex = (t:number) => Math.pow(t, 0.3);\nexport const logarithmic = (t:number) => Math.log(Math.max(0.01, t)) / Math.log(2);\nexport const squareRoot = (t:number) => Math.sqrt(t);\nexport const inverse = (t:number) => 1 - t;\nexport const gaussian = (t:number) => {\n const sigma = 0.5;\n return Math.exp(-Math.pow(t - 0.5, 2) / (2 * sigma));\n};\n\n/**\n * Easing functions for interpolating values over time.\n */\nexport const Easing = {\n SINE_EASE_IN: sineEaseIn,\n SINE_EASE_OUT: sineEaseOut,\n SINE_EASE_IN_OUT: sineEaseInOut,\n QUADRATIC_EASE_IN: quadraticEaseIn,\n QUADRATIC_EASE_OUT: quadraticEaseOut,\n QUADRATIC_EASE_IN_OUT: quadraticEaseInOut,\n CUBIC_EASE_IN: cubicEaseIn,\n CUBIC_EASE_OUT: cubicEaseOut,\n CUBIC_EASE_IN_OUT: cubicEaseInOut,\n QUARTIC_EASE_IN: quarticEaseIn,\n QUARTIC_EASE_OUT: quarticEaseOut,\n QUARTIC_EASE_IN_OUT: quarticEaseInOut,\n QUINTIC_EASE_IN: quinticEaseIn,\n QUINTIC_EASE_OUT: quinticEaseOut,\n QUINTIC_EASE_IN_OUT: quinticEaseInOut,\n EXPONENTIAL_EASE_IN: exponentialEaseIn,\n EXPONENTIAL_EASE_OUT: exponentialEaseOut,\n EXPONENTIAL_EASE_IN_OUT: exponentialEaseInOut,\n CIRCULAR_EASE_IN: circularEaseIn,\n CIRCULAR_EASE_OUT: circularEaseOut,\n CIRCULAR_EASE_IN_OUT: circularEaseInOut,\n LINEAR: linear,\n SMOOTHSTEP: smoothstep,\n CONCAVE: concave,\n CONVEX: convex,\n LOGARITHMIC: logarithmic,\n SQUARE_ROOT: squareRoot,\n INVERSE: inverse,\n GAUSSIAN: gaussian,\n};\n","export const cubicCurve = (t: number, p0: number, p1: number, p2: number, p3: number): number => {\n const clampedT = Math.max(0, Math.min(1, t));\n const oneMinusT = 1 - clampedT;\n return (\n oneMinusT * oneMinusT * oneMinusT * p0 +\n 3 * oneMinusT * oneMinusT * clampedT * p1 +\n 3 * oneMinusT * clampedT * clampedT * p2 +\n clampedT * clampedT * clampedT * p3\n );\n};\n\nexport const dampedCurve = (t: number, damping: number = 1): number => {\n const clampedDamping = Math.max(0.001, damping); // Avoid zero or negative damping\n return (1 - Math.exp(-clampedDamping * t)) / (1 - Math.exp(-clampedDamping));\n};\n\nexport const exponentialCurve = (t: number, base: number = 1, factor: number = 1): number => {\n const clampedT = Math.max(0, Math.min(1, t));\n return base * Math.pow(clampedT, factor);\n};\n\nexport const logarithmicCurve = (t: number, base: number = 1, factor: number = 1): number => {\n const clampedT = Math.max(0.001, Math.min(1, t)); // Avoid log(0)\n return base * Math.log(factor * clampedT + 1);\n};\n\nexport const parabolicCurve = (t: number, a: number = 1, b: number = 0, c: number = 0): number => {\n const clampedT = Math.max(0, Math.min(1, t));\n return a * clampedT * clampedT + b * clampedT + c;\n};\n\nexport const quadraticCurve = (t: number, p0: number, p1: number, p2: number): number => {\n const clampedT = Math.max(0, Math.min(1, t));\n const oneMinusT = 1 - clampedT;\n return oneMinusT * oneMinusT * p0 + 2 * oneMinusT * clampedT * p1 + clampedT * clampedT * p2;\n};\n\nexport const sigmoidCurve = (t: number, a: number = 10): number => {\n const clampedT = Math.max(0, Math.min(1, t));\n return 1 / (1 + Math.exp(-a * (clampedT - 0.5)));\n};\n\nconst sinusoidalCurve = (t: number): number => {\n return Math.sin(t * Math.PI * 0.5);\n};\n\nexport const ParametricCurve = {\n CUBIC: cubicCurve,\n DAMPED: dampedCurve,\n EXPONENTIAL: exponentialCurve,\n LOGARITHMIC: logarithmicCurve,\n PARABOLIC: parabolicCurve,\n QUADRATIC: quadraticCurve,\n SIGMOID: sigmoidCurve,\n SINUSOIDAL: sinusoidalCurve,\n};\n","import { BufferGeometry, InstancedMesh, Material, Matrix4, MeshStandardMaterial, SphereGeometry, Vector3 } from \"three\";\n\nexport interface BubblingEffectOptions {\n geometry?: BufferGeometry;\n material?: Material;\n count?: number;\n height?: number;\n width?: number;\n depth?: number;\n}\n\nexport class BubblingEffect extends InstancedMesh {\n private bubblePositions: Vector3[] = [];\n private velocities: number[] = [];\n private width: number;\n private height: number;\n private depth: number;\n\n constructor(options: BubblingEffectOptions = {}) {\n const {\n count = 20,\n width = 1.5,\n height = 3,\n depth = 1.5,\n geometry = new SphereGeometry(0.1, 6, 6), // Small spheres\n material = new MeshStandardMaterial({\n color: 0xffffff,\n transparent: true,\n opacity: 0.6,\n roughness: 0.3,\n metalness: 0.3,\n }),\n } = options;\n super(geometry, material, count);\n\n this.height = height;\n this.width = width;\n this.depth = depth;\n\n // Initialize bubble positions and speeds\n for (let i = 0; i < this.count; i++) {\n const position = new Vector3(\n (Math.random() - 0.5) * width,\n Math.random() * (height - 1) + 0.5,\n (Math.random() - 0.5) * depth,\n );\n this.bubblePositions.push(position);\n this.velocities.push(0.01 + Math.random() * 0.02);\n this.updateInstanceMatrix(i);\n }\n }\n\n /**\n * Updates the position of a specific bubble instance in the InstancedMesh.\n */\n private updateInstanceMatrix(index: number): void {\n const position = this.bubblePositions[index];\n const matrix = new Matrix4().setPosition(position);\n this.setMatrixAt(index, matrix);\n this.instanceMatrix.needsUpdate = true;\n }\n\n /**\n * Updates bubble positions, moving them upward and resetting them\n * to the bottom if they reach the top.\n */\n public update(): void {\n for (let i = 0; i < this.count; i++) {\n const position = this.bubblePositions[i];\n position.y += this.velocities[i]; // Move bubble upwards\n\n // Reset bubble to bottom if it reaches the top\n if (position.y > this.height) {\n position.x = (Math.random() - 0.5) * this.width;\n position.y = 0;\n position.z = (Math.random() - 0.5) * this.depth;\n }\n\n this.updateInstanceMatrix(i);\n }\n }\n}\n","import { BufferGeometry, Float32BufferAttribute } from \"three\";\n\nexport class EllipticLeafGeometry extends BufferGeometry {\n constructor(size = 0.1) {\n super();\n\n const vertices = [];\n const indices = [];\n\n // Define vertices to approximate a simple, elongated, oval leaf shape\n const leafPoints = [\n [0, 1], // Top point\n [0.5, 0.75], // Right upper middle\n [0.75, 0.25], // Right lower middle\n [0.5, -0.5], // Right bottom middle\n [0, -1], // Bottom point\n [-0.5, -0.5], // Left bottom middle\n [-0.75, 0.25], // Left lower middle\n [-0.5, 0.75], // Left upper middle\n ];\n\n // Add vertices to the geometry, scaling them with the `size` parameter\n for (let i = 0; i < leafPoints.length; i++) {\n const [x, y] = leafPoints[i];\n vertices.push(x * size, y * size, 0);\n }\n\n // Define indices to form triangular faces of the leaf\n // Create a fan-like structure connecting the top vertex (index 0) to other neighboring vertices\n for (let i = 1; i < leafPoints.length - 1; i++) {\n indices.push(0, i, i + 1);\n }\n // Close the fan with the last triangle\n indices.push(0, leafPoints.length - 1, 1);\n\n // Convert the vertices and indices to buffer attributes\n const positionAttribute = new Float32BufferAttribute(vertices, 3);\n this.setAttribute('position', positionAttribute);\n this.setIndex(indices);\n\n this.computeVertexNormals();\n }\n}\n","import { BufferGeometry, DoubleSide, Euler, InstancedMesh, Material, Matrix4, MeshStandardMaterial, Vector3 } from \"three\";\nimport { EllipticLeafGeometry } from \"../geometry/leafs/EllipticLeafGeometry\";\n\nexport interface LeafEffectOptions {\n geometry?: BufferGeometry;\n material?: Material;\n count?: number;\n width?: number;\n height?: number;\n depth?: number;\n}\n\nexport class LeafEffect extends InstancedMesh {\n private dummyMatrix: Matrix4;\n private velocities: Vector3[];\n private width: number;\n private height: number;\n private depth: number;\n\n constructor(options: LeafEffectOptions = {}) {\n const {\n count = 200,\n width = 20,\n height = 10,\n depth = 20,\n geometry = new EllipticLeafGeometry(),\n material = new MeshStandardMaterial({\n color: 0x88aa33,\n metalness: 0.1,\n roughness: 0.8,\n flatShading: true,\n side: DoubleSide,\n }),\n } = options;\n\n super(geometry, material, count);\n\n this.dummyMatrix = new Matrix4();\n this.velocities = [];\n this.width = width;\n this.height = height;\n this.depth = depth;\n\n // Initialize instances\n for (let i = 0; i < count; i++) {\n // Random position within specified area\n const x = (Math.random() - 0.5) * width;\n const y = Math.random() * (height - 1) + 0.5;\n const z = (Math.random() - 0.5) * depth;\n\n // Random rotation\n const rotationX = (Math.random() - 0.5) * Math.PI;\n const rotationY = (Math.random() - 0.5) * Math.PI;\n const rotationZ = (Math.random() - 0.5) * Math.PI;\n\n // Set position and rotation\n this.dummyMatrix.makeRotationFromEuler(new Euler(rotationX, rotationY, rotationZ));\n this.dummyMatrix.setPosition(x, y, z);\n\n this.setMatrixAt(i, this.dummyMatrix);\n\n // Store velocity for animation\n const velocity = new Vector3((Math.random() - 0.5) * 0.01, -0.005, (Math.random() - 0.5) * 0.01);\n this.velocities.push(velocity);\n }\n\n this.instanceMatrix.needsUpdate = true;\n }\n\n public update(): void {\n for (let i = 0; i < this.count; i++) {\n const matrix = new Matrix4();\n this.getMatrixAt(i, matrix);\n\n const position = new Vector3();\n position.setFromMatrixPosition(matrix);\n\n // Update position\n const velocity = this.velocities[i];\n position.add(velocity);\n\n // Reset position if below ground\n if (position.y < 0) {\n position.set(\n (Math.random() - 0.5) * this.width,\n Math.random() * (this.height - 1) + 0.5,\n (Math.random() - 0.5) * this.depth,\n );\n\n // Update velocity\n velocity.set((Math.random() - 0.5) * 0.01, -0.005, (Math.random() - 0.5) * 0.01);\n }\n\n matrix.setPosition(position);\n this.setMatrixAt(i, matrix);\n }\n this.instanceMatrix.needsUpdate = true;\n }\n}\n","import { BufferGeometry, BufferAttribute, InterleavedBuffer, InterleavedBufferAttribute, TrianglesDrawMode, TriangleFanDrawMode, TriangleStripDrawMode, Vector3, Float32BufferAttribute } from \"three\";\nimport { getWithKey } from \"../types/helpers.js\";\nconst mergeBufferGeometries = (geometries, useGroups) => {\n const isIndexed = geometries[0].index !== null;\n const attributesUsed = new Set(Object.keys(geometries[0].attributes));\n const morphAttributesUsed = new Set(Object.keys(geometries[0].morphAttributes));\n const attributes = {};\n const morphAttributes = {};\n const morphTargetsRelative = geometries[0].morphTargetsRelative;\n const mergedGeometry = new BufferGeometry();\n let offset = 0;\n geometries.forEach((geom, i) => {\n let attributesCount = 0;\n if (isIndexed !== (geom.index !== null)) {\n console.error(\n \"THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index \" + i + \". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them.\"\n );\n return null;\n }\n for (let name in geom.attributes) {\n if (!attributesUsed.has(name)) {\n console.error(\n \"THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index \" + i + '. All geometries must have compatible attributes; make sure \"' + name + '\" attribute exists among all geometries, or in none of them.'\n );\n return null;\n }\n if (attributes[name] === void 0) {\n attributes[name] = [];\n }\n attributes[name].push(geom.attributes[name]);\n attributesCount++;\n }\n if (attributesCount !== attributesUsed.size) {\n console.error(\n \"THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index \" + i + \". Make sure all geometries have the same number of attributes.\"\n );\n return null;\n }\n if (morphTargetsRelative !== geom.morphTargetsRelative) {\n console.error(\n \"THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index \" + i + \". .morphTargetsRelative must be consistent throughout all geometries.\"\n );\n return null;\n }\n for (let name in geom.morphAttributes) {\n if (!morphAttributesUsed.has(name)) {\n console.error(\n \"THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index \" + i + \". .morphAttributes must be consistent throughout all geometries.\"\n );\n return null;\n }\n if (morphAttributes[name] === void 0)\n morphAttributes[name] = [];\n morphAttributes[name].push(geom.morphAttributes[name]);\n }\n mergedGeometry.userData.mergedUserData = mergedGeometry.userData.mergedUserData || [];\n mergedGeometry.userData.mergedUserData.push(geom.userData);\n if (useGroups) {\n let count;\n if (geom.index) {\n count = geom.index.count;\n } else if (geom.attributes.position !== void 0) {\n count = geom.attributes.position.count;\n } else {\n console.error(\n \"THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index \" + i + \". The geometry must have either an index or a position attribute\"\n );\n return null;\n }\n mergedGeometry.addGroup(offset, count, i);\n offset += count;\n }\n });\n if (isIndexed) {\n let indexOffset = 0;\n const mergedIndex = [];\n geometries.forEach((geom) => {\n const index = geom.index;\n for (let j = 0; j < index.count; ++j) {\n mergedIndex.push(index.getX(j) + indexOffset);\n }\n indexOffset += geom.attributes.position.count;\n });\n mergedGeometry.setIndex(mergedIndex);\n }\n for (let name in attributes) {\n const mergedAttribute = mergeBufferAttributes(attributes[name]);\n if (!mergedAttribute) {\n console.error(\n \"THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the \" + name + \" attribute.\"\n );\n return null;\n }\n mergedGeometry.setAttribute(name, mergedAttribute);\n }\n for (let name in morphAttributes) {\n const numMorphTargets = morphAttributes[name][0].length;\n if (numMorphTargets === 0)\n break;\n mergedGeometry.morphAttributes = mergedGeometry.morphAttributes || {};\n mergedGeometry.morphAttributes[name] = [];\n for (let i = 0; i < numMorphTargets; ++i) {\n const morphAttributesToMerge = [];\n for (let j = 0; j < morphAttributes[name].length; ++j) {\n morphAttributesToMerge.push(morphAttributes[name][j][i]);\n }\n const mergedMorphAttribute = mergeBufferAttributes(morphAttributesToMerge);\n if (!mergedMorphAttribute) {\n console.error(\n \"THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the \" + name + \" morphAttribute.\"\n );\n return null;\n }\n mergedGeometry.morphAttributes[name].push(mergedMorphAttribute);\n }\n }\n return mergedGeometry;\n};\nconst mergeBufferAttributes = (attributes) => {\n let TypedArray = void 0;\n let itemSize = void 0;\n let normalized = void 0;\n let arrayLength = 0;\n attributes.forEach((attr) => {\n if (TypedArray === void 0) {\n TypedArray = attr.array.constructor;\n }\n if (TypedArray !== attr.array.constructor) {\n console.error(\n \"THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes.\"\n );\n return null;\n }\n if (itemSize === void 0)\n itemSize = attr.itemSize;\n if (itemSize !== attr.itemSize) {\n console.error(\n \"THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes.\"\n );\n return null;\n }\n if (normalized === void 0)\n normalized = attr.normalized;\n if (normalized !== attr.normalized) {\n console.error(\n \"THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes.\"\n );\n return null;\n }\n arrayLength += attr.array.length;\n });\n if (TypedArray && itemSize) {\n const array = new TypedArray(arrayLength);\n let offset = 0;\n attributes.forEach((attr) => {\n array.set(attr.array, offset);\n offset += attr.array.length;\n });\n return new BufferAttribute(array, itemSize, normalized);\n }\n};\nconst interleaveAttributes = (attributes) => {\n let TypedArray = void 0;\n let arrayLength = 0;\n let stride = 0;\n for (let i = 0, l = attributes.length; i < l; ++i) {\n const attribute = attributes[i];\n if (TypedArray === void 0)\n TypedArray = attribute.array.constructor;\n if (TypedArray !== attribute.array.constructor) {\n console.error(\"AttributeBuffers of different types cannot be interleaved\");\n return null;\n }\n arrayLength += attribute.array.length;\n stride += attribute.itemSize;\n }\n const interleavedBuffer = new InterleavedBuffer(new TypedArray(arrayLength), stride);\n let offset = 0;\n const res = [];\n const getters = [\"getX\", \"getY\", \"getZ\", \"getW\"];\n const setters = [\"setX\", \"setY\", \"setZ\", \"setW\"];\n for (let j = 0, l = attributes.length; j < l; j++) {\n const attribute = attributes[j];\n const itemSize = attribute.itemSize;\n const count = attribute.count;\n const iba = new InterleavedBufferAttribute(interleavedBuffer, itemSize, offset, attribute.normalized);\n res.push(iba);\n offset += itemSize;\n for (let c = 0; c < count; c++) {\n for (let k = 0; k < itemSize; k++) {\n const set = getWithKey(iba, setters[k]);\n const get = getWithKey(attribute, getters[k]);\n set(c, get(c));\n }\n }\n }\n return res;\n};\nfunction estimateBytesUsed(geometry) {\n let mem = 0;\n for (let name in geometry.attributes) {\n const attr = geometry.getAttribute(name);\n mem += attr.count * attr.itemSize * attr.array.BYTES_PER_ELEMENT;\n }\n const indices = geometry.getIndex();\n mem += indices ? indices.count * indices.itemSize * indices.array.BYTES_PER_ELEMENT : 0;\n return mem;\n}\nfunction mergeVertices(geometry, tolerance = 1e-4) {\n tolerance = Math.max(tolerance, Number.EPSILON);\n const hashToIndex = {};\n const indices = geometry.getIndex();\n const positions = geometry.getAttribute(\"position\");\n const vertexCount = indices ? indices.count : positions.count;\n let nextIndex = 0;\n const attributeNames = Object.keys(geometry.attributes);\n const attrArrays = {};\n const morphAttrsArrays = {};\n const newIndices = [];\n const getters = [\"getX\", \"getY\", \"getZ\", \"getW\"];\n for (let i = 0, l = attributeNames.length; i < l; i++) {\n const name = attributeNames[i];\n attrArrays[name] = [];\n const morphAttr = geometry.morphAttributes[name];\n if (morphAttr) {\n morphAttrsArrays[name] = new Array(morphAttr.length).fill(0).map(() => []);\n }\n }\n const decimalShift = Math.log10(1 / tolerance);\n const shiftMultiplier = Math.pow(10, decimalShift);\n for (let i = 0; i < vertexCount; i++) {\n const index = indices ? indices.getX(i) : i;\n let hash = \"\";\n for (let j = 0, l = attributeNames.length; j < l; j++) {\n const name = attributeNames[j];\n const attribute = geometry.getAttribute(name);\n const itemSize = attribute.itemSize;\n for (let k = 0; k < itemSize; k++) {\n hash += `${~~(attribute[getters[k]](index) * shiftMultiplier)},`;\n }\n }\n if (hash in hashToIndex) {\n newIndices.push(hashToIndex[hash]);\n } else {\n for (let j = 0, l = attributeNames.length; j < l; j++) {\n const name = attributeNames[j];\n const attribute = geometry.getAttribute(name);\n const morphAttr = geometry.morphAttributes[name];\n const itemSize = attribute.itemSize;\n const newarray = attrArrays[name];\n const newMorphArrays = morphAttrsArrays[name];\n for (let k = 0; k < itemSize; k++) {\n const getterFunc = getters[k];\n newarray.push(attribute[getterFunc](index));\n if (morphAttr) {\n for (let m = 0, ml = morphAttr.length; m < ml; m++) {\n newMorphArrays[m].push(morphAttr[m][getterFunc](index));\n }\n }\n }\n }\n hashToIndex[hash] = nextIndex;\n newIndices.push(nextIndex);\n nextIndex++;\n }\n }\n const result = geometry.clone();\n for (let i = 0, l = attributeNames.length; i < l; i++) {\n const name = attributeNames[i];\n const oldAttribute = geometry.getAttribute(name);\n const buffer = new oldAttribute.array.constructor(attrArrays[name]);\n const attribute = new BufferAttribute(buffer, oldAttribute.itemSize, oldAttribute.normalized);\n result.setAttribute(name, attribute);\n if (name in morphAttrsArrays) {\n for (let j = 0; j < morphAttrsArrays[name].length; j++) {\n const oldMorphAttribute = geometry.morphAttributes[name][j];\n const buffer2 = new oldMorphAttribute.array.constructor(morphAttrsArrays[name][j]);\n const morphAttribute = new BufferAttribute(buffer2, oldMorphAttribute.itemSize, oldMorphAttribute.normalized);\n result.morphAttributes[name][j] = morphAttribute;\n }\n }\n }\n result.setIndex(newIndices);\n return result;\n}\nfunction toTrianglesDrawMode(geometry, drawMode) {\n if (drawMode === TrianglesDrawMode) {\n console.warn(\"THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.\");\n return geometry;\n }\n if (drawMode === TriangleFanDrawMode || drawMode === TriangleStripDrawMode) {\n let index = geometry.getIndex();\n if (index === null) {\n const indices = [];\n const position = geometry.getAttribute(\"position\");\n if (position !== void 0) {\n for (let i = 0; i < position.count; i++) {\n indices.push(i);\n }\n geometry.setIndex(indices);\n index = geometry.getIndex();\n } else {\n console.error(\n \"THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.\"\n );\n return geometry;\n }\n }\n const numberOfTriangles = index.count - 2;\n const newIndices = [];\n if (index) {\n if (drawMode === TriangleFanDrawMode) {\n for (let i = 1; i <= numberOfTriangles; i++) {\n newIndices.push(index.getX(0));\n newIndices.push(index.getX(i));\n newIndices.push(index.getX(i + 1));\n }\n } else {\n for (let i = 0; i < numberOfTriangles; i++) {\n if (i % 2 === 0) {\n newIndices.push(index.getX(i));\n newIndices.push(index.getX(i + 1));\n newIndices.push(index.getX(i + 2));\n } else {\n newIndices.push(index.getX(i + 2));\n newIndices.push(index.getX(i + 1));\n newIndices.push(index.getX(i));\n }\n }\n }\n }\n if (newIndices.length / 3 !== numberOfTriangles) {\n console.error(\"THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.\");\n }\n const newGeometry = geometry.clone();\n newGeometry.setIndex(newIndices);\n newGeometry.clearGroups();\n return newGeometry;\n } else {\n console.error(\"THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:\", drawMode);\n return geometry;\n }\n}\nfunction computeMorphedAttributes(object) {\n if (object.geometry.isBufferGeometry !== true) {\n console.error(\"THREE.BufferGeometryUtils: Geometry is not of type BufferGeometry.\");\n return null;\n }\n const _vA = new Vector3();\n const _vB = new Vector3();\n const _vC = new Vector3();\n const _tempA = new Vector3();\n const _tempB = new Vector3();\n const _tempC = new Vector3();\n const _morphA = new Vector3();\n const _morphB = new Vector3();\n const _morphC = new Vector3();\n function _calculateMorphedAttributeData(object2, material2, attribute, morphAttribute, morphTargetsRelative2, a2, b2, c2, modifiedAttributeArray) {\n _vA.fromBufferAttribute(attribute, a2);\n _vB.fromBufferAttribute(attribute, b2);\n _vC.fromBufferAttribute(attribute, c2);\n const morphInfluences = object2.morphTargetInfluences;\n if (\n // @ts-ignore\n material2.morphTargets && morphAttribute && morphInfluences\n ) {\n _morphA.set(0, 0, 0);\n _morphB.set(0, 0, 0);\n _morphC.set(0, 0, 0);\n for (let i2 = 0, il2 = morphAttribute.length; i2 < il2; i2++) {\n const influence = morphInfluences[i2];\n const morph = morphAttribute[i2];\n if (influence === 0)\n continue;\n _tempA.fromBufferAttribute(morph, a2);\n _tempB.fromBufferAttribute(morph, b2);\n _tempC.fromBufferAttribute(morph, c2);\n if (morphTargetsRelative2) {\n _morphA.addScaledVector(_tempA, influence);\n _morphB.addScaledVector(_tempB, influence);\n _morphC.addScaledVector(_tempC, influence);\n } else {\n _morphA.addScaledVector(_tempA.sub(_vA), influence);\n _morphB.addScaledVector(_tempB.sub(_vB), influence);\n _morphC.addScaledVector(_tempC.sub(_vC), influence);\n }\n }\n _vA.add(_morphA);\n _vB.add(_morphB);\n _vC.add(_morphC);\n }\n if (object2.isSkinnedMesh) {\n object2.boneTransform(a2, _vA);\n object2.boneTransform(b2, _vB);\n object2.boneTransform(c2, _vC);\n }\n modifiedAttributeArray[a2 * 3 + 0] = _vA.x;\n modifiedAttributeArray[a2 * 3 + 1] = _vA.y;\n modifiedAttributeArray[a2 * 3 + 2] = _vA.z;\n modifiedAttributeArray[b2 * 3 + 0] = _vB.x;\n modifiedAttributeArray[b2 * 3 + 1] = _vB.y;\n modifiedAttributeArray[b2 * 3 + 2] = _vB.z;\n modifiedAttributeArray[c2 * 3 + 0] = _vC.x;\n modifiedAttributeArray[c2 * 3 + 1] = _vC.y;\n modifiedAttributeArray[c2 * 3 + 2] = _vC.z;\n }\n const geometry = object.geometry;\n const material = object.material;\n let a, b, c;\n const index = geometry.index;\n const positionAttribute = geometry.attributes.position;\n const morphPosition = geometry.morphAttributes.position;\n const morphTargetsRelative = geometry.morphTargetsRelative;\n const normalAttribute = geometry.attributes.normal;\n const morphNormal = geometry.morphAttributes.position;\n const groups = geometry.groups;\n const drawRange = geometry.drawRange;\n let i, j, il, jl;\n let group, groupMaterial;\n let start, end;\n const modifiedPosition = new Float32Array(positionAttribute.count * positionAttribute.itemSize);\n const modifiedNormal = new Float32Array(normalAttribute.count * normalAttribute.itemSize);\n if (index !== null) {\n if (Array.isArray(material)) {\n for (i = 0, il = groups.length; i < il; i++) {\n group = groups[i];\n groupMaterial = material[group.materialIndex];\n start = Math.max(group.start, drawRange.start);\n end = Math.min(group.start + group.count, drawRange.start + drawRange.count);\n for (j = start, jl = end; j < jl; j += 3) {\n a = index.getX(j);\n b = index.getX(j + 1);\n c = index.getX(j + 2);\n _calculateMorphedAttributeData(\n object,\n groupMaterial,\n positionAttribute,\n morphPosition,\n morphTargetsRelative,\n a,\n b,\n c,\n modifiedPosition\n );\n _calculateMorphedAttributeData(\n object,\n groupMaterial,\n normalAttribute,\n morphNormal,\n morphTargetsRelative,\n a,\n b,\n c,\n modifiedNormal\n );\n }\n }\n } else {\n start = Math.max(0, drawRange.start);\n end = Math.min(index.count, drawRange.start + drawRange.count);\n for (i = start, il = end; i < il; i += 3) {\n a = index.getX(i);\n b = index.getX(i + 1);\n c = index.getX(i + 2);\n _calculateMorphedAttributeData(\n object,\n material,\n positionAttribute,\n morphPosition,\n morphTargetsRelative,\n a,\n b,\n c,\n modifiedPosition\n );\n _calculateMorphedAttributeData(\n object,\n material,\n normalAttribute,\n morphNormal,\n morphTargetsRelative,\n a,\n b,\n c,\n modifiedNormal\n );\n }\n }\n } else if (positionAttribute !== void 0) {\n if (Array.isArray(material)) {\n for (i = 0, il = groups.length; i < il; i++) {\n group = groups[i];\n groupMaterial = material[group.materialIndex];\n start = Math.max(group.start, drawRange.start);\n end = Math.min(group.start + group.count, drawRange.start + drawRange.count);\n for (j = start, jl = end; j < jl; j += 3) {\n a = j;\n b = j + 1;\n c = j + 2;\n _calculateMorphedAttributeData(\n object,\n groupMaterial,\n positionAttribute,\n morphPosition,\n morphTargetsRelative,\n a,\n b,\n c,\n modifiedPosition\n );\n _calculateMorphedAttributeData(\n object,\n groupMaterial,\n normalAttribute,\n morphNormal,\n morphTargetsRelative,\n a,\n b,\n c,\n modifiedNormal\n );\n }\n }\n } else {\n start = Math.max(0, drawRange.start);\n end = Math.min(positionAttribute.count, drawRange.start + drawRange.count);\n for (i = start, il = end; i < il; i += 3) {\n a = i;\n b = i + 1;\n c = i + 2;\n _calculateMorphedAttributeData(\n object,\n material,\n positionAttribute,\n morphPosition,\n morphTargetsRelative,\n a,\n b,\n c,\n modifiedPosition\n );\n _calculateMorphedAttributeData(\n object,\n material,\n normalAttribute,\n morphNormal,\n morphTargetsRelative,\n a,\n b,\n c,\n modifiedNormal\n );\n }\n }\n }\n const morphedPositionAttribute = new Float32BufferAttribute(modifiedPosition, 3);\n const morphedNormalAttribute = new Float32BufferAttribute(modifiedNormal, 3);\n return {\n positionAttribute,\n normalAttribute,\n morphedPositionAttribute,\n morphedNormalAttribute\n };\n}\nfunction toCreasedNormals(geometry, creaseAngle = Math.PI / 3) {\n const creaseDot = Math.cos(creaseAngle);\n const hashMultiplier = (1 + 1e-10) * 100;\n const verts = [new Vector3(), new Vector3(), new Vector3()];\n const tempVec1 = new Vector3();\n const tempVec2 = new Vector3();\n const tempNorm = new Vector3();\n const tempNorm2 = new Vector3();\n function hashVertex(v) {\n const x = ~~(v.x * hashMultiplier);\n const y = ~~(v.y * hashMultiplier);\n const z = ~~(v.z * hashMultiplier);\n return `${x},${y},${z}`;\n }\n const resultGeometry = geometry.index ? geometry.toNonIndexed() : geometry;\n const posAttr = resultGeometry.attributes.position;\n const vertexMap = {};\n for (let i = 0, l = posAttr.count / 3; i < l; i++) {\n const i3 = 3 * i;\n const a = verts[0].fromBufferAttribute(posAttr, i3 + 0);\n const b = verts[1].fromBufferAttribute(posAttr, i3 + 1);\n const c = verts[2].fromBufferAttribute(posAttr, i3 + 2);\n tempVec1.subVectors(c, b);\n tempVec2.subVectors(a, b);\n const normal = new Vector3().crossVectors(tempVec1, tempVec2).normalize();\n for (let n = 0; n < 3; n++) {\n const vert = verts[n];\n const hash = hashVertex(vert);\n if (!(hash in vertexMap)) {\n vertexMap[hash] = [];\n }\n vertexMap[hash].push(normal);\n }\n }\n const normalArray = new Float32Array(posAttr.count * 3);\n const normAttr = new BufferAttribute(normalArray, 3, false);\n for (let i = 0, l = posAttr.count / 3; i < l; i++) {\n const i3 = 3 * i;\n const a = verts[0].fromBufferAttribute(posAttr, i3 + 0);\n const b = verts[1].fromBufferAttribute(posAttr, i3 + 1);\n const c = verts[2].fromBufferAttribute(posAttr, i3 + 2);\n tempVec1.subVectors(c, b);\n tempVec2.subVectors(a, b);\n tempNorm.crossVectors(tempVec1, tempVec2).normalize();\n for (let n = 0; n < 3; n++) {\n const vert = verts[n];\n const hash = hashVertex(vert);\n const otherNormals = vertexMap[hash];\n tempNorm2.set(0, 0, 0);\n for (let k = 0, lk = otherNormals.length; k < lk; k++) {\n const otherNorm = otherNormals[k];\n if (tempNorm.dot(otherNorm) > creaseDot) {\n tempNorm2.add(otherNorm);\n }\n }\n tempNorm2.normalize();\n normAttr.setXYZ(i3 + n, tempNorm2.x, tempNorm2.y, tempNorm2.z);\n }\n }\n resultGeometry.setAttribute(\"normal\", normAttr);\n return resultGeometry;\n}\nexport {\n computeMorphedAttributes,\n estimateBytesUsed,\n interleaveAttributes,\n mergeBufferAttributes,\n mergeBufferGeometries,\n mergeVertices,\n toCreasedNormals,\n toTrianglesDrawMode\n};\n//# sourceMappingURL=BufferGeometryUtils.js.map\n","import { BufferGeometry, Vector3, Float32BufferAttribute } from \"three\";\nclass ParametricGeometry extends BufferGeometry {\n constructor(func = (u, v, target) => target.set(u, v, Math.cos(u) * Math.sin(v)), slices = 8, stacks = 8) {\n super();\n this.type = \"ParametricGeometry\";\n this.parameters = {\n func,\n slices,\n stacks\n };\n const indices = [];\n const vertices = [];\n const normals = [];\n const uvs = [];\n const EPS = 1e-5;\n const normal = new Vector3();\n const p0 = new Vector3(), p1 = new Vector3();\n const pu = new Vector3(), pv = new Vector3();\n const sliceCount = slices + 1;\n for (let i = 0; i <= stacks; i++) {\n const v = i / stacks;\n for (let j = 0; j <= slices; j++) {\n const u = j / slices;\n func(u, v, p0);\n vertices.push(p0.x, p0.y, p0.z);\n if (u - EPS >= 0) {\n func(u - EPS, v, p1);\n pu.subVectors(p0, p1);\n } else {\n func(u + EPS, v, p1);\n pu.subVectors(p1, p0);\n }\n if (v - EPS >= 0) {\n func(u, v - EPS, p1);\n pv.subVectors(p0, p1);\n } else {\n func(u, v + EPS, p1);\n pv.subVectors(p1, p0);\n }\n normal.crossVectors(pu, pv).normalize();\n normals.push(normal.x, normal.y, normal.z);\n uvs.push(u, v);\n }\n }\n for (let i = 0; i < stacks; i++) {\n for (let j = 0; j < slices; j++) {\n const a = i * sliceCount + j;\n const b = i * sliceCount + j + 1;\n const c = (i + 1) * sliceCount + j + 1;\n const d = (i + 1) * sliceCount + j;\n indices.push(a, b, d);\n indices.push(b, c, d);\n }\n }\n this.setIndex(indices);\n this.setAttribute(\"position\", new Float32BufferAttribute(vertices, 3));\n this.setAttribute(\"normal\", new Float32BufferAttribute(normals, 3));\n this.setAttribute(\"uv\", new Float32BufferAttribute(uvs, 2));\n }\n}\nexport {\n ParametricGeometry\n};\n//# sourceMappingURL=ParametricGeometry.js.map\n","import { BoxGeometry, BufferAttribute, BufferGeometry } from \"three\";\nimport { mergeBufferGeometries } from \"three-stdlib\";\n\n/**\n * Book\n *\n * Group indices:\n * 0. cover\n * 1. page\n */\nexport class BookGeometry extends BufferGeometry {\n constructor(width = 1, height = 1.5, depth = 0.5, coverThickness = 0.05, pageIndent = 0.05) {\n super();\n\n const w = width;\n const h = height;\n const d = depth;\n const t = coverThickness;\n const i = pageIndent;\n\n const vertices = [\n // Front cover\n 0, 0, 0,\n w, 0, 0,\n w, h, 0,\n 0, h, 0,\n\n // Back cover\n w, 0, -d,\n 0, 0, -d,\n 0, h, -d,\n w, h, -d,\n\n // Spine\n 0, 0, -d,\n 0, 0, 0,\n 0, h, 0,\n 0, h, -d,\n\n // Inside front cover\n w, 0, -t,\n t, 0, -t,\n t, h, -t,\n w, h, -t,\n\n // Inside back cover\n t, 0, -d + t,\n w, 0, -d + t,\n w, h, -d + t,\n t, h, -d + t,\n\n // Inside spine\n t, 0, -t,\n t, 0, -d + t,\n t, h, -d + t,\n t, h, -t,\n\n // Front cover top\n 0, h, 0,\n w, h, 0,\n w, h, -t,\n t, h, -t,\n\n // Back cover top\n 0, h, -d,\n t, h, -d + t,\n w, h, -d + t,\n w, h, -d,\n\n // Spine cover top\n 0, h, 0,\n t, h, -t,\n t, h, -d + t,\n 0, h, -d,\n\n // Front cover bottom\n 0, 0, 0,\n t, 0, -t,\n w, 0, -t,\n w, 0, 0,\n\n // Back cover bottom\n 0, 0, -d,\n w, 0, -d,\n w, 0, -d + t,\n t, 0, -d + t,\n\n // Spine cover bottom\n 0, 0, 0,\n 0, 0, -d,\n t, 0, -d + t,\n t, 0, -t,\n\n // Front cover edge\n w, 0, 0,\n w, 0, -t,\n w, h, -t,\n w, h, 0,\n\n // Back cover edge\n w, 0, -d,\n w, h, -d,\n w, h, -d + t,\n w, 0, -d + t,\n ];\n\n\n\n const normals = [\n 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, // Front cover\n 0, 0,-1, 0, 0,-1, 0, 0,-1, 0, 0,-1, // Back cover\n -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, // Spine\n 0, 0,-1, 0, 0,-1, 0, 0,-1, 0, 0,-1, // Inside front cover\n 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, // Inside back cover\n 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, // Inside spine\n 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, // Front cover top\n 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, // Back cover top\n 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, // Spine cover top\n 0,-1, 0, 0,-1, 0, 0,-1, 0, 0,-1, 0, // Front cover bottom\n 0,-1, 0, 0,-1, 0, 0,-1, 0, 0,-1, 0, // Back cover bottom\n 0,-1, 0, 0,-1, 0, 0,-1, 0, 0,-1, 0, // Spine cover bottom\n 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, // Front cover edge\n 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, // Back cover edge\n ];\n\n const u1 = width / ((width * 2) + depth);\n const u2 = (width + depth) / ((width * 2) + depth);\n\n const uvs = [\n u2,0, 1,0, 1,1, u2,1, // Front cover\n 0,0, u1,0, u1,1, 0,1, // Back cover\n u1,0, u2,0, u2,1, u1,1, // Spine\n 1,0, u2,0, u2,1, 1,1, // Inside front cover\n u1,0, 0,0, 0,1, u1,1, // Inside back cover\n u2,0, u1,0, u1,1, u2,1, // Inside spine\n u2,0, 1,0, 1,1, u2,1, // Front cover top\n 0,0, 1,0, 1,1, 0,1, // Back cover top\n 0,0, 1,0, 1,1, 0,1, // Spine cover top\n 0,0, 1,0, 1,1, 0,1, // Front cover bottom\n 0,0, 1,0, 1,1, 0,1, // Back cover bottom\n 0,0, 1,0, 1,1, 0,1, // Spine cover bottom\n 0,0, 1,0, 1,1, 0,1, // Front cover edge\n 0,0, 1,0, 1,1, 0,1, // Back cover edge\n ];\n\n const indices = [\n 0, 1, 2, 0, 2, 3, // Front cover face\n 4, 5, 6, 4, 6, 7, // Back cover face\n 8, 9, 10, 8, 10, 11, // Spine face\n 12, 13, 14, 12, 14, 15, // Inside front cover\n 16, 17, 18, 16, 18, 19, // Inside back cover\n 20, 21, 22, 20, 22, 23, // Inside spine\n 24, 25, 26, 24, 26, 27, // Front cover top\n 28, 29, 30, 28, 30, 31, // Back cover top\n 32, 33, 34, 32, 34, 35, // Spine cover top\n 36, 37, 38, 36, 38, 39, // Front cover bottom\n 40, 41, 42, 40, 42, 43, // Back cover bottom\n 44, 45, 46, 44, 46, 47, // Spine cover bottom\n 48, 49, 50, 48, 50, 51, // Front cover edge\n 52, 53, 54, 52, 54, 55, // Back cover edge\n ];\n\n const positions = new Float32Array(vertices);\n const normalArray = new Float32Array(normals);\n const uvArray = new Float32Array(uvs);\n const indexArray = new Uint16Array(indices);\n\n const coverGeometry = new BufferGeometry();\n coverGeometry.setAttribute('position', new BufferAttribute(positions, 3));\n coverGeometry.setAttribute('normal', new BufferAttribute(normalArray, 3));\n coverGeometry.setAttribute('uv', new BufferAttribute(uvArray, 2));\n coverGeometry.setIndex(new BufferAttribute(indexArray, 1));\n\n const pagesGeometry = new BoxGeometry(width - t - i, h - i * 2, d - t * 2);\n pagesGeometry.translate((width - t - i) / 2 + t, h / 2, -d / 2 );\n this.copy(mergeBufferGeometries([coverGeometry, pagesGeometry], true) as BufferGeometry);\n }\n}\n","import { BookGeometry } from \"../geometry/books/BookGeometry\";\nimport { InstancedMesh, Matrix4, Vector3, Material } from \"three\";\nimport { logarithmicRandomMax, logarithmicRandomMin, randomFloat } from \"../utils/RandomNumberUtils\";\n\n// Define an interface for the scaling options\ninterface RandomScaleOptions {\n scaleXMin?: number;\n scaleXMax?: number;\n scaleYMin?: number;\n scaleYMax?: number;\n scaleZMin?: number;\n scaleZMax?: number;\n}\n\n// Define a generic interface for book row options using scales\ninterface RowOfBooksByScalesOptions<T extends Material = Material> {\n coverMaterial: T;\n pagesMaterial: T;\n scales: Vector3[];\n}\n\n// Define a generic interface for book row options using count or length\ninterface RowOfBooksOptions<T extends Material = Material> {\n coverMaterial: T;\n pagesMaterial: T;\n count?: number;\n length?: number;\n scaleXMin?: number;\n scaleXMax?: number;\n scaleYMin?: number;\n scaleYMax?: number;\n scaleZMin?: number;\n scaleZMax?: number;\n}\n\nfunction randomScale({\n scaleXMin = 0.4,\n scaleXMax = 0.7,\n scaleYMin = 0.3,\n scaleYMax = 0.95,\n scaleZMin = 0.1,\n scaleZMax = 0.5,\n}: RandomScaleOptions = {}): Vector3 {\n return new Vector3(\n randomFloat(scaleXMin, scaleXMax),\n logarithmicRandomMax(0.25, scaleYMin, scaleYMax),\n logarithmicRandomMin(0.8, scaleZMin, scaleZMax),\n );\n}\n\n/**\n * Creates a row of books from the scales array of Vector3.\n */\nexport function rowOfBooksByScales<T extends Material>({\n coverMaterial,\n pagesMaterial,\n scales,\n}: RowOfBooksByScalesOptions<T>): InstancedMesh {\n const geometry = new BookGeometry();\n const row = new InstancedMesh(geometry, [coverMaterial, pagesMaterial], scales.length);\n const matrix = new Matrix4();\n let currentZ = 0;\n\n for (let i = 0; i < scales.length; i++) {\n const scale = scales[i];\n const scaleMatrix = new Matrix4();\n scaleMatrix.makeScale(scale.x, scale.y, scale.z);\n matrix.identity();\n matrix.multiply(scaleMatrix);\n matrix.setPosition(0.01 + Math.random() * 0.1, 0, currentZ + scale.z * 0.5);\n row.setMatrixAt(i, matrix);\n currentZ += scale.z * 0.5;\n }\n return row;\n}\n\n/**\n * Creates a row of books with a given count.\n */\nexport function rowOfBooksByCount<T extends Material>({\n coverMaterial,\n pagesMaterial,\n count = 10,\n scaleXMin = 0.4,\n scaleXMax = 0.7,\n scaleYMin = 0.3,\n scaleYMax = 0.95,\n scaleZMin = 0.1,\n scaleZMax = 0.5,\n}: RowOfBooksOptions<T>): InstancedMesh {\n const scales = Array.from({ length: count }, () =>\n randomScale({ scaleXMin, scaleXMax, scaleYMin, scaleYMax, scaleZMin, scaleZMax }),\n );\n\n return rowOfBooksByScales({ coverMaterial, pagesMaterial, scales });\n}\n\n/**\n * Creates a row of books with a total length.\n */\nexport function rowOfBooksByLength<T extends Material>({\n coverMaterial,\n pagesMaterial,\n length = 10,\n scaleXMin = 0.4,\n scaleXMax = 0.7,\n scaleYMin = 0.3,\n scaleYMax = 0.95,\n scaleZMin = 0.1,\n scaleZMax = 0.5,\n}: RowOfBooksOptions<T>): InstancedMesh {\n const scales: Vector3[] = [];\n let remainingZ = length;\n while (remainingZ > 0) {\n const scale = randomScale({ scaleXMin, scaleXMax, scaleYMin, scaleYMax, scaleZMin, scaleZMax });\n scale.z = Math.min(scale.z, remainingZ);\n scales.push(scale);\n remainingZ -= scale.z;\n }\n\n return rowOfBooksByScales({ coverMaterial, pagesMaterial, scales });\n}\n","import { ExtrudeGeometry, InstancedMesh, Material, MeshStandardMaterial, Object3D, Shape } from \"three\";\n\nexport interface HexagonalTileOptions {\n width: number; // Total area width to fill (x-axis)\n depth: number; // Total area depth to fill (z-axis)\n height: number; // Height of each tile (y-axis)\n radius: number; // Radius of each hexagonal tile\n gap: number; // Gap spacing between tiles\n material?: Material; // Optional custom material\n}\n\n/**\n * Hexagonal tile pattern factory.\n *\n * Example usage:\n * ```ts\n * const hexTile = createHexagonalTile({\n * width: 10,\n * depth: 10,\n * height: 0.01,\n * radius: 0.1,\n * gap: 0.01,\n * material: new THREE.MeshStandardMaterial({ color: ColorPalette.White }),\n * });\n *\n * scene.add(hexTile);\n * ```\n */\nexport function createHexagonalTile(options: HexagonalTileOptions): InstancedMesh {\n const { width, depth, height, radius, gap, material } = options;\n\n const tileMaterial = material || new MeshStandardMaterial({ color: 0x8b4513 }); // Default earthy color\n\n // Effective spacing between hexagon centers, including the gap\n const spacingX = (radius * 3) / 2 + gap; // Horizontal distance between hex centers\n const spacingZ = Math.sqrt(3) * radius + gap; // Vertical distance between hex centers\n\n // Calculate the number of tiles that fit within the area\n const hexTileCountX = Math.floor(width / spacingX);\n const hexTileCountZ = Math.floor(depth / spacingZ);\n\n const hexTileCount = hexTileCountX * hexTileCountZ;\n\n // Create a hexagonal prism geometry\n const hexShape = new Shape();\n for (let i = 0; i < 6; i++) {\n const angle = (Math.PI / 3) * i; // 60-degree increments\n const x = Math.cos(angle) * radius;\n const y = Math.sin(angle) * radius;\n\n if (i === 0) hexShape.moveTo(x, y);\n else hexShape.lineTo(x, y);\n }\n hexShape.closePath();\n const geometry = new ExtrudeGeometry(hexShape, { depth: height, bevelEnabled: false });\n\n // Rotate geometry so tiles lay flat\n geometry.rotateX(-Math.PI / 2);\n\n // Create the instanced mesh\n const instancedMesh = new InstancedMesh(geometry, tileMaterial, hexTileCount);\n\n const dummy = new Object3D();\n let index = 0;\n\n for (let x = 0; x < hexTileCountX; x++) {\n for (let z = 0; z < hexTileCountZ; z++) {\n // Calculate the staggered row offset\n const offsetX = x * spacingX;\n const offsetZ = z * spacingZ + (x % 2) * (spacingZ / 2); // Stagger odd rows by half a tile\n\n // Center the grid\n const positionX = offsetX - (hexTileCountX * spacingX) / 2 + spacingX / 2;\n const positionZ = offsetZ - (hexTileCountZ * spacingZ) / 2 + spacingZ / 2;\n\n dummy.position.set(positionX, 0, positionZ);\n dummy.updateMatrix();\n instancedMesh.setMatrixAt(index++, dummy.matrix);\n }\n }\n\n instancedMesh.instanceMatrix.needsUpdate = true;\n\n return instancedMesh;\n}\n","import { BufferGeometry, Float32BufferAttribute } from \"three\";\n\nclass BifurcatedStaircaseGeometry extends BufferGeometry {\n constructor(stepWidth = 2, stepHeight = 0.3, stepDepth = 0.6, numStepsCentral = 5, numStepsBranch = 5, branchAngle = Math.PI / 4) {\n super();\n\n const vertices = [];\n const indices = [];\n\n // Generate central flight of steps\n for (let i = 0; i < numStepsCentral; i++) {\n const yBottom = i * stepHeight;\n const yTop = yBottom + stepHeight;\n const zFront = i * stepDepth;\n const zBack = zFront + stepDepth;\n\n // Central flight of steps (8 vertices per step)\n vertices.push(\n // Vertical riser\n -stepWidth / 2, yBottom, zFront, // Bottom-left\n stepWidth / 2, yBottom, zFront, // Bottom-right\n stepWidth / 2, yTop, zFront, // Top-right\n -stepWidth / 2, yTop, zFront, // Top-left\n\n // Horizontal tread\n -stepWidth / 2, yTop, zFront, // Top-left\n stepWidth / 2, yTop, zFront, // Top-right\n stepWidth / 2, yTop, zBack, // Back-right\n -stepWidth / 2, yTop, zBack // Back-left\n );\n\n const baseIndex = i * 8;\n // Indices for riser\n indices.push(\n baseIndex, baseIndex + 1, baseIndex + 2,\n baseIndex, baseIndex + 2, baseIndex + 3\n );\n\n // Indices for tread\n indices.push(\n baseIndex + 4, baseIndex + 5, baseIndex + 6,\n baseIndex + 4, baseIndex + 6, baseIndex + 7\n );\n }\n\n // Landing platform\n const landingY = numStepsCentral * stepHeight;\n const landingZ = numStepsCentral * stepDepth;\n const landingWidth = stepWidth * 2;\n\n vertices.push(\n // Landing platform (4 vertices)\n -landingWidth / 2, landingY, landingZ, // Bottom-left\n landingWidth / 2, landingY, landingZ, // Bottom-right\n landingWidth / 2, landingY, landingZ + stepDepth,// Top-right\n -landingWidth / 2, landingY, landingZ + stepDepth // Top-left\n );\n\n const landingBaseIndex = numStepsCentral * 8;\n indices.push(\n landingBaseIndex, landingBaseIndex + 1, landingBaseIndex + 2, // First triangle for landing\n landingBaseIndex, landingBaseIndex + 2, landingBaseIndex + 3 // Second triangle for landing\n );\n\n // Generate branching flights (left and right)\n for (let j = 0; j < 2; j++) {\n const direction = j === 0 ? 1 : -1; // Left or right branch\n\n for (let i = 0; i < numStepsBranch; i++) {\n const yBottom = landingY + i * stepHeight;\n const yTop = yBottom + stepHeight;\n\n // Calculate positions for the branching steps\n const xStart = direction * (landingWidth / 4);\n const zStart = landingZ + stepDepth;\n\n const xOffset = i * stepDepth * Math.cos(branchAngle);\n const zOffset = i * stepDepth * Math.sin(branchAngle);\n\n const xFrontLeft = xStart + direction * xOffset - (stepWidth / 2) * Math.cos(branchAngle);\n const xFrontRight = xStart + direction * xOffset + (stepWidth / 2) * Math.cos(branchAngle);\n const zFront = zStart + zOffset;\n const xBackLeft = xFrontLeft + direction * stepDepth * Math.cos(branchAngle);\n const xBackRight = xFrontRight + direction * stepDepth * Math.cos(branchAngle);\n const zBack = zFront + stepDepth * Math.sin(branchAngle);\n\n // Branch flight of steps (8 vertices per step)\n vertices.push(\n // Vertical riser\n xFrontLeft, yBottom, zFront, // Bottom-left\n xFrontRight, yBottom, zFront, // Bottom-right\n xFrontRight, yTop, zFront, // Top-right\n xFrontLeft, yTop, zFront, // Top-left\n\n // Horizontal tread\n xFrontLeft, yTop, zFront, // Top-left\n xFrontRight, yTop, zFront, // Top-right\n xBackRight, yTop, zBack, // Back-right\n xBackLeft, yTop, zBack // Back-left\n );\n\n const baseIndex = landingBaseIndex + 4 + j * numStepsBranch * 8 + i * 8;\n // Indices for riser\n indices.push(\n baseIndex, baseIndex + 1, baseIndex + 2,\n baseIndex, baseIndex + 2, baseIndex + 3\n );\n\n // Indices for tread\n indices.push(\n baseIndex + 4, baseIndex + 5, baseIndex + 6,\n baseIndex + 4, baseIndex + 6, baseIndex + 7\n );\n }\n }\n\n // Create BufferAttribute for vertices and indices\n this.setIndex(indices);\n this.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n this.computeVertexNormals(); // Compute normals for proper lighting\n }\n}\n\nexport { BifurcatedStaircaseGeometry };\n","import { BufferAttribute, BufferGeometry } from \"three\";\n\n/**\n * Geometry for a diorama with a floor and walls.\n *\n * Group indices:\n * 0: Interior walls\n * 1: Floor\n * 2: Exterior walls\n */\nexport class DioramaGeometry extends BufferGeometry {\n constructor({ width = 5, height = 3, depth = 5, wallThickness = 0.05 } = {}) {\n super();\n\n const w = width;\n const h = height;\n const d = depth;\n const t = wallThickness;\n\n const vertices = [\n 0, 0, 0, w, 0, 0, w, h, 0, 0, h, 0, // Back wall\n 0, 0, d, 0, 0, 0, 0, h, 0, 0, h, d, // Left wall\n 0, 0, d, w, 0, d, w, 0, 0, 0, 0, 0, // Floor\n -t, -t, d, w, -t, d, w, 0, d, 0, 0, d, // Floor front\n w, -t, d, w, -t, -t, w, 0, 0, w, 0, d, // Floor side\n -t, -t, d, 0, 0, d, 0, h, d, -t, h, d, // Left wall side\n w, 0, 0, w, -t, -t, w, h, -t, w, h, 0, // Back wall side\n -t, h, d, 0, h, d, 0, h, 0, -t, h, -t, // Ceiling left\n 0, h, 0, w, h, 0, w, h, -t, -t, h, -t, // Ceiling right\n -t, -t, -t, w, -t, -t, w, -t, d, -t, -t, d, // Floor backside\n -t, -t, -t, -t, -t, d, -t, h, d, -t, h, -t, // Left wall backside\n w, -t, -t, -t, -t, -t, -t, h, -t, w, h, -t, // back wall backside\n ];\n\n const indices = [\n 0, 1, 3, 1, 2, 3, // Back wall\n 4, 5, 7, 5, 6, 7, // Left wall\n 8, 9, 11, 9, 10, 11, // Floor\n 12, 13, 15, 13, 14, 15, // Floor (side: front)\n 16, 17, 19, 17, 18, 19, // Floor (side: right)\n 20, 21, 23, 21, 22, 23, // Left wall (side: front)\n 24, 25, 27, 25, 26, 27, // Back wall (side: right)\n 28, 29, 31, 29, 30, 31, // Left wall (side: top)\n 32, 33, 35, 33, 34, 35, // Back wall (side: top)\n 36, 37, 39, 37, 38, 39, // Floor backside\n 40, 41, 43, 41, 42, 43, // Left wall backside\n 44, 45, 47, 45, 46, 47, // Back wall backside\n ];\n\n const normals = [\n 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, // Back wall\n 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, // Left wall\n 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, // Floor\n 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, // Floor (side: front)\n 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, // Floor (side: right)\n 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, // Left wall (side: front)\n 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, // Back wall (side: right)\n 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, // Left wall (side: top)\n 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, // Back wall (side: top)\n 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, // Floor backside\n -1, 0, 0, -1, 0, 0, -1 ,0, 0, -1, 0, 0, // Left wall backside\n 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, // Back wall backside\n ];\n\n const uvs = [\n 0.5, 0, 1, 0, 1, 1, 0.5, 1, // Back wall\n 0, 0, 0.5, 0, 0.5, 1, 0, 1, // Left wall\n 0, 0, 1, 0, 1, 1, 0, 1, // Floor\n 0, 0, 1, 0, 1, t/w, 0, t/w, // Floor (side: front)\n 0, 0, 1, 0, 1, t/w, 0, t/w, // Floor (side: right)\n 0, 0, t/w, 0, t/w, 1, 0, 1, // Left wall (side: front)\n 1-(t/w), 0, 1, 0, 1, 1, 1-(t/w), 1, // Back wall (side: right)\n 0, 0, t/w, 0, t/w, 1, 0, 1, // Left wall (side: top)\n 0, 1-(t/w), 1, 1-(t/w), 1, 1, 0, 1, // Back wall (side: top)\n 0, 0, 1, 0, 1, 1, 0, 1, // Floor backside\n 0, 0, 1, 0, 1, 1, 0, 1, // Left wall backside\n 0, 0, 1, 0, 1, 1, 0, 1, // Back wall backside\n ];\n\n const positions = new Float32Array(vertices);\n const normalArray = new Float32Array(normals);\n const uvArray = new Float32Array(uvs);\n\n this.setAttribute('position', new BufferAttribute(positions, 3));\n this.setAttribute('normal', new BufferAttribute(normalArray, 3));\n this.setAttribute('uv', new BufferAttribute(uvArray, 2));\n this.setIndex(indices);\n\n this.addGroup(0, 12, 0); // Interior walls\n this.addGroup(12, 6, 1); // Floor\n this.addGroup(18, 54, 2); // Exterior walls\n }\n}\n\n","import { BufferGeometry, Float32BufferAttribute } from \"three\";\n\nclass LShapedStaircaseGeometry extends BufferGeometry {\n constructor(stepWidth = 2, stepHeight = 0.3, stepDepth = 0.5, numStepsPerFlight = 5, landingDepth = 2) {\n super();\n\n const vertices = [];\n const indices = [];\n\n // Generate first flight of steps\n for (let i = 0; i < numStepsPerFlight; i++) {\n const yBottom = i * stepHeight;\n const yTop = yBottom + stepHeight;\n const zFront = i * stepDepth;\n const zBack = zFront + stepDepth;\n\n // First flight of steps (4 vertices per step, 8 vertices per flight)\n vertices.push(\n // Vertical riser\n -stepWidth / 2, yBottom, zFront, // Bottom-left\n stepWidth / 2, yBottom, zFront, // Bottom-right\n stepWidth / 2, yTop, zFront, // Top-right\n -stepWidth / 2, yTop, zFront, // Top-left\n\n // Horizontal tread\n -stepWidth / 2, yTop, zFront, // Top-left\n stepWidth / 2, yTop, zFront, // Top-right\n stepWidth / 2, yTop, zBack, // Back-right\n -stepWidth / 2, yTop, zBack // Back-left\n );\n\n const baseIndex = i * 8;\n // Indices for riser\n indices.push(\n baseIndex, baseIndex + 1, baseIndex + 2,\n baseIndex, baseIndex + 2, baseIndex + 3\n );\n\n // Indices for tread\n indices.push(\n baseIndex + 4, baseIndex + 5, baseIndex + 6,\n baseIndex + 4, baseIndex + 6, baseIndex + 7\n );\n }\n\n // Add landing platform\n const landingY = numStepsPerFlight * stepHeight;\n const landingZ = numStepsPerFlight * stepDepth;\n\n vertices.push(\n // Landing platform (4 vertices)\n -stepWidth / 2, landingY, landingZ, // Bottom-left\n stepWidth / 2, landingY, landingZ, // Bottom-right\n stepWidth / 2, landingY, landingZ + landingDepth, // Top-right\n -stepWidth / 2, landingY, landingZ + landingDepth // Top-left\n );\n\n const landingBaseIndex = numStepsPerFlight * 8;\n indices.push(\n landingBaseIndex, landingBaseIndex + 1, landingBaseIndex + 2, // First triangle for landing\n landingBaseIndex, landingBaseIndex + 2, landingBaseIndex + 3 // Second triangle for landing\n );\n\n // Generate second flight of steps (turn 90 degrees)\n for (let i = 0; i < numStepsPerFlight; i++) {\n const yBottom = landingY + i * stepHeight;\n const yTop = yBottom + stepHeight;\n const xFront = -stepWidth / 2 - i * stepDepth;\n const xBack = xFront - stepDepth;\n\n // Second flight of steps (4 vertices per step, 8 vertices per flight)\n vertices.push(\n // Vertical riser\n xFront, yBottom, landingZ + landingDepth, // Bottom-left\n xFront, yBottom, landingZ + landingDepth - stepWidth, // Bottom-right\n xFront, yTop, landingZ + landingDepth - stepWidth, // Top-right\n xFront, yTop, landingZ + landingDepth, // Top-left\n\n // Horizontal tread\n xFront, yTop, landingZ + landingDepth, // Top-left\n xFront, yTop, landingZ + landingDepth - stepWidth, // Top-right\n xBack, yTop, landingZ + landingDepth - stepWidth, // Back-right\n xBack, yTop, landingZ + landingDepth // Back-left\n );\n\n const baseIndex = landingBaseIndex + 4 + i * 8;\n // Indices for riser\n indices.push(\n baseIndex, baseIndex + 1, baseIndex + 2,\n baseIndex, baseIndex + 2, baseIndex + 3\n );\n\n // Indices for tread\n indices.push(\n baseIndex + 4, baseIndex + 5, baseIndex + 6,\n baseIndex + 4, baseIndex + 6, baseIndex + 7\n );\n }\n\n // Create BufferAttribute for vertices and indices\n this.setIndex(indices);\n this.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n this.computeVertexNormals(); // Compute normals for proper lighting\n }\n}\n\nexport { LShapedStaircaseGeometry };\n","import { BufferGeometry, Float32BufferAttribute } from \"three\";\n\nclass SpiralStaircaseGeometry extends BufferGeometry {\n constructor(stepWidth = 1, stepDepth = 0.4, stepHeight = 0.2, numSteps = 20, radius = 2, angleIncrement = Math.PI / 8) {\n super();\n\n const vertices = [];\n const indices = [];\n let currentAngle = 0;\n\n // Generate vertices and indices for each step\n for (let i = 0; i < numSteps; i++) {\n // Calculate the center position of the step based on the angle and radius\n const xCenter = radius * Math.cos(currentAngle);\n const zCenter = radius * Math.sin(currentAngle);\n const yBottom = i * stepHeight;\n const yTop = yBottom + stepHeight;\n\n // Define the four corners of the vertical riser part of the current step\n vertices.push(\n // Front face (vertical riser)\n xCenter - (stepWidth / 2) * Math.cos(currentAngle), yBottom, zCenter - (stepWidth / 2) * Math.sin(currentAngle), // Bottom-left\n xCenter + (stepWidth / 2) * Math.cos(currentAngle), yBottom, zCenter + (stepWidth / 2) * Math.sin(currentAngle), // Bottom-right\n xCenter + (stepWidth / 2) * Math.cos(currentAngle), yTop, zCenter + (stepWidth / 2) * Math.sin(currentAngle), // Top-right\n xCenter - (stepWidth / 2) * Math.cos(currentAngle), yTop, zCenter - (stepWidth / 2) * Math.sin(currentAngle) // Top-left\n );\n\n // Define the four corners of the horizontal tread part of the current step\n vertices.push(\n // Top face (horizontal tread)\n xCenter - (stepWidth / 2) * Math.cos(currentAngle), yTop, zCenter - (stepWidth / 2) * Math.sin(currentAngle), // Top-left-front\n xCenter + (stepWidth / 2) * Math.cos(currentAngle), yTop, zCenter + (stepWidth / 2) * Math.sin(currentAngle), // Top-right-front\n xCenter + (stepWidth / 2) * Math.cos(currentAngle) - stepDepth * Math.sin(currentAngle), yTop, zCenter + (stepWidth / 2) * Math.sin(currentAngle) + stepDepth * Math.cos(currentAngle), // Back-right\n xCenter - (stepWidth / 2) * Math.cos(currentAngle) - stepDepth * Math.sin(currentAngle), yTop, zCenter - (stepWidth / 2) * Math.sin(currentAngle) + stepDepth * Math.cos(currentAngle) // Back-left\n );\n\n // Indices for the riser (vertical face of each step)\n const baseIndex = i * 8; // 8 vertices per step (4 for riser, 4 for tread)\n indices.push(\n baseIndex, baseIndex + 1, baseIndex + 2, // First triangle for riser\n baseIndex, baseIndex + 2, baseIndex + 3 // Second triangle for riser\n );\n\n // Indices for the tread (horizontal face of each step)\n indices.push(\n baseIndex + 4, baseIndex + 5, baseIndex + 6, // First triangle for tread\n baseIndex + 4, baseIndex + 6, baseIndex + 7 // Second triangle for tread\n );\n\n // Increment the angle for the next step\n currentAngle += angleIncrement;\n }\n\n // Create BufferAttribute for vertices and indices\n this.setIndex(indices);\n this.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n this.computeVertexNormals(); // Compute normals for proper lighting\n }\n}\n\nexport { SpiralStaircaseGeometry };\n","import { BufferGeometry, Float32BufferAttribute } from \"three\";\n\nclass StaircaseGeometry extends BufferGeometry {\n constructor(width = 2, stepHeight = 0.3, stepDepth = 0.5, numSteps = 10) {\n super();\n\n const vertices = [];\n const indices = [];\n\n // Generate vertices and indices for each step\n for (let i = 0; i < numSteps; i++) {\n const stepBottomY = i * stepHeight;\n const stepTopY = stepBottomY + stepHeight;\n const stepFrontZ = i * stepDepth;\n const stepBackZ = stepFrontZ + stepDepth;\n\n // Vertices for each step (8 vertices per step to cover tread and riser)\n vertices.push(\n // Bottom face of riser (front face)\n -width / 2, stepBottomY, stepFrontZ, // 0: Bottom-left-front\n width / 2, stepBottomY, stepFrontZ, // 1: Bottom-right-front\n width / 2, stepTopY, stepFrontZ, // 2: Top-right-front\n -width / 2, stepTopY, stepFrontZ, // 3: Top-left-front\n\n // Top face of tread (horizontal step)\n -width / 2, stepTopY, stepFrontZ, // 4: Top-left-front (repeated)\n width / 2, stepTopY, stepFrontZ, // 5: Top-right-front (repeated)\n width / 2, stepTopY, stepBackZ, // 6: Top-right-back\n -width / 2, stepTopY, stepBackZ // 7: Top-left-back\n );\n\n // Indices for each step\n const baseIndex = i * 8;\n\n // Riser face (front face of each step)\n indices.push(\n baseIndex, baseIndex + 1, baseIndex + 2, // First triangle for riser\n baseIndex, baseIndex + 2, baseIndex + 3 // Second triangle for riser\n );\n\n // Tread face (top horizontal surface of each step)\n indices.push(\n baseIndex + 4, baseIndex + 6, baseIndex + 5, // First triangle for tread\n baseIndex + 4, baseIndex + 7, baseIndex + 6 // Second triangle for tread\n );\n }\n\n // Create BufferAttribute for vertices and indices\n this.setIndex(indices);\n this.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n this.computeVertexNormals(); // Compute normals for proper lighting\n }\n}\n\nexport { StaircaseGeometry };\n","import { BufferGeometry, CylinderGeometry, LatheGeometry, Vector2 } from \"three\";\nimport { mergeBufferGeometries } from \"three-stdlib\";\n\n/**\n * Group indices\n * 0. Jar\n * 1. Cork\n */\nexport class JarGeometry extends BufferGeometry {\n constructor() {\n super();\n\n // Jar\n const points = [\n new Vector2(0, 0), // Bottom of the jar\n new Vector2(1.2, 0), // Base\n new Vector2(1.5, 1.5), // Mid-body\n new Vector2(1, 3), // Narrow neck\n new Vector2(0.6, 3.5), // Mouth of the jar\n new Vector2(0.5, 3.5), // Cork\n ];\n\n const bodyGeometry = new LatheGeometry(points, 10);\n\n // Cork\n const corkGeometry = new CylinderGeometry(0.6, 0.5, 0.3, 10);\n corkGeometry.translate(0, 3.5, 0);\n\n this.copy(mergeBufferGeometries([bodyGeometry, corkGeometry], true) as BufferGeometry);\n }\n}\n","/**\n * Calculate the x-coordinate for a given y-coordinate using the slope-intercept equation of a line.\n * x = x1 + (y - y1) / m\n *\n * Example usage\n * ```\n * const x1 = 0.8, y1 = 0, x2 = 1, y2 = 1.5, y = 1.0;\n * const x = calculateXForY(x1, y1, x2, y2, y);\n * console.log(`The x-position for y=${y} is x=${x.toFixed(4)}`);\n * ```\n */\nexport function calculateXFromSlopeIntercept(x1: number, y1: number, x2: number, y2: number, y: number): number {\n const m = (y2 - y1) / (x2 - x1); // slope\n return x1 + (y - y1) / m;\n}\n\n/**\n * Calculate the y-coordinate for a given x-coordinate using the slope-intercept equation of a line.\n * y = y1 + m * (x - x1)\n *\n * Example usage\n * ```\n * const x1 = 0.8, y1 = 0, x2 = 1, y2 = 1.5, x = 0.9333;\n * const y = calculateYForX(x1, y1, x2, y2, x);\n * console.log(`The y-position for x=${x} is y=${y.toFixed(4)}`);\n * ```\n */\nexport function calculateYFromSlopeIntercept(x1: number, y1: number, x2: number, y2: number, x: number): number {\n const m = (y2 - y1) / (x2 - x1); // slope\n return y1 + m * (x - x1);\n}\n\nexport const LineEquations = {\n calculateXFromSlopeIntercept,\n calculateYFromSlopeIntercept,\n};\n","import { BufferGeometry, CylinderGeometry, LatheGeometry, Vector2 } from \"three\";\nimport { calculateXFromSlopeIntercept } from \"../../utils/LineEquations\";\nimport { mergeBufferGeometries } from \"three-stdlib\";\n\n/**\n * Potion bottle geometry\n *\n * Group indices\n * 0. Bottle\n * 1. Cork\n * 2. Liquid (optional)\n */\nexport class PotionBottleGeometry extends BufferGeometry {\n constructor() {\n super();\n\n // Bottle\n const points = [\n new Vector2(0, 0), // Origin\n new Vector2(0.8, 0), // Base\n new Vector2(1, 1.5), // Rounded body\n new Vector2(0.5, 2.2), // Neck\n new Vector2(0.6, 2.5), // Mouth\n new Vector2(0.5, 2.5), // Cork\n ];\n\n const bottleGeometry = new LatheGeometry(points, 10);\n\n // Cork\n const corkGeometry = new CylinderGeometry(0.55, 0.45, 0.2, 10);\n corkGeometry.translate(0, 2.5, 0);\n\n // Liquid (optional)\n const liquidPoints = [\n new Vector2(0, 0),\n new Vector2(0.8, 0),\n new Vector2(calculateXFromSlopeIntercept(0.8, 0, 1, 1.5, 1.0), 1.0),\n new Vector2(0, 1.0),\n ];\n\n const liquidGeometry = new LatheGeometry(liquidPoints, 10);\n liquidGeometry.translate(0, 0.1, 0);\n liquidGeometry.scale(0.9, 0.9, 0.9);\n\n this.copy(mergeBufferGeometries([bottleGeometry, corkGeometry, liquidGeometry], true) as BufferGeometry);\n }\n}\n","import { BufferGeometry, CylinderGeometry } from \"three\";\nimport { mergeBufferGeometries } from \"three-stdlib\";\n\nclass WineBottleGeometry extends BufferGeometry {\n constructor({ radius = 0.5, neckRadius = 0.2, height = 3, neckHeight = 1, segments = 16 } = {}) {\n super();\n\n // Main body\n const bodyHeight = height - neckHeight;\n const bodyGeometry = new CylinderGeometry(radius, radius, bodyHeight, segments);\n bodyGeometry.translate(0, bodyHeight / 2, 0);\n\n // Shoulder section between body and neck\n const shoulderHeight = 0.3;\n const shoulderGeometry = new CylinderGeometry(neckRadius, radius, shoulderHeight, segments);\n shoulderGeometry.translate(0, bodyHeight + shoulderHeight / 2, 0);\n\n // Neck\n const neckGeometry = new CylinderGeometry(neckRadius, neckRadius, neckHeight, segments);\n neckGeometry.translate(0, bodyHeight + shoulderHeight + neckHeight / 2, 0);\n\n // Merge geometries\n this.copy(mergeBufferGeometries([bodyGeometry, shoulderGeometry, neckGeometry], false) as BufferGeometry);\n }\n}\n\nexport { WineBottleGeometry };\n","import { BoxGeometry, BufferGeometry } from \"three\";\nimport { mergeBufferGeometries } from \"three-stdlib\";\n\nclass CrossHeadstoneGeometry extends BufferGeometry {\n constructor(width: number = 0.4, height: number = 1.2, depth: number = 0.2) {\n super();\n\n // Create the vertical part of the cross\n const verticalHeight = height * 0.6;\n const verticalGeometry = new BoxGeometry(width / 2, verticalHeight, depth);\n verticalGeometry.translate(0, verticalHeight / 2, 0);\n\n // Create the horizontal part of the cross\n const horizontalWidth = width * 1.5;\n const horizontalGeometry = new BoxGeometry(horizontalWidth, width / 4, depth);\n horizontalGeometry.translate(0, verticalHeight * 0.75, 0);\n\n // Merge both parts into a cross\n this.copy(mergeBufferGeometries([verticalGeometry, horizontalGeometry], false) as BufferGeometry);\n this.computeVertexNormals();\n }\n}\n\nexport { CrossHeadstoneGeometry };\n","import { BoxGeometry, BufferGeometry, ConeGeometry, CylinderGeometry, ExtrudeGeometry, Shape } from \"three\";\nimport { mergeBufferGeometries } from \"three-stdlib\";\n\n/**\n * Mausoleum Geometry\n *\n * Group indices:\n * 0. Base\n * 1. Building\n * 2. Roof\n * 3. Arched entrance\n */\nexport class MausoleumGeometry extends BufferGeometry {\n constructor() {\n super();\n\n // Base of the Mausoleum\n const baseGeometry = new BoxGeometry(5, 1, 5);\n baseGeometry.translate(0, 0.5, 0);\n\n // Main Building Structure\n const buildingGeometry = new BoxGeometry(4, 3, 4);\n buildingGeometry.translate(0, 2.5, 0);\n\n // Pillars\n const pillarPositions = [\n [-1.8, 2.3, -2.2],\n [1.8, 2.3, -2.2],\n [-1.8, 2.3, 2.2],\n [1.8, 2.3, 2.2],\n ];\n\n const pillars: BufferGeometry[] = [];\n pillarPositions.forEach((position) => {\n const pillar = new CylinderGeometry(0.2, 0.2, 3.5, 16);\n pillar.translate(position[0], position[1], position[2]);\n pillars.push(pillar);\n });\n\n // Roof (Peaked)\n const roofGeometry = new ConeGeometry(3.5, 2, 4);\n roofGeometry.rotateY(Math.PI / 4);\n roofGeometry.translate(0, 5, 0);\n\n // Arched Entrance\n const archShape = new Shape();\n archShape.moveTo(-1, 0);\n archShape.lineTo(-1, 2);\n archShape.absarc(0, 2, 1, Math.PI, 0, true);\n archShape.lineTo(1, 0);\n\n const extrudeSettings = {\n depth: 0.5,\n bevelEnabled: false,\n };\n const archGeometry = new ExtrudeGeometry(archShape, extrudeSettings);\n archGeometry.translate(0, 0.5, 1.7);\n archGeometry.setIndex([...Array(archGeometry.attributes.position.count).keys()]);\n\n this.copy(\n mergeBufferGeometries(\n [\n baseGeometry,\n mergeBufferGeometries([buildingGeometry, ...pillars], false) as BufferGeometry,\n roofGeometry,\n archGeometry,\n ],\n true,\n ) as BufferGeometry,\n );\n this.computeVertexNormals();\n }\n}\n","import { BoxGeometry, BufferGeometry, ConeGeometry } from \"three\";\nimport {mergeBufferGeometries} from \"three-stdlib\";\n\nclass ObeliskHeadstoneGeometry extends BufferGeometry {\n constructor(totalHeight = 1.75, baseWidth = 0.75) {\n super();\n\n // Define height proportions relative to the total height\n const baseHeight = totalHeight * 0.05;\n const lowerSegmentHeight = totalHeight * 0.15;\n const middleSegmentHeight = totalHeight * 0.15;\n const topSegmentHeight = totalHeight * 0.75;\n\n let currentHeight = 0;\n\n // Base of the Headstone (a wide box)\n const baseGeometry = new BoxGeometry(baseWidth, baseHeight, baseWidth);\n baseGeometry.translate(0, currentHeight + baseHeight / 2, 0);\n currentHeight += baseHeight;\n\n // Lower Segment (a slightly narrower box)\n const lowerSegmentGeometry = new BoxGeometry(baseWidth * 0.8, lowerSegmentHeight, baseWidth * 0.8);\n lowerSegmentGeometry.translate(0, currentHeight + lowerSegmentHeight / 2, 0);\n currentHeight += lowerSegmentHeight;\n\n // Middle Segment (an even narrower box)\n const middleSegmentGeometry = new BoxGeometry(baseWidth * 0.6, middleSegmentHeight, baseWidth * 0.6);\n middleSegmentGeometry.translate(0, currentHeight + middleSegmentHeight / 2, 0);\n currentHeight += middleSegmentHeight;\n\n // Top Segment (a tall, thin box to form the obelisk shape)\n const topSegmentGeometry = new BoxGeometry(baseWidth * 0.4, topSegmentHeight, baseWidth * 0.4);\n topSegmentGeometry.translate(0, currentHeight + topSegmentHeight / 2, 0);\n currentHeight += topSegmentHeight;\n\n // Pyramid Top (a cone to form the pointed top of the obelisk)\n const pyramidGeometry = new ConeGeometry((baseWidth * 0.4) / Math.sqrt(2), 0.1, 4, 1, false, Math.PI / 4);\n pyramidGeometry.translate(0, currentHeight + 0.1 / 2, 0);\n\n this.copy(mergeBufferGeometries([baseGeometry, lowerSegmentGeometry, middleSegmentGeometry, topSegmentGeometry, pyramidGeometry], false) as BufferGeometry);\n this.computeVertexNormals();\n }\n}\n\nexport { ObeliskHeadstoneGeometry };\n","import { BoxGeometry, BufferGeometry, CylinderGeometry } from \"three\";\nimport {mergeBufferGeometries} from \"three-stdlib\";\n\nclass RoundedHeadstoneGeometry extends BufferGeometry {\n constructor(width = 0.6, height = 1.0, depth = 0.2, radius = 0.6) {\n super();\n\n // Create the base of the headstone (a box)\n const baseHeight = height - radius / 2;\n const baseGeometry = new BoxGeometry(width, baseHeight, depth);\n baseGeometry.translate(0, baseHeight / 2, 0);\n\n // Create the rounded top part (a half cylinder with caps)\n const topGeometry = new CylinderGeometry(radius / 2, radius / 2, depth, 16, 1, false, 0, Math.PI);\n topGeometry.rotateY(Math.PI / 2);\n topGeometry.rotateX(Math.PI / 2);\n topGeometry.translate(0, baseHeight, 0);\n\n // Merge base and top into a single geometry\n this.copy(mergeBufferGeometries([baseGeometry, topGeometry], false) as BufferGeometry);\n this.computeVertexNormals();\n }\n}\n\nexport { RoundedHeadstoneGeometry };\n","import { BoxGeometry, BufferGeometry } from \"three\";\n\nexport class SquareHeadstoneGeometry extends BufferGeometry {\n constructor(width = 0.5, height = 0.8, depth = 0.15) {\n super();\n\n // Create a rectangular slab\n const slabGeometry = new BoxGeometry(width, height, depth);\n slabGeometry.translate(0, height / 2, 0);\n\n this.copy(slabGeometry);\n }\n}\n","import { BoxGeometry, BufferGeometry } from \"three\";\nimport { mergeBufferGeometries } from \"three-stdlib\";\n\n/**\n * Fence Column Geometry, a stone slab fence column shape\n */\nexport class StoneFencePostGeometry extends BufferGeometry {\n constructor({ height = 2.25 } = {}) {\n super();\n\n // Column Base (a wider base for stability)\n const baseGeometry = new BoxGeometry(1.2, 0.5, 1.2);\n baseGeometry.translate(0, 0.25, 0);\n\n // Main Column (a tall rectangular shape, adjustable height)\n const columnGeometry = new BoxGeometry(1, height, 1);\n columnGeometry.translate(0, 0.5 + height / 2, 0);\n\n // Column Cap (a slightly wider cap on top)\n const capGeometry = new BoxGeometry(1.4, 0.3, 1.4);\n capGeometry.translate(0, 0.5 + height + 0.15, 0);\n\n this.copy(mergeBufferGeometries([baseGeometry, columnGeometry, capGeometry], false) as BufferGeometry);\n }\n}\n","import { BufferGeometry, ConeGeometry, CylinderGeometry } from \"three\";\nimport { mergeBufferGeometries } from \"three-stdlib\";\n\n/**\n * Wrought Iron Bar Geometry, a simple wrought iron bar shape\n */\nexport class WroughtIronBarGeometry extends BufferGeometry {\n constructor({\n barHeight = 2.0, //\n barRadius = 0.05,\n spikeHeight = 0.3,\n spikeRadius = 0.075,\n spikeScaleZ = 1.0,\n radialSegments = 8,\n } = {}) {\n super();\n\n // Create a cylinder for the vertical bar\n const barGeometry = new CylinderGeometry(barRadius, barRadius, barHeight, radialSegments);\n barGeometry.translate(0, barHeight / 2, 0);\n\n // Create a cone for the spike on top\n const spikeGeometry = new ConeGeometry(spikeRadius, spikeHeight, radialSegments);\n spikeGeometry.translate(0, barHeight + spikeHeight / 2, 0);\n spikeGeometry.scale(1, 1, spikeScaleZ);\n\n // Merge bar and spike into one geometry\n this.copy(mergeBufferGeometries([barGeometry, spikeGeometry], false) as BufferGeometry);\n }\n}\n","import { BoxGeometry, BufferGeometry } from \"three\";\nimport { WroughtIronBarGeometry } from \"./WroughtIronBarGeometry\";\nimport { mergeBufferGeometries } from \"three-stdlib\";\n\nexport class WroughtIronFenceGeometry extends BufferGeometry {\n constructor({\n count = 20, //\n spacing = 0.4,\n barHeight = 2.0,\n barRadius = 0.05,\n spikeHeight = 0.3,\n spikeRadius = 0.075,\n spikeScaleZ = 1.0,\n railHeight = 0.1,\n railDepth = 0.05,\n railOffset = 0.0,\n radialSegments = 8,\n } = {}) {\n super();\n\n const geometries = [];\n const bar = new WroughtIronBarGeometry({ barHeight, barRadius, spikeHeight, spikeRadius, spikeScaleZ, radialSegments });\n const rail = new BoxGeometry(count * spacing, railHeight, railDepth);\n\n for (let i = 0; i < count; i++) {\n const geometry = bar.clone();\n geometry.translate(i * spacing, 0, 0);\n geometries.push(geometry);\n }\n\n const topRail = rail.clone();\n topRail.translate((spacing * (count - 1)) / 2, barHeight - railOffset - railHeight / 2, 0);\n geometries.push(topRail);\n\n const bottomRail = rail.clone();\n bottomRail.translate((spacing * (count - 1)) / 2, railHeight / 2, 0);\n geometries.push(bottomRail);\n\n this.copy(mergeBufferGeometries(geometries) as BufferGeometry);\n }\n}\n","import { BoxGeometry, BufferGeometry } from \"three\";\nimport {mergeBufferGeometries} from \"three-stdlib\";\n\nexport class BookshelfGeometry extends BufferGeometry {\n constructor({\n width = 5, //\n height = 8,\n depth = 1,\n shelves = 4,\n frameThickness = 0.1,\n open = false,\n } = {}) {\n super();\n\n // Create the outer frame of the bookshelf\n const frameHeight = height;\n const frameWidth = width;\n const frameDepth = depth;\n\n // Base geometries\n const sidePanelGeometry = new BoxGeometry(frameThickness, frameHeight, frameDepth);\n const shelfGeometry = new BoxGeometry(frameWidth - 2 * frameThickness, frameThickness, frameDepth);\n\n // Panels\n const leftPanel = sidePanelGeometry.clone();\n leftPanel.translate(-frameWidth / 2 + frameThickness / 2, frameHeight / 2, 0);\n\n const rightPanel = sidePanelGeometry.clone();\n rightPanel.translate(frameWidth / 2 - frameThickness / 2, frameHeight / 2, 0);\n\n const topPanel = shelfGeometry.clone();\n topPanel.translate(0, frameHeight - frameThickness / 2, 0);\n\n const bottomPanel = shelfGeometry.clone();\n bottomPanel.translate(0, frameThickness / 2, 0);\n\n const backPanel = new BoxGeometry(frameWidth, frameHeight, frameThickness);\n backPanel.translate(0, frameHeight / 2, -frameDepth / 2 + frameThickness / 2);\n\n const shelfPanels = [];\n const shelfSpacing = (frameHeight - frameThickness) / (shelves + 1);\n for (let i = 1; i <= shelves; i++) {\n const shelfPanel = shelfGeometry.clone();\n shelfPanel.translate(0, frameThickness / 2 + i * shelfSpacing, 0);\n shelfPanels.push(shelfPanel);\n }\n\n this.copy(mergeBufferGeometries([\n leftPanel, //\n rightPanel,\n topPanel,\n bottomPanel,\n ...(open ? [] : [backPanel]),\n ...shelfPanels\n ], false) as BufferGeometry);\n }\n}\n","import { BoxGeometry, BufferGeometry, LatheGeometry, Vector2 } from \"three\";\nimport { mergeBufferGeometries } from \"three-stdlib\";\n\n/**\n * Group indices:\n * 0. Desk surface\n * 1. Desk legs\n */\nexport class DeskGeometry extends BufferGeometry {\n constructor() {\n super();\n\n // Desk Surface\n const surfaceGeometry = new BoxGeometry(5, 0.3, 3);\n surfaceGeometry.translate(0, 3.15, 0);\n\n // Desk Legs (using lathe geometry)\n const points = [\n new Vector2(0.2, 0), //\n new Vector2(0.25, 0.5),\n new Vector2(0.15, 1.5),\n new Vector2(0.3, 3),\n ];\n\n const legLatheGeometry = new LatheGeometry(points, 32);\n\n // Create four legs for the desk\n const legPositions = [\n [2.1, 0, 1.1],\n [-2.1, 0, 1.1],\n [2.1, 0, -1.1],\n [-2.1, 0, -1.1],\n ];\n\n const legGeometry = mergeBufferGeometries(\n legPositions.map((position) => {\n const leg = legLatheGeometry.clone();\n leg.translate(position[0], position[1], position[2]);\n return leg;\n }),\n ) as BufferGeometry;\n\n this.copy(mergeBufferGeometries([surfaceGeometry, legGeometry], true) as BufferGeometry);\n }\n}\n","import { ParametricGeometry } from \"three-stdlib\";\nimport { Vector3 } from \"three\";\n\nexport class FlameGeometry extends ParametricGeometry {\n constructor({ height = 0.25, radius = 0.05, segmentsU = 16, segmentsV = 16 } = {}) {\n super(\n (u: number, v: number, target: Vector3) => {\n const theta = u * Math.PI * 2;\n const radialFactor = Math.sin(v * Math.PI);\n const x = radius * radialFactor * Math.cos(theta);\n const y = v * height; // center: v * height - height / 2\n const z = radius * radialFactor * Math.sin(theta);\n\n target.set(x, y, -z);\n },\n segmentsU,\n segmentsV,\n );\n }\n}\n","import { BufferGeometry, CylinderGeometry } from \"three\";\nimport { FlameGeometry } from \"./FlameGeometry\";\nimport { mergeBufferGeometries } from \"three-stdlib\";\n\n/**\n * Group indices\n * 0: Stick\n * 1: Flame\n */\nexport class CandleGeometry extends BufferGeometry {\n constructor({\n radiusTop = 0.2, //\n radiusBottom = 0.2,\n height = 1,\n flameHeight = 0.25,\n flameRadius = 0.05,\n segments = 16,\n } = {}) {\n super();\n const stickGeometry = new CylinderGeometry(radiusTop, radiusBottom, height, segments);\n stickGeometry.translate(0, height / 2 , 0);\n\n const flameGeometry = new FlameGeometry({\n segmentsU: segments,\n segmentsV: segments,\n height: flameHeight,\n radius: flameRadius,\n });\n flameGeometry.translate(0, height , 0);\n\n this.copy(mergeBufferGeometries([stickGeometry, flameGeometry], true) as BufferGeometry);\n }\n}\n","import { BufferAttribute, BufferGeometry } from \"three\";\n\n/**\n * Prismatic parallelogram, with horizontal skew (offset in X for the slant).\n */\nexport class ParallelogramBoxGeometry extends BufferGeometry {\n constructor(width = 1, height = 2, depth = 0.5, angle = Math.PI / 4) {\n super();\n\n const s = height * Math.tan(angle); // skew\n const w = width;\n const h = height;\n const d = depth;\n\n // Bottom face vertices (X, Y, Z)\n const vertices = [\n 0, 0, 0, // Front face, bottom left\n w, 0, 0, // Front face, bottom right\n w + s, h, 0, // Front face, top right\n s, h, 0, // Front face, top left\n\n w, 0, -d, // Back face\n 0, 0, -d,\n s, h, -d,\n w + s, h, -d,\n\n 0, 0, -d, // Left face\n 0, 0, 0,\n s, h, 0,\n s, h, -d,\n\n w, 0, 0, // Right face\n w, 0, -d,\n w + s, h, -d,\n w + s, h, 0,\n\n s, h, 0, // Top face\n w + s, h, 0,\n w + s, h, -d,\n s, h, -d,\n\n 0, 0, -d, // Bottom\n w, 0, -d,\n w, 0, 0,\n 0, 0, 0,\n ];\n\n const normals = [\n 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, // Front face\n 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, // Back face\n -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, // Left face\n 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, // Right face\n 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, // Top face\n 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, // Bottom face\n ]\n\n // Define indices for faces (triangles)\n const indices = [\n 0, 1, 2, 2, 3, 0, // Front face\n 4, 5, 6, 6, 7, 4, // Back face\n 8, 9, 10, 10, 11, 8, // Left face\n 12, 13, 14, 14, 15, 12, // Right face\n 16, 17, 18, 18, 19, 16, // Top face\n 20, 21, 22, 22, 23, 20, // Bottom face\n ];\n\n // Define UV coordinates\n const uvs = new Float32Array([\n 0, 0, 1, 0, 1, 1, 0, 1, // Front face\n 0, 0, 1, 0, 1, 1, 0, 1, // Back face\n 0, 0, 1, 0, 1, 1, 0, 1, // Left face\n 0, 0, 1, 0, 1, 1, 0, 1, // Right face\n 0, 0, 1, 0, 1, 1, 0, 1, // Top face\n 0, 0, 1, 0, 1, 1, 0, 1, // Bottom face\n ]);\n\n\n const positions = new Float32Array(vertices);\n const normalArray = new Float32Array(normals);\n const uvArray = new Float32Array(uvs);\n const indexArray = new Uint16Array(indices);\n\n this.setAttribute('position', new BufferAttribute(positions, 3));\n this.setAttribute('normal', new BufferAttribute(normalArray, 3));\n this.setAttribute('uv', new BufferAttribute(uvArray, 2));\n this.setIndex(new BufferAttribute(indexArray, 1));\n this.center();\n }\n}\n","import { BufferGeometry, DodecahedronGeometry } from \"three\";\nimport { mergeBufferGeometries } from \"three-stdlib\";\n\n/**\n * Group indices:\n * 0. Rocks\n * 1. Moss\n */\nexport class MossyRocksGeometry extends BufferGeometry {\n constructor() {\n super();\n\n const rocks: DodecahedronGeometry[] = [];\n const mosses: DodecahedronGeometry[] = [];\n\n for (let i = 0; i < 5; i++) {\n const scaleX = 0.8 + Math.random() * 0.4;\n const scaleY = 0.8 + Math.random() * 0.4;\n const scaleZ = 0.8 + Math.random() * 0.4;\n const rotationX = Math.random() * Math.PI;\n const rotationY = Math.random() * Math.PI;\n const rotationZ = Math.random() * Math.PI;\n const positionX = (Math.random() - 0.5) * 4;\n const positionY = 0;\n const positionZ = (Math.random() - 0.5) * 4;\n\n const rock = new DodecahedronGeometry(1, 0);\n rock.scale(scaleX, scaleY, scaleZ);\n rock.rotateX(rotationX);\n rock.rotateY(rotationY);\n rock.rotateZ(rotationZ);\n rock.translate(positionX, positionY, positionZ);\n rocks.push(rock);\n\n const moss = new DodecahedronGeometry(1, 0);\n moss.scale(scaleX * 0.9, scaleY * 0.5, scaleZ * 0.9);\n moss.rotateX(rotationX);\n moss.rotateY(rotationY);\n moss.rotateZ(rotationZ);\n moss.translate(positionX, positionY + 0.3, positionZ);\n mosses.push(moss);\n }\n\n this.copy(\n mergeBufferGeometries([\n mergeBufferGeometries(rocks) as BufferGeometry,\n mergeBufferGeometries(mosses) as BufferGeometry,\n ], true) as BufferGeometry\n )\n }\n}\n","import { Axis } from \"../constants/Axis\";\nimport { BufferGeometry, Vector3 } from \"three\";\nimport { mergeVertices } from \"three-stdlib\";\n\nexport function randomTransformVertices<T extends BufferGeometry>(geometry:T, axis = Axis.XYZ, minScale = 0.5, maxScale = 2.0) {\n // Delete unnecessary attributes\n geometry.deleteAttribute(\"uv\");\n geometry.deleteAttribute(\"normal\");\n geometry = mergeVertices(geometry) as T;\n geometry.computeVertexNormals();\n\n // Get position attribute\n const positionAttribute = geometry.getAttribute(\"position\");\n\n // Loop through each vertex\n for (let i = 0; i < positionAttribute.count; i++) {\n const vertex = new Vector3().fromBufferAttribute(positionAttribute, i);\n\n // Randomly scale the displacement along the given axis\n const randomScale = Math.random() * (maxScale - minScale) + minScale;\n const displacement = axis.clone().multiplyScalar(randomScale);\n\n // Apply the displacement to the vertex\n vertex.add(displacement);\n positionAttribute.setXYZ(i, vertex.x, vertex.y, vertex.z);\n }\n\n // Notify Three.js that the position attribute has been updated\n positionAttribute.needsUpdate = true;\n geometry.computeVertexNormals();\n\n return geometry;\n}\n","import { Axis } from \"../../constants/Axis\";\nimport { BufferGeometry, SphereGeometry } from \"three\";\nimport { randomTransformVertices } from \"../../utils/VertexUtils\";\n\nexport class RockGeometry extends BufferGeometry {\n constructor(radius = 1, widthSegments = 4, heightSegments = 4) {\n super();\n\n const sphere = new SphereGeometry(radius, widthSegments, heightSegments);\n this.copy(randomTransformVertices(sphere, Axis.XYZ, 0.5, 1.0));\n this.computeVertexNormals();\n this.center();\n }\n}\n","import { BufferGeometry, DodecahedronGeometry } from \"three\";\nimport { mergeBufferGeometries } from \"three-stdlib\";\n\nexport class RocksGeometry extends BufferGeometry {\n constructor() {\n super();\n\n const rocks: DodecahedronGeometry[] = [];\n\n for (let i = 0; i < 5; i++) {\n const rock = new DodecahedronGeometry(1, 0);\n rock.scale(0.8 + Math.random() * 0.4, 0.8 + Math.random() * 0.4, 0.8 + Math.random() * 0.4);\n rock.rotateX(Math.random() * Math.PI);\n rock.rotateY(Math.random() * Math.PI);\n rock.rotateZ(Math.random() * Math.PI);\n rock.translate((Math.random() - 0.5) * 4, 0, (Math.random() - 0.5) * 4);\n\n rocks.push(rock);\n }\n\n this.copy(mergeBufferGeometries(rocks) as BufferGeometry);\n }\n}\n","import { BufferGeometry, CylinderGeometry, SphereGeometry } from \"three\";\nimport { mergeBufferGeometries } from \"three-stdlib\";\n\n/**\n * Bone Geometry, a simple bone shape\n * @extends BufferGeometry\n *\n * @example\n * // Create a bone\n * const boneGeometry = new BoneGeometry();\n * const boneMaterial = new MeshStandardMaterial({ color: 0xffffff });\n * const bone = new Mesh(boneGeometry, boneMaterial);\n * scene.add(bone);\n */\nclass BoneGeometry extends BufferGeometry {\n constructor(radiusTop = 0.1, radiusBottom = 0.1, height = 0.4, radialSegments = 8) {\n super();\n\n // Create the cylinder (shaft of the bone)\n const cylinderGeometry = new CylinderGeometry(radiusTop * 0.6, radiusBottom * 0.6, height, radialSegments);\n cylinderGeometry.translate(0, 0, 0);\n\n // Create the spheres (ends of the bone)\n const sphereGeometry = new SphereGeometry(radiusTop, radialSegments, radialSegments);\n const topSphere1 = sphereGeometry.clone();\n const topSphere2 = sphereGeometry.clone();\n const bottomSphere1 = sphereGeometry.clone();\n const bottomSphere2 = sphereGeometry.clone();\n\n // Position the spheres at each end of the cylinder\n topSphere1.translate(0, height / 2 + radiusTop * 0.6, -radiusTop * 0.6);\n topSphere2.translate(0, height / 2 + radiusTop * 0.6, radiusTop * 0.6);\n bottomSphere1.translate(0, -height / 2 - radiusBottom * 0.6, -radiusBottom * 0.6);\n bottomSphere2.translate(0, -height / 2 - radiusBottom * 0.6, radiusBottom * 0.6);\n\n // Merge the parts\n this.copy(mergeBufferGeometries([cylinderGeometry, topSphere1, topSphere2, bottomSphere1, bottomSphere2], false) as BufferGeometry);\n }\n}\n\nexport { BoneGeometry };\n","import { BufferGeometry, LatheGeometry, Vector2 } from \"three\";\nimport {mergeBufferGeometries} from \"three-stdlib\";\n\nexport class ErlenmeyerFlaskGeometry extends BufferGeometry {\n constructor({\n flaskRadius = 1, //\n neckRadius = 0.3,\n height = 2.5,\n neckHeight = 1,\n radialSegments = 16,\n } = {}) {\n super();\n\n // Recalculating other radii to keep proportions consistent\n const points = [\n new Vector2(0, 0), // Bottom of the flask\n new Vector2(flaskRadius * 0.875, 0), // Flat base with minimum width\n new Vector2(flaskRadius, 0.1), // End of the rounded base\n new Vector2(neckRadius, height), // Start of the straight neck\n new Vector2(neckRadius, height + neckHeight), // End of the straight neck\n new Vector2(neckRadius * 1.1, height + neckHeight + 0.3), // Slight outward lip at the top\n ];\n\n const flaskGeometry = new LatheGeometry(points, radialSegments);\n\n this.copy(mergeBufferGeometries([flaskGeometry], false) as BufferGeometry);\n }\n}\n","/**\n * Calculate the radius to achieve a spherical cap height.\n * R = r / (1 - cos(thetaLength))\n */\nexport const radiusFromCapHeight = (height: number, thetaLength: number) => height / (1 - Math.cos(thetaLength));\n\n/**\n * Calculate the radius to achieve a spherical cap width.\n * R = w / (2 * sin(thetaLength))\n */\nexport const radiusFromCapWidth = (width: number, thetaLength: number) => width / (2 * Math.sin(thetaLength));\n\n/**\n * Calculate the height of a spherical cap.\n * h = R * (1 - cos(thetaLength))\n */\nexport const capHeightFromRadius = (radius: number, thetaLength: number) => radius * (1 - Math.cos(thetaLength));\n\n/**\n * Calculate the width of a spherical cap.\n * w = 2 * R * sin(thetaLength)\n */\nexport const capWidthFromRadius = (radius: number, thetaLength: number) => 2 * radius * Math.sin(thetaLength);\n\n/**\n * Calculate the thetaLength to achieve a specific hole radius in a sphere.\n * thetaLength = asin(w / (2 * R))\n *\n * Returns the thetaLength in radians.\n *\n * Example usage:\n * ```\n * const sphereRadius = 5; // Radius of the sphere\n * const holeRadius = 1; // Desired radius of the hole at the top\n * const thetaLength = thetaLengthForRadius(sphereRadius, holeRadius);\n * ```\n */\nexport const thetaLengthForRadius = (sphereRadius: number, holeRadius: number) => {\n const holeDiameter = 2 * holeRadius; // Hole width\n return Math.asin(holeDiameter / (2 * sphereRadius));\n};\n\n/**\n * Convert spherical coordinates to Cartesian coordinates.\n * @param {number} radius - The radius of the sphere.\n * @param {number} theta - The azimuthal angle in radians (from the x-axis in the x-y plane).\n * @param {number} phi - The polar angle in radians (from the positive z-axis).\n * @returns {{x: number, y: number, z: number}} The Cartesian coordinates.\n */\nexport const sphericalToCartesian = (radius: number, theta: number, phi: number) => {\n return {\n x: radius * Math.sin(phi) * Math.cos(theta),\n y: radius * Math.sin(phi) * Math.sin(theta),\n z: radius * Math.cos(phi),\n };\n};\n\n/**\n * Convert Cartesian coordinates to spherical coordinates.\n * @param {number} x - The x-coordinate.\n * @param {number} y - The y-coordinate.\n * @param {number} z - The z-coordinate.\n * @returns {{radius: number, theta: number, phi: number}} The spherical coordinates.\n */\nexport const cartesianToSpherical = (x: number, y: number, z: number) => {\n const radius = Math.sqrt(x * x + y * y + z * z);\n const theta = Math.atan2(y, x); // Azimuthal angle\n const phi = Math.acos(z / radius); // Polar angle\n return { radius, theta, phi };\n};\n","import { Vector2 } from \"three\";\nimport { thetaLengthForRadius } from \"./SphericalGeometryUtils\";\n\n/**\n * Generates spherical curve profile points, for use with geometry.\n * Enables connective geometry via holes at the top and bottom of the sphere.\n *\n * Example usage:\n *\n * Tube that connect with a sphere on the bottom:\n * ```\n * const points: Vector2[] = [\n * new Vector2(1, 0),\n * ...appendSphericalCurve(\n * 2, // Radius x\n * 2, // Radius y\n * 5, // Start y\n * 0, // Hole top radius\n * 1, // Hole bottom radius\n * 32, // Segments\n * ),\n * ];\n *\n * const latheGeometry = new LatheGeometry(points, 32);\n * ```\n *\n * Tube that connect with a sphere on the top:\n * ```\n * const points: Vector2[] = [\n * ...appendSphericalCurve(\n * 2, // Radius x\n * 2, // Radius y\n * 1, // Start y\n * 1, // Hole top radius\n * 0, // Hole bottom radius\n * 32, // Segments\n * ),\n * new Vector2(1, 5),\n * ];\n *\n * const latheGeometry = new LatheGeometry(points, 32);\n * ```\n */\nexport function appendSphericalCurve(\n sphereRadiusX: number,\n sphereRadiusY: number,\n sphereStartY: number,\n holeTopRadius: number = 0,\n holeBottomRadius: number = 0,\n segments: number = 32,\n) {\n const thetaTop = holeTopRadius ? thetaLengthForRadius(sphereRadiusX, holeTopRadius) : 0;\n const thetaBottom = holeBottomRadius ? Math.PI - thetaLengthForRadius(sphereRadiusX, holeBottomRadius) : Math.PI;\n\n // Generate sphere points (from bottom to top)\n const spherePoints = [];\n for (let i = 0; i <= segments; i++) {\n const theta = thetaBottom - ((thetaBottom - thetaTop) / segments) * i; // Bottom to top\n const x = sphereRadiusX * Math.sin(theta);\n const y = sphereRadiusY * Math.cos(theta) + sphereStartY; // Offset by sphereStartY\n spherePoints.push(new Vector2(x, y));\n }\n\n // Combine base points and sphere points\n return [...spherePoints];\n}\n","import { BufferGeometry, LatheGeometry, Vector2 } from \"three\";\nimport { appendSphericalCurve } from \"../../utils/SphericalCurve\";\n\nexport class FlorenceFlaskGeometry extends BufferGeometry {\n constructor() {\n super();\n\n const points = [\n ...appendSphericalCurve(1, 1, 0.5, 0.2, 0, 32),\n new Vector2(0.2, 3),\n ];\n\n // Create LatheGeometry\n const latheGeometry = new LatheGeometry(points, 32);\n this.copy(latheGeometry);\n }\n}\n","import { BufferGeometry, CircleGeometry, LatheGeometry, Vector2 } from \"three\";\nimport {mergeBufferGeometries} from \"three-stdlib\";\n\nclass MortarGeometry extends BufferGeometry {\n constructor() {\n super();\n\n const mortarPoints = [\n new Vector2(1, 0), // Bottom of the bowl\n new Vector2(1.2, 0.5), // Slight flare at the base\n new Vector2(1.4, 1.5), // Outer wall\n new Vector2(1.3, 1.8), // Flared edge\n new Vector2(0.8, 1.8), // Lip of the bowl\n ];\n const mortarGeometry = new LatheGeometry(mortarPoints, 12);\n\n // Create a disk to close off the bottom\n const baseDisk = new CircleGeometry(1, 12); // Radius matches the base of the mortar\n baseDisk.rotateX(-Math.PI / 2); // Rotate to align with the bottom\n baseDisk.translate(0, 0, 0); // Position at the base of the mortar\n\n this.copy(mergeBufferGeometries([mortarGeometry, baseDisk], false) as BufferGeometry);\n }\n}\n\nexport { MortarGeometry };\n","import { BufferGeometry, CylinderGeometry, TorusGeometry } from \"three\";\nimport {mergeBufferGeometries} from \"three-stdlib\";\n\nexport class StandGeometry extends BufferGeometry {\n constructor({\n radius = 0.3, //\n height = 0.4,\n count = 3,\n thickness = 0.03,\n radialSegments = 16,\n } = {}) {\n super();\n\n const ringGeometry = new TorusGeometry(radius, thickness, 8, radialSegments);\n ringGeometry.rotateX(Math.PI / 2);\n ringGeometry.translate(0, height, 0);\n\n const legGeometry = new CylinderGeometry(thickness * 0.6, thickness * 0.6, height, radialSegments);\n const legs = [];\n\n for (let i = 0; i < count; i++) {\n const angle = (i / count) * Math.PI * 2;\n const leg = legGeometry.clone();\n leg.translate(Math.cos(angle) * radius, height / 2, Math.sin(angle) * radius);\n legs.push(leg);\n }\n\n this.copy(mergeBufferGeometries([ringGeometry, ...legs], false) as BufferGeometry);\n }\n}\n","import { BufferGeometry, CylinderGeometry, SphereGeometry } from \"three\";\nimport { mergeBufferGeometries } from \"three-stdlib\";\n\n/**\n * Group indices\n * 0: Base\n * 1: Coil\n */\nexport class TeslaCoilGeometry extends BufferGeometry {\n constructor() {\n super();\n\n // Base geometry\n const baseGeometry = new CylinderGeometry(0.5, 0.6, 0.3, 16);\n baseGeometry.translate(0, 0.15, 0);\n\n // Coil geometry\n const coilGeometry = new CylinderGeometry(0.15, 0.15, 2, 12, 1, true);\n coilGeometry.translate(0, 1.3, 0);\n const coilTopGeometry = new SphereGeometry(0.3, 16, 16);\n coilTopGeometry.translate(0, 2.4, 0);\n\n this.copy(\n mergeBufferGeometries(\n [baseGeometry, mergeBufferGeometries([coilGeometry, coilTopGeometry]) as BufferGeometry],\n true,\n ) as BufferGeometry,\n );\n }\n}\n","import { BufferGeometry, CylinderGeometry, SphereGeometry } from \"three\";\nimport { mergeBufferGeometries } from \"three-stdlib\";\n\nclass TestTubeGeometry extends BufferGeometry {\n constructor(radiusTop = 0.2, radiusBottom = 0.2, height = 3, segments = 32, openEnded = true) {\n super();\n\n // Create the cylindrical body\n const tubeGeometry = new CylinderGeometry(radiusTop, radiusBottom, height, segments, 1, openEnded);\n\n // Create the rounded bottom using a half sphere\n const bottomGeometry = new SphereGeometry(radiusBottom, segments, segments / 2, 0, Math.PI * 2, Math.PI / 2, Math.PI / 2);\n bottomGeometry.translate(0, -(height / 2), 0); // Position it at the bottom of the cylinder\n\n // Merge parts\n this.copy(mergeBufferGeometries([tubeGeometry, bottomGeometry], false) as BufferGeometry);\n }\n}\n\nexport { TestTubeGeometry };\n","import { BufferGeometry, SphereGeometry } from \"three\";\n\nexport class HillGeometry extends BufferGeometry {\n constructor({\n radius = 3, //\n height = 0.6,\n widthSegments = 64,\n heightSegments = 16,\n phiStart = 0,\n phiLength = Math.PI * 2,\n } = {}) {\n super();\n\n this.copy(new SphereGeometry(radius, widthSegments, heightSegments, phiStart, phiLength, 0, Math.PI / 2));\n this.scale(1, height / radius, 1);\n }\n}\n","import { BufferGeometry, SphereGeometry } from \"three\";\nimport {capHeightFromRadius, radiusFromCapWidth} from \"../../utils/SphericalGeometryUtils\";\n\n/**\n * Mound-like geometry with a flat top.\n *\n * To create a radius based on a desired width:\n * ```\n * const moundGeometry = new MoundGeometry({\n * radius: radiusFromCapWidth(5, Math.PI / 10),\n * }\n * ```\n *\n * To create a radius based on a desired height:\n * ```\n * const moundGeometry = new MoundGeometry({\n * radius: radiusFromCapHeight(5, Math.PI / 10),\n * }\n * ```\n */\nexport class MoundGeometry extends BufferGeometry {\n constructor({\n radius = radiusFromCapWidth(5, Math.PI / 10), //\n widthSegments = 64,\n heightSegments = 32,\n phiStart = 0,\n phiLength = Math.PI * 2,\n thetaLength = Math.PI / 10,\n } = {}) {\n super();\n\n this.copy(new SphereGeometry(radius, widthSegments, heightSegments, phiStart, phiLength, 0, thetaLength));\n\n // Translate the geometry so the base is at the origin\n const height = capHeightFromRadius(radius, thetaLength);\n this.translate(0, -radius + height, 0);\n }\n}\n","import {BufferGeometry, CylinderGeometry, DodecahedronGeometry} from \"three\";\nimport {mergeBufferGeometries} from \"three-stdlib\";\n\n/**\n * Tree geometry, consisting of a trunk and leaves.\n *\n * Group order:\n * - Trunk Material\n * - Leaf Material\n */\nclass TreeGeometry extends BufferGeometry {\n constructor({\n trunkRadiusTop = 0.25,\n trunkRadiusBottom = 0.4,\n trunkHeight = 2.5,\n trunkSegments = 14,\n leafSize = 0.8,\n leafCount = 6,\n leafDetail = 0,\n leafSpreadRadius = 1.5,\n } = {}) {\n super();\n\n // Create trunk geometry\n const trunk = new CylinderGeometry(trunkRadiusTop, trunkRadiusBottom, trunkHeight, trunkSegments);\n trunk.translate(0, trunkHeight / 2, 0);\n\n // Create leaf geometries\n const leafs: DodecahedronGeometry[] = [];\n for (let i = 0; i < leafCount; i++) {\n const leaf = new DodecahedronGeometry(leafSize, leafDetail);\n\n leaf.translate(\n (Math.random() - 0.5) * leafSpreadRadius,\n (Math.random() - 0.5) * leafSize + trunkHeight,\n (Math.random() - 0.5) * leafSpreadRadius,\n );\n leafs.push(leaf);\n }\n\n // Merge trunk and leaves\n this.copy(mergeBufferGeometries([trunk.toNonIndexed(), mergeBufferGeometries(leafs, false) as BufferGeometry], true) as BufferGeometry);\n this.computeVertexNormals();\n }\n}\n\nexport { TreeGeometry };\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { ColorPalette } from \"../../constants/ColorPalette\";\nimport { DioramaGeometry } from \"../../geometry/architecture/DioramaGeometry\";\n\n/**\n * A diorama with a floor and walls.\n *\n * Material indices:\n * 0: Interior walls\n * 1: Floor\n * 2: Exterior walls\n */\nexport class Diorama extends Mesh<DioramaGeometry, MeshStandardMaterial[]> {\n constructor({\n width = 5,\n height = 3,\n depth = 5,\n wallThickness = 0.05,\n interiorColor = ColorPalette.WHITE_SMOKE,\n floorColor = ColorPalette.RAW_SIENNA,\n exteriorColor = ColorPalette.GRAY,\n } = {}) {\n super(\n new DioramaGeometry({ width, height, depth, wallThickness }),\n [\n new MeshStandardMaterial({ color: interiorColor }),\n new MeshStandardMaterial({ color: floorColor }),\n new MeshStandardMaterial({ color: exteriorColor }),\n ],\n );\n }\n}\n","/**\n * Moon shader\n * Simple moon effect with noise\n */\nexport const moonShader = {\n uniforms: {\n time: { value: 0.0 },\n },\n vertexShader: `\n varying vec3 vNormal;\n varying vec3 vPosition;\n void main() {\n vNormal = normalize(normal);\n vPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n `,\n fragmentShader: `\n varying vec3 vNormal;\n varying vec3 vPosition;\n\n // Simple 3D noise function\n float hash(vec3 p) {\n p = fract(p * 0.3183099 + vec3(0.71, 0.113, 0.419));\n p *= 17.0;\n return fract(p.x * p.y * p.z * (p.x + p.y + p.z));\n }\n\n float noise(vec3 p) {\n vec3 ip = floor(p);\n vec3 fp = fract(p);\n fp = fp * fp * (3.0 - 2.0 * fp); // Smoothstep\n return mix(\n mix(mix(hash(ip), hash(ip + vec3(1.0, 0.0, 0.0)), fp.x),\n mix(hash(ip + vec3(0.0, 1.0, 0.0)), hash(ip + vec3(1.0, 1.0, 0.0)), fp.x), fp.y),\n mix(mix(hash(ip + vec3(0.0, 0.0, 1.0)), hash(ip + vec3(1.0, 0.0, 1.0)), fp.x),\n mix(hash(ip + vec3(0.0, 1.0, 1.0)), hash(ip + vec3(1.0, 1.0, 1.0)), fp.x), fp.y),\n fp.z);\n }\n\n void main() {\n vec3 color = vec3(0.8, 0.8, 0.7); // Base moon color\n float n = noise(vPosition * 0.5); // Apply noise with frequency\n color *= 0.8 + 0.2 * n; // Modulate color by noise\n gl_FragColor = vec4(color, 1.0);\n }\n `,\n};\n","import { Mesh, ShaderMaterial, SphereGeometry } from \"three\";\nimport { moonShader } from \"../../shaders/moonShader\";\n\nexport class Moon extends Mesh<SphereGeometry, ShaderMaterial> {\n constructor() {\n super(\n new SphereGeometry(5, 32, 32),\n new ShaderMaterial(moonShader),\n );\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { BookGeometry } from \"../../geometry/books/BookGeometry\";\nimport { ColorPalette } from \"../../constants/ColorPalette\";\n\n/**\n * Book prefab\n *\n * Material indices:\n * 0. cover\n * 1. page\n */\nexport class Book extends Mesh<BookGeometry, MeshStandardMaterial[]> {\n constructor({\n width = 1,\n height = 1.5,\n depth = 0.5,\n coverThickness = 0.05,\n pageIndent = 0.05,\n coverColor = ColorPalette.DARK_RED,\n pageColor = ColorPalette.TITANIUM_WHITE,\n } = {}) {\n super(\n new BookGeometry(width, height, depth, coverThickness, pageIndent),\n [\n new MeshStandardMaterial({ color: coverColor, metalness: 0.1, roughness: 0.7, flatShading: true }),\n new MeshStandardMaterial({ color: pageColor, flatShading: true }),\n ],\n );\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { JarGeometry } from \"../../geometry/bottles/JarGeometry\";\n\n/**\n * Material indices\n * 0. Jar\n * 1. Cork\n */\nexport class Jar extends Mesh<JarGeometry, MeshStandardMaterial[]> {\n constructor() {\n super(new JarGeometry(), [\n new MeshStandardMaterial({\n color: 0x88ccaa,\n transparent: true,\n depthWrite: false,\n opacity: 0.4,\n roughness: 0.1,\n metalness: 0.5,\n }),\n new MeshStandardMaterial({\n color: 0x8b4513,\n roughness: 1.0,\n }),\n ]);\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { ColorPalette } from \"../../constants/ColorPalette\";\nimport { PotionBottleGeometry } from \"../../geometry/bottles/PotionBottleGeometry\";\n\n/**\n * Potion bottle, with optional liquid fill\n *\n * Material indices\n * 0. Bottle\n * 1. Cork\n * 2. Liquid (optional)\n */\nexport class PotionBottle extends Mesh<PotionBottleGeometry, MeshStandardMaterial[]> {\n constructor() {\n super(new PotionBottleGeometry(), [\n new MeshStandardMaterial({\n color: 0x88ccff,\n transparent: true,\n depthWrite: false,\n opacity: 0.5,\n roughness: 0.1,\n metalness: 0.3,\n }),\n new MeshStandardMaterial({\n color: 0x8b4513,\n roughness: 1.0,\n }),\n new MeshStandardMaterial({\n color: ColorPalette.PINK_SHERBET,\n transparent: true,\n depthWrite: false,\n opacity: 0.5,\n }),\n ]);\n }\n}\n","import { Mesh, MeshPhysicalMaterial } from \"three\";\nimport { WineBottleGeometry } from \"../../geometry/bottles/WineBottleGeometry\";\n\nexport class WineBottle extends Mesh<WineBottleGeometry, MeshPhysicalMaterial> {\n constructor() {\n super(\n new WineBottleGeometry(),\n new MeshPhysicalMaterial({\n color: 0x556b2f,\n roughness: 0.1,\n transmission: 0.9,\n thickness: 0.2,\n metalness: 0,\n clearcoat: 1.0,\n clearcoatRoughness: 0.1,\n }),\n );\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { CrossHeadstoneGeometry } from \"../../geometry/cemetery/CrossHeadstoneGeometry\";\n\ninterface CrossHeadstoneOptions {\n width?: number;\n height?: number;\n depth?: number;\n}\n\nexport class CrossHeadstone extends Mesh<CrossHeadstoneGeometry, MeshStandardMaterial> {\n constructor({\n width = 0.4,\n height = 1.2,\n depth = 0.2,\n }: CrossHeadstoneOptions = {}) {\n super(\n new CrossHeadstoneGeometry(width, height, depth),\n new MeshStandardMaterial({ color: 0x777777, roughness: 0.8 })\n );\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { MausoleumGeometry } from \"../../geometry/cemetery/MausoleumGeometry\";\n\n/**\n * Material indices:\n * 0. Base\n * 1. Building\n * 2. Roof\n * 3. Arched entrance\n */\nexport class Mausoleum extends Mesh<MausoleumGeometry, MeshStandardMaterial[]> {\n constructor() {\n super(\n new MausoleumGeometry(),\n [\n new MeshStandardMaterial({ color: 0x808080, flatShading: true }), // Base\n new MeshStandardMaterial({ color: 0x696969, flatShading: true }), // Building\n new MeshStandardMaterial({ color: 0x505050, flatShading: true }), // Roof\n new MeshStandardMaterial({ color: 0x404040, flatShading: true }), // Arched entrance\n ],\n );\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { ObeliskHeadstoneGeometry } from \"../../geometry/cemetery/ObeliskHeadstoneGeometry\";\n\ninterface ObeliskHeadstoneOptions {\n baseWidth?: number;\n totalHeight?: number;\n}\n\nexport class ObeliskHeadstone extends Mesh<ObeliskHeadstoneGeometry, MeshStandardMaterial> {\n constructor({ totalHeight = 1.75, baseWidth = 0.75 }: ObeliskHeadstoneOptions = {}) {\n super(\n new ObeliskHeadstoneGeometry(totalHeight, baseWidth),\n new MeshStandardMaterial({ color: 0x777777, roughness: 0.8 })\n );\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { RoundedHeadstoneGeometry } from \"../../geometry/cemetery/RoundedHeadstoneGeometry\";\n\nexport class RoundedHeadstone extends Mesh<RoundedHeadstoneGeometry, MeshStandardMaterial> {\n constructor(width = 0.6, height = 1.0, depth = 0.2, radius = 0.6) {\n super(\n new RoundedHeadstoneGeometry(width, height, depth, radius),\n new MeshStandardMaterial({ color: 0x777777, roughness: 0.8 })\n );\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { SquareHeadstoneGeometry } from \"../../geometry/cemetery/SquareHeadstoneGeometry\";\n\nexport class SquareHeadstone extends Mesh<SquareHeadstoneGeometry, MeshStandardMaterial> {\n constructor(width = 0.5, height = 0.8, depth = 0.15) {\n super(\n new SquareHeadstoneGeometry(width, height, depth),\n new MeshStandardMaterial({ color: 0x777777, roughness: 0.8 })\n );\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { StoneFencePostGeometry } from \"../../geometry/fence/StoneFencePostGeometry\";\n\nexport class StoneFencePost extends Mesh<StoneFencePostGeometry, MeshStandardMaterial> {\n constructor({ height = 2.25 } = {}) {\n super(\n new StoneFencePostGeometry({ height }),\n new MeshStandardMaterial({ color: 0x8b7d7b, flatShading: true })\n );\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { WroughtIronBarGeometry } from \"../../geometry/fence/WroughtIronBarGeometry\";\n\nexport class WroughtIronBar extends Mesh<WroughtIronBarGeometry, MeshStandardMaterial> {\n constructor({\n barHeight = 2.0, //\n barRadius = 0.05,\n spikeHeight = 0.3,\n spikeRadius = 0.075,\n spikeScaleZ = 1.0,\n radialSegments = 8,\n } = {}) {\n super(\n new WroughtIronBarGeometry({\n barHeight,\n barRadius,\n spikeHeight,\n spikeRadius,\n spikeScaleZ,\n radialSegments,\n }),\n new MeshStandardMaterial({ color: 0x333333, metalness: 0.8, roughness: 0.4 }),\n );\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { WroughtIronFenceGeometry } from \"../../geometry/fence/WroughtIronFenceGeometry\";\n\nexport class WroughtIronFence extends Mesh<WroughtIronFenceGeometry, MeshStandardMaterial> {\n constructor({\n count = 20, //\n spacing = 0.4,\n barHeight = 2.0,\n barRadius = 0.05,\n spikeHeight = 0.3,\n spikeRadius = 0.075,\n spikeScaleZ = 1.0,\n railHeight = 0.1,\n railDepth = 0.05,\n railOffset = 0.0,\n radialSegments = 8,\n } = {}) {\n super(\n new WroughtIronFenceGeometry({\n count,\n spacing,\n barHeight,\n barRadius,\n spikeHeight,\n spikeRadius,\n spikeScaleZ,\n railHeight,\n railDepth,\n railOffset,\n radialSegments,\n }),\n new MeshStandardMaterial({ color: 0x333333, metalness: 0.8, roughness: 0.4 }),\n );\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { BookshelfGeometry } from \"../../geometry/furniture/BookshelfGeometry\";\n\nexport class Bookshelf extends Mesh<BookshelfGeometry, MeshStandardMaterial> {\n constructor({\n width = 5, //\n height = 8,\n depth = 1,\n shelves = 4,\n frameThickness = 0.1,\n open = false,\n } = {}) {\n super(\n new BookshelfGeometry({ width, height, depth, shelves, frameThickness, open }),\n new MeshStandardMaterial({ color: 0x8b4513 }),\n );\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { DeskGeometry } from \"../../geometry/furniture/DeskGeometry\";\n\n/**\n * Material indices:\n * 0. Desk surface\n * 1. Desk legs\n */\nexport class Desk extends Mesh<DeskGeometry, MeshStandardMaterial[]> {\n constructor() {\n super(new DeskGeometry(), [\n new MeshStandardMaterial({ color: 0x8b5a2b }), // Desk surface\n new MeshStandardMaterial({ color: 0x4b3621 }), // Desk legs\n ]);\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { CandleGeometry } from \"../../geometry/lighting/CandleGeometry\";\n\n/**\n * Material indices\n * 0: Stick\n * 1: Flame\n */\nexport class Candle extends Mesh<CandleGeometry, MeshStandardMaterial[]> {\n constructor({\n radiusTop = 0.2, //\n radiusBottom = 0.2,\n height = 1,\n flameHeight = 0.25,\n flameRadius = 0.05,\n segments = 16,\n } = {}) {\n super(\n new CandleGeometry({\n radiusTop,\n radiusBottom,\n height,\n flameHeight,\n flameRadius,\n segments,\n }),\n [\n new MeshStandardMaterial({ color: 0xffffff }),\n new MeshStandardMaterial({ color: 0xffd700, emissive: 0xffa500, emissiveIntensity: 0.35 }),\n ],\n );\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { FlameGeometry } from \"../../geometry/lighting/FlameGeometry\";\n\nexport class Flame extends Mesh<FlameGeometry, MeshStandardMaterial> {\n constructor({ height = 0.25, radius = 0.05, segmentsU = 16, segmentsV = 16 } = {}) {\n super(\n new FlameGeometry({ segmentsU, segmentsV, height, radius }),\n new MeshStandardMaterial({ color: 0xffd700, emissive: 0xffa500, emissiveIntensity: 0.35 }),\n );\n }\n}\n","import { ConeGeometry, CylinderGeometry, Group, Mesh, MeshStandardMaterial, PointLight, TorusGeometry } from \"three\";\n\n// Class for Lantern Geometry\nclass Lantern extends Group {\n constructor(height = 1.3, baseWidth = 0.5) {\n super();\n\n // Lantern Base (cylinder)\n const baseGeometry = new CylinderGeometry(baseWidth, baseWidth, 0.2, 16);\n const baseMaterial = new MeshStandardMaterial({ color: 0x8b4513, flatShading: true });\n const baseMesh = new Mesh(baseGeometry, baseMaterial);\n baseMesh.position.set(0, 0, 0);\n this.add(baseMesh);\n\n // Lantern Body (a rectangular frame)\n const bodyGeometry = new CylinderGeometry(baseWidth * 0.9, baseWidth * 0.9, height);\n const bodyMaterial = new MeshStandardMaterial({ color: 0xffd700, flatShading: true, transparent: true, opacity: 0.6 });\n const bodyMesh = new Mesh(bodyGeometry, bodyMaterial);\n bodyMesh.position.set(0, height / 2 + 0.1, 0); // Adjust position based on height\n this.add(bodyMesh);\n\n // Lantern Roof (a cone)\n const roofGeometry = new ConeGeometry(baseWidth * 1.1, 0.5, 8);\n const roofMaterial = new MeshStandardMaterial({ color: 0x8b4513, flatShading: true });\n const roofMesh = new Mesh(roofGeometry, roofMaterial);\n roofMesh.position.set(0, height + 0.35, 0); // Adjusted position based on height\n this.add(roofMesh);\n\n // Lantern Handle (a torus)\n const handleGeometry = new TorusGeometry(baseWidth * 0.8, 0.05, 8, 16);\n const handleMaterial = new MeshStandardMaterial({ color: 0x8b4513, flatShading: true });\n const handleMesh = new Mesh(handleGeometry, handleMaterial);\n handleMesh.position.set(0, height + 0.85, 0); // Adjusted to sit above the roof\n this.add(handleMesh);\n\n // Lantern Light (point light inside)\n const light = new PointLight(0xffaa00, 1.5, 15);\n light.position.set(0, height / 2 + 0.1, 0); // Adjust position based on height\n light.castShadow = true;\n this.add(light);\n }\n}\n\nexport { Lantern };\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { MossyRocksGeometry } from \"../../geometry/rocks/MossyRocksGeometry\";\n\n/**\n * Material indices:\n * 0. Rocks\n * 1. Moss\n */\nexport class MossyRocks extends Mesh<MossyRocksGeometry, MeshStandardMaterial[]> {\n constructor() {\n super(new MossyRocksGeometry(), [\n new MeshStandardMaterial({ color: 0x808080, flatShading: true }),\n new MeshStandardMaterial({ color: 0x4b8b3b, flatShading: true, opacity: 0.8, transparent: true }),\n ]);\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { RockGeometry } from \"../../geometry/rocks/RockGeometry\";\n\nexport class Rock extends Mesh<RockGeometry, MeshStandardMaterial> {\n constructor(radius = 1, widthSegments = 4, heightSegments = 4) {\n super(\n new RockGeometry(radius, widthSegments, heightSegments),\n new MeshStandardMaterial({ color: 0x808080, flatShading: true }),\n );\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { RocksGeometry } from \"../../geometry/rocks/RocksGeometry\";\n\nexport class Rocks extends Mesh<RocksGeometry, MeshStandardMaterial> {\n constructor() {\n super(new RocksGeometry(), new MeshStandardMaterial({ color: 0x808080, flatShading: true }));\n }\n}\n","import { ConeGeometry, CylinderGeometry, Group, Mesh, MeshStandardMaterial } from \"three\";\n\nclass BunsenBurner extends Group {\n constructor() {\n super();\n\n // Base geometry\n const baseGeometry = new CylinderGeometry(0.3, 0.4, 0.1, 16);\n const baseMaterial = new MeshStandardMaterial({\n color: 0x333333,\n roughness: 0.6,\n metalness: 0.3,\n });\n const base = new Mesh(baseGeometry, baseMaterial);\n base.position.y = 0.05;\n\n // Burner tube geometry\n const tubeGeometry = new CylinderGeometry(0.1, 0.1, 0.7, 16);\n const tubeMaterial = new MeshStandardMaterial({\n color: 0x555555,\n roughness: 0.5,\n metalness: 0.4,\n });\n const tube = new Mesh(tubeGeometry, tubeMaterial);\n tube.position.y = 0.4;\n\n // Flame geometry\n const flameGeometry = new ConeGeometry(0.075, 0.2, 16);\n const flameMaterial = new MeshStandardMaterial({\n color: 0xff5500,\n emissive: 0xff5500,\n emissiveIntensity: 0.6,\n transparent: true,\n opacity: 0.8,\n });\n const flame = new Mesh(flameGeometry, flameMaterial);\n flame.position.y = 0.8;\n\n this.add(base, tube, flame);\n }\n}\n\nexport { BunsenBurner };\n","import { BoxGeometry, CylinderGeometry, Group, Mesh, MeshStandardMaterial, SphereGeometry } from \"three\";\n\nclass ElectricPanel extends Group {\n constructor() {\n super();\n\n // Panel base geometry\n const panelGeometry = new BoxGeometry(3, 4, 0.1);\n const panelMaterial = new MeshStandardMaterial({\n color: 0x2e2e2e,\n roughness: 0.8,\n metalness: 0.6,\n });\n\n // Create switches and dials\n const switchGeometry = new BoxGeometry(0.2, 0.5, 0.2);\n const switchMaterial = new MeshStandardMaterial({\n color: 0xaaaaaa,\n roughness: 0.5,\n metalness: 0.7,\n });\n\n const dialGeometry = new CylinderGeometry(0.3, 0.3, 0.1, 16);\n const dialMaterial = new MeshStandardMaterial({\n color: 0x555555,\n roughness: 0.7,\n metalness: 0.5,\n });\n\n // Create panel and switches\n const panel = new Mesh(panelGeometry, panelMaterial);\n\n // Add multiple switches and dials\n const switches = [];\n for (let i = -1; i <= 1; i++) {\n const toggleSwitch = new Mesh(switchGeometry, switchMaterial);\n toggleSwitch.position.set(i, 1.5, 0.1);\n switches.push(toggleSwitch);\n panel.add(toggleSwitch);\n }\n\n const dial = new Mesh(dialGeometry, dialMaterial);\n dial.rotation.x = Math.PI / 2;\n dial.position.set(0, 0.5, 0.15);\n panel.add(dial);\n\n // Create red indicator light\n const lightGeometry = new SphereGeometry(0.15, 8, 8);\n const lightMaterial = new MeshStandardMaterial({\n color: 0xff0000,\n emissive: 0xff0000,\n emissiveIntensity: 0.5,\n });\n const light = new Mesh(lightGeometry, lightMaterial);\n light.position.set(0, -1, 0.1);\n panel.add(light);\n\n this.add(panel);\n\n // Define variables for flickering effect\n let flickerSpeed = 0.015; // Speed of flicker\n let flickerMaxIntensity = 0.8; // Maximum emissive intensity\n let flickerMinIntensity = 0.2; // Minimum emissive intensity\n\n // Main render loop\n function animate() {\n requestAnimationFrame(animate);\n\n // Create a flicker effect by adjusting the emissive intensity\n const flickerIntensity = flickerMinIntensity + Math.abs(Math.sin(Date.now() * flickerSpeed)) * (flickerMaxIntensity - flickerMinIntensity);\n light.material.emissiveIntensity = flickerIntensity;\n }\n\n animate();\n }\n}\n\nexport { ElectricPanel };\n","import { ErlenmeyerFlaskGeometry } from \"../../geometry/science/ErlenmeyerFlaskGeometry\";\nimport { DoubleSide, Mesh, MeshPhysicalMaterial } from \"three\";\n\nexport class ErlenmeyerFlask extends Mesh<ErlenmeyerFlaskGeometry, MeshPhysicalMaterial> {\n constructor({\n flaskRadius = 1, //\n neckRadius = 0.3,\n height = 2.5,\n neckHeight = 1,\n radialSegments = 16,\n } = {}) {\n super(\n new ErlenmeyerFlaskGeometry({ flaskRadius, neckRadius, height, neckHeight, radialSegments }),\n new MeshPhysicalMaterial({\n color: 0x88ccff,\n transparent: true,\n opacity: 0.4,\n roughness: 0.1,\n metalness: 0.1,\n reflectivity: 0.8,\n transmission: 0.9,\n side: DoubleSide,\n }),\n );\n }\n}\n","import { FlorenceFlaskGeometry } from \"../../geometry/science/FlorenceFlaskGeometry\";\nimport { DoubleSide, Mesh, MeshPhysicalMaterial } from \"three\";\n\nexport class FlorenceFlask extends Mesh<FlorenceFlaskGeometry, MeshPhysicalMaterial> {\n constructor() {\n super(\n new FlorenceFlaskGeometry(),\n new MeshPhysicalMaterial({\n color: 0x88ccff,\n transparent: true,\n depthWrite: false,\n opacity: 0.4,\n roughness: 0.1,\n metalness: 0.1,\n reflectivity: 0.8,\n transmission: 0.9,\n side: DoubleSide,\n }),\n );\n }\n}\n","import { BoxGeometry, CylinderGeometry, Group, Mesh, MeshStandardMaterial, SphereGeometry } from \"three\";\n\nclass LeverPanel extends Group {\n constructor() {\n super();\n\n // New panel for levers\n const leverPanelGeometry = new BoxGeometry(2, 3, 0.1);\n const leverPanelMaterial = new MeshStandardMaterial({\n color: 0x333333,\n roughness: 0.8,\n metalness: 0.5,\n });\n const leverPanel = new Mesh(leverPanelGeometry, leverPanelMaterial);\n\n // Lever geometry\n const leverBaseGeometry = new CylinderGeometry(0.1, 0.1, 0.2, 8);\n const leverHandleGeometry = new CylinderGeometry(0.05, 0.05, 1, 8);\n\n // Lever material\n const leverMaterial = new MeshStandardMaterial({\n color: 0xaaaaaa,\n roughness: 0.5,\n metalness: 0.7,\n });\n\n // Create multiple levers\n const levers = [];\n for (let i = -0.5; i <= 0.5; i += 0.5) {\n // Lever base\n const leverBase = new Mesh(leverBaseGeometry, leverMaterial);\n leverBase.position.set(i, 1, 0.1);\n\n // Lever handle\n const leverHandle = new Mesh(leverHandleGeometry, leverMaterial);\n leverHandle.position.y = 0.5; // Position handle on top of the base\n // leverHandle.rotation.x = Math.PI / 4; // Tilt forward along the x-axis\n leverBase.add(leverHandle);\n\n // Group base and handle as a lever\n levers.push(leverHandle);\n this.add(leverBase);\n }\n\n // Position the panel in the scene\n this.add(leverPanel);\n }\n}\n\nexport { LeverPanel };\n","import { BoxGeometry, CylinderGeometry, Group, Mesh, MeshStandardMaterial } from \"three\";\n\nclass Microscope extends Group {\n constructor() {\n super();\n\n // Base geometry\n const baseGeometry = new BoxGeometry(1, 0.2, 0.5);\n const baseMaterial = new MeshStandardMaterial({\n color: 0x444444,\n roughness: 0.6,\n metalness: 0.3,\n });\n const base = new Mesh(baseGeometry, baseMaterial);\n base.position.y = 0.1;\n\n // Arm geometry\n const armGeometry = new BoxGeometry(0.2, 1, 0.2);\n const arm = new Mesh(armGeometry, baseMaterial);\n arm.position.set(0, 0.6, -0.2);\n\n // Eyepiece geometry\n const eyepieceGeometry = new CylinderGeometry(0.1, 0.1, 0.4, 8);\n const eyepieceMaterial = new MeshStandardMaterial({\n color: 0x333333,\n roughness: 0.5,\n metalness: 0.6,\n });\n const eyepiece = new Mesh(eyepieceGeometry, eyepieceMaterial);\n eyepiece.position.set(0, 1.1, -0.35);\n eyepiece.rotation.x = -Math.PI / 4; // Angle the eyepiece for viewing\n\n // Stage geometry\n const stageGeometry = new BoxGeometry(0.6, 0.1, 0.6);\n const stageMaterial = new MeshStandardMaterial({\n color: 0x555555,\n roughness: 0.8,\n metalness: 0.2,\n });\n const stage = new Mesh(stageGeometry, stageMaterial);\n stage.position.set(0, 0.6, 0);\n\n // Assemble microscope\n this.add(base, arm, eyepiece, stage);\n }\n}\n\nexport { Microscope };\n","import { CylinderGeometry, DoubleSide, Group, Mesh, MeshStandardMaterial } from \"three\";\nimport { MortarGeometry } from \"../../geometry/science/MortarGeometry\";\n\nclass MortarAndPestle extends Group {\n constructor() {\n super();\n\n // Mortar geometry\n const mortarGeometry = new MortarGeometry();\n\n // Pestle geometry\n const pestleGeometry = new CylinderGeometry(0.2, 0.3, 1.5, 8);\n pestleGeometry.translate(0, 0.75, 0); // Offset to make the end rounded\n\n // Materials\n const mortarMaterial = new MeshStandardMaterial({\n color: 0x5c4033, // Dark earthy tone\n roughness: 1.0,\n metalness: 0.0,\n side: DoubleSide, // Render inside and outside\n });\n\n const pestleMaterial = new MeshStandardMaterial({\n color: 0x8b5a2b, // Slightly lighter earthy color\n roughness: 0.8,\n metalness: 0.1,\n });\n\n // Meshes\n const mortar = new Mesh(mortarGeometry, mortarMaterial);\n mortar.castShadow = true;\n const pestle = new Mesh(pestleGeometry, pestleMaterial);\n pestle.castShadow = true;\n\n // Position and rotate the pestle to rest in the mortar\n pestle.position.set(0.3, 1.3, 0);\n pestle.rotation.z = Math.PI / 4;\n\n // Group for easy manipulation\n this.add(mortar, pestle);\n }\n}\n\nexport { MortarAndPestle };\n","import { BoxGeometry, Mesh, MeshStandardMaterial } from \"three\";\n\nexport interface PanelOptions {\n width?: number;\n height?: number;\n depth?: number;\n}\n\n/**\n * Prefab for a panel.\n * Designed to be used as a control panel for switches, lights, levels, dials, and gauges.\n */\nexport class Panel extends Mesh {\n public geometry: BoxGeometry;\n public material: MeshStandardMaterial;\n\n constructor({ width = 3, height = 4, depth = 0.1 }: PanelOptions = {}) {\n super();\n\n this.geometry = new BoxGeometry(width, height, depth);\n this.material = new MeshStandardMaterial({\n color: 0x2e2e2e,\n roughness: 0.8,\n metalness: 0.6,\n });\n }\n}\n","import { Mesh, MeshStandardMaterial, SphereGeometry } from \"three\";\n\nexport interface PanelLightOptions {\n radius?: number;\n color?: number;\n emissive?: number;\n emissiveIntensity?: number;\n}\n\n/**\n * Prefab for a panel light.\n * Designed to appear as a LED light\n */\nexport class PanelLight extends Mesh {\n public geometry: SphereGeometry;\n public material: MeshStandardMaterial;\n\n constructor({\n radius = 0.15, //\n color = 0xffc7c7,\n emissive = 0xff0000,\n emissiveIntensity = 0.5,\n }: PanelLightOptions = {}) {\n super();\n\n this.geometry = new SphereGeometry(radius, 8, 8);\n this.material = new MeshStandardMaterial({\n color: color,\n emissive: emissive,\n emissiveIntensity: emissiveIntensity,\n });\n }\n}\n","import { CatmullRomCurve3, Group, Mesh, MeshStandardMaterial, TubeGeometry, Vector3 } from \"three\";\n\nclass SpiralTube extends Group {\n constructor() {\n super();\n\n // Create a multi-spiral path for the tube\n const spiralLength = 100; // Total number of points for more coils\n const heightIncrement = 0.05; // Smaller increment to keep the coils tight\n const curve = new CatmullRomCurve3(\n Array.from({ length: spiralLength }, (_, i) => {\n const angle = i * 0.2; // Controls tightness of the spiral\n return new Vector3(\n Math.cos(angle) * 0.4,\n i * heightIncrement, // Gradual height increase\n Math.sin(angle) * 0.4,\n );\n }),\n );\n\n // Create tube geometry with a high segment count for smoothness\n const tubeGeometry = new TubeGeometry(curve, 200, 0.1, 8, false);\n const glassMaterial = new MeshStandardMaterial({\n color: 0x88ccff,\n transparent: true,\n opacity: 0.3,\n roughness: 0.1,\n metalness: 0.2,\n emissive: 0x88ccff,\n });\n const multiSpiralTube = new Mesh(tubeGeometry, glassMaterial);\n this.add(multiSpiralTube);\n\n // Optional fluid animation inside tube (using gradient effect)\n function animateFluid() {\n glassMaterial.emissiveIntensity = 0.2 + Math.sin(Date.now() * 0.005) * 0.1;\n }\n\n // Main render loop with fluid animation\n function animate() {\n requestAnimationFrame(animate);\n animateFluid(); // Add subtle animation for fluid effect\n }\n\n animate();\n }\n}\n\nexport { SpiralTube };\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { StandGeometry } from \"../../geometry/science/StandGeometry\";\n\nexport class Stand extends Mesh<StandGeometry, MeshStandardMaterial> {\n constructor({\n radius = 0.3, //\n height = 0.4,\n count = 3,\n thickness = 0.03,\n radialSegments = 16,\n } = {}) {\n super(\n new StandGeometry({ radius, height, count, thickness, radialSegments }),\n new MeshStandardMaterial({\n color: 0x888888,\n roughness: 0.7,\n metalness: 0.3,\n }),\n );\n }\n}\n","import { DoubleSide, Mesh, MeshStandardMaterial } from \"three\";\nimport { TeslaCoilGeometry } from \"../../geometry/science/TeslaCoilGeometry\";\n\n/**\n * Material indices\n * 0: Base\n * 1: Coil\n */\nexport class TeslaCoil extends Mesh<TeslaCoilGeometry, MeshStandardMaterial[]> {\n constructor() {\n super(new TeslaCoilGeometry(), [\n new MeshStandardMaterial({\n color: 0x333333,\n roughness: 0.6,\n metalness: 0.5,\n }),\n new MeshStandardMaterial({\n color: 0xff6600,\n roughness: 0.5,\n metalness: 0.8,\n side: DoubleSide,\n }),\n ]);\n }\n}\n","import { DoubleSide, Mesh, MeshPhysicalMaterial } from \"three\";\nimport { TestTubeGeometry } from \"../../geometry/science/TestTubeGeometry\";\n\nexport class TestTube extends Mesh<TestTubeGeometry, MeshPhysicalMaterial> {\n constructor(radiusTop = 0.2, radiusBottom = 0.2, height = 3, segments = 32) {\n super(\n new TestTubeGeometry(radiusTop, radiusBottom, height, segments),\n new MeshPhysicalMaterial({\n color: 0x88ccff,\n transparent: true,\n opacity: 0.4,\n roughness: 0.1,\n metalness: 0.1,\n reflectivity: 0.8,\n transmission: 0.9,\n depthWrite: false,\n side: DoubleSide,\n }),\n );\n }\n}\n","import { BoxGeometry, DoubleSide, Group, Mesh, MeshStandardMaterial } from \"three\";\nimport { TestTubeGeometry } from \"../../geometry/science/TestTubeGeometry\";\n\nclass TestTubeRack extends Group {\n constructor(count = 3, colors = [0x00ffaa, 0xff00aa, 0xaa00ff]) {\n super();\n\n // Rack geometry\n const rackGeometry = new BoxGeometry(3, 0.2, 1);\n const rackMaterial = new MeshStandardMaterial({\n color: 0x8b4513, // Wooden color or change to metallic tone\n roughness: 0.7,\n metalness: 0.3,\n });\n const rack = new Mesh(rackGeometry, rackMaterial);\n rack.position.y = 0.5;\n rack.castShadow = true;\n\n // Test tube properties\n const testTubeGeometry = new TestTubeGeometry(0.1, 0.1, 1, 16);\n const glassMaterial = new MeshStandardMaterial({\n color: 0xaaaaaa,\n transparent: true,\n opacity: 0.4,\n roughness: 0.1,\n metalness: 0.5,\n depthWrite: false,\n side: DoubleSide,\n });\n\n // Create multiple test tubes with specified liquid colors\n for (let i = 0; i < count; i++) {\n // Test tube\n const testTube = new Mesh(testTubeGeometry, glassMaterial);\n const xPosition = (i - (count - 1) / 2) * 0.8;\n testTube.position.set(xPosition, 1, 0);\n testTube.castShadow = true;\n\n // Liquid geometry and material with unique color\n const liquidGeometry = new TestTubeGeometry(0.099, 0.099, 0.5, 16, false);\n const liquidColor = colors[i % colors.length]; // Cycle through colors if fewer than tubes\n const liquidMaterial = new MeshStandardMaterial({\n color: liquidColor,\n emissive: liquidColor,\n emissiveIntensity: 0.5,\n transparent: true,\n opacity: 0.6,\n });\n\n // Liquid inside test tube\n const liquid = new Mesh(liquidGeometry, liquidMaterial);\n liquid.position.set(0, -0.25, 0); // Position liquid inside tube\n testTube.add(liquid);\n\n // Add tube to rack\n rack.add(testTube);\n }\n\n // Group rack\n this.add(rack);\n }\n}\n\nexport { TestTubeRack };\n","import { Shape } from \"three\";\n\nclass BurstShape extends Shape {\n constructor(sides = 5, innerRadius = 0.5, outerRadius = 1.0) {\n super();\n\n const step = (Math.PI * 2) / sides;\n const halfStep = step / 2;\n const qtrStep = step / 4;\n\n this.moveTo(Math.cos(0) * outerRadius, -Math.sin(0) * outerRadius);\n\n for (let n = 1; n <= sides; ++n) {\n let cx = Math.cos(step * n - qtrStep * 3) * (innerRadius / Math.cos(qtrStep));\n let cy = -Math.sin(step * n - qtrStep * 3) * (innerRadius / Math.cos(qtrStep));\n let dx = Math.cos(step * n - halfStep) * innerRadius;\n let dy = -Math.sin(step * n - halfStep) * innerRadius;\n this.quadraticCurveTo(cx, cy, dx, dy);\n cx = Math.cos(step * n - qtrStep) * (innerRadius / Math.cos(qtrStep));\n cy = -Math.sin(step * n - qtrStep) * (innerRadius / Math.cos(qtrStep));\n dx = Math.cos(step * n) * outerRadius;\n dy = -Math.sin(step * n) * outerRadius;\n this.quadraticCurveTo(cx, cy, dx, dy);\n }\n\n this.closePath();\n }\n}\n\nexport { BurstShape };\n","import { ExtrudeGeometry, Mesh, MeshStandardMaterial } from \"three\";\nimport { BurstShape } from \"../../shapes/BurstShape\";\n\nclass Burst extends Mesh {\n constructor(sides = 5, innerRadius = 0.5, outerRadius = 1.0, depth = 0.25) {\n super();\n\n const shape = new BurstShape(sides, innerRadius, outerRadius);\n const geometry = new ExtrudeGeometry(shape, {\n depth: depth,\n bevelEnabled: depth > 0,\n bevelThickness: 0,\n bevelSize: 0,\n });\n const material = new MeshStandardMaterial({\n color: 0xffff00,\n emissive: 0xffd700,\n emissiveIntensity: 0.25,\n metalness: 0.1,\n roughness: 0.3,\n flatShading: true,\n });\n\n geometry.center();\n this.geometry = geometry;\n this.material = material;\n }\n}\n\nexport { Burst };\n","import { Path, Shape } from \"three\";\n\nclass GearShape extends Shape {\n constructor(sides = 5, innerRadius = 0.5, outerRadius = 1, holeSides = 5, holeRadius = 0.25) {\n super();\n\n const step = (Math.PI * 2) / sides;\n const qtrStep = step / 4;\n\n this.moveTo(Math.cos(0) * outerRadius, -Math.sin(0) * outerRadius);\n\n for (let n = 1; n <= sides; ++n) {\n this.lineTo(Math.cos(step * n - qtrStep * 3) * innerRadius, -Math.sin(step * n - qtrStep * 3) * innerRadius);\n this.lineTo(Math.cos(step * n - qtrStep * 2) * innerRadius, -Math.sin(step * n - qtrStep * 2) * innerRadius);\n this.lineTo(Math.cos(step * n - qtrStep) * outerRadius, -Math.sin(step * n - qtrStep) * outerRadius);\n this.lineTo(Math.cos(step * n) * outerRadius, -Math.sin(step * n) * outerRadius);\n }\n this.closePath();\n\n // Create the hole in the gear, if specified\n if (holeRadius > 0 && holeSides > 2) {\n const hole = new Path();\n const holeStep = (Math.PI * 2) / holeSides;\n\n hole.moveTo(Math.cos(0) * holeRadius, -Math.sin(0) * holeRadius);\n for (let n = 1; n < holeSides; ++n) {\n hole.lineTo(Math.cos(holeStep * n) * holeRadius, -Math.sin(holeStep * n) * holeRadius);\n }\n hole.lineTo(Math.cos(0) * holeRadius, -Math.sin(0) * holeRadius);\n\n this.holes.push(hole);\n }\n }\n}\n\nexport { GearShape };\n","import { ExtrudeGeometry, Mesh, MeshStandardMaterial } from \"three\";\nimport { GearShape } from \"../../shapes/GearShape\";\n\nclass Gear extends Mesh {\n constructor(sides = 5, innerRadius = 0.5, outerRadius = 1, holeSides = 5, holeRadius = 0.25, depth = 0.25) {\n super();\n\n const shape = new GearShape(sides, innerRadius, outerRadius, holeSides, holeRadius);\n const geometry = new ExtrudeGeometry(shape, {\n depth: depth,\n bevelEnabled: depth > 0,\n bevelThickness: 0,\n bevelSize: 0,\n });\n const material = new MeshStandardMaterial({\n color: 0xaaaaaa,\n metalness: 0.8,\n roughness: 0.2,\n });\n\n geometry.center();\n this.geometry = geometry;\n this.material = material;\n }\n}\n\nexport { Gear };\n","import { Shape } from \"three\";\n\nclass HeartShape extends Shape {\n constructor(size = 1, width = 2.1, height = 1.4, tipDepth = 1.6) {\n super();\n\n // Start from the top middle of the heart\n this.moveTo(0, height * size / 3);\n\n // Left curve\n this.bezierCurveTo(\n -width * 0.375 * size, height * size, // Control point 1 for the left lobe\n -width * size, height * size / 3, // Control point 2 for the left side of the heart\n 0, -tipDepth * size // Bottom tip of the heart, controlled by `tipDepth`\n );\n\n // Right curve\n this.bezierCurveTo(\n width * size, height * size / 3, // Control point 3 for the right side of the heart\n width * 0.375 * size, height * size, // Control point 4 for the right lobe\n 0, height * size / 3 // Close shape at the top middle\n );\n }\n}\n\nexport { HeartShape };\n","import { ExtrudeGeometry, Mesh, MeshStandardMaterial } from \"three\";\nimport { HeartShape } from \"../../shapes/HeartShape\";\n\nclass Heart extends Mesh {\n constructor(size = 1, width = 1, height = 1, tipDepth = 10, depth = 0.25) {\n super();\n\n const shape = new HeartShape(size, width, height, tipDepth);\n const geometry = new ExtrudeGeometry(shape, {\n depth: depth,\n bevelEnabled: depth > 0,\n bevelThickness: 0,\n bevelSize: 0,\n });\n const material = new MeshStandardMaterial({\n color: 0xc62828,\n emissive: 0xc61416,\n emissiveIntensity: 0.25,\n metalness: 0.1,\n roughness: 0.3,\n flatShading: true,\n });\n\n geometry.center();\n this.geometry = geometry;\n this.material = material;\n }\n}\n\nexport { Heart };\n","import { Shape } from \"three\";\n\nclass StarShape extends Shape {\n constructor(points = 5, innerRadius = 0.5, outerRadius = 1.0) {\n super();\n\n const step = (Math.PI * 2) / points;\n const halfStep = step / 2;\n this.moveTo(Math.cos(0) * outerRadius, Math.sin(0) * outerRadius);\n\n for (let n = 1; n <= points; ++n) {\n this.lineTo(Math.cos(step * n - halfStep) * innerRadius, Math.sin(step * n - halfStep) * innerRadius);\n this.lineTo(Math.cos(step * n) * outerRadius, Math.sin(step * n) * outerRadius);\n }\n\n this.closePath();\n }\n}\n\nexport { StarShape };\n","import { ExtrudeGeometry, Mesh, MeshStandardMaterial } from \"three\";\nimport { StarShape } from \"../../shapes/StarShape\";\n\nclass Star extends Mesh {\n constructor(points = 5, innerRadius = 0.5, outerRadius = 1.0, depth = 0.25) {\n super();\n\n const shape = new StarShape(points, innerRadius, outerRadius);\n const geometry = new ExtrudeGeometry(shape, {\n depth: depth,\n bevelEnabled: depth > 0,\n bevelThickness: 0,\n bevelSize: 0,\n });\n const material = new MeshStandardMaterial({\n color: 0xffff00,\n emissive: 0xffd700,\n emissiveIntensity: 0.25,\n metalness: 0.1,\n roughness: 0.3,\n flatShading: true,\n });\n\n geometry.center();\n this.geometry = geometry;\n this.material = material;\n }\n}\n\nexport { Star };\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { BoneGeometry } from \"../../geometry/skeleton/BoneGeometry\";\n\nexport class Bone extends Mesh<BoneGeometry, MeshStandardMaterial> {\n constructor() {\n super(new BoneGeometry(), new MeshStandardMaterial({ color: 0xffffff }));\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { TreeGeometry } from \"../../geometry/trees/TreeGeometry\";\n\n/**\n * Material indices:\n * 0. Trunk\n * 1. leafSize\n *\n * Example usage:\n * ```\n * const tree = new Tree({\n * trunkRadiusTop: 0.25,\n * trunkRadiusBottom: 0.4,\n * trunkHeight: 2.5,\n * trunkSegments: 14,\n * trunkColor: 0x8b4513,\n * leafSize: 0.8,\n * leafCount: 6,\n * leafDetail: 0,\n * leafSpreadRadius: 1.5,\n * leafColor: 0x228b22,\n * });\n * ```\n */\nexport class Tree extends Mesh<TreeGeometry, MeshStandardMaterial[]> {\n constructor({\n trunkRadiusTop = 0.25,\n trunkRadiusBottom = 0.4,\n trunkHeight = 2.5,\n trunkSegments = 14,\n trunkColor = 0x8b4513,\n leafSize = 0.8,\n leafCount = 6,\n leafDetail = 0,\n leafSpreadRadius = 1.5,\n leafColor = 0x228b22,\n } = {}) {\n super(\n new TreeGeometry({\n trunkRadiusTop: trunkRadiusTop,\n trunkRadiusBottom: trunkRadiusBottom,\n trunkHeight: trunkHeight,\n trunkSegments: trunkSegments,\n leafSize: leafSize,\n leafCount: leafCount,\n leafDetail: leafDetail,\n leafSpreadRadius: leafSpreadRadius,\n }),\n [\n new MeshStandardMaterial({\n color: trunkColor,\n roughness: 0.9,\n metalness: 0,\n flatShading: true,\n }),\n\n new MeshStandardMaterial({\n color: leafColor,\n roughness: 0.8,\n metalness: 0,\n flatShading: true,\n }),\n ],\n );\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { HillGeometry } from \"../../geometry/terrain/HillGeometry\";\n\nexport class Hill extends Mesh<HillGeometry, MeshStandardMaterial> {\n constructor({\n radius = 3, //\n height = 0.6,\n widthSegments = 64,\n heightSegments = 16,\n phiStart = 0,\n phiLength = Math.PI * 2,\n } = {}) {\n super(\n new HillGeometry({\n radius,\n height,\n widthSegments,\n heightSegments,\n phiStart,\n phiLength,\n }),\n new MeshStandardMaterial({ color: 0x00ff00, flatShading: true }),\n );\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { MoundGeometry } from \"../../geometry/terrain/MoundGeometry\";\nimport { radiusFromCapWidth } from \"../../utils/SphericalGeometryUtils\";\n\n/**\n * Mound-like mesh with a flat top.\n *\n * To create a radius based on a desired width:\n * ```\n * const mound = new Mound({\n * radius: radiusFromCapWidth(5, Math.PI / 10),\n * }\n * ```\n *\n * To create a radius based on a desired height:\n * ```\n * const mound = new Mound({\n * radius: radiusFromCapHeight(5, Math.PI / 10),\n * }\n * ```\n */\nexport class Mound extends Mesh<MoundGeometry, MeshStandardMaterial> {\n constructor({\n radius = radiusFromCapWidth(5, Math.PI / 10), //\n widthSegments = 64,\n heightSegments = 32,\n phiStart = 0,\n phiLength = Math.PI * 2,\n thetaLength = Math.PI / 10,\n } = {}) {\n super(\n new MoundGeometry({\n radius,\n widthSegments,\n heightSegments,\n phiStart,\n phiLength,\n thetaLength,\n }),\n new MeshStandardMaterial({ color: 0x00ff00, flatShading: true }),\n );\n }\n}\n","import {Material} from \"three\";\n\n/**\n * Utility function to add water-like vertex displacement to an existing Three.js material.\n * @param {Material} material - The material to mutate, e.g., MeshStandardMaterial.\n * @param {Object} options - Options for water wave modification.\n * @param {number} [options.time=0.0] - The time value for the wave function.\n * @param {number} [options.waveFrequency=0.2] - The frequency of the water waves.\n * @param {number} [options.waveAmplitude=0.5] - The amplitude of the water waves.\n */\nexport function addWaterDisplacement<T extends Material>(material:T, { time = 0.0, waveFrequency = 0.2, waveAmplitude = 0.5 } = {}) {\n material.onBeforeCompile = (shader) => {\n // Add uniforms for time, wave frequency, and wave amplitude\n shader.uniforms.time = { value: time };\n shader.uniforms.waveFrequency = { value: waveFrequency };\n shader.uniforms.waveAmplitude = { value: waveAmplitude };\n\n // Inject the water-like wave displacement code in the vertex shader\n shader.vertexShader = `\n uniform float time;\n uniform float waveFrequency;\n uniform float waveAmplitude;\n\n vec3 waterDisplacement(vec3 position, vec3 normal) {\n vec3 displaced = position;\n\n // Displace along the normal direction instead of local y-axis\n displaced += normal * (sin(position.x * waveFrequency + time) * waveAmplitude);\n displaced += normal * (cos(position.z * waveFrequency + time) * waveAmplitude);\n\n return displaced;\n }\n ` + shader.vertexShader;\n\n // Replace the vertex transformation logic to add displacement based on the normal\n shader.vertexShader = shader.vertexShader.replace(\n `#include <begin_vertex>`,\n `\n vec3 transformed = waterDisplacement(position, normal);\n `\n );\n\n // Store shader reference in material for time updates\n material.userData.shader = shader;\n };\n}\n\n/**\n * Updates the time uniform of the material's shader to animate the water effect.\n * @param {Material} material - The material to update.\n * @param {number} deltaTime - The time increment to add.\n */\nexport function updateWaterDisplacementTime<T extends Material>(material:T, deltaTime:number) {\n if (material.userData.shader) {\n material.userData.shader.uniforms.time.value += deltaTime;\n }\n}\n","import { Axis } from \"../constants/Axis\";\nimport { Material, Vector3 } from \"three\";\n\ninterface NoiseDisplacementOptions {\n time?: number;\n intensity?: number;\n axis?: Vector3;\n scale?: number;\n}\n\n/**\n * Utility function to add noise-based vertex displacement to an existing Three.js material.\n * @param {Material} material - The material to mutate, e.g., MeshStandardMaterial.\n * @param {Object} options - Options for noise modification.\n * @param {number} [options.time=0.0] - The time value for the noise function.\n * @param {number} [options.intensity=1.0] - The intensity of the displacement.\n * @param {Vector3} [options.axis=new Vector3(1, 1, 1)] - The axis of displacement.\n * @param {number} [options.scale=10.0] - The scale of the noise effect.\n */\nexport function addNoiseDisplacement<T extends Material>(\n material: T,\n { time = 0.0, intensity = 1.0, axis = Axis.XYZ, scale = 10.0 }: NoiseDisplacementOptions = {},\n) {\n material.onBeforeCompile = (shader) => {\n // Add uniforms for time, axis, intensity, and scale\n shader.uniforms.time = { value: time };\n shader.uniforms.axis = { value: axis };\n shader.uniforms.intensity = { value: intensity };\n shader.uniforms.scale = { value: scale };\n\n // Add noise function and modify the vertex shader to displace vertices\n shader.vertexShader = `\n uniform float time;\n uniform vec3 axis;\n uniform float intensity;\n uniform float scale;\n\n float mod289(float x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\n vec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\n vec4 perm(vec4 x) { return mod289(((x * 34.0) + 1.0) * x); }\n\n float noise(vec3 p) {\n vec3 a = floor(p);\n vec3 d = p - a;\n d = d * d * (3.0 - 2.0 * d);\n\n vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0);\n vec4 k1 = perm(b.xyxy);\n vec4 k2 = perm(k1.xyxy + b.zzww);\n\n vec4 c = k2 + a.zzzz;\n vec4 k3 = perm(c);\n vec4 k4 = perm(c + 1.0);\n\n vec4 o1 = fract(k3 * (1.0 / 41.0));\n vec4 o2 = fract(k4 * (1.0 / 41.0));\n\n vec4 o3 = o2 * d.z + o1 * (1.0 - d.z);\n vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x);\n\n return o4.y * d.y + o4.x * (1.0 - d.y);\n }\n ` + shader.vertexShader;\n\n // Replace the vertex transformation logic to add noise-based displacement\n shader.vertexShader = shader.vertexShader.replace(\n `#include <begin_vertex>`,\n `\n vec3 transformed = vec3(position);\n float n = noise(transformed * scale + time);\n transformed += normalize(axis) * n * intensity;\n vec3 transformedNormal = normal;\n `,\n );\n\n // Store shader reference in material for time updates\n material.userData.shader = shader;\n };\n}\n\n/**\n * Updates the time uniform of the material's shader to animate the noise effect.\n * @param {Material} material - The material to update.\n * @param {number} deltaTime - The time increment to add.\n */\nexport function updateNoiseDisplacementTime<T extends Material>(material: T, deltaTime: number) {\n if (material.userData.shader) {\n material.userData.shader.uniforms.time.value += deltaTime;\n }\n}\n","import { MathUtils, Uniform, Vector3 } from \"three\";\n\nexport interface AtmosphericShaderUniforms {\n turbidity: Uniform<number>;\n rayleigh: Uniform<number>;\n mieCoefficient: Uniform<number>;\n mieDirectionalG: Uniform<number>;\n sunPosition: Uniform<Vector3>;\n up: Uniform<Vector3>;\n}\n\n/**\n * Atmospheric scattering shader.\n *\n * Based on \"A Practical Analytic Model for Daylight\"\n * aka The Preetham Model, the de facto standard analytic skydome model\n * https://www.researchgate.net/publication/220720443_A_Practical_Analytic_Model_for_Daylight\n *\n * First implemented by Simon Wallner\n * http://simonwallner.at/project/atmospheric-scattering/\n *\n * Improved by Martin Upitis\n * http://blenderartists.org/forum/showthread.php?245954-preethams-sky-impementation-HDR\n *\n * Three.js integration by zz85 http://twitter.com/blurspline\n *\n * Example:\n * ```\n * const geometry = new BoxGeometry(1, 1, 1);\n *\n * const material = new ShaderMaterial({\n * uniforms: atmosphericShader.uniforms,\n * vertexShader: atmosphericShader.vertexShader,\n * fragmentShader: atmosphericShader.fragmentShader,\n * depthWrite: false,\n * side: BackSide,\n * }) as ShaderMaterial & { uniforms: AtmosphericShaderUniforms };\n *\n * const theta = MathUtils.degToRad(89);\n * const phi = MathUtils.degToRad(180);\n * const sun = new Vector3().setFromSphericalCoords(1, theta, phi);\n *\n * material.uniforms.sunPosition.value = sun;\n *\n * const mesh = new Mesh(geometry, material);\n * mesh.scale.setScalar(450000);\n * ```\n */\nexport const atmosphericShader = {\n uniforms: {\n turbidity: { value: 10 },\n rayleigh: { value: 2 },\n mieCoefficient: { value: 0.005 },\n mieDirectionalG: { value: 0.8 },\n sunPosition: { value: new Vector3().setFromSphericalCoords(1, MathUtils.degToRad(90), MathUtils.degToRad(180)) },\n up: { value: new Vector3(0, 1, 0) },\n },\n vertexShader: `\n\t\tuniform vec3 sunPosition;\n\t\tuniform float rayleigh;\n\t\tuniform float turbidity;\n\t\tuniform float mieCoefficient;\n\t\tuniform vec3 up;\n\n\t\tvarying vec3 vWorldPosition;\n\t\tvarying vec3 vSunDirection;\n\t\tvarying float vSunfade;\n\t\tvarying vec3 vBetaR;\n\t\tvarying vec3 vBetaM;\n\t\tvarying float vSunE;\n\n\t\t// constants for atmospheric scattering\n\t\tconst float e = 2.71828182845904523536028747135266249775724709369995957;\n\t\tconst float pi = 3.141592653589793238462643383279502884197169;\n\n\t\t// wavelength of used primaries, according to preetham\n\t\tconst vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 );\n\t\t// this pre-calculation replaces older TotalRayleigh(vec3 lambda) function:\n\t\t// (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn))\n\t\tconst vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 );\n\n\t\t// mie stuff\n\t\t// K coefficient for the primaries\n\t\tconst float v = 4.0;\n\t\tconst vec3 K = vec3( 0.686, 0.678, 0.666 );\n\t\t// MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K\n\t\tconst vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 );\n\n\t\t// earth shadow hack\n\t\t// cutoffAngle = pi / 1.95;\n\t\tconst float cutoffAngle = 1.6110731556870734;\n\t\tconst float steepness = 1.5;\n\t\tconst float EE = 1000.0;\n\n\t\tfloat sunIntensity( float zenithAngleCos ) {\n\t\t\tzenithAngleCos = clamp( zenithAngleCos, -1.0, 1.0 );\n\t\t\treturn EE * max( 0.0, 1.0 - pow( e, -( ( cutoffAngle - acos( zenithAngleCos ) ) / steepness ) ) );\n\t\t}\n\n\t\tvec3 totalMie( float T ) {\n\t\t\tfloat c = ( 0.2 * T ) * 10E-18;\n\t\t\treturn 0.434 * c * MieConst;\n\t\t}\n\n\t\tvoid main() {\n\t\t\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\t\t\tvWorldPosition = worldPosition.xyz;\n\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\tgl_Position.z = gl_Position.w; // set z to camera.far\n\n\t\t\tvSunDirection = normalize( sunPosition );\n\n\t\t\tvSunE = sunIntensity( dot( vSunDirection, up ) );\n\n\t\t\tvSunfade = 1.0 - clamp( 1.0 - exp( ( sunPosition.y / 450000.0 ) ), 0.0, 1.0 );\n\n\t\t\tfloat rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) );\n\n\t\t\t// extinction (absorption + out scattering)\n\t\t\t// rayleigh coefficients\n\t\t\tvBetaR = totalRayleigh * rayleighCoefficient;\n\n\t\t\t// mie coefficients\n\t\t\tvBetaM = totalMie( turbidity ) * mieCoefficient;\n }\n `,\n fragmentShader: `\n \tvarying vec3 vWorldPosition;\n\t\tvarying vec3 vSunDirection;\n\t\tvarying float vSunfade;\n\t\tvarying vec3 vBetaR;\n\t\tvarying vec3 vBetaM;\n\t\tvarying float vSunE;\n\n\t\tuniform float mieDirectionalG;\n\t\tuniform vec3 up;\n\n\t\t// constants for atmospheric scattering\n\t\tconst float pi = 3.141592653589793238462643383279502884197169;\n\n\t\tconst float n = 1.0003; // refractive index of air\n\t\tconst float N = 2.545E25; // number of molecules per unit volume for air at 288.15K and 1013mb (sea level -45 celsius)\n\n\t\t// optical length at zenith for molecules\n\t\tconst float rayleighZenithLength = 8.4E3;\n\t\tconst float mieZenithLength = 1.25E3;\n\t\t// 66 arc seconds -> degrees, and the cosine of that\n\t\tconst float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;\n\n\t\t// 3.0 / ( 16.0 * pi )\n\t\tconst float THREE_OVER_SIXTEENPI = 0.05968310365946075;\n\t\t// 1.0 / ( 4.0 * pi )\n\t\tconst float ONE_OVER_FOURPI = 0.07957747154594767;\n\n\t\tfloat rayleighPhase( float cosTheta ) {\n\t\t\treturn THREE_OVER_SIXTEENPI * ( 1.0 + pow( cosTheta, 2.0 ) );\n\t\t}\n\n\t\tfloat hgPhase( float cosTheta, float g ) {\n\t\t\tfloat g2 = pow( g, 2.0 );\n\t\t\tfloat inverse = 1.0 / pow( 1.0 - 2.0 * g * cosTheta + g2, 1.5 );\n\t\t\treturn ONE_OVER_FOURPI * ( ( 1.0 - g2 ) * inverse );\n\t\t}\n\n void main() {\n\t\t\tvec3 direction = normalize( vWorldPosition - cameraPosition );\n\n\t\t\t// optical length\n\t\t\t// cutoff angle at 90 to avoid singularity in next formula.\n\t\t\tfloat zenithAngle = acos( max( 0.0, dot( up, direction ) ) );\n\t\t\tfloat inverse = 1.0 / ( cos( zenithAngle ) + 0.15 * pow( 93.885 - ( ( zenithAngle * 180.0 ) / pi ), -1.253 ) );\n\t\t\tfloat sR = rayleighZenithLength * inverse;\n\t\t\tfloat sM = mieZenithLength * inverse;\n\n\t\t\t// combined extinction factor\n\t\t\tvec3 Fex = exp( -( vBetaR * sR + vBetaM * sM ) );\n\n\t\t\t// in scattering\n\t\t\tfloat cosTheta = dot( direction, vSunDirection );\n\n\t\t\tfloat rPhase = rayleighPhase( cosTheta * 0.5 + 0.5 );\n\t\t\tvec3 betaRTheta = vBetaR * rPhase;\n\n\t\t\tfloat mPhase = hgPhase( cosTheta, mieDirectionalG );\n\t\t\tvec3 betaMTheta = vBetaM * mPhase;\n\n\t\t\tvec3 Lin = pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * ( 1.0 - Fex ), vec3( 1.5 ) );\n\t\t\tLin *= mix( vec3( 1.0 ), pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * Fex, vec3( 1.0 / 2.0 ) ), clamp( pow( 1.0 - dot( up, vSunDirection ), 5.0 ), 0.0, 1.0 ) );\n\n\t\t\t// night sky\n\t\t\tfloat theta = acos( direction.y ); // elevation --> y-axis, [-pi/2, pi/2]\n\t\t\tfloat phi = atan( direction.z, direction.x ); // azimuth --> x-axis [-pi/2, pi/2]\n\t\t\tvec2 uv = vec2( phi, theta ) / vec2( 2.0 * pi, pi ) + vec2( 0.5, 0.0 );\n\t\t\tvec3 L0 = vec3( 0.1 ) * Fex;\n\n\t\t\t// composition + solar disc\n\t\t\tfloat sundisk = smoothstep( sunAngularDiameterCos, sunAngularDiameterCos + 0.00002, cosTheta );\n\t\t\tL0 += ( vSunE * 19000.0 * Fex ) * sundisk;\n\n\t\t\tvec3 texColor = ( Lin + L0 ) * 0.04 + vec3( 0.0, 0.0003, 0.00075 );\n\n\t\t\tvec3 retColor = pow( texColor, vec3( 1.0 / ( 1.2 + ( 1.2 * vSunfade ) ) ) );\n\n\t\t\tgl_FragColor = vec4( retColor, 1.0 );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <colorspace_fragment>\n\t\t}\n `,\n};\n","import { Color, Uniform } from \"three\";\n\nexport interface DaySkyUniforms {\n topColor: Uniform<Color>;\n bottomColor: Uniform<Color>;\n}\n\n/**\n * Shader for a day skybox.\n *\n * Example:\n * ```\n * this.material = new ShaderMaterial({\n * uniforms: daySkyShader.uniforms,\n * vertexShader: daySkyShader.vertexShader,\n * fragmentShader: daySkyShader.fragmentShader,\n * side: BackSide,\n * }) as ShaderMaterial & { uniforms: DaySkyUniforms };\n * ```\n */\nexport const daySkyShader = {\n uniforms: {\n topColor: { value: new Color(0.5, 0.8, 1.0) },\n bottomColor: { value: new Color(1.0, 1.0, 1.0) },\n },\n vertexShader: `\n varying vec3 vPosition;\n void main() {\n vPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n `,\n fragmentShader: `\n uniform vec3 topColor;\n uniform vec3 bottomColor;\n varying vec3 vPosition;\n void main() {\n float y = normalize(vPosition).y * 0.5 + 0.5; // Normalizing y to range 0 to 1\n gl_FragColor = vec4(mix(bottomColor, topColor, y), 1.0);\n }\n `,\n};\n","// Shader for fade effect\nexport const fadeShader = {\n uniforms: {\n tDiffuse: { value: null },\n opacity: { value: 1.0 },\n },\n vertexShader: `\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n `,\n fragmentShader: `\n uniform float opacity;\n uniform sampler2D tDiffuse;\n varying vec2 vUv;\n void main() {\n vec4 texel = texture2D(tDiffuse, vUv);\n gl_FragColor = opacity * texel;\n }\n `,\n};\n","import { Color, Uniform } from \"three\";\n\nexport interface NightSkyUniforms {\n topColor: Uniform<Color>;\n bottomColor: Uniform<Color>;\n offset: Uniform<number>;\n exponent: Uniform<number>;\n}\n\n/**\n * Shader for a night skybox.\n *\n * Example:\n * ```\n * this.material = new ShaderMaterial({\n * vertexShader: nightSkyShader.vertexShader,\n * fragmentShader: nightSkyShader.fragmentShader,\n * uniforms: nightSkyShader.uniforms,\n * side: BackSide,\n * }) as ShaderMaterial & { uniforms: NightSkyUniforms };\n * ```\n */\nexport const nightSkyShader = {\n uniforms: {\n topColor: { value: new Color(0x000033) },\n bottomColor: { value: new Color(0x000011) },\n offset: { value: 33 },\n exponent: { value: 0.6 },\n },\n vertexShader: `\n varying vec3 vWorldPosition;\n void main() {\n vec4 worldPosition = modelMatrix * vec4(position, 1.0);\n vWorldPosition = worldPosition.xyz;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n `,\n fragmentShader: `\n uniform vec3 topColor;\n uniform vec3 bottomColor;\n uniform float offset;\n uniform float exponent;\n varying vec3 vWorldPosition;\n void main() {\n float h = normalize(vWorldPosition + offset).y;\n gl_FragColor = vec4(mix(bottomColor, topColor, max(pow(max(h, 0.0), exponent), 0.0)), 1.0);\n }\n `,\n};\n","import { BackSide, BoxGeometry, MathUtils, Mesh, ShaderMaterial, Vector3 } from \"three\";\nimport { atmosphericShader, AtmosphericShaderUniforms } from \"../shaders/atmosphericShader\";\n\n/**\n * Atmospheric scattering skybox.\n *\n * Elevation (theta, θ): Angle measured above or below the horizon (from the xy-plane towards the zenith or nadir).\n * Azimuth (phi, φ): Angle measured around the horizon from a reference direction (e.g., north, east).\n */\nexport class AtmosphericSkybox extends Mesh {\n geometry: BoxGeometry;\n material: ShaderMaterial & { uniforms: AtmosphericShaderUniforms };\n\n constructor() {\n super();\n\n this.geometry = new BoxGeometry(1, 1, 1);\n\n this.material = new ShaderMaterial({\n uniforms: atmosphericShader.uniforms,\n vertexShader: atmosphericShader.vertexShader,\n fragmentShader: atmosphericShader.fragmentShader,\n depthWrite: false,\n side: BackSide,\n }) as ShaderMaterial & { uniforms: AtmosphericShaderUniforms };\n\n this.scale.setScalar(450000);\n\n const theta = MathUtils.degToRad(89);\n const phi = MathUtils.degToRad(180);\n const sun = new Vector3().setFromSphericalCoords(1, theta, phi);\n\n this.material.uniforms.sunPosition.value = sun;\n }\n\n /**\n * Set the sun position.\n *\n * Elevation (theta, θ)\n * - Angle measured above or below the horizon (from the xy-plane towards the zenith or nadir).\n * - Ranges from 0 to π/2 radians (or 0 to 90 degrees).\n * - This is the vertical angle in the xy-plane.\n *\n * Azimuth (phi, φ)\n * - Angle measured around the horizon from a reference direction (e.g., north, east).\n * - Ranges from 0 to 2π radians (or 0 to 360 degrees).\n * - This is the horizontal angle in the xy-plane.\n */\n sunPosition(theta: number, phi: number) {\n const sun = new Vector3();\n sun.setFromSphericalCoords(1, theta, phi);\n\n this.material.uniforms.sunPosition.value = sun;\n }\n}\n","import { BackSide, BoxGeometry, Mesh, ShaderMaterial } from \"three\";\nimport { daySkyShader, DaySkyUniforms } from \"../shaders/daySkyShader\";\n\nexport class DaySkybox extends Mesh {\n geometry: BoxGeometry;\n material: ShaderMaterial & { uniforms: DaySkyUniforms };\n\n constructor(size = 1000) {\n super();\n\n this.geometry = new BoxGeometry(size, size, size);\n\n this.material = new ShaderMaterial({\n uniforms: daySkyShader.uniforms,\n vertexShader: daySkyShader.vertexShader,\n fragmentShader: daySkyShader.fragmentShader,\n side: BackSide,\n }) as ShaderMaterial & { uniforms: DaySkyUniforms };\n }\n}\n","import { BackSide, Mesh, ShaderMaterial, SphereGeometry } from \"three\";\nimport { nightSkyShader, NightSkyUniforms } from \"../shaders/nightSkyShader\";\n\nexport class NightSkybox extends Mesh {\n geometry: SphereGeometry;\n material: ShaderMaterial & { uniforms: NightSkyUniforms };\n\n constructor(size = 1000) {\n super();\n\n this.geometry = new SphereGeometry(size, 32, 15);\n\n this.material = new ShaderMaterial({\n vertexShader: nightSkyShader.vertexShader,\n fragmentShader: nightSkyShader.fragmentShader,\n uniforms: nightSkyShader.uniforms,\n side: BackSide,\n }) as ShaderMaterial & { uniforms: NightSkyUniforms };\n }\n}\n","import { DataTexture, NearestFilter, RepeatWrapping, RGBAFormat, UnsignedByteType } from \"three\";\n\n/**\n * Create a checkerboard texture\n *\n * Example:\n * ```\n * const material = new MeshStandardMaterial();\n * material.map = createCheckerboardTexture(8);\n * ```\n */\nexport const checkerboardTexture = (size: number): DataTexture => {\n const data = new Uint8Array(4 * size * size);\n for (let i = 0; i < size * size; i++) {\n const stride = i * 4;\n const color = (i % size ^ Math.floor(i / size)) & 1 ? 255 : 0;\n data[stride] = color; // red\n data[stride + 1] = color; // green\n data[stride + 2] = color; // blue\n data[stride + 3] = 255; // alpha\n }\n\n const texture = new DataTexture(data, size, size, RGBAFormat, UnsignedByteType);\n texture.wrapS = RepeatWrapping;\n texture.wrapT = RepeatWrapping;\n texture.minFilter = NearestFilter;\n texture.needsUpdate = true;\n\n return texture;\n};\n","import { Box3, Object3D, Vector3 } from \"three\";\nimport { BoxSide } from \"../constants/BoxSide\";\n\n/**\n * Aligns an array of Object3D objects (or subclasses) to a specified side\n * (left, right, top, bottom, front, or back) based on their world-space bounding boxes.\n */\nexport function alignToEdge<T extends Object3D>(objects: T[], side: BoxSide): void {\n if (objects.length === 0) {\n throw new Error(\"No objects provided for alignment.\");\n }\n\n const worldBoundingBox = new Box3();\n const worldPosition = new Vector3();\n\n // Precompute world-space bounding boxes and positions for all objects\n const objectData = objects.map((object) => {\n worldBoundingBox.setFromObject(object); // Accounts for scale and rotation\n object.getWorldPosition(worldPosition);\n\n return {\n object,\n boundingBox: worldBoundingBox.clone(), // Clone to avoid overwriting\n worldPosition: worldPosition.clone(),\n };\n });\n\n // Compute the reference alignment value based on the specified side\n const referenceValue = objectData.reduce(\n (acc, { boundingBox }) => {\n switch (side) {\n case BoxSide.LEFT:\n return Math.min(acc, boundingBox.min.x);\n case BoxSide.RIGHT:\n return Math.max(acc, boundingBox.max.x);\n case BoxSide.BOTTOM:\n return Math.min(acc, boundingBox.min.y);\n case BoxSide.TOP:\n return Math.max(acc, boundingBox.max.y);\n case BoxSide.BACK:\n return Math.min(acc, boundingBox.min.z);\n case BoxSide.FRONT:\n return Math.max(acc, boundingBox.max.z);\n default:\n throw new Error(`Unsupported side type: ${side}`);\n }\n },\n side === BoxSide.RIGHT || side === BoxSide.TOP || side === BoxSide.FRONT ? -Infinity : Infinity,\n );\n\n // Align each object to the computed reference value\n objectData.forEach(({ object, boundingBox }) => {\n switch (side) {\n case BoxSide.LEFT:\n object.position.x += referenceValue - boundingBox.min.x;\n break;\n case BoxSide.RIGHT:\n object.position.x += referenceValue - boundingBox.max.x;\n break;\n case BoxSide.BOTTOM:\n object.position.y += referenceValue - boundingBox.min.y;\n break;\n case BoxSide.TOP:\n object.position.y += referenceValue - boundingBox.max.y;\n break;\n case BoxSide.BACK:\n object.position.z += referenceValue - boundingBox.min.z;\n break;\n case BoxSide.FRONT:\n object.position.z += referenceValue - boundingBox.max.z;\n break;\n }\n });\n}\n","import { Direction } from \"../constants/Direction\";\nimport { Box3, Object3D, Vector3 } from \"three\";\n\n/**\n * Aligns an array of `Object3D` objects along a specified direction with optional spacing.\n */\nexport function alignToRow<T extends Object3D>(\n objects: T[],\n direction: Vector3 = Direction.RIGHT,\n spacing: number = 0,\n): void {\n // Ensure the direction vector is normalized\n const alignmentDirection = direction.clone().normalize();\n\n // Start the position tracker for alignment\n let currentPosition = new Vector3();\n const worldBoundingBox = new Box3();\n\n // Align each object\n objects.forEach((object) => {\n // Compute the world-space bounding box\n worldBoundingBox.setFromObject(object); // Accounts for scale and rotation\n\n // Calculate the object's size along the alignment direction\n const sizeVector = new Vector3(\n worldBoundingBox.max.x - worldBoundingBox.min.x,\n worldBoundingBox.max.y - worldBoundingBox.min.y,\n worldBoundingBox.max.z - worldBoundingBox.min.z,\n );\n const size = sizeVector.dot(alignmentDirection);\n\n // Compute the object's center in world space\n const objectCenter = new Vector3();\n worldBoundingBox.getCenter(objectCenter);\n\n // Adjust the object's position so its center aligns with the current position\n const offset = alignmentDirection.clone().multiplyScalar(size / 2);\n object.position.copy(currentPosition.clone().add(offset).sub(objectCenter).add(object.position));\n\n // Update the position tracker for the next object\n currentPosition.add(alignmentDirection.clone().multiplyScalar(size + spacing));\n });\n}\n","import { Box3, BufferGeometry, Float32BufferAttribute, InstancedMesh, Matrix4, Object3D, Quaternion, Vector3 } from \"three\";\n\n//------------------------------\n// Object3D\n//------------------------------\n\n/**\n * Align an Object3D to a surface by adjusting its position.\n */\nexport function alignObjectToSurface(object: Object3D, targetPosition: Vector3, offset: Vector3 = new Vector3(0, 0, 0)): void {\n const boundingBox = new Box3().setFromObject(object);\n\n if (!boundingBox.isEmpty()) {\n const min = boundingBox.min;\n\n // Compute bottom center in world space\n const bottomCenter = new Vector3((min.x + boundingBox.max.x) / 2, min.y, (min.z + boundingBox.max.z) / 2);\n object.localToWorld(bottomCenter);\n\n // Calculate adjustment vector in world space\n const adjustment = targetPosition.clone().sub(bottomCenter).add(offset);\n\n // Transform adjustment to local space and apply\n const localAdjustment = object.worldToLocal(adjustment.clone());\n object.position.add(localAdjustment);\n } else {\n console.warn(\"The object has no geometry or is not visible.\");\n }\n}\n\n//------------------------------\n// Buffer Geometry\n//------------------------------\n\n/**\n * Align a BufferGeometry to a surface by adjusting its vertices.\n */\nexport function alignBufferGeometryToSurface(geometry: BufferGeometry, targetPositionY: number): void {\n const boundingBox = new Box3().setFromBufferAttribute(new Float32BufferAttribute(geometry.attributes.position.array, 3));\n\n if (!boundingBox.isEmpty()) {\n const minY = boundingBox.min.y;\n\n // Translate the geometry to align the bottom to the target position\n geometry.translate(0, targetPositionY - minY, 0);\n } else {\n console.warn(\"The geometry is empty or invalid.\");\n }\n}\n\n//------------------------------\n// Instanced Mesh\n//------------------------------\n\n/**\n * Align an InstancedMesh to a surface.\n */\nexport function alignInstancedMeshToSurface(\n instancedMesh: InstancedMesh,\n targetPosition: Vector3,\n offset: Vector3 = new Vector3(0, 0, 0),\n): void {\n // Compute the bounding box for the entire InstancedMesh\n const boundingBox = new Box3().setFromObject(instancedMesh);\n\n if (!boundingBox.isEmpty()) {\n // Find the bottom Y coordinate of the bounding box\n const minY = boundingBox.min.y;\n\n // Compute the adjustment needed to align the bottom of the InstancedMesh to the target position\n const adjustment = new Vector3(0, targetPosition.y - minY, 0).add(offset);\n\n // Transform adjustment to local space and apply to position\n const localAdjustment = instancedMesh.worldToLocal(adjustment.clone());\n instancedMesh.position.add(localAdjustment);\n } else {\n console.warn(\"The InstancedMesh has no geometry or is not visible.\");\n }\n}\n\n/**\n * Align a specific instance in an InstancedMesh to a surface.\n */\nexport function alignInstancedMeshIndexToSurface(\n instancedMesh: InstancedMesh,\n targetPosition: Vector3,\n instanceIndex: number,\n offset: Vector3 = new Vector3(0, 0, 0),\n): void {\n const boundingBox = new Box3().setFromObject(instancedMesh);\n\n if (!boundingBox.isEmpty()) {\n const minY = boundingBox.min.y;\n\n // Get the instance's current transformation matrix\n const matrix = new Matrix4();\n instancedMesh.getMatrixAt(instanceIndex, matrix);\n\n // Decompose the matrix to extract position, rotation, and scale\n const position = new Vector3();\n const quaternion = new Quaternion();\n const scale = new Vector3();\n matrix.decompose(position, quaternion, scale);\n\n // Transform targetPosition to the instanced mesh's local space\n const localTargetPosition = instancedMesh.worldToLocal(targetPosition.clone());\n\n // Adjust the position of the instance\n position.y = localTargetPosition.y - minY + offset.y;\n\n // Recompose the matrix and update the instance\n matrix.compose(position, quaternion, scale);\n instancedMesh.setMatrixAt(instanceIndex, matrix);\n\n // Mark the instance matrix as needing an update\n instancedMesh.instanceMatrix.needsUpdate = true;\n } else {\n console.warn(\"The instanced mesh has invalid geometry.\");\n }\n}\n","import { Box3, Mesh, Object3D, Vector3 } from \"three\";\n\n//------------------------------\n// Object3D\n//------------------------------\n\n/**\n * Centers an `Object3D` relative to a specified target position with an optional offset.\n *\n * This function calculates the bounding box center of the given `Object3D` and adjusts\n * its position so that it is centered at the specified target position, with an optional\n * offset applied. The centering respects the object's current transformation, including\n * its scale and rotation.\n */\nexport function centerObject<T extends Object3D>(object: T, target = new Vector3(0, 0, 0), offset = new Vector3(0, 0, 0)) {\n const box = new Box3().setFromObject(object);\n const center = box.getCenter(new Vector3());\n const totalOffset = new Vector3().addVectors(target, offset);\n const adjustment = new Vector3().subVectors(totalOffset, center);\n\n object.position.add(adjustment);\n}\n\n/**\n * Centers the geometry of an `Object3D` relative to a target position with an optional offset.\n *\n * This function calculates the bounding box center of the given `Object3D` and adjusts its\n * geometry's position by translating it such that the geometry is centered at the specified\n * target position, with an optional offset applied. Unlike modifying the `position` property,\n * this function directly translates the geometry within the object's local space.\n */\nexport function centerObjectGeometry<T extends Object3D>(\n object: T,\n target: Vector3 = new Vector3(0, 0, 0),\n offset: Vector3 = new Vector3(0, 0, 0),\n): void {\n const box = new Box3().setFromObject(object);\n const center = box.getCenter(new Vector3());\n const totalTarget = new Vector3().addVectors(target, offset);\n\n object.translateX(totalTarget.x - center.x);\n object.translateY(totalTarget.y - center.y);\n object.translateZ(totalTarget.z - center.z);\n object.updateMatrixWorld(true);\n}\n\n//------------------------------\n// Mesh\n//------------------------------\n\n/**\n * Centers the geometry of a `Mesh` relative to a target position with an optional offset.\n *\n * This function calculates the bounding box center of the `Mesh` geometry and adjusts its\n * position by translating the geometry such that it is centered at the specified target\n * position, with an optional offset applied. The function modifies the geometry directly,\n * leaving the `Mesh`'s transformation properties (`position`, `rotation`, `scale`) unchanged.\n */\nexport function centerMeshGeometry<T extends Mesh>(\n mesh: T,\n target: Vector3 = new Vector3(0, 0, 0),\n offset: Vector3 = new Vector3(0, 0, 0),\n): void {\n // Compute the bounding box for the geometry\n mesh.geometry.computeBoundingBox();\n const box = mesh.geometry.boundingBox;\n\n if (box) {\n const center = box.getCenter(new Vector3());\n const totalTarget = new Vector3().addVectors(target, offset);\n const translationOffset = new Vector3().subVectors(totalTarget, center);\n\n mesh.geometry.translate(translationOffset.x, translationOffset.y, translationOffset.z);\n }\n}\n\nexport const Center = {\n object: centerObject,\n objectGeometry: centerObjectGeometry,\n meshGeometry: centerMeshGeometry,\n};\n","//------------------------------\n// Hex\n//------------------------------\n\n/**\n * Convert hex color code color string to RGB array\n */\nexport function parseHexCode(hex: string): [number, number, number] {\n const bigint = parseInt(hex.slice(1), 16);\n return [\n (bigint >> 16) & 255, // r\n (bigint >> 8) & 255, // g\n bigint & 255, // b\n ];\n}\n\nexport function hexToHsl(hex: number): [number, number, number] {\n const [r, g, b] = hexToRgb(hex);\n return rgbToHsl(r, g, b);\n}\n\n/**\n * Convert hexadecimal literal numeric color value to RGB array\n * @param hex\n */\nexport function hexToRgb(hex: number): [number, number, number] {\n const r = (hex >> 16) & 0xff;\n const g = (hex >> 8) & 0xff;\n const b = hex & 0xff;\n\n return [r, g, b];\n}\n\n//------------------------------\n// HSL\n//------------------------------\n\n/**\n * Example usage:\n * ```\n * const h = 200; // Hue\n * const s = 75; // Saturation\n * const l = 50; // Lightness\n *\n * const [ r, g, b ] = hslToHex(h, s, l);\n * ```\n */\nexport function hslToHex(h: number, s: number, l: number): [number, number, number] {\n s /= 100;\n l /= 100;\n\n function hueToRgb(p: number, q: number, t: number): number {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1 / 6) return p + (q - p) * 6 * t;\n if (t < 1 / 2) return q;\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n }\n\n let r: number, g: number, b: number;\n\n if (s === 0) {\n r = g = b = l; // Achromatic (grey)\n } else {\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n r = hueToRgb(p, q, h / 360 + 1 / 3);\n g = hueToRgb(p, q, h / 360);\n b = hueToRgb(p, q, h / 360 - 1 / 3);\n }\n\n // Convert RGB to hex\n const toHexValue = (x: number): number => Math.round(x * 255);\n\n return [\n toHexValue(r),\n toHexValue(g),\n toHexValue(b),\n ];\n}\n\nexport function hslToRgb(h: number, s: number, l: number): [number, number, number] {\n s /= 100;\n l /= 100;\n const k = (n: number) => (n + h / 30) % 12;\n const a = s * Math.min(l, 1 - l);\n const f = (n: number) => l - a * Math.max(-1, Math.min(k(n) - 3, Math.min(9 - k(n), 1)));\n\n return [f(0) * 255, f(8) * 255, f(4) * 255];\n}\n\n//------------------------------\n// RGB\n//------------------------------\n\nexport function normalizeRgb(r: number, g: number, b: number): [number, number, number] {\n return [r / 255, g / 255, b / 255];\n}\n\nexport function rgbToHex(r: number, g: number, b: number): number {\n r = Math.round(r);\n g = Math.round(g);\n b = Math.round(b);\n\n return (r << 16) + (g << 8) + b;\n}\n\n/**\n * Converts an RGB color to HSL.\n *\n * Example usage:\n * ```\n * const rgbColor = { r: 255, g: 0, b: 0 }; // Red\n * const hslColor = rgbToHsl(rgbColor.r, rgbColor.g, rgbColor.b);\n * console.log(hslColor); // Output: { h: 0, s: 100, l: 50 }\n * ```\n */\nexport function rgbToHsl(r: number, g: number, b: number): [number, number, number] {\n // Normalize r, g, b values to the range 0–1\n r /= 255;\n g /= 255;\n b /= 255;\n\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const delta = max - min;\n\n let h = 0;\n let s = 0;\n const l = (max + min) / 2;\n\n // Calculate hue\n if (delta !== 0) {\n if (max === r) {\n h = ((g - b) / delta + (g < b ? 6 : 0)) * 60;\n } else if (max === g) {\n h = ((b - r) / delta + 2) * 60;\n } else if (max === b) {\n h = ((r - g) / delta + 4) * 60;\n }\n }\n\n // Calculate saturation\n if (delta !== 0) {\n s = delta / (1 - Math.abs(2 * l - 1));\n }\n\n // Convert h and s to percentages\n h = Math.round(h);\n s = Math.round(s * 100);\n const lPercent = Math.round(l * 100);\n\n return [ h, s, lPercent ];\n}\n\n//------------------------------\n// Distance functions\n//------------------------------\n\n/**\n * Calculate the Euclidean distance between two colors in RGB space\n * distance = sqrt((r1 - r2)^2 + (g1 - g2)^2 + (b1 - b2)^2)\n */\nexport function calculateDistance(color1: [number, number, number], color2: [number, number, number]): number {\n return Math.sqrt(\n Math.pow(color1[0] - color2[0], 2) +\n Math.pow(color1[1] - color2[1], 2) +\n Math.pow(color1[2] - color2[2], 2),\n );\n}\n\n/**\n * Calculate the sum of absolute differences for each channel\n * difference = |r1 - r2| + |g1 - g2| + |b1 - b2|\n */\nexport function calculateChannelDifference(color1: [number, number, number], color2: [number, number, number]): number {\n return (\n Math.abs(color1[0] - color2[0]) + //\n Math.abs(color1[1] - color2[1]) +\n Math.abs(color1[2] - color2[2])\n );\n}\n\nexport function findClosestColor(inputColor: number, dataset: number[]): number | null {\n const inputRgb = hexToRgb(inputColor);\n let closestColor = null;\n let smallestDistance = Infinity;\n\n for (const entry of dataset) {\n const colorRgb = hexToRgb(entry);\n const distance = calculateDistance(inputRgb, colorRgb);\n\n if (distance < smallestDistance) {\n smallestDistance = distance;\n closestColor = entry;\n }\n }\n\n return closestColor;\n}\n\nexport function findClosestColorChannelWise(inputColor: number, dataset: number[]): number | null {\n const inputRgb = hexToRgb(inputColor);\n let closestColor = null;\n let smallestDifference = Infinity;\n\n for (const entry of dataset) {\n const colorRgb = hexToRgb(entry);\n const difference = calculateChannelDifference(inputRgb, colorRgb);\n\n if (difference < smallestDifference) {\n smallestDifference = difference;\n closestColor = entry;\n }\n }\n\n return closestColor;\n}\n\n//------------------------------\n// Palette generation\n//------------------------------\n\n/**\n * Example usage:\n * ```\n * const baseHue = Math.floor(Math.random() * 360);\n * const color1 = getAnalogousColors(baseHue);\n * const color2 = getAnalogousColors(baseHue);\n * ```\n */\nexport function getAnalogousColors(baseHue: number): [number, number, number] {\n const h = (baseHue + Math.floor(-30 + Math.random() * 61)) % 360; // ±30 degrees from baseHue\n const s = Math.floor(60 + Math.random() * 21); // Saturation: 60 - 80\n const l = Math.floor(50 + Math.random() * 21); // Lightness: 50 - 70\n return hslToRgb(h, s, l);\n}\n","import { Mesh, Vector3 } from \"three\";\n\n/**\n * Get the closest point on a mesh to a specified point.\n *\n * Example usage:\n * ```ts\n * const point = new Vector3(5, 2, 1); // The point to check against the mesh\n * const closestPoint = getClosestPointOnMesh(point, targetMesh);\n * ```\n */\nexport function findClosestPoint(point: Vector3, mesh: Mesh) {\n if (!mesh.geometry.isBufferGeometry) {\n throw new Error(\"Mesh must have a BufferGeometry.\");\n }\n\n const geometry = mesh.geometry;\n const positionAttribute = geometry.getAttribute(\"position\");\n const closestPoint = new Vector3();\n const tempPoint = new Vector3();\n let minDistance = Infinity;\n\n for (let i = 0; i < positionAttribute.count; i++) {\n tempPoint.fromBufferAttribute(positionAttribute, i);\n const distance = tempPoint.distanceTo(point);\n\n if (distance < minDistance) {\n minDistance = distance;\n closestPoint.copy(tempPoint);\n }\n }\n\n // Transform the closest point to world space (if the mesh is transformed)\n mesh.localToWorld(closestPoint);\n\n return closestPoint;\n}\n","import { Vector2 } from \"three\";\n\n/**\n * Normalizes a time value `t` between a minimum and maximum value.\n * @param t - The value to normalize.\n * @param min - The minimum value of the range.\n * @param max - The maximum value of the range.\n * @returns A normalized value between 0 and 1.\n */\nfunction normalizeT(t: number, min: number, max: number): number {\n return Math.max(0, Math.min(1, (t - min) / (max - min)));\n}\n\n/**\n * Generates an array of interpolated 2D points using an easing function.\n * @param curveFunction - The easing function to apply to the normalized value.\n * @param startRadius - The starting radius for interpolation.\n * @param endRadius - The ending radius for interpolation.\n * @param startHeight - The starting height for interpolation.\n * @param endHeight - The ending height for interpolation.\n * @param segments - The number of segments for interpolation (default is 20).\n * @param min - The minimum value of the normalization range (default is 0).\n * @param max - The maximum value of the normalization range (default is 1).\n * @returns An array of `Vector2` points representing the interpolated curve.\n */\nexport function interpolateCurve(\n curveFunction: (t: number) => number,\n startRadius: number,\n endRadius: number,\n startHeight: number,\n endHeight: number,\n segments: number = 20,\n min: number = 0,\n max: number = 1\n): Vector2[] {\n const points: Vector2[] = [];\n\n for (let i = 0; i <= segments; i++) {\n const t = i / segments; // Normalized value between 0 and 1\n const easedT = curveFunction(normalizeT(t, min, max));\n const x = startRadius + easedT * (endRadius - startRadius);\n const y = startHeight + t * (endHeight - startHeight);\n points.push(new Vector2(x, y));\n }\n\n return points;\n}\n","import { ParametricCurve } from \"../constants/ParametricCurve\";\nimport { Vector2 } from \"three\";\n\n/**\n * Function to create cubic Bezier curve points\n *\n * Example:\n * ```\n * const points = [\n * ...ParametricCurveUtils.createCubicCurvePoints(\n * new THREE.Vector2(0.5, 2), // Start of the cubic curve\n * new THREE.Vector2(1.5, 3), // First control point (outward curve)\n * new THREE.Vector2(1.5, 4), // Second control point (outward curve)\n * new THREE.Vector2(0.5, 5), // End of the curve\n * 24, // Resolution of the quadratic curve\n * ),\n * ]\n * ```\n */\nexport const createCubicCurvePoints = (start: Vector2, control1: Vector2, control2: Vector2, end: Vector2, segments = 24) => {\n let curvePoints = [];\n for (let i = 0; i <= segments; i++) {\n const t = i / segments;\n const x = ParametricCurve.CUBIC(t, start.x, control1.x, control2.x, end.x);\n const y = ParametricCurve.CUBIC(t, start.y, control1.y, control2.y, end.y);\n curvePoints.push(new Vector2(x, y));\n }\n return curvePoints;\n};\n\n/**\n * Function to create damped curve points\n *\n * Example:\n * ```\n * const points = [\n * ...ParametricCurveUtils.createDampedCurvePoints(\n * new THREE.Vector2(0.5, 2), // Start of the damped curve\n * new THREE.Vector2(1.5, 5), // End of the damped curve\n * 5, // Damping factor\n * 24, // Resolution of the damped curve\n * ),\n * ]\n * ```\n */\nexport const createDampedCurvePoints = (start: Vector2, end: Vector2, damping: number, segments = 24) => {\n let curvePoints = [];\n for (let i = 0; i <= segments; i++) {\n const t = i / segments;\n const x = ParametricCurve.DAMPED(t, damping) * (end.x - start.x) + start.x;\n const y = start.y + t * (end.y - start.y);\n curvePoints.push(new Vector2(x, y));\n }\n return curvePoints;\n};\n\n/**\n * Function to create exponential curve points\n *\n * Example:\n * ```\n * const points = [\n * ...ParametricCurveUtils.createExponentialCurvePoints(\n * new THREE.Vector2(0.5, 2), // Start of the exponential curve\n * new THREE.Vector2(1.5, 5), // End of the exponential curve\n * 0.5, // Base of the exponential function\n * 2, // Exponential factor\n * 24 // Resolution of the exponential curve\n * ),\n * ]\n * ```\n */\nexport const createExponentialCurvePoints = (start: Vector2, end: Vector2, base: number, factor: number, segments = 24) => {\n let curvePoints = [];\n for (let i = 0; i <= segments; i++) {\n const t = i / segments;\n const x = ParametricCurve.EXPONENTIAL(t, base, factor) * (end.x - start.x) + start.x;\n const y = start.y + t * (end.y - start.y);\n curvePoints.push(new Vector2(x, y));\n }\n return curvePoints;\n};\n\n/**\n * Function to create logarithmic curve points\n *\n * Example:\n * ```\n * const points = [\n * ...ParametricCurveUtils.createLogarithmicCurvePoints(\n * new THREE.Vector2(0.5, 2), // Start of the logarithmic curve\n * new THREE.Vector2(1.5, 5), // End of the logarithmic curve\n * 0.5, // Base of the logarithmic function\n * 10, // Logarithmic factor\n * 24, // Resolution of the logarithmic curve\n * ),\n * ]\n * ```\n */\nexport const createLogarithmicCurvePoints = (start: Vector2, end: Vector2, base: number, factor: number, segments = 24) => {\n let curvePoints = [];\n for (let i = 0; i <= segments; i++) {\n const t = i / segments;\n const x = ParametricCurve.LOGARITHMIC(t, base, factor) * (end.x - start.x) + start.x;\n const y = start.y + t * (end.y - start.y);\n curvePoints.push(new Vector2(x, y));\n }\n return curvePoints;\n};\n\n/**\n * Function to create parabolic curve points\n *\n * Example:\n * ```\n * const points = [\n * ...ParametricCurveUtils.createParabolicCurvePoints(\n * new THREE.Vector2(0.5, 2), // Start point\n * new THREE.Vector2(0.5, 5), // End point\n * 1, // Coefficient for t^2 (controls curvature)\n * 0, // Coefficient for t (linear component)\n * 0, // Constant term (vertical offset)\n * 24, // Resolution\n * ),\n * ]\n * ```\n */\nexport const createParabolicCurvePoints = (start: Vector2, end: Vector2, a: number, b: number, c: number, segments = 24) => {\n let curvePoints = [];\n for (let i = 0; i <= segments; i++) {\n const t = i / segments;\n const x = a * t * t + b * t + c + start.x;\n const y = start.y + t * (end.y - start.y);\n curvePoints.push(new Vector2(x, y));\n }\n return curvePoints;\n};\n\n/**\n * Function to create quadratic Bezier curve points\n *\n * Example:\n * ```\n * const points = [\n * ...ParametricCurveUtils.createQuadraticCurvePoints(\n * new THREE.Vector2(0.5, 2), // Start of the quadratic curve\n * new THREE.Vector2(1.5, 5), // Control point (outward curve)\n * new THREE.Vector2(0.5, 5), // End of the curve\n * 24, // Resolution of the quadratic curve\n * ),\n * ]\n * ```\n */\nexport const createQuadraticCurvePoints = (start: Vector2, control: Vector2, end: Vector2, segments = 24) => {\n let curvePoints = [];\n for (let i = 0; i <= segments; i++) {\n const t = i / segments;\n const x = ParametricCurve.QUADRATIC(t, start.x, control.x, end.x);\n const y = ParametricCurve.QUADRATIC(t, start.y, control.y, end.y);\n curvePoints.push(new Vector2(x, y));\n }\n return curvePoints;\n};\n\n/**\n * Function to create sigmoid curve points\n *\n * Example:\n * ```\n * const points = [\n * ...ParametricCurveUtils.createSigmoidCurvePoints(\n * new THREE.Vector2(0.5, 2), // Start of the sigmoid curve\n * new THREE.Vector2(1.5, 5), // End of the sigmoid curve\n * 20, // Sigmoid steepness factor\n * 24, // Resolution of the sigmoid curve\n * ),\n * ]\n */\nexport const createSigmoidCurvePoints = (start: Vector2, end: Vector2, a: number, segments = 24) => {\n let curvePoints = [];\n for (let i = 0; i <= segments; i++) {\n const t = i / segments;\n const x = ParametricCurve.SIGMOID(t, a) * (end.x - start.x) + start.x;\n const y = start.y + t * (end.y - start.y);\n curvePoints.push(new Vector2(x, y));\n }\n return curvePoints;\n};\n\nexport const ParametricCurveUtils = {\n createCubicCurvePoints,\n createDampedCurvePoints,\n createExponentialCurvePoints,\n createLogarithmicCurvePoints,\n createParabolicCurvePoints,\n createQuadraticCurvePoints,\n createSigmoidCurvePoints,\n};\n","/**\n * Generates vertices for two triangles based upon a quad.\n *\n * Example usages:\n *\n * Create a face of a box:\n * ```\n * const frontQuad = createQuad(\n * [-1, -1, 1], // Bottom-left\n * [ 1, -1, 1], // Bottom-right\n * [-1, 1, 1], // Top-left\n * [ 1, 1, 1], // Top-right\n * [ 0, 0, 1] // Normal (facing forward)\n * );\n * ```\n *\n * Assembling a box:\n * ```\n * const vertices = [\n * ...createQuad([-1, -1, 1], [1, -1, 1], [-1, 1, 1], [1, 1, 1], [0, 0, 1]), // Front face\n * ...createQuad([1, -1, -1], [-1, -1, -1], [1, 1, -1], [-1, 1, -1], [0, 0, -1]), // Back face\n * ...createQuad([-1, 1, 1], [1, 1, 1], [-1, 1, -1], [1, 1, -1], [0, 1, 0]), // Top face\n * ...createQuad([-1, -1, -1], [1, -1, -1], [-1, -1, 1], [1, -1, 1], [0, -1, 0]), // Bottom face\n * ...createQuad([-1, -1, -1], [-1, -1, 1], [-1, 1, -1], [-1, 1, 1], [-1, 0, 0]), // Left face\n * ...createQuad([1, -1, 1], [1, -1, -1], [1, 1, 1], [1, 1, -1], [1, 0, 0]), // Right face\n * ];\n * ```\n *\n * Generating Buffer Geometry:\n * ```\n * const positions = [];\n * const normals = [];\n * const uvs = [];\n *\n * for (const vertex of vertices) {\n * positions.push(...vertex.pos);\n * normals.push(...vertex.norm);\n * uvs.push(...vertex.uv);\n * }\n *\n * const geometry = new THREE.BufferGeometry();\n * geometry.setAttribute('position', new THREE.BufferAttribute(new Float32Array(positions), 3));\n * geometry.setAttribute('normal', new THREE.BufferAttribute(new Float32Array(normals), 3));\n * geometry.setAttribute('uv', new THREE.BufferAttribute(new Float32Array(uvs), 2));\n * ```\n */\nexport function createQuad(\n p1: [number, number, number], //\n p2: [number, number, number],\n p3: [number, number, number],\n p4: [number, number, number],\n normal?: [number, number, number],\n uv1: [number, number] = [0, 0],\n uv2: [number, number] = [1, 0],\n uv3: [number, number] = [0, 1],\n uv4: [number, number] = [1, 1],\n) {\n const normalVector = normal || calculateNormal(p1, p2, p3);\n\n return [\n // Triangle 1\n { pos: p1, norm: normalVector, uv: uv1 },\n { pos: p2, norm: normalVector, uv: uv2 },\n { pos: p4, norm: normalVector, uv: uv4 },\n // Triangle 2\n { pos: p1, norm: normalVector, uv: uv1 },\n { pos: p4, norm: normalVector, uv: uv4 },\n { pos: p3, norm: normalVector, uv: uv3 },\n ];\n}\n\n/**\n * Compute normal based on the quad’s vertices (using the cross product of two edges).\n */\nexport function calculateNormal(\n p1: [number, number, number],\n p2: [number, number, number],\n p3: [number, number, number],\n): [number, number, number] {\n // Edge vectors\n const u: [number, number, number] = [\n p2[0] - p1[0],\n p2[1] - p1[1],\n p2[2] - p1[2],\n ];\n const v: [number, number, number] = [\n p3[0] - p1[0],\n p3[1] - p1[1],\n p3[2] - p1[2],\n ];\n\n // Cross product to calculate normal\n const normal: [number, number, number] = [\n u[1] * v[2] - u[2] * v[1],\n u[2] * v[0] - u[0] * v[2],\n u[0] * v[1] - u[1] * v[0],\n ];\n\n // Normalize the normal vector\n const length = Math.sqrt(normal[0] ** 2 + normal[1] ** 2 + normal[2] ** 2);\n return normal.map((val) => val / length) as [number, number, number];\n}\n","/**\n * Planar UV Mapping\n * Projects UVs onto the geometry from a single direction (like shining a projector onto a surface).\n *\n * Example:\n * ```\n * const vertices = [\n * [-1, -1, 1],\n * [1, -1, 1],\n * [-1, 1, 1],\n * [1, 1, 1],\n * ];\n *\n * const uvs = planarUVMapping(vertices, 'z'); // Project onto the Z-axis\n */\nexport function planarUVMapping(vertices: [number, number, number][], axis: 'x' | 'y' | 'z'): [number, number][] {\n return vertices.map(([x, y, z]) => {\n switch (axis) {\n case 'x': return [y, z]; // Use Y and Z for X-axis projection\n case 'y': return [x, z]; // Use X and Z for Y-axis projection\n case 'z': return [x, y]; // Use X and Y for Z-axis projection\n default: throw new Error(`Invalid axis: ${axis}`);\n }\n });\n}\n\n/**\n * Cubic UV Mapping\n * Applies a texture by projecting UVs along each face of a cube.\n *\n * Example usage:\n * ```\n * const cubeVertices = [\n * [-1, -1, 1],\n * [1, -1, 1],\n * [-1, 1, 1],\n * [1, 1, 1],\n * ];\n *\n * const cubeUVs = cubicUVMappingBatch(cubeVertices);\n * ```\n */\nexport function cubicUVMapping(vertex: [number, number, number]): [number, number] {\n const [x, y, z] = vertex;\n const absX = Math.abs(x), absY = Math.abs(y), absZ = Math.abs(z);\n\n if (absX >= absY && absX >= absZ) { // X face\n return [z > 0 ? z : -z, y];\n } else if (absY >= absX && absY >= absZ) { // Y face\n return [x, z > 0 ? z : -z];\n } else { // Z face\n return [x, y];\n }\n}\n\nexport function cubicUVMappingBatch(vertices: [number, number, number][]): [number, number][] {\n return vertices.map((vertex) => cubicUVMapping(vertex));\n}\n\n/**\n * Spherical UV Mapping\n * Wraps UVs around the geometry as if the texture were projected from a globe.\n *\n * Example usage:\n * ```\n * const sphereVertices = [\n * [1, 0, 0],\n * [0, 1, 0],\n * [0, 0, 1],\n * ];\n *\n * const sphereUVs = sphericalUVMapping(sphereVertices);\n * ```\n */\nexport function sphericalUVMapping(vertices: [number, number, number][]): [number, number][] {\n return vertices.map(([x, y, z]) => {\n const theta = Math.atan2(z, x); // Angle around the Y-axis\n const phi = Math.acos(y / Math.sqrt(x ** 2 + y ** 2 + z ** 2)); // Angle from the Y-axis\n const u = (theta / (2 * Math.PI)) + 0.5; // Map theta to [0, 1]\n const v = 1 - (phi / Math.PI); // Map phi to [0, 1]\n return [u, v];\n });\n}\n\n/**\n * Cylindrical UV Mapping\n * Projects UV coordinates onto the surface as though the texture is\n * wrapped around the cylinder's height and circumference.\n *\n * Example usage:\n * ```\n * const cylinderVertices = [\n * [1, 0, 0], // Vertex on the \"equator\"\n * [0, 1, 0], // Vertex on the top\n * [0, -1, 1], // Vertex on the bottom\n * [-1, 0, 0], // Opposite side of the equator\n * ];\n *\n * const cylinderUVs = cylindricalUVMapping(cylinderVertices);\n * ```\n */\nexport function cylindricalUVMapping(vertices: [number, number, number][]): [number, number][] {\n return vertices.map(([x, y, z]) => {\n const theta = Math.atan2(z, x); // Angle around the Y-axis (circumference)\n const u = (theta / (2 * Math.PI)) + 0.5; // Map theta to [0, 1]\n const v = y; // Use Y-axis as the vertical component (height)\n return [u, v];\n });\n}\n\n/**\n * Polar UV Mapping\n * Map textures onto circular or radial geometries, such as discs or dome-like structures.\n * Maps the radial distance from the center of the geometry to the v coordinate\n * and the angular position to the u coordinate.\n *\n * const discVertices = [\n * [1, 0, 0], // Vertex at (1, 0, 0)\n * [0, 0, 1], // Vertex at (0, 0, 1)\n * [-1, 0, 0], // Vertex at (-1, 0, 0)\n * [0, 0, -1], // Vertex at (0, 0, -1)\n * ];\n *\n * const polarUVs = polarUVMapping(discVertices);\n */\nexport function polarUVMapping(vertices: [number, number, number][]): [number, number][] {\n return vertices.map(([x, y, z]) => {\n const radius = Math.sqrt(x ** 2 + z ** 2); // Distance from the Y-axis (polar radius)\n const theta = Math.atan2(z, x); // Angle around the Y-axis (polar angle)\n\n const u = (theta / (2 * Math.PI)) + 0.5; // Map angle to [0, 1]\n const v = radius; // Use radial distance for v\n return [u, v];\n });\n}\n\n/**\n * Generic Normalization Function\n * This function will normalize 2D UV coordinates based on given bounds.\n *\n * Full pipeline:\n * - Compute UVs\n * - Calculate bounds\n * - Normalize UVs\n *\n * Example usage:\n * ```\n * const planarMapping = (vertex: [number, number, number]) => [vertex[0], vertex[1]];\n * const uvs = vertices.map(mappingFunction);\n * const { minBounds, maxBounds } = calculateUVBounds(uvs);\n * const normalizedUVs = normalizeUVBatch(uvs, minBounds, maxBounds);\n * ```\n */\nexport function normalizeUV(\n uv: [number, number],\n minU: number,\n maxU: number,\n minV: number,\n maxV: number\n): [number, number] {\n return [\n (uv[0] - minU) / (maxU - minU),\n (uv[1] - minV) / (maxV - minV),\n ];\n}\n\n/**\n * Batch Normalization for Multiple UVs\n * If you have multiple UVs, normalize them all based on the overall min/max bounds.\n */\nexport function normalizeUVBatch(\n uvs: [number, number][],\n minBounds: [number, number],\n maxBounds: [number, number]\n): [number, number][] {\n const [minU, minV] = minBounds;\n const [maxU, maxV] = maxBounds;\n\n return uvs.map((uv) => normalizeUV(uv, minU, maxU, minV, maxV));\n}\n\n/**\n * Finding Bounds for a List of UVs\n * calculate the min and max values dynamically.\n */\nexport function calculateUVBounds(uvs: [number, number][]): { minBounds: [number, number]; maxBounds: [number, number] } {\n const minU = Math.min(...uvs.map((uv) => uv[0]));\n const maxU = Math.max(...uvs.map((uv) => uv[0]));\n const minV = Math.min(...uvs.map((uv) => uv[1]));\n const maxV = Math.max(...uvs.map((uv) => uv[1]));\n\n return {\n minBounds: [minU, minV],\n maxBounds: [maxU, maxV],\n };\n}\n"],"names":["cameraDollyAnimation","camera","distance","duration","onComplete","startPos","endPos","Vector3","startTime","animate","time","progress","cameraFlythroughAnimation","waypoints","totalSegments","totalProgress","segmentProgress","segmentIndex","segmentFraction","start","end","cameraOrbitAnimation","target","radius","angle","x","z","cameraPendulumAnimation","center","oscillations","oscillationCount","elapsed","oscillationDuration","cameraSpiralAscensionAnimation","height","revolutions","y","cameraWobbleAnimation","intensity","originalPosition","offset","cameraZoomInAnimation","startFov","endFov","initialFov","MathUtils","EmissivePulseAnimation","options","__publicField","speed","maxIntensity","minIntensity","elapsedTime","randomFloat","min","max","randomInteger","logarithmicRandomMax","exponent","logarithmicRandomMin","LightFlickerAnimation","light","jitterX","jitterY","jitterZ","setRandomTimeout","callback","minDelay","maxDelay","delay","setRandomInterval","timeoutId","scheduleNext","LightningAnimation","minDuration","maxDuration","Direction","Falloff","t","displacementBrush","geometry","position","strength","direction","falloffFn","positions","i","vertex","influence","flattenBrush","targetHeight","projectedHeight","delta","noiseBrush","falloff","noiseStrength","noise","smoothBrush","tempPosition","averagePosition","count","j","spikeBrush","inward","twistBrush","quaternion","Quaternion","Axis","BoxSide","ColorPalette","sineEaseIn","sineEaseOut","sineEaseInOut","quadraticEaseIn","quadraticEaseOut","quadraticEaseInOut","cubicEaseIn","cubicEaseOut","cubicEaseInOut","quarticEaseIn","quarticEaseOut","quarticEaseInOut","quinticEaseIn","quinticEaseOut","quinticEaseInOut","exponentialEaseIn","exponentialEaseOut","exponentialEaseInOut","circularEaseIn","circularEaseOut","circularEaseInOut","linear","smoothstep","concave","convex","logarithmic","squareRoot","inverse","gaussian","Easing","cubicCurve","p0","p1","p2","p3","clampedT","oneMinusT","dampedCurve","damping","clampedDamping","exponentialCurve","base","factor","logarithmicCurve","parabolicCurve","a","b","c","quadraticCurve","sigmoidCurve","ParametricCurve","BubblingEffect","InstancedMesh","width","depth","SphereGeometry","material","MeshStandardMaterial","index","matrix","Matrix4","EllipticLeafGeometry","BufferGeometry","size","vertices","indices","leafPoints","positionAttribute","Float32BufferAttribute","LeafEffect","DoubleSide","rotationX","rotationY","rotationZ","Euler","velocity","mergeBufferGeometries","geometries","useGroups","isIndexed","attributesUsed","morphAttributesUsed","attributes","morphAttributes","morphTargetsRelative","mergedGeometry","geom","attributesCount","name","indexOffset","mergedIndex","mergedAttribute","mergeBufferAttributes","numMorphTargets","morphAttributesToMerge","mergedMorphAttribute","TypedArray","itemSize","normalized","arrayLength","attr","array","BufferAttribute","mergeVertices","tolerance","hashToIndex","vertexCount","nextIndex","attributeNames","attrArrays","morphAttrsArrays","newIndices","getters","l","morphAttr","decimalShift","shiftMultiplier","hash","attribute","k","newarray","newMorphArrays","getterFunc","m","ml","result","oldAttribute","buffer","oldMorphAttribute","buffer2","morphAttribute","ParametricGeometry","func","u","v","slices","stacks","normals","uvs","EPS","normal","pu","pv","sliceCount","d","BookGeometry","coverThickness","pageIndent","w","h","u1","u2","normalArray","uvArray","indexArray","coverGeometry","pagesGeometry","BoxGeometry","randomScale","scaleXMin","scaleXMax","scaleYMin","scaleYMax","scaleZMin","scaleZMax","rowOfBooksByScales","coverMaterial","pagesMaterial","scales","row","currentZ","scale","scaleMatrix","rowOfBooksByCount","rowOfBooksByLength","length","remainingZ","createHexagonalTile","gap","tileMaterial","spacingX","spacingZ","hexTileCountX","hexTileCountZ","hexTileCount","hexShape","Shape","ExtrudeGeometry","instancedMesh","dummy","Object3D","offsetX","offsetZ","positionX","positionZ","BifurcatedStaircaseGeometry","stepWidth","stepHeight","stepDepth","numStepsCentral","numStepsBranch","branchAngle","yBottom","yTop","zFront","zBack","baseIndex","landingY","landingZ","landingWidth","landingBaseIndex","xStart","zStart","xOffset","zOffset","xFrontLeft","xFrontRight","xBackLeft","xBackRight","DioramaGeometry","wallThickness","LShapedStaircaseGeometry","numStepsPerFlight","landingDepth","xFront","xBack","SpiralStaircaseGeometry","numSteps","angleIncrement","currentAngle","xCenter","zCenter","StaircaseGeometry","stepBottomY","stepTopY","stepFrontZ","stepBackZ","JarGeometry","points","Vector2","bodyGeometry","LatheGeometry","corkGeometry","CylinderGeometry","calculateXFromSlopeIntercept","x1","y1","x2","y2","calculateYFromSlopeIntercept","LineEquations","PotionBottleGeometry","bottleGeometry","liquidPoints","liquidGeometry","WineBottleGeometry","neckRadius","neckHeight","segments","bodyHeight","shoulderHeight","shoulderGeometry","neckGeometry","CrossHeadstoneGeometry","verticalHeight","verticalGeometry","horizontalWidth","horizontalGeometry","MausoleumGeometry","baseGeometry","buildingGeometry","pillarPositions","pillars","pillar","roofGeometry","ConeGeometry","archShape","extrudeSettings","archGeometry","ObeliskHeadstoneGeometry","totalHeight","baseWidth","baseHeight","lowerSegmentHeight","middleSegmentHeight","topSegmentHeight","currentHeight","lowerSegmentGeometry","middleSegmentGeometry","topSegmentGeometry","pyramidGeometry","RoundedHeadstoneGeometry","topGeometry","SquareHeadstoneGeometry","slabGeometry","StoneFencePostGeometry","columnGeometry","capGeometry","WroughtIronBarGeometry","barHeight","barRadius","spikeHeight","spikeRadius","spikeScaleZ","radialSegments","barGeometry","spikeGeometry","WroughtIronFenceGeometry","spacing","railHeight","railDepth","railOffset","bar","rail","topRail","bottomRail","BookshelfGeometry","shelves","frameThickness","open","frameHeight","frameWidth","frameDepth","sidePanelGeometry","shelfGeometry","leftPanel","rightPanel","topPanel","bottomPanel","backPanel","shelfPanels","shelfSpacing","shelfPanel","DeskGeometry","surfaceGeometry","legLatheGeometry","legGeometry","leg","FlameGeometry","segmentsU","segmentsV","theta","radialFactor","CandleGeometry","radiusTop","radiusBottom","flameHeight","flameRadius","stickGeometry","flameGeometry","ParallelogramBoxGeometry","s","MossyRocksGeometry","rocks","mosses","scaleX","scaleY","scaleZ","positionY","rock","DodecahedronGeometry","moss","randomTransformVertices","axis","minScale","maxScale","displacement","RockGeometry","widthSegments","heightSegments","sphere","RocksGeometry","BoneGeometry","cylinderGeometry","sphereGeometry","topSphere1","topSphere2","bottomSphere1","bottomSphere2","ErlenmeyerFlaskGeometry","flaskRadius","flaskGeometry","radiusFromCapHeight","thetaLength","radiusFromCapWidth","capHeightFromRadius","capWidthFromRadius","thetaLengthForRadius","sphereRadius","holeRadius","holeDiameter","sphericalToCartesian","phi","cartesianToSpherical","appendSphericalCurve","sphereRadiusX","sphereRadiusY","sphereStartY","holeTopRadius","holeBottomRadius","thetaTop","thetaBottom","spherePoints","FlorenceFlaskGeometry","latheGeometry","MortarGeometry","mortarPoints","mortarGeometry","baseDisk","CircleGeometry","StandGeometry","thickness","ringGeometry","TorusGeometry","legs","TeslaCoilGeometry","coilGeometry","coilTopGeometry","TestTubeGeometry","openEnded","tubeGeometry","bottomGeometry","HillGeometry","phiStart","phiLength","MoundGeometry","TreeGeometry","trunkRadiusTop","trunkRadiusBottom","trunkHeight","trunkSegments","leafSize","leafCount","leafDetail","leafSpreadRadius","trunk","leafs","leaf","Diorama","Mesh","interiorColor","floorColor","exteriorColor","moonShader","Moon","ShaderMaterial","Book","coverColor","pageColor","Jar","PotionBottle","WineBottle","MeshPhysicalMaterial","CrossHeadstone","Mausoleum","ObeliskHeadstone","RoundedHeadstone","SquareHeadstone","StoneFencePost","WroughtIronBar","WroughtIronFence","Bookshelf","Desk","Candle","Flame","Lantern","Group","baseMaterial","baseMesh","bodyMaterial","bodyMesh","roofMaterial","roofMesh","handleGeometry","handleMaterial","handleMesh","PointLight","MossyRocks","Rock","Rocks","BunsenBurner","tubeMaterial","tube","flameMaterial","flame","ElectricPanel","panelGeometry","panelMaterial","switchGeometry","switchMaterial","dialGeometry","dialMaterial","panel","toggleSwitch","dial","lightGeometry","lightMaterial","flickerSpeed","flickerMaxIntensity","flickerMinIntensity","flickerIntensity","ErlenmeyerFlask","FlorenceFlask","LeverPanel","leverPanelGeometry","leverPanelMaterial","leverPanel","leverBaseGeometry","leverHandleGeometry","leverMaterial","leverBase","leverHandle","Microscope","armGeometry","arm","eyepieceGeometry","eyepieceMaterial","eyepiece","stageGeometry","stageMaterial","stage","MortarAndPestle","pestleGeometry","mortarMaterial","pestleMaterial","mortar","pestle","Panel","PanelLight","color","emissive","emissiveIntensity","SpiralTube","spiralLength","heightIncrement","curve","CatmullRomCurve3","_","TubeGeometry","glassMaterial","multiSpiralTube","animateFluid","Stand","TeslaCoil","TestTube","TestTubeRack","colors","rackGeometry","rackMaterial","rack","testTubeGeometry","testTube","xPosition","liquidColor","liquidMaterial","liquid","BurstShape","sides","innerRadius","outerRadius","step","halfStep","qtrStep","n","cx","cy","dx","dy","Burst","shape","GearShape","holeSides","hole","Path","holeStep","Gear","HeartShape","tipDepth","Heart","StarShape","Star","Bone","Tree","trunkColor","leafColor","Hill","Mound","addWaterDisplacement","waveFrequency","waveAmplitude","shader","updateWaterDisplacementTime","deltaTime","addNoiseDisplacement","updateNoiseDisplacementTime","atmosphericShader","daySkyShader","Color","fadeShader","nightSkyShader","AtmosphericSkybox","BackSide","sun","DaySkybox","NightSkybox","checkerboardTexture","data","stride","texture","DataTexture","RGBAFormat","UnsignedByteType","RepeatWrapping","NearestFilter","alignToEdge","objects","side","worldBoundingBox","Box3","worldPosition","objectData","object","referenceValue","acc","boundingBox","alignToRow","alignmentDirection","currentPosition","objectCenter","alignObjectToSurface","targetPosition","bottomCenter","adjustment","localAdjustment","alignBufferGeometryToSurface","targetPositionY","minY","alignInstancedMeshToSurface","alignInstancedMeshIndexToSurface","instanceIndex","localTargetPosition","centerObject","totalOffset","centerObjectGeometry","totalTarget","centerMeshGeometry","mesh","box","translationOffset","Center","parseHexCode","hex","bigint","hexToHsl","r","g","hexToRgb","rgbToHsl","hslToHex","hueToRgb","p","q","toHexValue","hslToRgb","f","normalizeRgb","rgbToHex","lPercent","calculateDistance","color1","color2","calculateChannelDifference","findClosestColor","inputColor","dataset","inputRgb","closestColor","smallestDistance","entry","colorRgb","findClosestColorChannelWise","smallestDifference","difference","getAnalogousColors","baseHue","findClosestPoint","point","closestPoint","tempPoint","minDistance","normalizeT","interpolateCurve","curveFunction","startRadius","endRadius","startHeight","endHeight","easedT","createCubicCurvePoints","control1","control2","curvePoints","createDampedCurvePoints","createExponentialCurvePoints","createLogarithmicCurvePoints","createParabolicCurvePoints","createQuadraticCurvePoints","control","createSigmoidCurvePoints","ParametricCurveUtils","createQuad","p4","uv1","uv2","uv3","uv4","normalVector","calculateNormal","val","planarUVMapping","cubicUVMapping","absX","absY","absZ","cubicUVMappingBatch","sphericalUVMapping","cylindricalUVMapping","polarUVMapping","normalizeUV","uv","minU","maxU","minV","maxV","normalizeUVBatch","minBounds","maxBounds","calculateUVBounds"],"mappings":"+aAYO,SAASA,EACdC,EACAC,EACAC,EACAC,EACM,CACA,MAAAC,EAAWJ,EAAO,SAAS,MAAM,EACjCK,EAASD,EAAS,MAAM,EAAE,IAAIJ,EAAO,kBAAkB,IAAIM,EAAA,OAAS,EAAE,eAAe,CAACL,CAAQ,CAAC,EACrG,IAAIM,EAA2B,KAE/B,SAASC,EAAQC,EAAoB,CAC/BF,IAAc,OAAkBA,EAAAE,GAEpC,MAAMC,GADUD,EAAOF,GACIL,EAE3B,GAAIQ,GAAY,EAAG,CACVV,EAAA,SAAS,KAAKK,CAAM,EACvBF,GAAuBA,IAC3B,MACF,CAGAH,EAAO,SAAS,YAAYI,EAAUC,EAAQK,CAAQ,EAEtD,sBAAsBF,CAAO,CAC/B,CAEA,sBAAsBA,CAAO,CAC/B,CCnBO,SAASG,GAA0BX,EAAgBY,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