Skip to main content

Geometry

Struct Geometry 

Source
pub struct Geometry {
Show 15 fields pub base: [V3; 6], pub dir: [V3; 6], pub axis: [V3; 6], pub anchors: [V3; 6], pub platform_radius: f64, pub crank: f64, pub rod: f64, pub branch: f64, pub min_margin: f64, pub max_crank_joint: f64, pub max_platform_joint: f64, pub min_clearance: f64, pub min_body_clearance: f64, pub max_condition: f64, pub home: [f64; 6], /* private fields */
}
Expand description

The kinematics, apart from masses and drives.

Fields§

§base: [V3; 6]

Crank axes’ centres (base frame), the cranks’ zero directions d_i, their axes k_i, and the platform joints (platform frame).

§dir: [V3; 6]§axis: [V3; 6]§anchors: [V3; 6]§platform_radius: f64§crank: f64§rod: f64§branch: f64

-1 for the branch “out”, +1 for “in”.

§min_margin: f64

Working range: the least angle from the dead centre (rad), the steepest rod at the crank’s ball joint (out of the crank’s plane) and at the platform’s (against the platform’s normal), rad, the least distance between two rods (m), the highest condition number.

§max_crank_joint: f64§max_platform_joint: f64§min_clearance: f64§min_body_clearance: f64

The least distance of a rod’s axis from the platform’s and the base’s hexagon edges (m).

§max_condition: f64§home: [f64; 6]

The pose Newton’s forward kinematics starts from: the centre of the tool’s box.

Implementations§

Source§

impl Geometry

Source

pub fn new( base_radius: f64, base_half: f64, platform_radius: f64, platform_half: f64, axis_turn: f64, crank: f64, rod: f64, out: bool, ) -> Self

Joints at the azimuths 120 k -+ the base half angle and 120 k -+ (60 - the platform half angle), degrees; each crank axis the base radius turned by -+ axis_turn degrees; cranks of length crank, rods of rod.

Source

pub fn set_home(&mut self, home: [f64; 6])

Sets the pose the forward kinematics starts from, and its first-order guess there (none where home is out of reach or singular).

Source

pub fn rotation(tool: &[f64]) -> M3

Source

pub fn tip(&self, i: usize, theta: f64) -> Crank

Crank i’s tip, tangent and second derivative at the angle theta.

Source

pub fn cranks(&self, q: &[f64]) -> [Crank; 6]

The six cranks at the angles q: what a Newton iteration over the platform’s pose keeps, since the cranks do not move with it.

Source

pub fn crank_angle(&self, i: usize, joint: V3) -> Option<f64>

The crank angle that puts crank i’s rod onto the platform joint at joint (closed form); None out of reach.

Source

pub fn legs_at(&self, q: &[f64], p: V3, r: &M3) -> [Leg; 6]

The legs at crank angles q with the platform at p turned by r.

Source

pub fn inverse(&self, tool: &[f64], q: &mut [f64]) -> bool

Crank angles for a tool pose (closed form); false where a rod cannot reach.

Source

pub fn legs(&self, tool: &[f64]) -> Option<[Leg; 6]>

The legs at a tool pose, by the inverse; None out of reach.

Source

pub fn constraint(legs: &[Leg; 6]) -> [f64; 36]

A (6 x 6, row by row): row i (u_i, b_i x u_i), the rate of rod i’s length over the platform’s twist.

Source

pub fn inverse_jacobian(legs: &[Leg; 6]) -> Vec<f64>

The inverse Jacobian (6 x 6, row by row): the crank rates per platform twist, theta’ = diag(m)^-1 A xi.

Source

pub fn pose(&self, q: &[f64]) -> Option<(V3, M3)>

The platform’s centre and rotation for crank angles, by Newton’s method from home; None where it does not converge.

Source

pub fn forward(&self, q: &[f64], tool: &mut [f64])

The tool pose for crank angles (pose); NaN where it does not converge.

Source

pub fn condition(&self, tool: &[f64]) -> f64

The condition number of the inverse Jacobian with the turns weighed by the platform radius (the platform joints’ speed for w); infinite out of reach and where one crank is at its dead centre (all six at once scale the rows alike, which the dead centre’s margin in unreachable catches).

Source

pub fn angles(&self, legs: &[Leg; 6], r: &M3) -> [[f64; 3]; 6]

Per leg: the rod’s angle from the crank’s tangent (90 degrees at the dead centre), its angle out of the crank’s plane at the crank’s ball joint, and its angle against the platform’s normal at the platform’s, rad.

Source

pub fn clearance(legs: &[Leg; 6]) -> f64

The least distance between the axes of two rods, m.

Source

pub fn body_clearance(&self, legs: &[Leg; 6]) -> f64

The least distance of a rod’s axis from the platform’s hexagon (its joints in order) and the base’s (the crank axes’ centres in order): the edges that end at the rod’s own platform joint, and at its own crank axis, apart.

Trait Implementations§

Source§

impl Clone for Geometry

Source§

fn clone(&self) -> Geometry

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Geometry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.