Tutorials Overview
Understanding the WiTwin ecosystem and Studio
System Architecture#
WiTwin uses a client-server architecture that combines Python's flexibility with web-based visualization.
| Component | Description |
|---|---|
| Python Backend | Scene management, simulation engine, and WebSocket server |
| WiTwin Core | High-performance C++ ray tracing and EM simulation |
| Web Studio | Interactive web-based visual interface |
Component Details#
Python Backend provides:
- Scene & Object API
- Component System
- Simulation Control
- Data Processing
Communication Flow#
Python API ↔ WebSocket ↔ Web Studio
(User Code) (Real-time) (Visualization)Quick Start#
Get up and running with WiTwin in just a few lines of code:
1. Start Server & Studio#
from witwin import Scene, Server
# Create a scene
scene = Scene()
# Create and start the server
server = Server(scene=scene)
server.start() # Opens browser automatically
print("Server running at http://localhost:8080")First Time Setup
The first time you run this, the WiTwin Studio assets will be automatically downloaded. This may take a few minutes.
2. Create Objects#
from witwin import Scene
scene = Scene()
# Create objects
cube = scene.create_object("MyCube")
cube.add_component("Mesh", mesh_type="Cube")
cube.transform.position = [0, 0, 0]
sphere = scene.create_object("MySphere")
sphere.add_component("Mesh", mesh_type="Sphere")
sphere.transform.position = [3, 0, 0]
# Objects appear in Studio immediately!3. Modify Properties#
# Access transform
cube.transform.position = [1.0, 2.0, 3.0]
# Access material component
material = cube.get_component("Material")
if material:
material.color = [1.0, 0.5, 0.0, 1.0] # Orange
material.metalness = 0.8
# Changes sync to Studio in real-time!WiTwin Studio#
The WiTwin Studio is a web-based visual interface that connects to your Python backend, providing real-time visualization and interactive editing capabilities.
Studio Panels#
| Panel | Description |
|---|---|
| Viewport | Main 3D viewport for visualization |
| Hierarchy | Tree view of scene objects |
| Properties | Edit object components |
| Library | Asset browser for adding objects |
| Node Editor | Visual programming |
| Hyperparameters | Optimization parameters |
| Results | Visualization panel |
| Console | Logging & commands |
| Timeline | Animation & keyframes |
| Settings | Studio configuration |
Tutorial Path#
Follow these tutorials in order:
- Installation - Set up WiTwin
- Import 3D Models - Load geometry
- Component System - Understand components
- Radar Simulation - Simulate FMCW radar
- Field Simulation - EM field propagation