three-low-poly 0.9.12 → 0.9.14

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 +1 @@
1
- {"version":3,"file":"index.es.js","sources":["../src/constants/Direction.js","../src/constants/Falloff.js","../src/brushes/DisplacementBrush.js","../src/brushes/FlattenBrush.js","../src/brushes/NoiseBrush.js","../src/brushes/SmoothBrush.js","../src/brushes/SpikeBrush.js","../src/brushes/TwistBrush.js","../src/constants/Easing.js","../src/constants/ParametricCurve.js","../src/effects/Bubbling.js","../src/geometry/books/BookGeometry.js","../src/utils/RandomNumberUtils.js","../src/factory/BookFactory.js","../src/geometry/architecture/BifurcatedStaircaseGeometry.js","../src/geometry/architecture/DioramaGeometry.js","../src/geometry/architecture/LShapedStaircaseGeometry.js","../src/geometry/architecture/SpiralStaircaseGeometry.js","../src/geometry/architecture/StaircaseGeometry.js","../src/geometry/cemetery/CrossHeadstoneGeometry.js","../src/geometry/cemetery/ObeliskHeadstoneGeometry.js","../src/geometry/cemetery/RoundedHeadstoneGeometry.js","../src/geometry/cemetery/SquareHeadstoneGeometry.js","../src/geometry/fence/FenceColumnGeometry.js","../src/geometry/fence/WroughtIronBarGeometry.js","../src/geometry/fence/WroughtIronFenceGeometry.js","../src/geometry/furniture/BookshelfGeometry.js","../src/geometry/leafs/SimpleLeafGeometry.js","../src/utils/VertexUtils.js","../src/geometry/rocks/RockGeometry.js","../src/geometry/skeleton/BoneGeometry.js","../src/geometry/science/BeakerGeometry.js","../src/geometry/science/ErlenmeyerFlaskGeometry.js","../src/geometry/science/MortarGeometry.js","../src/geometry/science/StandGeometry.js","../src/geometry/science/TestTubeGeometry.js","../src/geometry/science/WineBottleGeometry.js","../src/geometry/terrain/HillGeometry.js","../src/utils/SphericalGeometryUtils.js","../src/geometry/terrain/MoundGeometry.js","../src/geometry/trees/TreeGeometry.js","../src/models/astronomy/Moon.js","../src/models/books/Book.js","../src/models/cemetery/CrossHeadstone.js","../src/models/cemetery/Mausoleum.js","../src/models/cemetery/ObeliskHeadstone.js","../src/models/cemetery/RoundedHeadstone.js","../src/models/cemetery/SquareHeadstone.js","../src/models/fence/FenceColumn.js","../src/models/fence/WroughtIronBar.js","../src/models/fence/WroughtIronFence.js","../src/models/furniture/Bookshelf.js","../src/models/furniture/Desk.js","../src/models/lighting/Candle.js","../src/models/lighting/Lantern.js","../src/models/rocks/MossyRocks.js","../src/models/rocks/Rock.js","../src/models/rocks/Rocks.js","../src/models/science/Beaker.js","../src/models/science/Bottle.js","../src/models/science/BunsenBurner.js","../src/models/science/ElectricPanel.js","../src/models/science/ErlenmeyerFlask.js","../src/models/science/Flask.js","../src/models/science/LeverPanel.js","../src/models/science/Microscope.js","../src/models/science/MortarAndPestle.js","../src/models/science/SpiralTube.js","../src/models/science/Stand.js","../src/models/science/TeslaCoil.js","../src/models/science/TestTube.js","../src/models/science/TestTubeRack.js","../src/models/science/WineBottle.js","../src/shapes/BurstShape.js","../src/models/shapes/Burst.js","../src/shapes/GearShape.js","../src/models/shapes/Gear.js","../src/shapes/HeartShape.js","../src/models/shapes/Heart.js","../src/shapes/StarShape.js","../src/models/shapes/Star.js","../src/models/skeleton/Bone.js","../src/models/trees/Tree.js","../src/models/terrain/Hill.js","../src/models/terrain/Mound.js","../src/shaders/addWaterDisplacement.js","../src/shaders/addNoiseDisplacement.js","../src/shaders/daySkyShader.js","../src/shaders/fadeShader.js","../src/shaders/nightSkyShader.js","../src/skybox/DaySkybox.js","../src/skybox/NightSkybox.js","../src/skybox/TwilightSkybox.js","../src/textures/checkerboard.js","../src/utils/GroupUtils.js","../src/utils/InstancedMeshUtils.js","../src/utils/InterpolateCurve.js","../src/utils/MeshUtils.js","../src/utils/ParametricCurveUtils.js","../src/utils/SceneUtils.js"],"sourcesContent":["import { Vector3 } from \"three\";\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 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 const Falloff = {\n LINEAR: (distance, radius) => 1 - distance / radius,\n QUADRATIC: (distance, radius) => Math.pow(1 - distance / radius, 2),\n SQUARE_ROOT: (distance, radius) => Math.pow(1 - distance / radius, 0.5),\n LOGARITHMIC: (distance, radius) => Math.log(1 + (radius - distance)) / Math.log(1 + radius),\n SINE: (distance, radius) => Math.cos(((distance / radius) * Math.PI) / 2),\n EXPONENTIAL: (distance, radius) => Math.exp(-distance / radius),\n CUBIC: (distance, radius) => Math.pow(1 - distance / radius, 3),\n GAUSSIAN: (distance, radius) => Math.exp(-Math.pow(distance, 2) / (2 * Math.pow(radius / 3, 2))),\n INVERSE: (distance, radius) => radius / (radius + distance),\n SMOOTHSTEP: (distance, radius) => {\n const t = Math.max(0, Math.min(1, 1 - distance / radius));\n return t * t * (3 - 2 * t);\n },\n};\n","import { Vector3 } from \"three\";\nimport { Direction } from \"../constants/Direction.js\";\nimport { Falloff } from \"../constants/Falloff.js\";\n\n/**\n * Moves vertices within a specified radius around a target position along a given direction\n */\nexport const displacementBrush = (geometry, position, radius, strength, direction = Direction.UP, falloffFn = Falloff.LINEAR) => {\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 {Direction} from \"../constants/Direction.js\";\nimport {Vector3} from \"three\";\nimport {Falloff} from \"../constants/Falloff.js\";\n\n/**\n * Flattens vertices to a given plane defined by a target height or normal direction.\n */\nexport const flattenBrush = (geometry, position, radius, targetHeight, strength, direction = Direction.UP, falloffFn = Falloff.LINEAR) => {\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 { MathUtils, Vector3 } from \"three\";\nimport { Direction } from \"../constants/Direction.js\";\nimport { Falloff } from \"../constants/Falloff.js\";\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 = (geometry, position, radius, strength, direction = Direction.UP, falloffFn = Falloff.LINEAR) => {\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 { 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 = (geometry, position, radius, strength) => {\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 { Falloff } from \"../constants/Falloff.js\";\nimport { Vector3 } from \"three\";\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 = (geometry, position, radius, strength, inward = false, falloffFn = Falloff.LINEAR) => {\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 { Quaternion, Vector3 } from \"three\";\nimport { Direction } from \"../constants/Direction.js\";\nimport { Falloff } from \"../constants/Falloff.js\";\n\n/**\n * Applies a twisting force to the vertices, rotating them around the direction defined by the target position.\n */\nexport const twistBrush = (geometry, position, radius, strength, direction = Direction.UP, falloffFn = Falloff.LINEAR) => {\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","export const sineEaseIn = (t) => 1 - Math.cos((t * Math.PI) / 2);\nexport const sineEaseOut = (t) => Math.sin((t * Math.PI) / 2);\nexport const sineEaseInOut = (t) => -0.5 * (Math.cos(Math.PI * t) - 1);\n\nexport const quadraticEaseIn = (t) => t * t;\nexport const quadraticEaseOut = (t) => 1 - Math.pow(1 - t, 2);\nexport const quadraticEaseInOut = (t) => (t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2);\n\nexport const cubicEaseIn = (t) => t * t * t;\nexport const cubicEaseOut = (t) => 1 - Math.pow(1 - t, 3);\nexport const cubicEaseInOut = (t) => (t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2);\n\nexport const quarticEaseIn = (t) => t * t * t * t;\nexport const quarticEaseOut = (t) => 1 - Math.pow(1 - t, 4);\nexport const quarticEaseInOut = (t) => (t < 0.5 ? 8 * t * t * t * t : 1 - Math.pow(-2 * t + 2, 4) / 2);\n\nexport const quinticEaseIn = (t) => t * t * t * t * t;\nexport const quinticEaseOut = (t) => 1 - Math.pow(1 - t, 5);\nexport const quinticEaseInOut = (t) => (t < 0.5 ? 16 * t * t * t * t * t : 1 - Math.pow(-2 * t + 2, 5) / 2);\n\nexport const exponentialEaseIn = (t) => (t === 0 ? 0 : Math.pow(2, 10 * t - 10));\nexport const exponentialEaseOut = (t) => (t === 1 ? 1 : 1 - Math.pow(2, -10 * t));\nexport const exponentialEaseInOut = (t) => {\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) => 1 - Math.sqrt(1 - Math.pow(t, 2));\nexport const circularEaseOut = (t) => Math.sqrt(1 - Math.pow(t - 1, 2));\nexport const circularEaseInOut = (t) =>\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) => t;\nexport const smoothstep = (t) => t * t * (3 - 2 * t);\nexport const concave = (t) => 1 - Math.pow(1 - t, 0.3);\nexport const convex = (t) => Math.pow(t, 0.3);\nexport const logarithmic = (t) => Math.log(Math.max(0.01, t)) / Math.log(2);\nexport const squareRoot = (t) => Math.sqrt(t);\nexport const inverse = (t) => 1 - t;\nexport const gaussian = (t) => {\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 parabolicCurve = (t, a = 1, b = 0, c = 0) => {\n const clampedT = Math.max(0, Math.min(1, t));\n return a * clampedT * clampedT + b * clampedT + c;\n};\n\nexport const dampedCurve = (t, damping = 1) => {\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 quadraticCurve = (t, p0, p1, p2) => {\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 cubicCurve = (t, p0, p1, p2, p3) => {\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 exponentialCurve = (t, base = 1, factor = 1) => {\n const clampedT = Math.max(0, Math.min(1, t));\n return base * Math.pow(clampedT, factor);\n};\n\nexport const logarithmicCurve = (t, base = 1, factor = 1) => {\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 sigmoidCurve = (t, a = 10) => {\n const clampedT = Math.max(0, Math.min(1, t));\n return 1 / (1 + Math.exp(-a * (clampedT - 0.5)));\n};\n\nexport const ParametricCurve = {\n PARABOLIC: parabolicCurve,\n DAMPED: dampedCurve,\n QUADRATIC: quadraticCurve,\n CUBIC: cubicCurve,\n EXPONENTIAL: exponentialCurve,\n LOGARITHMIC: logarithmicCurve,\n SIGMOID: sigmoidCurve,\n};\n","import {Group, Mesh, MeshStandardMaterial, SphereGeometry} from \"three\";\n\nclass Bubbling extends Group {\n constructor() {\n super();\n\n // Bubble properties\n const bubbles = [];\n const bubbleCount = 20; // Number of bubbles\n\n // Create bubble geometry and material\n const bubbleGeometry = new SphereGeometry(0.1, 6, 6); // Small spheres\n const bubbleMaterial = new MeshStandardMaterial({\n color: 0xffffff,\n transparent: true,\n opacity: 0.6,\n roughness: 0.3,\n metalness: 0.3,\n });\n\n for (let i = 0; i < bubbleCount; i++) {\n const bubble = new Mesh(bubbleGeometry, bubbleMaterial);\n bubble.position.set(\n (Math.random() - 0.5) * 1.5, // Random x position within flask\n Math.random() * 3, // Random y position within flask height\n (Math.random() - 0.5) * 1.5, // Random z position within flask\n );\n bubbles.push(bubble);\n this.add(bubble);\n }\n\n // Bubble animation loop\n function animateBubbles() {\n bubbles.forEach((bubble) => {\n bubble.position.y += 0.02; // Move bubble upwards\n\n // Reset bubble to bottom if it reaches top\n if (bubble.position.y > 3) {\n bubble.position.y = 0;\n bubble.position.x = (Math.random() - 0.5) * 1.5; // Randomize x position again\n bubble.position.z = (Math.random() - 0.5) * 1.5; // Randomize z position again\n }\n });\n }\n\n // Add animateBubbles to the main render loop\n function animate() {\n requestAnimationFrame(animate);\n animateBubbles(); // Update bubble positions\n }\n\n animate();\n }\n}\n\nexport { Bubbling };\n","import { BoxGeometry, BufferAttribute, BufferGeometry } from \"three\";\nimport { mergeGeometries } from \"three/addons/utils/BufferGeometryUtils.js\";\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(mergeGeometries([coverGeometry, pagesGeometry], true));\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 { BookGeometry } from \"../geometry/books/BookGeometry.js\";\nimport { InstancedMesh, Matrix4, Vector3 } from \"three\";\nimport { logarithmicRandomMax, logarithmicRandomMin, randomFloat } from \"../utils/RandomNumberUtils.js\";\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} = {}) {\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({ coverMaterial, pagesMaterial, scales = [] } = {}) {\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({\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} = {}) {\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({\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} = {}) {\n const scales = [];\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 { 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 { BufferGeometry, Float32BufferAttribute } from \"three\";\n\nclass DioramaGeometry extends BufferGeometry {\n constructor(width = 5, height = 3, depth = 5, wallThickness = 0.2) {\n super();\n\n // Vertices array (each set of 3 numbers represents x, y, z of a vertex)\n const vertices = [\n // Floor vertices\n -width / 2, 0, -depth / 2, // 0\n width / 2, 0, -depth / 2, // 1\n width / 2, 0, depth / 2, // 2\n -width / 2, 0, depth / 2, // 3\n\n // Back wall vertices\n -width / 2, 0, -depth / 2, // 4\n width / 2, 0, -depth / 2, // 5\n width / 2, height, -depth / 2, // 6\n -width / 2, height, -depth / 2, // 7\n\n // Left wall vertices\n -width / 2, 0, -depth / 2, // 8\n -width / 2, 0, depth / 2, // 9\n -width / 2, height, depth / 2, // 10\n -width / 2, height, -depth / 2, // 11\n ];\n\n // Indices array (each set of 3 numbers represents a triangle)\n const indices = [\n // Floor\n 0, 1, 2,\n 0, 2, 3,\n\n // Back wall\n 4, 5, 6,\n 4, 6, 7,\n\n // Left wall\n 8, 9, 10,\n 8, 10, 11,\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 { DioramaGeometry }\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 { BoxGeometry, BufferGeometry } from \"three\";\nimport { mergeGeometries } from \"three/addons/utils/BufferGeometryUtils.js\";\n\nclass CrossHeadstoneGeometry extends BufferGeometry {\n constructor(width = 0.4, height = 1.2, depth = 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(mergeGeometries([verticalGeometry, horizontalGeometry], false));\n this.computeVertexNormals();\n }\n}\n\nexport { CrossHeadstoneGeometry };\n","import { BoxGeometry, BufferGeometry, ConeGeometry } from \"three\";\nimport { mergeGeometries } from \"three/addons/utils/BufferGeometryUtils.js\";\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(mergeGeometries([baseGeometry, lowerSegmentGeometry, middleSegmentGeometry, topSegmentGeometry, pyramidGeometry], false));\n this.computeVertexNormals();\n }\n}\n\nexport { ObeliskHeadstoneGeometry };\n","import { BoxGeometry, BufferGeometry, CylinderGeometry } from \"three\";\nimport { mergeGeometries } from \"three/addons/utils/BufferGeometryUtils.js\";\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(mergeGeometries([baseGeometry, topGeometry], false));\n this.computeVertexNormals();\n }\n}\n\nexport { RoundedHeadstoneGeometry };\n","import { BoxGeometry, BufferGeometry } from \"three\";\n\nclass 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}\nexport { SquareHeadstoneGeometry };\n","import { BoxGeometry, BufferGeometry } from \"three\";\nimport { mergeGeometries } from \"three/addons/utils/BufferGeometryUtils.js\";\n\n/**\n * Fence Column Geometry, a stone slab fence column shape\n */\nexport class FenceColumnGeometry 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(mergeGeometries([baseGeometry, columnGeometry, capGeometry], false));\n }\n}\n","import { BufferGeometry, ConeGeometry, CylinderGeometry } from \"three\";\nimport { mergeGeometries } from \"three/addons/utils/BufferGeometryUtils.js\";\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(mergeGeometries([barGeometry, spikeGeometry], false));\n }\n}\n","import { BoxGeometry, BufferGeometry } from \"three\";\nimport { WroughtIronBarGeometry } from \"./WroughtIronBarGeometry.js\";\nimport { mergeGeometries } from \"three/addons/utils/BufferGeometryUtils.js\";\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(mergeGeometries(geometries));\n }\n}\n","import { BoxGeometry, BufferGeometry } from \"three\";\nimport { mergeGeometries } from \"three/addons/utils/BufferGeometryUtils.js\";\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(mergeGeometries([\n leftPanel, //\n rightPanel,\n topPanel,\n bottomPanel,\n ...(open ? [] : [backPanel]),\n ...shelfPanels\n ], false));\n }\n}\n","import { BufferGeometry, Float32BufferAttribute } from \"three\";\n\nclass SimpleLeafGeometry 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\nexport { SimpleLeafGeometry };\n","import { Vector3 } from \"three\";\nimport { mergeVertices } from \"three/addons/utils/BufferGeometryUtils.js\";\nimport { Direction } from \"../constants/Direction.js\";\n\nexport function randomTransformVertices(geometry, direction = Direction.XYZ, minScale = 0.5, maxScale = 2.0) {\n // Delete unnecessary attributes\n geometry.deleteAttribute(\"uv\");\n geometry.deleteAttribute(\"normal\");\n geometry = mergeVertices(geometry);\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 direction\n const randomScale = Math.random() * (maxScale - minScale) + minScale;\n const displacement = direction.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 { BufferGeometry, SphereGeometry } from \"three\";\nimport { Direction } from \"../../constants/Direction.js\";\nimport { randomTransformVertices } from \"../../utils/VertexUtils.js\";\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, Direction.XYZ, 0.5, 1.0));\n this.computeVertexNormals();\n this.center();\n }\n}\n","import { BufferGeometry, CylinderGeometry, SphereGeometry } from \"three\";\nimport { mergeGeometries } from \"three/addons/utils/BufferGeometryUtils.js\";\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(mergeGeometries([cylinderGeometry, topSphere1, topSphere2, bottomSphere1, bottomSphere2], false));\n }\n}\n\nexport { BoneGeometry };\n","import { BufferGeometry, CylinderGeometry, SphereGeometry } from \"three\";\nimport { mergeGeometries } from \"three/addons/utils/BufferGeometryUtils.js\";\n\nclass BeakerGeometry extends BufferGeometry {\n constructor() {\n super();\n\n // Create the sphere part of the glassware\n const sphereGeometry = new SphereGeometry(1, 16, 16);\n const tubeGeometry = new CylinderGeometry(0.2, 0.2, 2, 16, 1, true);\n\n // Adjust tube position to stick out of the sphere\n tubeGeometry.translate(0, 1.5, 0);\n tubeGeometry.rotateX(Math.PI / 2);\n\n this.copy(mergeGeometries([sphereGeometry, tubeGeometry], false));\n }\n}\n\nexport { BeakerGeometry };\n","import { BufferGeometry, LatheGeometry, Vector2 } from \"three\";\nimport { mergeGeometries } from \"three/addons/utils/BufferGeometryUtils.js\";\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(mergeGeometries([flaskGeometry], false));\n }\n}\n","import { BufferGeometry, CircleGeometry, LatheGeometry, Vector2 } from \"three\";\nimport { mergeGeometries } from \"three/addons/utils/BufferGeometryUtils.js\";\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(mergeGeometries([mortarGeometry, baseDisk], false));\n }\n}\n\nexport { MortarGeometry };\n","import { BufferGeometry, CylinderGeometry, TorusGeometry } from \"three\";\nimport { mergeGeometries } from \"three/addons/utils/BufferGeometryUtils.js\";\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(mergeGeometries([ringGeometry, ...legs], false));\n }\n}\n","import { BufferGeometry, CylinderGeometry, SphereGeometry } from \"three\";\nimport { mergeGeometries } from \"three/addons/utils/BufferGeometryUtils.js\";\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(mergeGeometries([tubeGeometry, bottomGeometry], false));\n }\n}\n\nexport { TestTubeGeometry };\n","import { BufferGeometry, CylinderGeometry } from \"three\";\nimport { mergeGeometries } from \"three/addons/utils/BufferGeometryUtils.js\";\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(mergeGeometries([bodyGeometry, shoulderGeometry, neckGeometry], false));\n }\n}\n\nexport { WineBottleGeometry };\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","/**\n * Calculate the radius to achieve a spherical cap height.\n * R = r / (1 - cos(thetaLength))\n */\nexport const radiusFromCapHeight = (height, thetaLength) => 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, thetaLength) => 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, thetaLength) => 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, thetaLength) => 2 * radius * Math.sin(thetaLength);\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, theta, phi) => {\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, y, z) => {\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 { BufferGeometry, SphereGeometry } from \"three\";\nimport {capHeightFromRadius, radiusFromCapWidth} from \"../../utils/SphericalGeometryUtils.js\";\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 { mergeGeometries } from \"three/addons/utils/BufferGeometryUtils.js\";\n\n/**\n * Tree geometry, consisting of a trunk and leaves.\n *\n * Group order:\n * - Trunk Material\n * - Leaf Material\n *\n * @example\n * const treeGeometry = new TreeGeometry({\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 */\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 = [];\n for (let i = 0; i < leafCount; i++) {\n const leaf = new DodecahedronGeometry(leafSize, leafDetail);\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(mergeGeometries([trunk.toNonIndexed(), mergeGeometries(leafs, false)], true));\n this.computeVertexNormals();\n }\n}\n\nexport { TreeGeometry };\n","import { Group, Mesh, ShaderMaterial, SphereGeometry } from \"three\";\n\nclass Moon extends Group {\n constructor() {\n super();\n\n // Create moon geometry\n const moonGeometry = new SphereGeometry(5, 32, 32);\n\n // Custom ShaderMaterial\n const moonMaterial = new ShaderMaterial({\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\n // Create the moon mesh and add it to the scene\n const moon = new Mesh(moonGeometry, moonMaterial);\n this.add(moon);\n }\n}\n\nexport { Moon };\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { BookGeometry } from \"../../geometry/books/BookGeometry.js\";\n\nexport class Book extends Mesh {\n constructor({\n width = 1,\n height = 1.5,\n depth = 0.5,\n coverThickness = 0.05,\n pageIndent = 0.05,\n coverColor = 0x8b0000,\n pageColor = 0xffffff,\n } = {}) {\n super();\n\n this.geometry = new BookGeometry(width, height, depth, coverThickness, pageIndent);\n this.material = [\n new MeshStandardMaterial({ color: coverColor, metalness: 0.1, roughness: 0.7, flatShading: true }),\n new MeshStandardMaterial({ color: pageColor, flatShading: true }),\n ];\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { CrossHeadstoneGeometry } from \"../../geometry/cemetery/CrossHeadstoneGeometry.js\";\n\nexport class CrossHeadstone extends Mesh {\n constructor(width = 0.4, height = 1.2, depth = 0.2) {\n super();\n\n this.geometry = new CrossHeadstoneGeometry(width, height, depth);\n this.material = new MeshStandardMaterial({ color: 0x777777, roughness: 0.8 });\n }\n}\n","import { BoxGeometry, ConeGeometry, CylinderGeometry, ExtrudeGeometry, Group, Mesh, MeshStandardMaterial, Shape } from \"three\";\n\nclass Mausoleum extends Group {\n constructor() {\n super();\n\n // Base of the Mausoleum\n const baseGeometry = new BoxGeometry(5, 1, 5);\n const baseMaterial = new MeshStandardMaterial({ color: 0x808080, flatShading: true });\n const baseMesh = new Mesh(baseGeometry, baseMaterial);\n baseMesh.position.set(0, 0.5, 0);\n this.add(baseMesh);\n\n // Main Building Structure\n const buildingGeometry = new BoxGeometry(4, 3, 4);\n const buildingMaterial = new MeshStandardMaterial({ color: 0x696969, flatShading: true });\n const buildingMesh = new Mesh(buildingGeometry, buildingMaterial);\n buildingMesh.position.set(0, 2.5, 0);\n this.add(buildingMesh);\n\n // Roof (Peaked)\n const roofGeometry = new ConeGeometry(3.5, 2, 4);\n const roofMaterial = new MeshStandardMaterial({ color: 0x505050, flatShading: true });\n const roofMesh = new Mesh(roofGeometry, roofMaterial);\n roofMesh.rotation.y = Math.PI / 4;\n roofMesh.position.set(0, 5, 0);\n this.add(roofMesh);\n\n // Pillars\n const pillarGeometry = new CylinderGeometry(0.2, 0.2, 3.5, 16);\n const pillarMaterial = new MeshStandardMaterial({ color: 0x696969, flatShading: true });\n\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 pillarPositions.forEach((position) => {\n const pillarMesh = new Mesh(pillarGeometry, pillarMaterial);\n pillarMesh.position.set(...position);\n this.add(pillarMesh);\n });\n\n // Corrected 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 const archMaterial = new MeshStandardMaterial({ color: 0x404040, flatShading: true });\n const archMesh = new Mesh(archGeometry, archMaterial);\n archMesh.position.set(0, 0.5, 1.7);\n this.add(archMesh);\n }\n}\n\nexport { Mausoleum };\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { ObeliskHeadstoneGeometry } from \"../../geometry/cemetery/ObeliskHeadstoneGeometry.js\";\n\nexport class ObeliskHeadstone extends Mesh {\n constructor(totalHeight = 1.75, baseWidth = 0.75) {\n super();\n\n this.geometry = new ObeliskHeadstoneGeometry(totalHeight, baseWidth);\n this.material = new MeshStandardMaterial({ color: 0x777777, roughness: 0.8 });\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { RoundedHeadstoneGeometry } from \"../../geometry/cemetery/RoundedHeadstoneGeometry.js\";\n\nexport class RoundedHeadstone extends Mesh {\n constructor(width = 0.6, height = 1.0, depth = 0.2, radius = 0.6) {\n super();\n\n this.geometry = new RoundedHeadstoneGeometry(width, height, depth, radius);\n this.material = new MeshStandardMaterial({ color: 0x777777, roughness: 0.8 });\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { SquareHeadstoneGeometry } from \"../../geometry/cemetery/SquareHeadstoneGeometry.js\";\n\nexport class SquareHeadstone extends Mesh {\n constructor(width = 0.5, height = 0.8, depth = 0.15) {\n super();\n\n this.geometry = new SquareHeadstoneGeometry(width, height, depth);\n this.material = new MeshStandardMaterial({ color: 0x777777, roughness: 0.8 });\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { FenceColumnGeometry } from \"../../geometry/fence/FenceColumnGeometry.js\";\n\nexport class FenceColumn extends Mesh {\n constructor({ height = 2.25 } = {}) {\n super();\n\n this.geometry = new FenceColumnGeometry({ height });\n this.material = new MeshStandardMaterial({ color: 0x8b7d7b, flatShading: true });\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { WroughtIronBarGeometry } from \"../../geometry/fence/WroughtIronBarGeometry.js\";\n\nexport class WroughtIronBar extends Mesh {\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 this.geometry = new WroughtIronBarGeometry({\n barHeight,\n barRadius,\n spikeHeight,\n spikeRadius,\n spikeScaleZ,\n radialSegments,\n });\n this.material = new MeshStandardMaterial({ color: 0x333333, metalness: 0.8, roughness: 0.4 });\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { WroughtIronFenceGeometry } from \"../../geometry/fence/WroughtIronFenceGeometry.js\";\n\nexport class WroughtIronFence extends Mesh {\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 this.geometry = 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 this.material = new MeshStandardMaterial({ color: 0x333333, metalness: 0.8, roughness: 0.4 });\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { BookshelfGeometry } from \"../../geometry/furniture/BookshelfGeometry\";\n\nexport class Bookshelf extends Mesh {\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 this.geometry = new BookshelfGeometry({ width, height, depth, shelves, frameThickness, open });\n this.material = new MeshStandardMaterial({ color: 0x8b4513 });\n }\n}\n","import { BoxGeometry, Group, LatheGeometry, Mesh, MeshStandardMaterial, Vector2 } from \"three\";\n\nclass Desk extends Group {\n constructor() {\n super();\n\n // Desk Surface\n const surfaceGeometry = new BoxGeometry(5, 0.3, 3); // Width, Height (depth), Length\n const surfaceMaterial = new MeshStandardMaterial({ color: 0x8b5a2b }); // Wood-like color\n const deskSurface = new Mesh(surfaceGeometry, surfaceMaterial);\n deskSurface.position.set(0, 3.15, 0); // Raise the desk up\n\n // Desk Legs (using lathe geometry)\n const points = [];\n points.push(new Vector2(0.2, 0)); // Starting point at bottom (thin)\n points.push(new Vector2(0.25, 0.5)); // Curve outward\n points.push(new Vector2(0.15, 1.5)); // Narrow toward the middle\n points.push(new Vector2(0.3, 3)); // Final part toward the top\n\n const legGeometry = new LatheGeometry(points, 32);\n const legMaterial = new MeshStandardMaterial({ color: 0x4b3621 }); // Darker wood for legs\n\n // Create four legs for the desk\n const legPositions = [\n [2.2, 0, 1.2], // Adjust Y to 0 so legs start at ground level\n [-2.2, 0, 1.2],\n [2.2, 0, -1.2],\n [-2.2, 0, -1.2],\n ];\n\n legPositions.forEach((position) => {\n const leg = new Mesh(legGeometry, legMaterial);\n leg.position.set(...position);\n this.add(leg);\n });\n\n this.add(deskSurface);\n }\n}\n\nexport { Desk };\n","import { CylinderGeometry, Group, Mesh, MeshBasicMaterial, MeshStandardMaterial, PointLight, SphereGeometry } from \"three\";\n\nclass Candle extends Group {\n constructor(height = 1, radius = 0.2) {\n super();\n this.height = height;\n this.radius = radius;\n this.createCandle();\n this.animateFlicker();\n }\n\n createCandle() {\n // Candle Geometry\n const candleGeometry = new CylinderGeometry(this.radius, this.radius, this.height, 32);\n const candleMaterial = new MeshStandardMaterial({ color: 0xffffff });\n this.candle = new Mesh(candleGeometry, candleMaterial);\n this.candle.position.set(0, this.height / 2, 0);\n this.add(this.candle);\n\n // Flame Geometry\n const flameGeometry = new SphereGeometry(0.05, 16, 16);\n const flameMaterial = new MeshBasicMaterial({ color: 0xffa500 });\n this.flame = new Mesh(flameGeometry, flameMaterial);\n this.flame.position.set(0, this.height + 0.05, 0);\n this.add(this.flame);\n\n // Candlelight\n this.candleLight = new PointLight(0xffa500, 1, 5);\n this.candleLight.position.set(0, this.height + 0.05, 0);\n this.candleLight.castShadow = true;\n this.add(this.candleLight);\n }\n\n animateFlicker() {\n const flicker = () => {\n // Random flicker intensity between 0.8 and 1.2\n this.candleLight.intensity = 1 + (Math.random() * 0.4 - 0.2);\n\n // Optional: slight random movement to simulate a flickering flame\n this.candleLight.position.x = Math.random() * 0.02 - 0.01;\n this.candleLight.position.z = Math.random() * 0.02 - 0.01;\n\n requestAnimationFrame(flicker);\n };\n flicker();\n }\n}\n\nexport { Candle };\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 { DodecahedronGeometry, Group, Mesh, MeshStandardMaterial } from \"three\";\n\nclass MossyRocks extends Group {\n constructor() {\n super();\n\n // Rock Geometry (using Dodecahedron for a low-poly random rock-like shape)\n const rockGeometry = new DodecahedronGeometry(1, 0); // Low-poly shape\n const rockMaterial = new MeshStandardMaterial({ color: 0x808080, flatShading: true });\n const mossMaterial = new MeshStandardMaterial({ color: 0x4b8b3b, flatShading: true, opacity: 0.8, transparent: true });\n\n // Create multiple random rocks with slight variations\n for (let i = 0; i < 5; i++) {\n const rockMesh = new Mesh(rockGeometry, rockMaterial);\n rockMesh.scale.set(0.8 + Math.random() * 0.4, 0.8 + Math.random() * 0.4, 0.8 + Math.random() * 0.4); // Scale randomly to make each rock unique\n rockMesh.rotation.set(Math.random() * Math.PI, Math.random() * Math.PI, Math.random() * Math.PI); // Random rotation for variation\n rockMesh.position.set((Math.random() - 0.5) * 4, 0, (Math.random() - 0.5) * 4); // Keep rocks at ground level\n this.add(rockMesh);\n\n // Moss Layer (using a slightly smaller scale and positioned on top of the rock)\n const mossMesh = new Mesh(rockGeometry, mossMaterial);\n mossMesh.scale.set(rockMesh.scale.x * 0.9, rockMesh.scale.y * 0.5, rockMesh.scale.z * 0.9); // Make the moss layer flatter\n mossMesh.rotation.copy(rockMesh.rotation);\n mossMesh.position.copy(rockMesh.position);\n mossMesh.position.y += 0.3; // Raise the moss slightly to sit on top of the rock\n this.add(mossMesh);\n }\n }\n}\n\nexport { MossyRocks };\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { RockGeometry } from \"../../geometry/rocks/RockGeometry.js\";\n\nexport class Rock extends Mesh {\n constructor(radius = 1, widthSegments = 4, heightSegments = 4) {\n super();\n\n // Create a rock geometry\n this.geometry = new RockGeometry(radius, widthSegments, heightSegments);\n this.material = new MeshStandardMaterial({ color: 0x808080, flatShading: true });\n }\n}\n","import { DodecahedronGeometry, Group, Mesh, MeshStandardMaterial } from \"three\";\n\nclass Rocks extends Group {\n constructor() {\n super();\n\n // Rock Geometry (using Dodecahedron for a low-poly random rock-like shape)\n const rockGeometry = new DodecahedronGeometry(1, 0); // Low-poly shape\n const rockMaterial = new MeshStandardMaterial({ color: 0x808080, flatShading: true });\n\n // Create multiple random rocks with slight variations\n for (let i = 0; i < 5; i++) {\n const rockMesh = new Mesh(rockGeometry, rockMaterial);\n rockMesh.scale.set(0.8 + Math.random() * 0.4, 0.8 + Math.random() * 0.4, 0.8 + Math.random() * 0.4); // Scale randomly to make each rock unique\n rockMesh.rotation.set(Math.random() * Math.PI, Math.random() * Math.PI, Math.random() * Math.PI); // Random rotation for variation\n rockMesh.position.set((Math.random() - 0.5) * 4, 0, (Math.random() - 0.5) * 4); // Keep rocks at ground level\n this.add(rockMesh);\n }\n }\n}\n\nexport { Rocks };\n","import { BeakerGeometry } from \"../../geometry/science/BeakerGeometry.js\";\nimport { DoubleSide, Group, Mesh, MeshPhysicalMaterial } from \"three\";\n\nclass Beaker extends Group {\n constructor() {\n super();\n\n // Create the geometry\n const beakerGeometry = new BeakerGeometry();\n\n // Create a group to combine the geometries\n const glassMaterial = 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 const beaker = new Mesh(beakerGeometry, glassMaterial);\n beaker.rotation.x = -Math.PI / 2;\n this.add(beaker);\n }\n}\n\nexport { Beaker };\n","import { CylinderGeometry, Group, LatheGeometry, Mesh, MeshStandardMaterial, Vector2 } from \"three\";\n\nclass Bottle extends Group {\n constructor() {\n super();\n\n // Potion bottle geometry\n const bottlePoints = [\n new Vector2(0, 0), // Bottom\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 ];\n const bottleGeometry = new LatheGeometry(bottlePoints, 10); // Low-poly segments\n\n // Cork geometry\n const corkGeometry = new CylinderGeometry(0.3, 0.4, 0.2, 8);\n\n // Materials\n const glassMaterial = new MeshStandardMaterial({\n color: 0x88ccff,\n transparent: true,\n opacity: 0.5,\n roughness: 0.1,\n metalness: 0.3,\n });\n\n const liquidMaterial = new MeshStandardMaterial({\n color: 0xff3366, // Vibrant potion color\n transparent: true,\n opacity: 0.6,\n });\n\n const corkMaterial = new MeshStandardMaterial({\n color: 0x8b4513,\n roughness: 1.0,\n });\n\n // Meshes\n const bottle = new Mesh(bottleGeometry, glassMaterial);\n const liquid = new Mesh(bottleGeometry, liquidMaterial);\n const cork = new Mesh(corkGeometry, corkMaterial);\n\n // Adjust liquid position to appear inside bottle\n liquid.scale.set(0.8, 0.8, 0.8);\n liquid.position.y = 0.1; // Position slightly lower to appear \"inside\"\n\n // Position cork at the bottle's mouth\n cork.position.y = 2.5;\n\n // Group all elements for easy manipulation\n const potionBottle = new Group();\n potionBottle.add(bottle, liquid, cork);\n this.add(potionBottle);\n }\n}\n\nexport { Bottle };\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.js\";\nimport { DoubleSide, Mesh, MeshPhysicalMaterial } from \"three\";\n\nexport class ErlenmeyerFlask extends Mesh {\n constructor({\n flaskRadius = 1, //\n neckRadius = 0.3,\n height = 2.5,\n neckHeight = 1,\n radialSegments = 16,\n } = {}) {\n super();\n\n this.geometry = new ErlenmeyerFlaskGeometry({ flaskRadius, neckRadius, height, neckHeight, radialSegments });\n this.material = 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 wireframe: false,\n });\n }\n}\n","import {CylinderGeometry, Group, LatheGeometry, Mesh, MeshStandardMaterial, Vector2} from \"three\";\n\nclass Flask extends Group {\n constructor() {\n super();\n\n // Flask body geometry\n const flaskPoints = [\n new Vector2(0, 0), // Bottom of the flask\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 flask\n ];\n const flaskGeometry = new LatheGeometry(flaskPoints, 12); // 12 segments for low-poly style\n\n // Cork stopper geometry\n const corkGeometry = new CylinderGeometry(0.6, 0.7, 0.3, 8); // Simple tapered cylinder\n\n // Materials for flask and cork\n const glassMaterial = new MeshStandardMaterial({\n color: 0x88ccaa,\n transparent: true,\n opacity: 0.4,\n roughness: 0.1,\n metalness: 0.5,\n });\n\n const corkMaterial = new MeshStandardMaterial({\n color: 0x8b4513,\n roughness: 1.0,\n });\n\n // Meshes\n const flask = new Mesh(flaskGeometry, glassMaterial);\n const cork = new Mesh(corkGeometry, corkMaterial);\n\n // Position cork on top of the flask\n cork.position.y = 3.5;\n\n // Add both to a single object for easy manipulation\n this.add(flask, cork);\n }\n}\n\nexport { Flask };\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.js\";\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 const pestle = new Mesh(pestleGeometry, pestleMaterial);\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 { 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.js\";\n\nclass Stand extends Mesh {\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 this.geometry = new StandGeometry({ radius, height, count, thickness, radialSegments });\n this.material = new MeshStandardMaterial({\n color: 0x888888,\n roughness: 0.7,\n metalness: 0.3,\n });\n }\n}\n\nexport { Stand };\n","import {\n BufferGeometry,\n CylinderGeometry,\n DoubleSide,\n Group,\n Line,\n LineBasicMaterial,\n Mesh,\n MeshStandardMaterial,\n SphereGeometry,\n Vector3,\n} from \"three\";\n\nclass TeslaCoil extends Group {\n constructor() {\n super();\n\n // Base geometry\n const coilBaseGeometry = new CylinderGeometry(0.5, 0.6, 0.3, 16);\n const coilBaseMaterial = new MeshStandardMaterial({\n color: 0x333333,\n roughness: 0.6,\n metalness: 0.5,\n });\n const coilBase = new Mesh(coilBaseGeometry, coilBaseMaterial);\n coilBase.position.y = 0.15;\n\n // Coil geometry\n const coilGeometry = new CylinderGeometry(0.15, 0.15, 2, 12, 1, true);\n const coilMaterial = new MeshStandardMaterial({\n color: 0xff6600,\n roughness: 0.5,\n metalness: 0.8,\n side: DoubleSide,\n });\n const coil = new Mesh(coilGeometry, coilMaterial);\n coil.position.y = 1.3;\n\n // Sphere at the top\n const coilTopGeometry = new SphereGeometry(0.3, 16, 16);\n const coilTop = new Mesh(coilTopGeometry, coilMaterial);\n coilTop.position.y = 2.4;\n\n this.add(coilBase, coil, coilTop);\n\n // Sparking effect (using lines)\n const sparks = [];\n for (let i = 0; i < 5; i++) {\n const sparkMaterial = new LineBasicMaterial({ color: 0x99ccff });\n const points = [\n new Vector3(0, 2.4, 0),\n new Vector3((Math.random() - 0.5) * 1.5, Math.random() * 2.4, (Math.random() - 0.5) * 1.5),\n ];\n const sparkGeometry = new BufferGeometry().setFromPoints(points);\n const spark = new Line(sparkGeometry, sparkMaterial);\n this.add(spark);\n sparks.push(spark);\n }\n\n // Update spark positions\n function animateSparks() {\n sparks.forEach((spark) => {\n const points = [\n new Vector3(0, 2.4, 0),\n new Vector3((Math.random() - 0.5) * 1.5, Math.random() * 2.4, (Math.random() - 0.5) * 1.5),\n ];\n spark.geometry.setFromPoints(points);\n });\n }\n\n function animate() {\n requestAnimationFrame(animate);\n animateSparks(); // Make the sparks “jump”\n }\n\n animate();\n }\n}\n\nexport { TeslaCoil };\n","import { DoubleSide, Group, Mesh, MeshPhysicalMaterial } from \"three\";\nimport { TestTubeGeometry } from \"../../geometry/science/TestTubeGeometry.js\";\n\nclass TestTube extends Group {\n constructor(radiusTop = 0.2, radiusBottom = 0.2, height = 3, segments = 32) {\n super();\n\n // Test Tube Geometry\n const tubeGeometry = new TestTubeGeometry(radiusTop, radiusBottom, height, segments);\n\n const tubeMaterial = 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, // For glass effect\n side: DoubleSide,\n });\n\n const tube = new Mesh(tubeGeometry, tubeMaterial);\n\n this.add(tube);\n }\n}\n\nexport { TestTube };\n","import { BoxGeometry, DoubleSide, Group, Mesh, MeshStandardMaterial } from \"three\";\nimport { TestTubeGeometry } from \"../../geometry/science/TestTubeGeometry.js\";\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\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 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\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 { Mesh, MeshPhysicalMaterial } from \"three\";\nimport { WineBottleGeometry } from \"../../geometry/science/WineBottleGeometry.js\";\n\nclass WineBottle extends Mesh {\n constructor() {\n super();\n\n // Create wine bottle geometry\n const wineBottle = new WineBottleGeometry();\n\n // Create a glass-like material\n const bottleMaterial = new MeshPhysicalMaterial({\n color: 0x556b2f,\n roughness: 0.1,\n transmission: 0.9, // Makes the material transparent\n thickness: 0.2,\n metalness: 0,\n clearcoat: 1.0,\n clearcoatRoughness: 0.1,\n });\n\n // Create mesh and add to the scene\n this.geometry = wineBottle;\n this.material = bottleMaterial;\n }\n}\n\nexport { WineBottle };\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.js\";\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.js\";\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 reflectivity: 0.5,\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.js\";\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.js\";\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.js\";\n\nexport class Bone extends Mesh {\n constructor() {\n super();\n\n this.geometry = new BoneGeometry();\n this.material = new MeshStandardMaterial({ color: 0xffffff });\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { TreeGeometry } from \"../../geometry/trees/TreeGeometry.js\";\n\n/**\n * @example\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 */\nclass Tree extends Mesh {\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\n const treeGeometry = new TreeGeometry({\n trunkRadiusTop: trunkRadiusTop,\n trunkRadiusBottom: trunkRadiusBottom,\n trunkHeight: trunkHeight,\n trunkSegments: trunkSegments,\n trunkColor: trunkColor,\n leafSize: leafSize,\n leafCount: leafCount,\n leafDetail: leafDetail,\n leafSpreadRadius: leafSpreadRadius,\n leafColor: leafColor,\n });\n\n const trunkMaterial = new MeshStandardMaterial({\n color: trunkColor,\n roughness: 0.9,\n metalness: 0,\n flatShading: true,\n });\n\n const leafMaterial = new MeshStandardMaterial({\n color: leafColor,\n roughness: 0.8,\n metalness: 0,\n flatShading: true,\n });\n\n this.geometry = treeGeometry;\n this.material = [trunkMaterial, leafMaterial];\n }\n}\n\nexport { Tree };\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { HillGeometry } from \"../../geometry/terrain/HillGeometry.js\";\n\nexport class Hill extends Mesh {\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.geometry = new HillGeometry({\n radius,\n height,\n widthSegments,\n heightSegments,\n phiStart,\n phiLength,\n });\n\n this.material = new MeshStandardMaterial({ color: 0x00ff00, flatShading: true });\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { MoundGeometry } from \"../../geometry/terrain/MoundGeometry.js\";\nimport { radiusFromCapWidth } from \"../../utils/SphericalGeometryUtils.js\";\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 {\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.geometry = new MoundGeometry({\n radius,\n widthSegments,\n heightSegments,\n phiStart,\n phiLength,\n thetaLength,\n });\n\n this.material = new MeshStandardMaterial({ color: 0x00ff00, flatShading: true });\n }\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(material, { 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(material, deltaTime) {\n if (material.userData.shader) {\n material.userData.shader.uniforms.time.value += deltaTime;\n }\n}\n","import { Direction } from \"../constants/Direction.js\";\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.direction=new Vector3(1, 1, 1)] - The direction of displacement.\n * @param {number} [options.scale=10.0] - The scale of the noise effect.\n */\nexport function addNoiseDisplacement(material, { time = 0.0, intensity = 1.0, direction = Direction.XYZ, scale = 10.0 } = {}) {\n material.onBeforeCompile = (shader) => {\n // Add uniforms for time, direction, intensity, and scale\n shader.uniforms.time = { value: time };\n shader.uniforms.direction = { value: direction };\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 direction;\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(direction) * 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(material, deltaTime) {\n if (material.userData.shader) {\n material.userData.shader.uniforms.time.value += deltaTime;\n }\n}\n","export const daySkyShader = {\n uniforms: {\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 varying vec3 vPosition;\n void main() {\n float y = normalize(vPosition).y * 0.5 + 0.5; // Normalizing y to range 0 to 1\n vec3 topColor = vec3(0.5, 0.8, 1.0); // Light blue\n vec3 bottomColor = vec3(1.0, 1.0, 1.0); // Light white/gray for the horizon\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 } from \"three\";\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, Mesh, ShaderMaterial } from \"three\";\nimport { daySkyShader } from \"../shaders/daySkyShader.js\";\n\nclass DaySkybox extends Mesh {\n constructor(size = 1000) {\n super();\n\n this.geometry = new BoxGeometry(size, size, size);\n\n this.material = new ShaderMaterial({\n vertexShader: daySkyShader.vertexShader,\n fragmentShader: daySkyShader.fragmentShader,\n side: BackSide,\n });\n }\n}\n\nexport { DaySkybox };\n","import { BackSide, Mesh, ShaderMaterial, SphereGeometry } from \"three\";\nimport { nightSkyShader } from \"../shaders/nightSkyShader.js\";\n\nclass NightSkybox extends Mesh {\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 });\n }\n}\n\nexport { NightSkybox };\n","import { Mesh, Vector3 } from \"three\";\nimport { Sky } from \"three/addons/objects/Sky.js\";\n\nclass TwilightSkybox extends Mesh {\n constructor(\n theta = Math.PI * 0.49, // Elevation angle (0 to PI)\n phi = 2 * Math.PI * 0.25, // Azimuth angle (0 to 2*PI)\n turbidity = 10,\n rayleigh = 2,\n mieCoefficient = 0.005,\n mieDirectionalG = 0.8,\n ) {\n super();\n\n const sky = new Sky();\n sky.scale.setScalar(450000);\n this.add(sky);\n\n const skyUniforms = sky.material.uniforms;\n skyUniforms[\"turbidity\"].value = turbidity;\n skyUniforms[\"rayleigh\"].value = rayleigh;\n skyUniforms[\"mieCoefficient\"].value = mieCoefficient;\n skyUniforms[\"mieDirectionalG\"].value = mieDirectionalG;\n\n this.skyUniforms = skyUniforms;\n\n this.sunPosition(theta, phi);\n }\n\n sunPosition(theta, phi) {\n const sun = new Vector3();\n const skyUniforms = this.skyUniforms;\n\n sun.setFromSphericalCoords(1, theta, phi);\n skyUniforms[\"sunPosition\"].value.copy(sun);\n }\n}\n\nexport { TwilightSkybox };\n","import { DataTexture, NearestFilter, RepeatWrapping, RGBAFormat, UnsignedByteType } from \"three\";\n\n/**\n * Create a checkerboard texture\n * @param size\n * @returns {DataTexture}\n *\n * @example\n * const material = new MeshStandardMaterial();\n * material.map = createCheckerboardTexture(8);\n */\nexport const checkerboardTexture = (size) => {\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, Vector3 } from \"three\";\n\nexport function centerGroup(group) {\n const box = new Box3().setFromObject(group);\n const center = new Vector3();\n box.getCenter(center);\n group.position.sub(center);\n}\n\nexport function centerGroupAtTarget(group, target = new Vector3(0, 0, 0)) {\n const box = new Box3().setFromObject(group);\n const currentCenter = new Vector3();\n box.getCenter(currentCenter);\n\n const offset = new Vector3().subVectors(target, currentCenter);\n group.position.add(offset);\n}\n","import { Vector3 } from \"three\";\n\nexport function centerInstancedMesh(mesh) {\n mesh.computeBoundingBox();\n const box = mesh.boundingBox;\n const center = box.getCenter(new Vector3());\n\n mesh.translateX(-center.x);\n mesh.translateY(-center.y);\n mesh.translateZ(-center.z);\n}\n","import { Vector2 } from \"three\";\n\n/**\n * Normalizes a time value between a minimum and maximum value.\n */\nfunction normalizeT(t, min, max) {\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 */\nexport function interpolateCurve(curveFunction, startRadius, endRadius, startHeight, endHeight, segments = 20, min = 0, max = 1) {\n const points = [];\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 return points;\n}\n","import { Box3, Vector3 } from \"three\";\n\n/**\n * Centers the given mesh at the origin (0, 0, 0) of the scene by adjusting its position.\n * The mesh is moved so that its bounding box center is placed at the origin.\n */\nexport function centerMesh(mesh) {\n const box = new Box3().setFromObject(mesh);\n const center = box.getCenter(new Vector3());\n\n mesh.translateX(-center.x);\n mesh.translateY(-center.y);\n mesh.translateZ(-center.z);\n mesh.updateMatrixWorld(true);\n}\n\n/**\n * Centers the geometry of the given mesh at the local origin (0, 0, 0) by modifying the geometry vertices.\n * This method moves the geometry itself so that its center is at the local origin,\n * without affecting the position, rotation, or scale of the mesh.\n */\nexport function centerMeshGeometry(mesh) {\n mesh.geometry.computeBoundingBox();\n const box = mesh.geometry.boundingBox;\n const center = box.getCenter(new Vector3());\n\n mesh.geometry.translate(-center.x, -center.y, -center.z);\n}\n","import { ParametricCurve } from \"../constants/ParametricCurve.js\";\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, control1, control2, end, 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, end, damping, 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, end, base, factor, 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, end, base, factor, 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, end, a, b, c, 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, control, end, 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, end, a, 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","import { EffectComposer } from \"three/addons/postprocessing/EffectComposer.js\";\nimport { RenderPass } from \"three/addons/postprocessing/RenderPass.js\";\nimport { ShaderPass } from \"three/addons/postprocessing/ShaderPass.js\";\nimport { fadeShader } from \"../shaders/fadeShader.js\";\n\nclass SceneUtils {\n static dispose(scene) {\n scene?.traverse((object) => {\n if (object.geometry) object.geometry.dispose();\n if (object.material) {\n if (Array.isArray(object.material)) {\n object.material.forEach((mat) => mat.dispose());\n } else {\n object.material.dispose();\n }\n }\n });\n }\n\n static fadeBetween(renderer, camera, scene1, scene2, duration = 1.0) {\n // Create composer and passes\n const composer = new EffectComposer(renderer);\n\n // Render pass for the initial scene\n const renderPass1 = new RenderPass(scene1, camera);\n composer.addPass(renderPass1);\n\n // Shader pass for fade effect\n const fadePass = new ShaderPass(fadeShader);\n fadePass.uniforms[\"opacity\"].value = 1.0;\n composer.addPass(fadePass);\n\n // Start fade out\n let startTime = null;\n\n function animateFadeOut(time) {\n if (!startTime) startTime = time;\n const elapsed = (time - startTime) / 1000;\n const progress = elapsed / duration;\n\n fadePass.uniforms[\"opacity\"].value = Math.max(1.0 - progress, 0.0);\n\n if (progress < 1.0) {\n composer.render();\n requestAnimationFrame(animateFadeOut);\n } else {\n // Switch to the new scene and start fade in\n composer.passes[0] = new RenderPass(scene2, camera);\n startTime = null;\n requestAnimationFrame(animateFadeIn);\n }\n }\n\n function animateFadeIn(time) {\n if (!startTime) startTime = time;\n const elapsed = (time - startTime) / 1000;\n const progress = elapsed / duration;\n\n fadePass.uniforms[\"opacity\"].value = Math.min(progress, 1.0);\n\n if (progress < 1.0) {\n composer.render();\n requestAnimationFrame(animateFadeIn);\n }\n }\n\n // Start the fade-out animation\n requestAnimationFrame(animateFadeOut);\n }\n}\n\nexport { SceneUtils };\n"],"names":["Direction","Vector3","Falloff","distance","radius","t","displacementBrush","geometry","position","strength","direction","falloffFn","positions","i","vertex","influence","flattenBrush","targetHeight","projectedHeight","delta","noiseBrush","falloff","noiseStrength","noise","MathUtils","smoothBrush","tempPosition","averagePosition","count","j","spikeBrush","inward","twistBrush","quaternion","Quaternion","angle","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","parabolicCurve","a","b","c","clampedT","dampedCurve","damping","clampedDamping","quadraticCurve","p0","p1","p2","oneMinusT","cubicCurve","p3","exponentialCurve","base","factor","logarithmicCurve","sigmoidCurve","ParametricCurve","Bubbling","Group","bubbles","bubbleCount","bubbleGeometry","SphereGeometry","bubbleMaterial","MeshStandardMaterial","bubble","Mesh","animateBubbles","animate","BookGeometry","BufferGeometry","width","height","depth","coverThickness","pageIndent","w","h","d","vertices","normals","u1","u2","uvs","indices","normalArray","uvArray","indexArray","coverGeometry","BufferAttribute","pagesGeometry","BoxGeometry","mergeGeometries","randomFloat","min","max","randomInteger","logarithmicRandomMax","exponent","logarithmicRandomMin","randomScale","scaleXMin","scaleXMax","scaleYMin","scaleYMax","scaleZMin","scaleZMax","rowOfBooksByScales","coverMaterial","pagesMaterial","scales","row","InstancedMesh","matrix","Matrix4","currentZ","scale","scaleMatrix","rowOfBooksByCount","rowOfBooksByLength","length","remainingZ","BifurcatedStaircaseGeometry","stepWidth","stepHeight","stepDepth","numStepsCentral","numStepsBranch","branchAngle","yBottom","yTop","zFront","zBack","baseIndex","landingY","landingZ","landingWidth","landingBaseIndex","xStart","zStart","xOffset","zOffset","xFrontLeft","xFrontRight","xBackLeft","xBackRight","Float32BufferAttribute","DioramaGeometry","wallThickness","LShapedStaircaseGeometry","numStepsPerFlight","landingDepth","xFront","xBack","SpiralStaircaseGeometry","numSteps","angleIncrement","currentAngle","xCenter","zCenter","StaircaseGeometry","stepBottomY","stepTopY","stepFrontZ","stepBackZ","CrossHeadstoneGeometry","verticalHeight","verticalGeometry","horizontalWidth","horizontalGeometry","ObeliskHeadstoneGeometry","totalHeight","baseWidth","baseHeight","lowerSegmentHeight","middleSegmentHeight","topSegmentHeight","currentHeight","baseGeometry","lowerSegmentGeometry","middleSegmentGeometry","topSegmentGeometry","pyramidGeometry","ConeGeometry","RoundedHeadstoneGeometry","topGeometry","CylinderGeometry","SquareHeadstoneGeometry","slabGeometry","FenceColumnGeometry","columnGeometry","capGeometry","WroughtIronBarGeometry","barHeight","barRadius","spikeHeight","spikeRadius","spikeScaleZ","radialSegments","barGeometry","spikeGeometry","WroughtIronFenceGeometry","spacing","railHeight","railDepth","railOffset","geometries","bar","rail","topRail","bottomRail","BookshelfGeometry","shelves","frameThickness","open","frameHeight","frameWidth","frameDepth","sidePanelGeometry","shelfGeometry","leftPanel","rightPanel","topPanel","bottomPanel","backPanel","shelfPanels","shelfSpacing","shelfPanel","SimpleLeafGeometry","size","leafPoints","x","y","positionAttribute","randomTransformVertices","minScale","maxScale","mergeVertices","displacement","RockGeometry","widthSegments","heightSegments","sphere","BoneGeometry","radiusTop","radiusBottom","cylinderGeometry","sphereGeometry","topSphere1","topSphere2","bottomSphere1","bottomSphere2","BeakerGeometry","tubeGeometry","ErlenmeyerFlaskGeometry","flaskRadius","neckRadius","neckHeight","points","Vector2","flaskGeometry","LatheGeometry","MortarGeometry","mortarPoints","mortarGeometry","baseDisk","CircleGeometry","StandGeometry","thickness","ringGeometry","TorusGeometry","legGeometry","legs","leg","TestTubeGeometry","segments","openEnded","bottomGeometry","WineBottleGeometry","bodyHeight","bodyGeometry","shoulderHeight","shoulderGeometry","neckGeometry","HillGeometry","phiStart","phiLength","radiusFromCapHeight","thetaLength","radiusFromCapWidth","capHeightFromRadius","capWidthFromRadius","sphericalToCartesian","theta","phi","cartesianToSpherical","z","MoundGeometry","TreeGeometry","trunkRadiusTop","trunkRadiusBottom","trunkHeight","trunkSegments","leafSize","leafCount","leafDetail","leafSpreadRadius","trunk","leafs","leaf","DodecahedronGeometry","Moon","moonGeometry","moonMaterial","ShaderMaterial","moon","Book","coverColor","pageColor","CrossHeadstone","Mausoleum","baseMaterial","baseMesh","buildingGeometry","buildingMaterial","buildingMesh","roofGeometry","roofMaterial","roofMesh","pillarGeometry","pillarMaterial","pillarMesh","archShape","Shape","extrudeSettings","archGeometry","ExtrudeGeometry","archMaterial","archMesh","ObeliskHeadstone","RoundedHeadstone","SquareHeadstone","FenceColumn","WroughtIronBar","WroughtIronFence","Bookshelf","Desk","surfaceGeometry","surfaceMaterial","deskSurface","legMaterial","Candle","candleGeometry","candleMaterial","flameGeometry","flameMaterial","MeshBasicMaterial","PointLight","flicker","Lantern","bodyMaterial","bodyMesh","handleGeometry","handleMaterial","handleMesh","light","MossyRocks","rockGeometry","rockMaterial","mossMaterial","rockMesh","mossMesh","Rock","Rocks","Beaker","beakerGeometry","glassMaterial","MeshPhysicalMaterial","DoubleSide","beaker","Bottle","bottlePoints","bottleGeometry","corkGeometry","liquidMaterial","corkMaterial","bottle","liquid","cork","potionBottle","BunsenBurner","tubeMaterial","tube","flame","ElectricPanel","panelGeometry","panelMaterial","switchGeometry","switchMaterial","dialGeometry","dialMaterial","panel","toggleSwitch","dial","lightGeometry","lightMaterial","flickerSpeed","flickerMaxIntensity","flickerMinIntensity","flickerIntensity","ErlenmeyerFlask","Flask","flaskPoints","flask","LeverPanel","leverPanelGeometry","leverPanelMaterial","leverPanel","leverBaseGeometry","leverHandleGeometry","leverMaterial","leverBase","leverHandle","Microscope","armGeometry","arm","eyepieceGeometry","eyepieceMaterial","eyepiece","stageGeometry","stageMaterial","stage","MortarAndPestle","pestleGeometry","mortarMaterial","pestleMaterial","mortar","pestle","SpiralTube","spiralLength","heightIncrement","curve","CatmullRomCurve3","_","TubeGeometry","multiSpiralTube","animateFluid","Stand","TeslaCoil","coilBaseGeometry","coilBaseMaterial","coilBase","coilGeometry","coilMaterial","coil","coilTopGeometry","coilTop","sparks","sparkMaterial","LineBasicMaterial","sparkGeometry","spark","Line","animateSparks","TestTube","TestTubeRack","colors","rackGeometry","rackMaterial","rack","testTubeGeometry","testTube","xPosition","liquidGeometry","liquidColor","WineBottle","wineBottle","bottleMaterial","BurstShape","sides","innerRadius","outerRadius","step","halfStep","qtrStep","n","cx","cy","dx","dy","Burst","shape","material","GearShape","holeSides","holeRadius","hole","Path","holeStep","Gear","HeartShape","tipDepth","Heart","StarShape","Star","Bone","Tree","trunkColor","leafColor","treeGeometry","trunkMaterial","leafMaterial","Hill","Mound","addWaterDisplacement","time","waveFrequency","waveAmplitude","shader","updateWaterDisplacementTime","deltaTime","addNoiseDisplacement","intensity","updateNoiseDisplacementTime","daySkyShader","fadeShader","nightSkyShader","Color","DaySkybox","BackSide","NightSkybox","TwilightSkybox","turbidity","rayleigh","mieCoefficient","mieDirectionalG","sky","Sky","skyUniforms","sun","checkerboardTexture","data","stride","color","texture","DataTexture","RGBAFormat","UnsignedByteType","RepeatWrapping","NearestFilter","centerGroup","group","box","Box3","center","centerGroupAtTarget","target","currentCenter","offset","centerInstancedMesh","mesh","normalizeT","interpolateCurve","curveFunction","startRadius","endRadius","startHeight","endHeight","easedT","centerMesh","centerMeshGeometry","createCubicCurvePoints","start","control1","control2","end","curvePoints","createDampedCurvePoints","createExponentialCurvePoints","createLogarithmicCurvePoints","createParabolicCurvePoints","createQuadraticCurvePoints","control","createSigmoidCurvePoints","ParametricCurveUtils","SceneUtils","scene","object","mat","renderer","camera","scene1","scene2","duration","composer","EffectComposer","renderPass1","RenderPass","fadePass","ShaderPass","startTime","animateFadeOut","progress","animateFadeIn"],"mappings":";;;;;;AAEY,MAACA,IAAY;AAAA,EACvB,IAAI,IAAIC,E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I,GAAU,CAAG,GAE7DA,IAAW,KACbR,EAAS,OAAM,GACf,sBAAsBO,CAAc,MAGpCP,EAAS,OAAO,CAAC,IAAI,IAAIG,GAAWL,GAAQF,CAAM,GAClDU,IAAY,MACZ,sBAAsBG,CAAa;AAAA,IAEtC;AAED,aAASA,EAAcxF,GAAM;AAC3B,MAAKqF,MAAWA,IAAYrF;AAE5B,YAAMuF,KADWvF,IAAOqF,KAAa,MACVP;AAE3B,MAAAK,EAAS,SAAS,QAAW,QAAQ,KAAK,IAAII,GAAU,CAAG,GAEvDA,IAAW,MACbR,EAAS,OAAM,GACf,sBAAsBS,CAAa;AAAA,IAEtC;AAGD,0BAAsBF,CAAc;AAAA,EACrC;AACH;"}
1
+ {"version":3,"file":"index.es.js","sources":["../src/animators/dollyAnimation.ts","../src/animators/flythroughAnimation.ts","../src/animators/orbitAnimation.ts","../src/animators/pendulumAnimation.ts","../src/animators/spiralAscentionAnimation.ts","../src/animators/wobbleAnimation.ts","../src/animators/zoomInAnimation.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/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","../src/geometry/books/BookGeometry.ts","../src/utils/RandomNumberUtils.ts","../src/factory/BookFactory.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/cemetery/CrossHeadstoneGeometry.ts","../src/geometry/cemetery/ObeliskHeadstoneGeometry.ts","../src/geometry/cemetery/RoundedHeadstoneGeometry.ts","../src/geometry/cemetery/SquareHeadstoneGeometry.ts","../src/geometry/fence/FenceColumnGeometry.ts","../src/geometry/fence/WroughtIronBarGeometry.ts","../src/geometry/fence/WroughtIronFenceGeometry.ts","../src/geometry/furniture/BookshelfGeometry.ts","../src/utils/VertexUtils.ts","../src/geometry/rocks/RockGeometry.ts","../src/geometry/skeleton/BoneGeometry.ts","../src/geometry/science/BeakerGeometry.ts","../src/geometry/science/ErlenmeyerFlaskGeometry.ts","../src/geometry/science/MortarGeometry.ts","../src/geometry/science/StandGeometry.ts","../src/geometry/science/TestTubeGeometry.ts","../src/geometry/science/WineBottleGeometry.ts","../src/geometry/terrain/HillGeometry.ts","../src/utils/SphericalGeometryUtils.ts","../src/geometry/terrain/MoundGeometry.ts","../src/geometry/trees/TreeGeometry.ts","../src/models/astronomy/Moon.ts","../src/models/books/Book.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/FenceColumn.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/Lantern.ts","../src/models/rocks/MossyRocks.ts","../src/models/rocks/Rock.ts","../src/models/rocks/Rocks.ts","../src/models/science/Beaker.ts","../src/models/science/Bottle.ts","../src/models/science/BunsenBurner.ts","../src/models/science/ElectricPanel.ts","../src/models/science/ErlenmeyerFlask.ts","../src/models/science/Flask.ts","../src/models/science/LeverPanel.ts","../src/models/science/Microscope.ts","../src/models/science/MortarAndPestle.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/models/science/WineBottle.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/GroupUtils.ts","../src/utils/InstancedMeshUtils.ts","../src/utils/InterpolateCurve.ts","../src/utils/MeshUtils.ts","../src/utils/ParametricCurveUtils.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 dollyAnimation(\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 flythroughAnimation(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 orbitAnimation(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 pendulumAnimation(\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 spiralAscensionAnimation(\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 wobbleAnimation(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 zoomInAnimation(\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 { Vector3 } from \"three\";\n\n/**\n * Examples\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 * Rotating or Orienting an Object\n * ```\n * const targetDirection = Direction.XY; // Diagonal upward\n * object.lookAt(object.position.clone().add(targetDirection));\n * ```\n *\n * Procedural Geometry\n * ```\n * const vertex = new Vector3(0, 0, 0);\n * const direction = Direction.XZ; // Diagonal direction on XZ plane\n *\n * const offset = direction.clone().multiplyScalar(5);\n * vertex.add(offset); // Move vertex in direction\n * geometry.vertices.push(vertex);\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 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 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","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 { BoxGeometry, BufferAttribute, BufferGeometry } from \"three\";\nimport { mergeBufferGeometries } from \"three-stdlib\";\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","/**\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 { 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 { 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 { BufferGeometry, Float32BufferAttribute } from \"three\";\n\nclass DioramaGeometry extends BufferGeometry {\n constructor(width = 5, height = 3, depth = 5, wallThickness = 0.2) {\n super();\n\n // Vertices array (each set of 3 numbers represents x, y, z of a vertex)\n const vertices = [\n // Floor vertices\n -width / 2, 0, -depth / 2, // 0\n width / 2, 0, -depth / 2, // 1\n width / 2, 0, depth / 2, // 2\n -width / 2, 0, depth / 2, // 3\n\n // Back wall vertices\n -width / 2, 0, -depth / 2, // 4\n width / 2, 0, -depth / 2, // 5\n width / 2, height, -depth / 2, // 6\n -width / 2, height, -depth / 2, // 7\n\n // Left wall vertices\n -width / 2, 0, -depth / 2, // 8\n -width / 2, 0, depth / 2, // 9\n -width / 2, height, depth / 2, // 10\n -width / 2, height, -depth / 2, // 11\n ];\n\n // Indices array (each set of 3 numbers represents a triangle)\n const indices = [\n // Floor\n 0, 1, 2,\n 0, 2, 3,\n\n // Back wall\n 4, 5, 6,\n 4, 6, 7,\n\n // Left wall\n 8, 9, 10,\n 8, 10, 11,\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 { DioramaGeometry }\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 { 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 } 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 FenceColumnGeometry 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 { BufferGeometry, Vector3 } from \"three\";\nimport { Direction } from \"../constants/Direction\";\nimport { mergeVertices } from \"three-stdlib\";\n\nexport function randomTransformVertices<T extends BufferGeometry>(geometry:T, direction = Direction.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 direction\n const randomScale = Math.random() * (maxScale - minScale) + minScale;\n const displacement = direction.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 { BufferGeometry, SphereGeometry } from \"three\";\nimport { Direction } from \"../../constants/Direction\";\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, Direction.XYZ, 0.5, 1.0));\n this.computeVertexNormals();\n this.center();\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, CylinderGeometry, SphereGeometry } from \"three\";\nimport { mergeBufferGeometries } from \"three-stdlib\";\n\nexport class BeakerGeometry extends BufferGeometry {\n constructor() {\n super();\n\n // Create the sphere part of the glassware\n const sphereGeometry = new SphereGeometry(1, 16, 16);\n const tubeGeometry = new CylinderGeometry(0.2, 0.2, 2, 16, 1, true);\n\n // Adjust tube position to stick out of the sphere\n tubeGeometry.translate(0, 1.5, 0);\n tubeGeometry.rotateX(Math.PI / 2);\n\n this.copy(mergeBufferGeometries([sphereGeometry, tubeGeometry], false) as BufferGeometry);\n }\n}\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","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\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, 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 { 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","/**\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 * 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 { 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 { Group, Mesh, ShaderMaterial, SphereGeometry } from \"three\";\n\nclass Moon extends Group {\n constructor() {\n super();\n\n // Create moon geometry\n const moonGeometry = new SphereGeometry(5, 32, 32);\n\n // Custom ShaderMaterial\n const moonMaterial = new ShaderMaterial({\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\n // Create the moon mesh and add it to the scene\n const moon = new Mesh(moonGeometry, moonMaterial);\n this.add(moon);\n }\n}\n\nexport { Moon };\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { BookGeometry } from \"../../geometry/books/BookGeometry\";\n\nexport class Book extends Mesh {\n constructor({\n width = 1,\n height = 1.5,\n depth = 0.5,\n coverThickness = 0.05,\n pageIndent = 0.05,\n coverColor = 0x8b0000,\n pageColor = 0xffffff,\n } = {}) {\n super();\n\n this.geometry = new BookGeometry(width, height, depth, coverThickness, pageIndent);\n this.material = [\n new MeshStandardMaterial({ color: coverColor, metalness: 0.1, roughness: 0.7, flatShading: true }),\n new MeshStandardMaterial({ color: pageColor, flatShading: true }),\n ];\n }\n}\n","import { Mesh, MeshStandardMaterial, Material } from \"three\";\nimport { CrossHeadstoneGeometry } from \"../../geometry/cemetery/CrossHeadstoneGeometry\";\n\ninterface CrossHeadstoneOptions {\n width?: number;\n height?: number;\n depth?: number;\n material?: Material;\n}\n\nexport class CrossHeadstone extends Mesh {\n constructor({\n width = 0.4,\n height = 1.2,\n depth = 0.2,\n material = new MeshStandardMaterial({ color: 0x777777, roughness: 0.8 }),\n }: CrossHeadstoneOptions = {}) {\n const geometry = new CrossHeadstoneGeometry(width, height, depth);\n super(geometry, material);\n }\n}\n","import { BoxGeometry, ConeGeometry, CylinderGeometry, ExtrudeGeometry, Group, Mesh, MeshStandardMaterial, Shape } from \"three\";\n\nclass Mausoleum extends Group {\n constructor() {\n super();\n\n // Base of the Mausoleum\n const baseGeometry = new BoxGeometry(5, 1, 5);\n const baseMaterial = new MeshStandardMaterial({ color: 0x808080, flatShading: true });\n const baseMesh = new Mesh(baseGeometry, baseMaterial);\n baseMesh.position.set(0, 0.5, 0);\n this.add(baseMesh);\n\n // Main Building Structure\n const buildingGeometry = new BoxGeometry(4, 3, 4);\n const buildingMaterial = new MeshStandardMaterial({ color: 0x696969, flatShading: true });\n const buildingMesh = new Mesh(buildingGeometry, buildingMaterial);\n buildingMesh.position.set(0, 2.5, 0);\n this.add(buildingMesh);\n\n // Roof (Peaked)\n const roofGeometry = new ConeGeometry(3.5, 2, 4);\n const roofMaterial = new MeshStandardMaterial({ color: 0x505050, flatShading: true });\n const roofMesh = new Mesh(roofGeometry, roofMaterial);\n roofMesh.rotation.y = Math.PI / 4;\n roofMesh.position.set(0, 5, 0);\n this.add(roofMesh);\n\n // Pillars\n const pillarGeometry = new CylinderGeometry(0.2, 0.2, 3.5, 16);\n const pillarMaterial = new MeshStandardMaterial({ color: 0x696969, flatShading: true });\n\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 pillarPositions.forEach((position) => {\n const pillarMesh = new Mesh(pillarGeometry, pillarMaterial);\n pillarMesh.position.set(position[0], position[1], position[2]);\n this.add(pillarMesh);\n });\n\n // Corrected 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 const archMaterial = new MeshStandardMaterial({ color: 0x404040, flatShading: true });\n const archMesh = new Mesh(archGeometry, archMaterial);\n archMesh.position.set(0, 0.5, 1.7);\n this.add(archMesh);\n }\n}\n\nexport { Mausoleum };\n","import { Material, 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 {\n constructor({ totalHeight = 1.75, baseWidth = 0.75 }: ObeliskHeadstoneOptions = {}) {\n super();\n\n this.geometry = new ObeliskHeadstoneGeometry(totalHeight, baseWidth);\n this.material = new MeshStandardMaterial({ color: 0x777777, roughness: 0.8 });\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { RoundedHeadstoneGeometry } from \"../../geometry/cemetery/RoundedHeadstoneGeometry\";\n\nexport class RoundedHeadstone extends Mesh {\n constructor(width = 0.6, height = 1.0, depth = 0.2, radius = 0.6) {\n super();\n\n this.geometry = new RoundedHeadstoneGeometry(width, height, depth, radius);\n this.material = new MeshStandardMaterial({ color: 0x777777, roughness: 0.8 });\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { SquareHeadstoneGeometry } from \"../../geometry/cemetery/SquareHeadstoneGeometry\";\n\nexport class SquareHeadstone extends Mesh {\n constructor(width = 0.5, height = 0.8, depth = 0.15) {\n super();\n\n this.geometry = new SquareHeadstoneGeometry(width, height, depth);\n this.material = new MeshStandardMaterial({ color: 0x777777, roughness: 0.8 });\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { FenceColumnGeometry } from \"../../geometry/fence/FenceColumnGeometry\";\n\nexport class FenceColumn extends Mesh {\n constructor({ height = 2.25 } = {}) {\n super();\n\n this.geometry = new FenceColumnGeometry({ height });\n this.material = new MeshStandardMaterial({ color: 0x8b7d7b, flatShading: true });\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { WroughtIronBarGeometry } from \"../../geometry/fence/WroughtIronBarGeometry\";\n\nexport class WroughtIronBar extends Mesh {\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 this.geometry = new WroughtIronBarGeometry({\n barHeight,\n barRadius,\n spikeHeight,\n spikeRadius,\n spikeScaleZ,\n radialSegments,\n });\n this.material = new MeshStandardMaterial({ color: 0x333333, metalness: 0.8, roughness: 0.4 });\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { WroughtIronFenceGeometry } from \"../../geometry/fence/WroughtIronFenceGeometry\";\n\nexport class WroughtIronFence extends Mesh {\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 this.geometry = 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 this.material = new MeshStandardMaterial({ color: 0x333333, metalness: 0.8, roughness: 0.4 });\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { BookshelfGeometry } from \"../../geometry/furniture/BookshelfGeometry\";\n\nexport class Bookshelf extends Mesh {\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 this.geometry = new BookshelfGeometry({ width, height, depth, shelves, frameThickness, open });\n this.material = new MeshStandardMaterial({ color: 0x8b4513 });\n }\n}\n","import { BoxGeometry, Group, LatheGeometry, Mesh, MeshStandardMaterial, Vector2 } from \"three\";\n\nclass Desk extends Group {\n constructor() {\n super();\n\n // Desk Surface\n const surfaceGeometry = new BoxGeometry(5, 0.3, 3); // Width, Height (depth), Length\n const surfaceMaterial = new MeshStandardMaterial({ color: 0x8b5a2b }); // Wood-like color\n const deskSurface = new Mesh(surfaceGeometry, surfaceMaterial);\n deskSurface.position.set(0, 3.15, 0); // Raise the desk up\n\n // Desk Legs (using lathe geometry)\n const points = [];\n points.push(new Vector2(0.2, 0)); // Starting point at bottom (thin)\n points.push(new Vector2(0.25, 0.5)); // Curve outward\n points.push(new Vector2(0.15, 1.5)); // Narrow toward the middle\n points.push(new Vector2(0.3, 3)); // Final part toward the top\n\n const legGeometry = new LatheGeometry(points, 32);\n const legMaterial = new MeshStandardMaterial({ color: 0x4b3621 }); // Darker wood for legs\n\n // Create four legs for the desk\n const legPositions = [\n [2.2, 0, 1.2], // Adjust Y to 0 so legs start at ground level\n [-2.2, 0, 1.2],\n [2.2, 0, -1.2],\n [-2.2, 0, -1.2],\n ];\n\n legPositions.forEach((position) => {\n const leg = new Mesh(legGeometry, legMaterial);\n leg.position.set(position[0], position[1], position[2]);\n this.add(leg);\n });\n\n this.add(deskSurface);\n }\n}\n\nexport { Desk };\n","import { CylinderGeometry, Group, Mesh, MeshBasicMaterial, MeshStandardMaterial, PointLight, SphereGeometry } from \"three\";\n\nclass Candle extends Group {\n private candle: Mesh;\n private flame: Mesh;\n private candleLight: PointLight;\n private height: number;\n private radius: number;\n\n constructor(height = 1, radius = 0.2) {\n super();\n this.height = height;\n this.radius = radius;\n\n // Candle Geometry\n const candleGeometry = new CylinderGeometry(this.radius, this.radius, this.height, 32);\n const candleMaterial = new MeshStandardMaterial({ color: 0xffffff });\n this.candle = new Mesh(candleGeometry, candleMaterial);\n this.candle.position.set(0, this.height / 2, 0);\n this.add(this.candle);\n\n // Flame Geometry\n const flameGeometry = new SphereGeometry(0.05, 16, 16);\n const flameMaterial = new MeshBasicMaterial({ color: 0xffa500 });\n this.flame = new Mesh(flameGeometry, flameMaterial);\n this.flame.position.set(0, this.height + 0.05, 0);\n this.add(this.flame);\n\n // Candlelight\n this.candleLight = new PointLight(0xffa500, 1, 5);\n this.candleLight.position.set(0, this.height + 0.05, 0);\n this.candleLight.castShadow = true;\n this.add(this.candleLight);\n\n this.animateFlicker();\n }\n\n animateFlicker() {\n const flicker = () => {\n // Random flicker intensity between 0.8 and 1.2\n this.candleLight.intensity = 1 + (Math.random() * 0.4 - 0.2);\n\n // Optional: slight random movement to simulate a flickering flame\n this.candleLight.position.x = Math.random() * 0.02 - 0.01;\n this.candleLight.position.z = Math.random() * 0.02 - 0.01;\n\n requestAnimationFrame(flicker);\n };\n flicker();\n }\n}\n\nexport { Candle };\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 { DodecahedronGeometry, Group, Mesh, MeshStandardMaterial } from \"three\";\n\nclass MossyRocks extends Group {\n constructor() {\n super();\n\n // Rock Geometry (using Dodecahedron for a low-poly random rock-like shape)\n const rockGeometry = new DodecahedronGeometry(1, 0); // Low-poly shape\n const rockMaterial = new MeshStandardMaterial({ color: 0x808080, flatShading: true });\n const mossMaterial = new MeshStandardMaterial({ color: 0x4b8b3b, flatShading: true, opacity: 0.8, transparent: true });\n\n // Create multiple random rocks with slight variations\n for (let i = 0; i < 5; i++) {\n const rockMesh = new Mesh(rockGeometry, rockMaterial);\n rockMesh.scale.set(0.8 + Math.random() * 0.4, 0.8 + Math.random() * 0.4, 0.8 + Math.random() * 0.4); // Scale randomly to make each rock unique\n rockMesh.rotation.set(Math.random() * Math.PI, Math.random() * Math.PI, Math.random() * Math.PI); // Random rotation for variation\n rockMesh.position.set((Math.random() - 0.5) * 4, 0, (Math.random() - 0.5) * 4); // Keep rocks at ground level\n this.add(rockMesh);\n\n // Moss Layer (using a slightly smaller scale and positioned on top of the rock)\n const mossMesh = new Mesh(rockGeometry, mossMaterial);\n mossMesh.scale.set(rockMesh.scale.x * 0.9, rockMesh.scale.y * 0.5, rockMesh.scale.z * 0.9); // Make the moss layer flatter\n mossMesh.rotation.copy(rockMesh.rotation);\n mossMesh.position.copy(rockMesh.position);\n mossMesh.position.y += 0.3; // Raise the moss slightly to sit on top of the rock\n this.add(mossMesh);\n }\n }\n}\n\nexport { MossyRocks };\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { RockGeometry } from \"../../geometry/rocks/RockGeometry\";\n\nexport class Rock extends Mesh {\n constructor(radius = 1, widthSegments = 4, heightSegments = 4) {\n super();\n\n // Create a rock geometry\n this.geometry = new RockGeometry(radius, widthSegments, heightSegments);\n this.material = new MeshStandardMaterial({ color: 0x808080, flatShading: true });\n }\n}\n","import { DodecahedronGeometry, Group, Mesh, MeshStandardMaterial } from \"three\";\n\nclass Rocks extends Group {\n constructor() {\n super();\n\n // Rock Geometry (using Dodecahedron for a low-poly random rock-like shape)\n const rockGeometry = new DodecahedronGeometry(1, 0); // Low-poly shape\n const rockMaterial = new MeshStandardMaterial({ color: 0x808080, flatShading: true });\n\n // Create multiple random rocks with slight variations\n for (let i = 0; i < 5; i++) {\n const rockMesh = new Mesh(rockGeometry, rockMaterial);\n rockMesh.scale.set(0.8 + Math.random() * 0.4, 0.8 + Math.random() * 0.4, 0.8 + Math.random() * 0.4); // Scale randomly to make each rock unique\n rockMesh.rotation.set(Math.random() * Math.PI, Math.random() * Math.PI, Math.random() * Math.PI); // Random rotation for variation\n rockMesh.position.set((Math.random() - 0.5) * 4, 0, (Math.random() - 0.5) * 4); // Keep rocks at ground level\n this.add(rockMesh);\n }\n }\n}\n\nexport { Rocks };\n","import { BeakerGeometry } from \"../../geometry/science/BeakerGeometry\";\nimport { DoubleSide, Group, Mesh, MeshPhysicalMaterial } from \"three\";\n\nclass Beaker extends Group {\n constructor() {\n super();\n\n // Create the geometry\n const beakerGeometry = new BeakerGeometry();\n\n // Create a group to combine the geometries\n const glassMaterial = 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 const beaker = new Mesh(beakerGeometry, glassMaterial);\n beaker.rotation.x = -Math.PI / 2;\n this.add(beaker);\n }\n}\n\nexport { Beaker };\n","import { CylinderGeometry, Group, LatheGeometry, Mesh, MeshStandardMaterial, Vector2 } from \"three\";\n\nclass Bottle extends Group {\n constructor() {\n super();\n\n // Potion bottle geometry\n const bottlePoints = [\n new Vector2(0, 0), // Bottom\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 ];\n const bottleGeometry = new LatheGeometry(bottlePoints, 10); // Low-poly segments\n\n // Cork geometry\n const corkGeometry = new CylinderGeometry(0.3, 0.4, 0.2, 8);\n\n // Materials\n const glassMaterial = new MeshStandardMaterial({\n color: 0x88ccff,\n transparent: true,\n opacity: 0.5,\n roughness: 0.1,\n metalness: 0.3,\n });\n\n const liquidMaterial = new MeshStandardMaterial({\n color: 0xff3366, // Vibrant potion color\n transparent: true,\n opacity: 0.6,\n });\n\n const corkMaterial = new MeshStandardMaterial({\n color: 0x8b4513,\n roughness: 1.0,\n });\n\n // Meshes\n const bottle = new Mesh(bottleGeometry, glassMaterial);\n const liquid = new Mesh(bottleGeometry, liquidMaterial);\n const cork = new Mesh(corkGeometry, corkMaterial);\n\n // Adjust liquid position to appear inside bottle\n liquid.scale.set(0.8, 0.8, 0.8);\n liquid.position.y = 0.1; // Position slightly lower to appear \"inside\"\n\n // Position cork at the bottle's mouth\n cork.position.y = 2.5;\n\n // Group all elements for easy manipulation\n const potionBottle = new Group();\n potionBottle.add(bottle, liquid, cork);\n this.add(potionBottle);\n }\n}\n\nexport { Bottle };\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 {\n constructor({\n flaskRadius = 1, //\n neckRadius = 0.3,\n height = 2.5,\n neckHeight = 1,\n radialSegments = 16,\n } = {}) {\n super();\n\n this.geometry = new ErlenmeyerFlaskGeometry({ flaskRadius, neckRadius, height, neckHeight, radialSegments });\n this.material = 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 wireframe: false,\n });\n }\n}\n","import { CylinderGeometry, Group, LatheGeometry, Mesh, MeshStandardMaterial, Vector2 } from \"three\";\n\nclass Flask extends Group {\n constructor() {\n super();\n\n // Flask body geometry\n const flaskPoints = [\n new Vector2(0, 0), // Bottom of the flask\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 flask\n ];\n const flaskGeometry = new LatheGeometry(flaskPoints, 12); // 12 segments for low-poly style\n\n // Cork stopper geometry\n const corkGeometry = new CylinderGeometry(0.6, 0.7, 0.3, 8); // Simple tapered cylinder\n\n // Materials for flask and cork\n const glassMaterial = new MeshStandardMaterial({\n color: 0x88ccaa,\n transparent: true,\n opacity: 0.4,\n roughness: 0.1,\n metalness: 0.5,\n depthWrite: false,\n });\n\n const corkMaterial = new MeshStandardMaterial({\n color: 0x8b4513,\n roughness: 1.0,\n });\n\n // Meshes\n const flask = new Mesh(flaskGeometry, glassMaterial);\n const cork = new Mesh(corkGeometry, corkMaterial);\n\n // Position cork on top of the flask\n cork.position.y = 3.5;\n\n // Add both to a single object for easy manipulation\n this.add(flask, cork);\n }\n}\n\nexport { Flask };\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 const pestle = new Mesh(pestleGeometry, pestleMaterial);\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 { 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\nclass Stand extends Mesh {\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 this.geometry = new StandGeometry({ radius, height, count, thickness, radialSegments });\n this.material = new MeshStandardMaterial({\n color: 0x888888,\n roughness: 0.7,\n metalness: 0.3,\n });\n }\n}\n\nexport { Stand };\n","import {\n BufferGeometry,\n CylinderGeometry,\n DoubleSide,\n Group,\n Line,\n LineBasicMaterial,\n Mesh,\n MeshStandardMaterial,\n SphereGeometry,\n Vector3,\n} from \"three\";\n\nclass TeslaCoil extends Group {\n constructor() {\n super();\n\n // Base geometry\n const coilBaseGeometry = new CylinderGeometry(0.5, 0.6, 0.3, 16);\n const coilBaseMaterial = new MeshStandardMaterial({\n color: 0x333333,\n roughness: 0.6,\n metalness: 0.5,\n });\n const coilBase = new Mesh(coilBaseGeometry, coilBaseMaterial);\n coilBase.position.y = 0.15;\n\n // Coil geometry\n const coilGeometry = new CylinderGeometry(0.15, 0.15, 2, 12, 1, true);\n const coilMaterial = new MeshStandardMaterial({\n color: 0xff6600,\n roughness: 0.5,\n metalness: 0.8,\n side: DoubleSide,\n });\n const coil = new Mesh(coilGeometry, coilMaterial);\n coil.position.y = 1.3;\n\n // Sphere at the top\n const coilTopGeometry = new SphereGeometry(0.3, 16, 16);\n const coilTop = new Mesh(coilTopGeometry, coilMaterial);\n coilTop.position.y = 2.4;\n\n this.add(coilBase, coil, coilTop);\n }\n}\n\nexport { TeslaCoil };\n","import { DoubleSide, Group, Mesh, MeshPhysicalMaterial } from \"three\";\nimport { TestTubeGeometry } from \"../../geometry/science/TestTubeGeometry\";\n\nclass TestTube extends Group {\n constructor(radiusTop = 0.2, radiusBottom = 0.2, height = 3, segments = 32) {\n super();\n\n // Test Tube Geometry\n const tubeGeometry = new TestTubeGeometry(radiusTop, radiusBottom, height, segments);\n\n const tubeMaterial = 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, // For glass effect\n depthWrite: false,\n side: DoubleSide,\n });\n\n const tube = new Mesh(tubeGeometry, tubeMaterial);\n\n this.add(tube);\n }\n}\n\nexport { TestTube };\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\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\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 { Mesh, MeshPhysicalMaterial } from \"three\";\nimport { WineBottleGeometry } from \"../../geometry/science/WineBottleGeometry\";\n\nclass WineBottle extends Mesh {\n constructor() {\n super();\n\n // Create wine bottle geometry\n const wineBottle = new WineBottleGeometry();\n\n // Create a glass-like material\n const bottleMaterial = new MeshPhysicalMaterial({\n color: 0x556b2f,\n roughness: 0.1,\n transmission: 0.9, // Makes the material transparent\n thickness: 0.2,\n metalness: 0,\n clearcoat: 1.0,\n clearcoatRoughness: 0.1,\n });\n\n // Create mesh and add to the scene\n this.geometry = wineBottle;\n this.material = bottleMaterial;\n }\n}\n\nexport { WineBottle };\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 {\n constructor() {\n super();\n\n this.geometry = new BoneGeometry();\n this.material = new MeshStandardMaterial({ color: 0xffffff });\n }\n}\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { TreeGeometry } from \"../../geometry/trees/TreeGeometry\";\n\n/**\n * @example\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 */\nclass Tree extends Mesh {\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\n const treeGeometry = 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 const trunkMaterial = new MeshStandardMaterial({\n color: trunkColor,\n roughness: 0.9,\n metalness: 0,\n flatShading: true,\n });\n\n const leafMaterial = new MeshStandardMaterial({\n color: leafColor,\n roughness: 0.8,\n metalness: 0,\n flatShading: true,\n });\n\n this.geometry = treeGeometry;\n this.material = [trunkMaterial, leafMaterial];\n }\n}\n\nexport { Tree };\n","import { Mesh, MeshStandardMaterial } from \"three\";\nimport { HillGeometry } from \"../../geometry/terrain/HillGeometry\";\n\nexport class Hill extends Mesh {\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.geometry = new HillGeometry({\n radius,\n height,\n widthSegments,\n heightSegments,\n phiStart,\n phiLength,\n });\n\n this.material = new MeshStandardMaterial({ color: 0x00ff00, flatShading: true });\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 {\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.geometry = new MoundGeometry({\n radius,\n widthSegments,\n heightSegments,\n phiStart,\n phiLength,\n thetaLength,\n });\n\n this.material = new MeshStandardMaterial({ color: 0x00ff00, flatShading: true });\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 { Direction } from \"../constants/Direction\";\nimport { Material, Vector3 } from \"three\";\n\ninterface NoiseDisplacementOptions {\n time?: number;\n intensity?: number;\n direction?: 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.direction=new Vector3(1, 1, 1)] - The direction 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, direction = Direction.XYZ, scale = 10.0 }: NoiseDisplacementOptions = {},\n) {\n material.onBeforeCompile = (shader) => {\n // Add uniforms for time, direction, intensity, and scale\n shader.uniforms.time = { value: time };\n shader.uniforms.direction = { value: direction };\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 direction;\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(direction) * 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\nclass 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\nexport { DaySkybox };\n","import { BackSide, Mesh, ShaderMaterial, SphereGeometry } from \"three\";\nimport { nightSkyShader, NightSkyUniforms } from \"../shaders/nightSkyShader\";\n\nclass 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\nexport { NightSkybox };\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, Group, Vector3 } from \"three\";\n\nexport function centerGroup<T extends Group>(group: T) {\n const box = new Box3().setFromObject(group);\n const center = new Vector3();\n box.getCenter(center);\n group.position.sub(center);\n}\n\nexport function centerGroupAtTarget<T extends Group>(group: T, target = new Vector3(0, 0, 0)) {\n const box = new Box3().setFromObject(group);\n const currentCenter = new Vector3();\n box.getCenter(currentCenter);\n\n const offset = new Vector3().subVectors(target, currentCenter);\n group.position.add(offset);\n}\n","import { InstancedMesh, Vector3 } from \"three\";\n\nexport function centerInstancedMesh<T extends InstancedMesh>(mesh: T) {\n mesh.computeBoundingBox();\n const box = mesh.boundingBox;\n\n if (box) {\n const center = box.getCenter(new Vector3());\n mesh.translateX(-center.x);\n mesh.translateY(-center.y);\n mesh.translateZ(-center.z);\n }\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 { Box3, Mesh, Vector3 } from \"three\";\n\n/**\n * Centers the given mesh at the origin (0, 0, 0) of the scene by adjusting its position.\n * The mesh is moved so that its bounding box center is placed at the origin.\n */\nexport function centerMesh<T extends Mesh>(mesh: T): void {\n const box = new Box3().setFromObject(mesh);\n const center = box.getCenter(new Vector3());\n\n mesh.translateX(-center.x);\n mesh.translateY(-center.y);\n mesh.translateZ(-center.z);\n mesh.updateMatrixWorld(true);\n}\n\n/**\n * Centers the geometry of the given mesh at the local origin (0, 0, 0) by modifying the geometry vertices.\n * This method moves the geometry itself so that its center is at the local origin,\n * without affecting the position, rotation, or scale of the mesh.\n */\nexport function centerMeshGeometry<T extends Mesh>(mesh: T): void {\n mesh.geometry.computeBoundingBox();\n const box = mesh.geometry.boundingBox;\n\n if (box) {\n const center = box.getCenter(new Vector3());\n mesh.geometry.translate(-center.x, -center.y, -center.z);\n }\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"],"names":["dollyAnimation","camera","distance","duration","onComplete","startPos","endPos","Vector3","startTime","animate","time","progress","flythroughAnimation","waypoints","totalSegments","totalProgress","segmentProgress","segmentIndex","segmentFraction","start","end","orbitAnimation","target","radius","angle","x","z","pendulumAnimation","center","oscillations","oscillationCount","elapsed","oscillationDuration","spiralAscensionAnimation","height","revolutions","y","wobbleAnimation","intensity","originalPosition","offset","zoomInAnimation","startFov","endFov","initialFov","MathUtils","Direction","Falloff","t","displacementBrush","geometry","position","strength","direction","falloffFn","positions","vertex","influence","flattenBrush","targetHeight","i","projectedHeight","delta","noiseBrush","falloff","noiseStrength","noise","smoothBrush","tempPosition","averagePosition","count","j","spikeBrush","inward","twistBrush","quaternion","Quaternion","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","sinusoidalCurve","ParametricCurve","BubblingEffect","InstancedMesh","options","width","depth","SphereGeometry","material","MeshStandardMaterial","__publicField","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","newarray","newMorphArrays","k","getterFunc","m","ml","result","oldAttribute","buffer","oldMorphAttribute","buffer2","morphAttribute","BookGeometry","coverThickness","pageIndent","w","h","d","normals","u1","u2","uvs","normalArray","uvArray","indexArray","coverGeometry","pagesGeometry","BoxGeometry","randomFloat","min","max","randomInteger","logarithmicRandomMax","exponent","logarithmicRandomMin","randomScale","scaleXMin","scaleXMax","scaleYMin","scaleYMax","scaleZMin","scaleZMax","rowOfBooksByScales","coverMaterial","pagesMaterial","scales","row","currentZ","scale","scaleMatrix","rowOfBooksByCount","rowOfBooksByLength","length","remainingZ","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","CrossHeadstoneGeometry","verticalHeight","verticalGeometry","horizontalWidth","horizontalGeometry","ObeliskHeadstoneGeometry","totalHeight","baseWidth","baseHeight","lowerSegmentHeight","middleSegmentHeight","topSegmentHeight","currentHeight","baseGeometry","lowerSegmentGeometry","middleSegmentGeometry","topSegmentGeometry","pyramidGeometry","ConeGeometry","RoundedHeadstoneGeometry","topGeometry","CylinderGeometry","SquareHeadstoneGeometry","slabGeometry","FenceColumnGeometry","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","randomTransformVertices","minScale","maxScale","displacement","RockGeometry","widthSegments","heightSegments","sphere","BoneGeometry","radiusTop","radiusBottom","cylinderGeometry","sphereGeometry","topSphere1","topSphere2","bottomSphere1","bottomSphere2","BeakerGeometry","tubeGeometry","ErlenmeyerFlaskGeometry","flaskRadius","neckRadius","neckHeight","points","Vector2","flaskGeometry","LatheGeometry","MortarGeometry","mortarPoints","mortarGeometry","baseDisk","CircleGeometry","StandGeometry","thickness","ringGeometry","TorusGeometry","legGeometry","legs","leg","TestTubeGeometry","segments","openEnded","bottomGeometry","WineBottleGeometry","bodyHeight","bodyGeometry","shoulderHeight","shoulderGeometry","neckGeometry","HillGeometry","phiStart","phiLength","radiusFromCapHeight","thetaLength","radiusFromCapWidth","capHeightFromRadius","capWidthFromRadius","sphericalToCartesian","theta","phi","cartesianToSpherical","MoundGeometry","TreeGeometry","trunkRadiusTop","trunkRadiusBottom","trunkHeight","trunkSegments","leafSize","leafCount","leafDetail","leafSpreadRadius","trunk","leafs","leaf","DodecahedronGeometry","Moon","Group","moonGeometry","moonMaterial","ShaderMaterial","moon","Mesh","Book","coverColor","pageColor","CrossHeadstone","Mausoleum","baseMaterial","baseMesh","buildingGeometry","buildingMaterial","buildingMesh","roofGeometry","roofMaterial","roofMesh","pillarGeometry","pillarMaterial","pillarMesh","archShape","Shape","extrudeSettings","archGeometry","ExtrudeGeometry","archMaterial","archMesh","ObeliskHeadstone","RoundedHeadstone","SquareHeadstone","FenceColumn","WroughtIronBar","WroughtIronFence","Bookshelf","Desk","surfaceGeometry","surfaceMaterial","deskSurface","legMaterial","Candle","candleGeometry","candleMaterial","flameGeometry","flameMaterial","MeshBasicMaterial","PointLight","flicker","Lantern","bodyMaterial","bodyMesh","handleGeometry","handleMaterial","handleMesh","light","MossyRocks","rockGeometry","rockMaterial","mossMaterial","rockMesh","mossMesh","Rock","Rocks","Beaker","beakerGeometry","glassMaterial","MeshPhysicalMaterial","beaker","Bottle","bottlePoints","bottleGeometry","corkGeometry","liquidMaterial","corkMaterial","bottle","liquid","cork","potionBottle","BunsenBurner","tubeMaterial","tube","flame","ElectricPanel","panelGeometry","panelMaterial","switchGeometry","switchMaterial","dialGeometry","dialMaterial","panel","toggleSwitch","dial","lightGeometry","lightMaterial","flickerSpeed","flickerMaxIntensity","flickerMinIntensity","flickerIntensity","ErlenmeyerFlask","Flask","flaskPoints","flask","LeverPanel","leverPanelGeometry","leverPanelMaterial","leverPanel","leverBaseGeometry","leverHandleGeometry","leverMaterial","leverBase","leverHandle","Microscope","armGeometry","arm","eyepieceGeometry","eyepieceMaterial","eyepiece","stageGeometry","stageMaterial","stage","MortarAndPestle","pestleGeometry","mortarMaterial","pestleMaterial","mortar","pestle","SpiralTube","spiralLength","heightIncrement","curve","CatmullRomCurve3","_","TubeGeometry","multiSpiralTube","animateFluid","Stand","TeslaCoil","coilBaseGeometry","coilBaseMaterial","coilBase","coilGeometry","coilMaterial","coil","coilTopGeometry","coilTop","TestTube","TestTubeRack","colors","rackGeometry","rackMaterial","rack","testTubeGeometry","testTube","xPosition","liquidGeometry","liquidColor","WineBottle","wineBottle","bottleMaterial","BurstShape","sides","innerRadius","outerRadius","step","halfStep","qtrStep","n","cx","cy","dx","dy","Burst","shape","GearShape","holeSides","holeRadius","hole","Path","holeStep","Gear","HeartShape","tipDepth","Heart","StarShape","Star","Bone","Tree","trunkColor","leafColor","treeGeometry","trunkMaterial","leafMaterial","Hill","Mound","addWaterDisplacement","waveFrequency","waveAmplitude","shader","updateWaterDisplacementTime","deltaTime","addNoiseDisplacement","updateNoiseDisplacementTime","atmosphericShader","daySkyShader","Color","fadeShader","nightSkyShader","AtmosphericSkybox","BackSide","sun","DaySkybox","NightSkybox","checkerboardTexture","data","stride","color","texture","DataTexture","RGBAFormat","UnsignedByteType","RepeatWrapping","NearestFilter","centerGroup","group","box","Box3","centerGroupAtTarget","currentCenter","centerInstancedMesh","mesh","normalizeT","interpolateCurve","curveFunction","startRadius","endRadius","startHeight","endHeight","easedT","centerMesh","centerMeshGeometry","createCubicCurvePoints","control1","control2","curvePoints","createDampedCurvePoints","createExponentialCurvePoints","createLogarithmicCurvePoints","createParabolicCurvePoints","createQuadraticCurvePoints","control","createSigmoidCurvePoints","ParametricCurveUtils"],"mappings":";;;;AAYO,SAASA,GACdC,GACAC,GACAC,GACAC,GACM;AACA,QAAAC,IAAWJ,EAAO,SAAS,MAAM,GACjCK,IAASD,EAAS,MAAM,EAAE,IAAIJ,EAAO,kBAAkB,IAAIM,EAAA,CAAS,EAAE,eAAe,CAACL,CAAQ,CAAC;AACrG,MAAIM,IAA2B;AAE/B,WAASC,EAAQC,GAAoB;AAC/B,IAAAF,MAAc,SAAkBA,IAAAE;AAEpC,UAAMC,KADUD,IAAOF,KACIL;AAE3B,QAAIQ,KAAY,GAAG;AACV,MAAAV,EAAA,SAAS,KAAKK,CAAM,GACvBF,KAAuBA;AAC3B;AAAA,IACF;AAGA,IAAAH,EAAO,SAAS,YAAYI,GAAUC,GAAQK,CAAQ,GAEtD,sBAAsBF,CAAO;AAAA,EAC/B;AAEA,wBAAsBA,CAAO;AAC/B;ACnBO,SAASG,GAAoBX,GAAgBY,GAAsBV,GAAkBC,GAA+B;AACnH,QAAAU,IAAgBD,EAAU,SAAS;AACzC,MAAIL,IAA2B;AAE/B,WAASC,EAAQC,GAAoB;AAC/B,IAAAF,MAAc,SAAkBA,IAAAE;AAEpC,UAAMK,KADUL,IAAOF,KACSL;AAEhC,QAAIY,KAAiB,GAAG;AACtB,MAAAd,EAAO,SAAS,KAAKY,EAAUA,EAAU,SAAS,CAAC,CAAC,GAChDT,KAAuBA;AAC3B;AAAA,IACF;AAGA,UAAMY,IAAkBD,IAAgBD,GAClCG,IAAe,KAAK,MAAMD,CAAe,GACzCE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