Skip to content

Visualise Rays

Visualise Rays icon

Display ยท Rays

Trace rays from the scene's sources, for display: each ray as a polyline over its wall hits, with the scattered rays when scattering is on. Press Play to draw the rays growing from the sources as sound travels; the same button reads Pause while playing and holds them where they are, Rewind goes back to the start, the time slider scrubs and Speed sets how fast they grow. Nothing is drawn before Play or a time. The Preview button shows or hides the drawing.

Visualise Rays on the Grasshopper canvas

Inputs

Name Type Access Default Description
scene ghdoc item Acoustic scene object.
source_idx int item Index of the source to trace from, in the order of the scene's sources. Empty (default): every source. Optional.
n_rays int item 500 Number of rays per source. Optional.
max_order int item 10 Highest reflection order traced per ray. Optional.
direction vector item Axis of a spotlight cone to emit the rays into, apex at each source. Empty (default): all directions. Needs angle. Optional.
angle float item Half angle of the spotlight cone in degrees. Empty (default): all directions. Needs direction. Optional.
scattering bool item Also trace scattered rays at the reflections (default False). Optional.
seed int item Seed of the scattered rays' random directions. Empty (default): a new seed each run. Only scattering uses it. Optional.
order int item Draw only the first reflections of each ray. Empty (default): all traced orders. The ray_field output stays whole. Optional.
time float item Time in ms. Alone: the rays as far as sound has travelled at that time (a slider scrubs). With Play: where playback stops (default: the end). Optional.
speed float item Playback speed, a factor of the default, which draws the whole ray field in 10 s: 0.5 is half as fast, 2 twice. Optional.

Outputs

Name Description
ray_field The RayField, whole.
rays The rays as polylines from the source over the wall hits, up to order.
scattered The scattered rays as polylines; empty without scattering.

Python equivalent

compas_acoustics.RayField