Node Editor

Visual programming for simulation workflows and parameter design

🚧

Under Construction

This tutorial is currently being developed and will be available soon.

Why Use a Visual Node Editor?

In RF digital twin simulations, we often need to control how scene parameters relate to global hyperparameters. This relationship can be mathematically expressed as:

θscene = f(θhyper)

where θscene represents all scene object parameters, θhyper represents hyperparameters, and f is the mapping function

The Node Editor is designed to help you visually construct this function f. Instead of writing complex Python code to define parameter relationships, you can create visual workflows that:

  • Map hyperparameters to scene object properties through mathematical operations
  • Apply the same parameter logic to groups of objects simultaneously
  • Create differentiable parameter chains for optimization workflows
  • Visualize and debug complex parameter dependencies intuitively

Opening the Node Editor

The Node Editor can be accessed from the bottom panel of the RFDT Editor interface. Once opened, you'll see:

Left Panel: HyperParameter Definition

This sub-panel allows you to create and configure hyperparameters that will be exposed for optimization:

  • • Add new hyperparameters (Float, Vector2, Vector3, Vector4, Color, Bool)
  • • Set parameter names and default values
  • • Mark parameters as differentiable (∂ button) for gradient-based optimization
  • • Drag parameters to canvas to create parameter nodes

Main Canvas: Node Graph

The main area where you construct your parameter mapping function:

  • • Right-click to open node creation menu
  • • Connect nodes by dragging from output to input ports
  • • Use Group nodes to organize complex workflows
  • • Add Note nodes for documentation

Working with Scene Objects

Object Group Node (Special Node)

The Object Group Node is a special component that controls multiple objects matching certain criteria:

Filtering Options:

  • By Name: Use wildcards (e.g., "Antenna*" matches all objects starting with "Antenna")
  • By Tag: Filter objects by their assigned tags

Usage Example:

Create an Object Group Node that filters "Antenna*" objects, then connect a hyperparameter to control the position or rotation of all antennas simultaneously. The node outputs typed ports for each component field (Transform, Material, etc.), and any changes propagate to all matched objects in real-time.

Dragging Objects from Hierarchy

For controlling individual objects, you can directly drag them from the Hierarchy panel to the Node Editor canvas:

  1. 1.Open the Hierarchy panel (left side of editor)
  2. 2.Find the object you want to control (e.g., a specific antenna or reflector)
  3. 3.Drag the object onto the Node Editor canvas
  4. 4.An Object Node will be created showing all components and their fields as output ports
  5. 5.Connect hyperparameters or math nodes to these ports to control the object's properties

Tip: Object nodes are 320px wide and display collapsible component groups. Any modifications made through connected nodes will sync to the scene in real-time via WebSocket.

Basic Node Operations

Node Categories

  • Math Operations: Add, Subtract, Multiply, Divide, Power, Sqrt, Lerp, Clamp
  • Constants: Float, Vector2, Vector3, Vector4, Bool
  • Input Nodes: Time, UV, Position, Normal, Color
  • Utility: Split, Combine, Swizzle
  • Special: Object, Object Group, Group, Note, Parameter

Operations

  • Add Node: Right-click on canvas → Select category → Choose node
  • Connect: Drag from output port to input port
  • Disconnect: Click on connection line
  • Delete: Select node + Delete key
  • Duplicate: Select + Ctrl+D
  • Pan: Middle mouse + drag
  • Zoom: Scroll wheel

Creating Custom Nodes

While PyRFDT provides many built-in nodes, you can also create custom nodes from Python functions. This allows you to extend the node editor with domain-specific operations.

Example: Path Loss Calculator

from rfdt.ui.nodes import register_node

@register_node(category="RF")
def calculate_path_loss(distance: float, frequency: float) -> float:
    """Calculate free space path loss in dB."""
    import math
    c = 299792458  # Speed of light (m/s)
    fspl = 20 * math.log10(distance) + \
           20 * math.log10(frequency) - 147.55
    return fspl

# This function automatically becomes a node with:
# - Two input sockets: distance, frequency
# - One output socket: return value
# - Appears in "RF" category in node menu

Advanced Example: Signal Processing

import numpy as np
from rfdt.ui.nodes import register_node

@register_node(category="Signal Processing")
def apply_fft(signal: np.ndarray, sample_rate: float) -> tuple:
    """Perform FFT on signal and return frequency and magnitude."""
    N = len(signal)
    yf = np.fft.fft(signal)
    xf = np.fft.fftfreq(N, 1/sample_rate)[:N//2]
    magnitude = 2.0/N * np.abs(yf[:N//2])
    return xf, magnitude

@register_node(category="Signal Processing")
def filter_bandpass(
    signal: np.ndarray,
    low_freq: float,
    high_freq: float,
    sample_rate: float
) -> np.ndarray:
    """Apply bandpass filter to signal."""
    from scipy import signal as sp_signal
    sos = sp_signal.butter(
        4,
        [low_freq, high_freq],
        'bandpass',
        fs=sample_rate,
        output='sos'
    )
    filtered = sp_signal.sosfilt(sos, signal)
    return filtered

Note: Custom nodes automatically generate input/output ports based on function signatures. Type hints are used to determine port colors following Unity Shader Graph conventions.

Use Cases

Parameter Optimization

Design differentiable parameter mappings for gradient-based antenna placement optimization

Batch Object Control

Use Object Group nodes to control arrays of antennas or reflectors with a single parameter set

Signal Processing

Build filter chains and processing pipelines visually for received signal analysis

Workflow Automation

Create reusable node graphs for common simulation tasks and parameter sweeps