Skip to content

Geometry

Geometry represents the physical layout (position and rotation) of AUTD3 devices.

Geometry::new(vec![Autd3::new(
Point3::origin(),
UnitQuaternion::identity(),
)]);

Autd3::new(origin, rotation) constructs a single device from an origin (Point3) and a rotation (UnitQuaternion). There is also Autd3::default(), which uses Point3::origin() for the origin and UnitQuaternion::identity() for the rotation.

When multiple devices are passed to Geometry::new, device numbers (idx) are assigned in order from the first.

Provides retrieval of information about the whole layout and access to each Device.

let num_devices = geometry.num_devices();
let total_transducers = geometry.num_transducers();
let array_center = geometry.center();
for device in &geometry {
let _ = device;
}
let first = &geometry[0];
Method Returns Description
num_devices() usize Number of devices
num_transducers() usize Total number of transducers across all devices
center() Point3<f32> Center coordinate of the whole array
pattern_buffer() Vec<Vec<Emission>> Allocate an output buffer for Pattern computation
iter() / &geometry Iterator<Item = &Device> Iterate over each Device
geometry[i] &Device Get the i-th Device

Represents a single device. It is obtained via geometry[i] or by iterating over &geometry. The position and normal direction of each transducer, as well as the device’s rotation, can be retrieved.

let idx = device.idx();
let num_transducers = device.num_transducers();
let center = device.center();
let rotation = device.rotation();
let x = device.x_direction();
let y = device.y_direction();
let axial = device.axial_direction();
let positions = device.positions();
let directions = device.directions();
let pos0 = device.position(0);
let dir0 = device.direction(0);
Method Returns Description
idx() usize Device number within the Geometry
num_transducers() usize Number of transducers
center() Point3<f32> Device center coordinate
rotation() UnitQuaternion<f32> Device rotation
x_direction() UnitVector3<f32> Local x-axis direction
y_direction() UnitVector3<f32> Local y-axis direction
axial_direction() UnitVector3<f32> Axial direction (ultrasound emission direction)
positions() &[Point3<f32>] Positions of all transducers
directions() &[UnitVector3<f32>] Normal directions of all transducers
position(i) Point3<f32> Position of the i-th transducer
direction(i) UnitVector3<f32> Direction of the i-th transducer

autd3_rs::geometry provides helpers to build coordinates. The argument type is Length, so a unit can be specified.

Function Returns Description
point(x, y, z) Point3<f32> An absolute-coordinate point
offset(x, y, z) Vector3<f32> A relative displacement vector

Python / C# have no length-unit type; coordinates are always in mm.