pub fn is_available() -> bool {
cfg!(feature = "step")
}
#[derive(Debug)]
pub struct StepNotAvailable;
impl std::fmt::Display for StepNotAvailable {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
"STEP export requires the 'step' feature. Build with: cargo build --features step"
)
}
}
impl std::error::Error for StepNotAvailable {}
#[cfg(feature = "step")]
mod occt_impl {
use opencascade::primitives::Shape;
use std::path::Path;
pub fn write_step(shape: &Shape, path: impl AsRef<Path>) -> Result<(), std::io::Error> {
shape
.write_step(path.as_ref())
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))
}
}
#[cfg(feature = "step")]
pub use occt_impl::write_step;