Sensor (drag me) Active ray Point cloud hit

2D LiDAR Ray-Casting: Point Cloud & Occupancy Grid

This 2D companion strips the 3D LiDAR simulation down to the geometry that actually does the work: a rotating beam solved against wall segments with the parametric ray–segment intersection formula, rendered as a plain top-down floor plan instead of a 3D scene. A live point cloud on the left accumulates every noisy hit as the sensor sweeps, while a log-odds occupancy grid on the right fills in free and occupied cells in real time — the same two data structures a real 2D LiDAR-equipped robot builds while mapping a room, just with the underlying math made directly visible.