app
Adom Step - File Viewer
Public Made by Adomby adom
Fusion 360-style viewer for STEP / STP files in a Hydrogen webview. Components outline, smart-pick measure (mm + mils + angle), hover-inspect HUD, and geometry-based pin / contact detection that handl
use crate::cli::{eval, ok, DEFAULT_PORT};
use anyhow::Result;
use clap::Parser;
#[derive(Parser)]
pub struct Args {
pub name: String,
#[arg(long, default_value_t = 5)]
pub timeout_secs: u64,
#[arg(long, default_value_t = DEFAULT_PORT)]
pub port: u16,
}
pub fn run(args: Args) -> Result<()> {
let code = format!(
"return window.adomStep ? window.adomStep.show({}) : {{ error: 'adomStep not loaded' }};",
serde_json::to_string(&args.name).unwrap()
);
eval::eval_snippet(&code, args.timeout_secs, args.port, true)?;
ok(format!("show {}", args.name));
Ok(())
}