Quick Start

Understanding the WiTwin platform architecture and capabilities

What is WiTwin?#

WiTwin (Wireless Digital Twin) is a fully differentiable physical simulation platform for wireless systems. It enables:

  • Real-time RF simulation with accurate physics
  • Differentiable computation for optimization and learning
  • Visual editing through WiTwin Studio
  • Python API for programmatic control

Info

WiTwin bridges the gap between traditional RF simulation tools and modern machine learning frameworks by providing end-to-end differentiability.

Quick Start#

1. Start Server & Editor#

from witwin import Scene, Server
 
# Create a scene
scene = Scene()
 
# Create and start the server (opens browser automatically)
server = Server(scene=scene)
server.start()
 
print("Server running at http://localhost:8080")

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 Editor immediately!

3. Modify Properties#

# Access transform
cube.transform.position = [1.0, 2.0, 3.0]
cube.transform.rotation = [0, 45, 0]  # Degrees
 
# Access material component
material = cube.get_component("Material")
material.color = [1.0, 0.5, 0.0, 1.0]  # Orange RGBA
material.metalness = 0.8
 
# Changes sync to Editor in real-time!

Core Concepts#

Scene#

The Scene is the top-level container for all simulation elements:

from witwin import Scene
 
scene = Scene()
print(scene.objects)  # List of all objects

Objects#

Objects represent individual entities in the scene. Each object has a Transform and can have multiple components:

# Create an object
building = scene.create_object("Building")
 
# Add components
building.add_component("Mesh", mesh_type="Cube")
building.add_component("Material")
 
# Access transform (always available)
building.transform.position = [0, 0, 0]
building.transform.scale = [10, 20, 30]

Components#

Components are modular pieces that define object behavior:

Component TypePurpose
TransformPosition, rotation, scale (always present)
Mesh3D geometry
MaterialVisual and EM properties
RadarFMCW radar configuration
TransmitterRF transmitter
ReceiverRF receiver

Architecture#

WiTwin Studio is a browser-based visual interface built with:

  • React for the UI framework
  • Three.js for 3D rendering
  • WebSocket for real-time sync with Python

Features:

  • Viewport for 3D scene visualization
  • Properties panel for object editing
  • Node editor for parameter connections
  • Console for Python output

Using Studio APIs#

WiTwin provides several APIs for interacting with the Studio:

from witwin import Console, Results, Notifications
 
# Console logging
Console.log("Processing started")
Console.warn("Low memory warning")
Console.error("Failed to load data")
 
# Results visualization
import numpy as np
x = np.linspace(0, 10, 100)
y = np.sin(x)
Results.plot(x, y, title="Sine Wave")
Results.commit(message="My first plot")
 
# Notifications
Notifications.info("Import", "Model loaded successfully")
Notifications.progress("task1", "Processing", 50)

Next Steps#

  1. Learn the principles - Read Design Principle
  2. Try tutorials - Start with Import 3D Models
  3. Explore the Studio - See Studio Overview

Note

For the best experience, we recommend using a system with an NVIDIA GPU for hardware-accelerated ray tracing.