/* Js for , Version=1778041390 */
 if(typeof(v) != "object") v = {};v.pageID = 58;;
;
        const container = document.getElementById('canvas-container');
        const scene = new THREE.Scene();
        scene.background = new THREE.Color(0xf8f8f8); 
        const camera = new THREE.PerspectiveCamera(45, container.clientWidth / container.clientHeight, 0.1, 1000);
        camera.position.set(0, 1, 8); 
        const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
        renderer.setSize(container.clientWidth, container.clientHeight);
        renderer.setPixelRatio(window.devicePixelRatio);
        container.appendChild(renderer.domElement);
        const labelRenderer = new THREE.CSS2DRenderer();
        labelRenderer.setSize(container.clientWidth, container.clientHeight);
        labelRenderer.domElement.className = 'css-label-renderer';
        container.appendChild(labelRenderer.domElement);
        const ambientLight = new THREE.AmbientLight(0xffffff, 0.6);
        scene.add(ambientLight);
        const directionalLight = new THREE.DirectionalLight(0xffffff, 0.8);
        directionalLight.position.set(5, 10, 7);
        scene.add(directionalLight);
        const backLight = new THREE.DirectionalLight(0xffffff, 0.3);
        backLight.position.set(-5, -5, -5);
        scene.add(backLight);
        const siMaterial = new THREE.MeshStandardMaterial({ 
            color: 0x2196F3, 
            roughness: 0.9,
            metalness: 0.1
        });
        const hMaterial = new THREE.MeshStandardMaterial({ 
            color: 0xcccccc, 
            roughness: 0.9, 
            metalness: 0.1 
        });
        const bondMaterial = new THREE.MeshStandardMaterial({ 
            color: 0xeeeeee,
            roughness: 0.5,
            metalness: 0.2
        });
        const moleculeGroup = new THREE.Group();
        scene.add(moleculeGroup);
        const bondLength = 2.2;
        const hRadius = 0.5;
        const siRadius = 1;
        const bondRadius = 0.15;
        const siGeometry = new THREE.SphereGeometry(siRadius, 32, 32);
        const siAtom = new THREE.Mesh(siGeometry, siMaterial);
        moleculeGroup.add(siAtom);
        const siDiv = document.createElement('div');
        siDiv.className = 'atom-label si-label';
        siDiv.textContent = 'Si';
        const siLabel = new THREE.CSS2DObject(siDiv);
        siAtom.add(siLabel); 
        const d = bondLength / Math.sqrt(3); 
        const positions = [
            new THREE.Vector3(d, d, d),
            new THREE.Vector3(d, -d, -d),
            new THREE.Vector3(-d, d, -d),
            new THREE.Vector3(-d, -d, d)
        ];
        positions.forEach(pos => {
            const hGeometry = new THREE.SphereGeometry(hRadius, 32, 32);
            const hAtom = new THREE.Mesh(hGeometry, hMaterial);
            hAtom.position.copy(pos);
            moleculeGroup.add(hAtom);
            const hDiv = document.createElement('div');
            hDiv.className = 'atom-label h-label';
            hDiv.textContent = 'H';
            const hLabel = new THREE.CSS2DObject(hDiv);
            hAtom.add(hLabel);
            const direction = new THREE.Vector3().copy(pos).normalize();
            const distance = pos.length();
            const cylinderGeometry = new THREE.CylinderGeometry(bondRadius, bondRadius, distance, 16);
            const bond = new THREE.Mesh(cylinderGeometry, bondMaterial);
            const axis = new THREE.Vector3(0, 1, 0); 
            const quaternion = new THREE.Quaternion();
            quaternion.setFromUnitVectors(axis, direction);
            bond.setRotationFromQuaternion(quaternion);
            bond.position.copy(pos).multiplyScalar(0.5);
            moleculeGroup.add(bond);
        });
        const controls = new THREE.OrbitControls(camera, renderer.domElement);
        controls.enableDamping = true;
        controls.dampingFactor = 0.05;
        controls.enableZoom = true; 
        controls.autoRotate = true;
        controls.autoRotateSpeed = 1.5;
        function animate() {
            requestAnimationFrame(animate);
            controls.update();
            renderer.render(scene, camera);
            labelRenderer.render(scene, camera);
        }
        animate();
        window.addEventListener('resize', () => {
            const width = container.clientWidth;
            const height = container.clientHeight;
            renderer.setSize(width, height);
            labelRenderer.setSize(width, height);
            camera.aspect = width / height;
            camera.updateProjectionMatrix();
        });
    