Struct autd3_core::geometry::Geometry
source · [−]pub struct Geometry<T: Transducer> {
pub attenuation: f64,
pub sound_speed: f64,
/* private fields */
}
Fields
attenuation: f64
sound_speed: f64
Implementations
sourceimpl<T: Transducer> Geometry<T>
impl<T: Transducer> Geometry<T>
pub fn num_devices(&self) -> usize
pub fn num_transducers(&self) -> usize
pub fn devices(&self) -> &[Device<T>]
pub fn devices_mut(&mut self) -> &mut [Device<T>]
pub fn transducers(&self) -> impl Iterator<Item = &T>
pub fn transducers_mut(&mut self) -> impl Iterator<Item = &mut T>
pub fn center(&self) -> Vector3
pub fn sound_speed(&self) -> f64
pub fn set_sound_speed(&mut self, sound_speed: f64)
sourceimpl Geometry<LegacyTransducer>
impl Geometry<LegacyTransducer>
sourcepub fn add_device(&mut self, position: Vector3, euler_angles: Vector3)
pub fn add_device(&mut self, position: Vector3, euler_angles: Vector3)
Add device to the geometry.
Use this method to specify the device geometry in order of proximity to the master. Call this method or add_device_quaternion as many times as the number of AUTDs connected to the master.
Arguments
pos
- Global position of AUTD.rot
- ZYZ Euler angles.
Example
use std::f64::consts::PI;
use autd3_core::geometry::{Vector3, GeometryBuilder};
let mut geometry = GeometryBuilder::new().legacy_mode().build();
geometry.add_device(Vector3::zeros(), Vector3::zeros());
geometry.add_device(Vector3::new(192., 0., 0.), Vector3::new(-PI, 0., 0.));
sourcepub fn add_device_quaternion(
&mut self,
position: Vector3,
rotation: UnitQuaternion
)
pub fn add_device_quaternion(
&mut self,
position: Vector3,
rotation: UnitQuaternion
)
Add device to the geometry.
Use this method to specify the device geometry in order of proximity to the master. Call this method or add_device as many times as the number of AUTDs connected to the master.
Arguments
pos
- Global position of AUTD.rot
- Rotation quaternion.
pub fn wavelength(&self) -> f64
pub fn set_wavelength(&mut self, wavelength: f64)
sourceimpl Geometry<NormalTransducer>
impl Geometry<NormalTransducer>
sourcepub fn add_device(&mut self, position: Vector3, euler_angles: Vector3)
pub fn add_device(&mut self, position: Vector3, euler_angles: Vector3)
Add device to the geometry.
Use this method to specify the device geometry in order of proximity to the master. Call this method or add_device_quaternion as many times as the number of AUTDs connected to the master.
Arguments
pos
- Global position of AUTD.rot
- ZYZ Euler angles.
Example
use std::f64::consts::PI;
use autd3_core::geometry::{Vector3, GeometryBuilder};
let mut geometry = GeometryBuilder::new().build();
geometry.add_device(Vector3::zeros(), Vector3::zeros());
geometry.add_device(Vector3::new(192., 0., 0.), Vector3::new(-PI, 0., 0.));
sourcepub fn add_device_quaternion(
&mut self,
position: Vector3,
rotation: UnitQuaternion
)
pub fn add_device_quaternion(
&mut self,
position: Vector3,
rotation: UnitQuaternion
)
Add device to the geometry.
Use this method to specify the device geometry in order of proximity to the master. Call this method or add_device as many times as the number of AUTDs connected to the master.
Arguments
pos
- Global position of AUTD.rot
- Rotation quaternion.
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for Geometry<T> where
T: RefUnwindSafe,
impl<T> Send for Geometry<T> where
T: Send,
impl<T> Sync for Geometry<T> where
T: Sync,
impl<T> Unpin for Geometry<T> where
T: Unpin,
impl<T> UnwindSafe for Geometry<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.