use commandagi::client::CommandAGI;
use std::{thread::sleep, time::Duration};
fn main() -> Result<(), commandagi::client::Error> {
let cagi = CommandAGI::from_env()?;
let thread = cagi.threads().create("Design a bracket for a NEMA 17 motor")?;
cagi.threads().send(&thread.id, "Make it 3 mm thick.")?;
let world = cagi.launch("simulation/arm-cell")?; world.sim().run()?; world.sim().ik([0.08, -0.12, 0.86])?; sleep(Duration::from_secs(2)); println!("{}", world.describe()?.text().len()); std::fs::write("cell.jpg", world.observe()?.bytes).unwrap(); world.stop()?; Ok(())
}