Skip to main content

belt

Function belt 

Source
pub fn belt(
    out: &mut Vec<Part>,
    path: &[[f64; 2]],
    y: f64,
    width: f64,
    tooth_spacing: f64,
    shade: impl Fn(usize) -> f32,
)
Expand description

Draws a belt along a path in the x-z plane at depth y: one strip per path segment, and teeth at a fixed spacing of belt length counted from the start of the path.

Start the path where the belt is clamped. Then the teeth sit at fixed places on the belt, and when the path changes with the pose they travel along it and around the pulleys by themselves. shade(i) is the highlight of the strip from point i to point i + 1.