UncategorizedMetaverse414 lines
Digital Twin Creation
Quick Summary18 lines
A digital twin is a real-time virtual replica of a physical object, system, or environment, continuously synchronized with its real-world counterpart through sensor data. This skill covers creating digital twins for metaverse and XR applications, from 3D capture and modeling to IoT data integration, simulation, and visualization within immersive environments. ## Key Points 1. Image Capture: 2. Processing: 3. Optimization: 1. Planning: 2. Scanning: 3. Registration: 4. Point Cloud Processing: 5. Mesh Generation: 1. Data Collection: 2. Analysis: 3. Visualization in Digital Twin: - Creating a digital twin of a building, facility, or product
skilldb get metaverse-skills/digital-twin-creationFull skill: 414 linesPaste into your CLAUDE.md or agent config
Digital Twin Creation
Purpose
A digital twin is a real-time virtual replica of a physical object, system, or environment, continuously synchronized with its real-world counterpart through sensor data. This skill covers creating digital twins for metaverse and XR applications, from 3D capture and modeling to IoT data integration, simulation, and visualization within immersive environments.
Digital Twin Types
Classification
Digital Twin Spectrum:
┌──────────────────────┬──────────────────────────────────┐
│ Type │ Description │
├──────────────────────┼──────────────────────────────────┤
│ Digital Model │ Static 3D representation │
│ │ No data flow from physical twin │
│ │ Manual updates only │
├──────────────────────┼──────────────────────────────────┤
│ Digital Shadow │ One-way data flow │
│ │ Physical → Digital (monitoring) │
│ │ Changes in physical reflected │
│ │ digitally, not vice versa │
├──────────────────────┼──────────────────────────────────┤
│ Digital Twin │ Bidirectional data flow │
│ (full) │ Physical ↔ Digital │
│ │ Changes in either reflected │
│ │ in the other │
├──────────────────────┼──────────────────────────────────┤
│ Predictive Twin │ Digital twin + simulation │
│ │ Predict future states │
│ │ "What if" scenario testing │
└──────────────────────┴──────────────────────────────────┘
Application Domains:
├── Buildings/Facilities — HVAC, occupancy, energy, maintenance
├── Manufacturing — Production lines, quality, equipment health
├── Cities — Traffic, utilities, planning, emergency response
├── Healthcare — Patient monitoring, surgical planning
├── Energy — Power grid, renewable assets, consumption
├── Logistics — Fleet tracking, warehouse, supply chain
└── Retail — Store layout, foot traffic, inventory
3D Capture Pipeline
Capture Methods
3D Capture Comparison:
┌────────────────────┬────────┬──────────┬──────────┬──────────┐
│ Method │ Scale │ Accuracy │ Cost │ Speed │
├────────────────────┼────────┼──────────┼──────────┼──────────┤
│ Photogrammetry │ Any │ 1-5mm │ Low │ Slow │
│ (photos → 3D) │ │ │ │ │
├────────────────────┼────────┼──────────┼──────────┼──────────┤
│ LiDAR scanning │ Room+ │ 1-3mm │ Medium │ Fast │
│ (laser measurement)│ │ │ │ │
├────────────────────┼────────┼──────────┼──────────┼──────────┤
│ Structured light │ Object │ 0.1mm │ Medium │ Fast │
│ (pattern projection)│ │ │ │ │
├────────────────────┼────────┼──────────┼──────────┼──────────┤
│ iPhone/iPad LiDAR │ Room │ 5-20mm │ Low │ Fast │
│ (consumer grade) │ │ │ │ │
├────────────────────┼────────┼──────────┼──────────┼──────────┤
│ Gaussian Splatting │ Scene │ Visual │ Low │ Medium │
│ (NeRF-based) │ │ fidelity │ │ │
├────────────────────┼────────┼──────────┼──────────┼──────────┤
│ BIM/CAD │ Build- │ Design │ High │ Slow │
│ (from plans) │ ing │ intent │ (exists) │ (exists) │
└────────────────────┴────────┴──────────┴──────────┴──────────┘
Photogrammetry Workflow
Photogrammetry Pipeline:
1. Image Capture:
├── Camera: 12+ MP, consistent settings
├── Coverage: 60-80% overlap between images
├── Angles: Multiple heights, all angles
├── Lighting: Diffuse, consistent, no harsh shadows
├── Count: 50-500+ images depending on complexity
└── Reference: Include scale bars or known measurements
2. Processing:
├── Feature detection (SIFT/SURF/ORB)
├── Feature matching across images
├── Structure from Motion (SfM) — camera positions
├── Dense point cloud generation
├── Mesh reconstruction (Poisson or Delaunay)
├── Texture projection
└── Post-processing (cleanup, hole filling)
3. Optimization:
├── Mesh decimation (reduce polygon count)
├── Retopology (clean quad mesh for animation)
├── UV unwrap and texture bake
├── LOD generation
└── Export (glTF, FBX, USD)
Tools:
├── Capture: DSLR, drone, smartphone
├── Processing: RealityCapture, Meshroom (open source), Metashape
├── Cleanup: Blender, ZBrush, MeshLab
└── Mobile: Polycam, Luma AI, Scaniverse
LiDAR Scanning for Buildings
Building Scan Workflow:
1. Planning:
├── Floor plan review — determine scan positions
├── Number of scans: 1 per 5-10m, more in complex areas
├── Target placement for registration (optional with SLAM)
└── Access coordination (all rooms, rooftop, exterior)
2. Scanning:
├── Terrestrial scanner: Leica, Faro, Trimble
│ └── Each scan: 5-15 minutes, 360° capture
├── Mobile scanner: NavVis, GeoSLAM
│ └── Walk-through capture, real-time SLAM
└── iPad/iPhone: Polycam, SiteScape
└── Quick capture, lower accuracy, good for reference
3. Registration:
├── Align multiple scans into unified coordinate system
├── Cloud-to-cloud registration (ICP algorithm)
├── Target-based registration (survey targets)
└── Georeferencing (GPS coordinates, survey points)
4. Point Cloud Processing:
├── Noise removal
├── Outlier filtering
├── Decimation (reduce density for performance)
├── Classification (floor, wall, ceiling, object)
└── Export: E57, LAS/LAZ, PLY
5. Mesh Generation:
├── Surface reconstruction from point cloud
├── Texturing from panoramic images
├── Segmentation (separate rooms, floors)
└── As-built BIM model generation (scan-to-BIM)
IoT Data Integration
Sensor Data Architecture
IoT-to-Digital-Twin Pipeline:
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Physical │ │ IoT │ │ Digital │
│ Sensors │───→│ Platform │───→│ Twin │
│ │ │ │ │ Platform │
└──────────────┘ └──────────────┘ └──────────────┘
Sensor Types for Building Twins:
├── Environmental: Temperature, humidity, air quality, CO2
├── Energy: Power consumption, solar generation, battery
├── Occupancy: PIR sensors, camera analytics, badge readers
├── Structural: Vibration, strain, displacement
├── HVAC: Airflow, pressure, valve positions
├── Lighting: Lux levels, on/off state
├── Safety: Smoke, fire, water leak, intrusion
└── Equipment: Runtime hours, error codes, efficiency
Data Flow:
Sensor → Edge Gateway → MQTT Broker → Stream Processing → Database
↓
Digital Twin API
↓
3D Visualization
Real-Time Data Binding
Binding Sensor Data to 3D Objects:
Data Binding Schema:
{
"bindings": [
{
"sensor_id": "temp_sensor_room_201",
"twin_object": "room_201_thermostat",
"property": "display_value",
"data_type": "temperature",
"unit": "celsius",
"visualization": {
"type": "color_gradient",
"range": [16, 30],
"colors": ["#0000FF", "#00FF00", "#FF0000"]
},
"alert_thresholds": {
"warning": { "above": 26 },
"critical": { "above": 30 }
}
},
{
"sensor_id": "occupancy_floor_2",
"twin_object": "floor_2_zone",
"property": "heatmap_overlay",
"data_type": "occupancy_count",
"visualization": {
"type": "heatmap",
"range": [0, 50],
"opacity": 0.4
}
}
]
}
Visualization Patterns:
├── Color coding: Object changes color based on value
│ └── Temperature → blue (cold) to red (hot)
├── Gauge/display: Virtual readout floating near sensor
├── Heatmap: Surface overlay showing spatial distribution
├── Particle effects: Airflow, water flow visualization
├── Animation: Moving parts match real-world speed
├── Alert indicators: Pulsing/glowing for abnormal values
└── Time series: Graph displayed next to data point
Simulation and Prediction
Physics Simulation
Simulation Capabilities:
├── Thermal Simulation:
│ ├── Heat transfer through walls, windows
│ ├── HVAC effectiveness modeling
│ ├── Solar gain calculation
│ └── "What if" HVAC failure scenario
│
├── Structural Simulation:
│ ├── Load analysis on beams and columns
│ ├── Vibration frequency analysis
│ ├── Seismic response modeling
│ └── Aging/degradation prediction
│
├── Flow Simulation:
│ ├── Airflow patterns (CFD — computational fluid dynamics)
│ ├── Water/pipe flow analysis
│ ├── Crowd flow and evacuation paths
│ └── Traffic flow patterns
│
├── Lighting Simulation:
│ ├── Daylight analysis (sun path over year)
│ ├── Artificial lighting coverage
│ ├── Energy consumption modeling
│ └── Glare analysis
│
└── Energy Simulation:
├── Building energy model (EnergyPlus integration)
├── Renewable energy generation forecast
├── Grid demand prediction
└── Cost optimization scenarios
Predictive Maintenance
Predictive Maintenance Pipeline:
1. Data Collection:
├── Equipment runtime hours
├── Operating parameters (temperature, vibration, current)
├── Maintenance history
└── Environmental conditions
2. Analysis:
├── Anomaly detection (ML models)
├── Remaining Useful Life (RUL) estimation
├── Failure mode classification
└── Trend analysis (degradation curves)
3. Visualization in Digital Twin:
├── Equipment health indicators (green/yellow/red)
├── Predicted failure timeline
├── Recommended maintenance actions
├── AR overlay for technicians (step-by-step repair in XR)
└── Historical comparison (current vs. normal operation)
4. Action:
├── Automated work order generation
├── Parts ordering based on prediction
├── Scheduling optimization
└── Post-maintenance verification
Digital Twin in XR
Immersive Visualization
XR Digital Twin Use Cases:
├── Remote Inspection:
│ ├── Walk through facility from anywhere
│ ├── See real-time sensor data overlaid on 3D model
│ ├── Zoom into equipment detail
│ └── Annotate issues with spatial markers
│
├── Collaborative Review:
│ ├── Multiple stakeholders in same virtual space
│ ├── Point at and discuss specific elements
│ ├── Compare design intent vs. as-built
│ └── Mark up changes in 3D
│
├── Training:
│ ├── Practice procedures on virtual equipment
│ ├── Simulate emergency scenarios
│ ├── Safe environment for hazardous operations
│ └── Record and review trainee performance
│
├── AR On-Site Overlay:
│ ├── Digital twin overlaid on physical building
│ ├── See hidden infrastructure (pipes, wiring behind walls)
│ ├── Step-by-step maintenance instructions
│ └── Compare current state to digital model
│
└── Planning:
├── Visualize proposed changes in context
├── Test configurations before implementation
├── Space planning with virtual furniture/equipment
└── Stakeholder presentation of future state
Performance for XR Digital Twins
Optimization for Real-Time XR Rendering:
├── Level of Detail:
│ ├── Building exterior: Simplified when viewing rooms
│ ├── Equipment: Full detail only when inspecting
│ ├── IoT data: Aggregate at distance, detail when close
│ └── Other floors: Wireframe or hidden when not on that floor
│
├── Data Refresh Rates:
│ ├── Environmental sensors: Every 30-60 seconds
│ ├── Equipment status: Every 5-10 seconds
│ ├── Occupancy: Every 10-30 seconds
│ ├── Energy: Every 1-5 minutes
│ └── Alerts: Real-time (push)
│
├── Rendering Budget:
│ ├── Building mesh: 500K-2M triangles (LOD)
│ ├── Equipment models: 10K-50K each (LOD)
│ ├── Data overlays: 2D textures on quads (cheap)
│ ├── Particle effects: Limit to focused area
│ └── Total target: < 11ms per frame (VR)
│
└── Streaming:
├── Only load floor/area user is in
├── Stream adjacent areas in background
├── Cache recently visited areas
└── Progressive loading (low-res → high-res)
Implementation Technologies
Technology Stack:
├── 3D Engine: Unity or Unreal Engine
├── BIM Integration: IFC.js, xBIM, Autodesk Forge
├── IoT Platform: Azure IoT, AWS IoT, Google Cloud IoT
├── Data Streaming: Apache Kafka, MQTT
├── Time Series DB: InfluxDB, TimescaleDB
├── 3D Format: glTF, USD, IFC
├── Point Cloud: Potree (web viewer), CloudCompare
├── GIS Integration: Cesium (geospatial 3D), Mapbox
├── ML/Analytics: Python (scikit-learn, TensorFlow)
└── Web Viewer: Three.js, Cesium, Babylon.js
Integration Architecture:
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ BIM Source │ │ IoT Data │ │ 3D Capture │
│ (Revit/IFC) │ │ (sensors) │ │ (scan data) │
└──────┬───────┘ └──────┬───────┘ └──────┬───────┘
│ │ │
└───────────┬───────┴───────────┬───────┘
│ │
┌──────┴───────┐ ┌──────┴───────┐
│ Data Fusion │ │ 3D Fusion │
│ Service │ │ Service │
└──────┬───────┘ └──────┬───────┘
│ │
┌──────┴───────────────────┴──────┐
│ Digital Twin Platform │
│ ├── 3D model + IoT data │
│ ├── API layer │
│ ├── Simulation engine │
│ └── Visualization/XR client │
└─────────────────────────────────┘
When to Apply This Skill
Use this skill when:
- Creating a digital twin of a building, facility, or product
- Integrating IoT sensor data with 3D visualization
- Planning 3D capture of physical spaces (photogrammetry, LiDAR)
- Building predictive maintenance or simulation systems
- Designing XR experiences for facility management or inspection
- Connecting BIM data with real-time operational data
Install this skill directly: skilldb add metaverse-skills