Skip to main content

polyline

Macro polyline 

Source
macro_rules! polyline {
    (vlogger: $vlogger:expr, target: $target:expr, $surface:expr, $($arg:tt)+) => { ... };
    (vlogger: $vlogger:expr, $surface:expr, $($arg:tt)+) => { ... };
    (target: $target:expr, $surface:expr, $($arg:tt)+) => { ... };
    ($surface:expr, $($arg:tt)+) => { ... };
}
Expand description

Sends an open or closed polyline to the vlogger.

ยงExamples

use v_log::polyline;

let pos1 = [3.234, -1.223];
let pos2 = [2.713, 0.577];
let pos3 = [6.283, 0.692];

// text is only allowed on single lines
polyline!("main_surface", (pos1, pos2), 5.0, Base, "--", "Position is: x: {}, y: {}", pos1[0], pos1[1]);
polyline!("main_surface", (pos1, pos2), 5.0, Base, "--");
polyline!("main_surface", (pos1, pos2), 5.0, Base);
polyline!("main_surface", (pos1, pos2, pos3), 5.0, Base, "--");
polyline!("main_surface", (pos1, pos2, pos3), 5.0, Base);
// adding a last , makes it closed -> draws a triangle
polyline!("main_surface", (pos1, pos2, pos3,), 5.0, Base, "--");
polyline!("main_surface", (pos1, pos2, pos3,), 5.0, Base);