diff --git a/crates/kernel/src/blend_smlib.rs b/crates/kernel/src/blend_smlib.rs index c456f1161..b3863f7c2 100644 --- a/crates/kernel/src/blend_smlib.rs +++ b/crates/kernel/src/blend_smlib.rs @@ -199,6 +199,7 @@ mod imp { let tagged = sb.tagged(0).map_err(|e| failed(what, "tag", e))?; let r = op(&tagged).map_err(|e| match e { SmError::Unsupported => super::unsupported(&format!("this {what}, which SMLib cannot build exactly")), + SmError::NoEffect => KernelError::Failed(format!("SMLib made no change: the {what} reported success but built no face")), e => failed(what, "operation", e), })?; let check = r.check(CheckLevel::All).map_err(|e| failed(what, "check", e))?; diff --git a/crates/kernel/src/offset_backend.rs b/crates/kernel/src/offset_backend.rs index 56d056a2b..b3dcf2a3c 100644 --- a/crates/kernel/src/offset_backend.rs +++ b/crates/kernel/src/offset_backend.rs @@ -35,6 +35,7 @@ fn refused(op: &str, e: SmError) -> KernelError { SmError::NoMatch { point } => KernelError::Invalid(format!("{op}: no face at selection point {}", point + 1)), SmError::Ambiguous { point } => KernelError::Invalid(format!("{op}: selection point {} is as near to two faces", point + 1)), SmError::Unsupported => KernelError::Failed(format!("not supported yet: SMLib {op} for this geometry")), + SmError::NoEffect => KernelError::Failed(format!("SMLib made no change: the {op} reported success but moved no face onto its new surface")), e => failed(op, "operation", e), } } diff --git a/crates/smlib/SMLIB_REV b/crates/smlib/SMLIB_REV index 0b7fc3e8c..b88bda259 100644 --- a/crates/smlib/SMLIB_REV +++ b/crates/smlib/SMLIB_REV @@ -1 +1 @@ -a6a0c024fd455adc9f98c6076806db7ea7164e2d +e7522f4e7917fe817643ff691f2860c310038c27 diff --git a/crates/smlib/src/ffi/ops.rs b/crates/smlib/src/ffi/ops.rs index 2134e96cc..b4d5e984c 100644 --- a/crates/smlib/src/ffi/ops.rs +++ b/crates/smlib/src/ffi/ops.rs @@ -18,6 +18,7 @@ pub const ERR_PICK_AMBIGUOUS: i32 = -1102; pub const ERR_NO_ROOM: i32 = -1103; pub const ERR_NO_CUT: i32 = -1104; pub const ERR_UNSUPPORTED: i32 = -1105; +pub const ERR_NO_EFFECT: i32 = -1107; pub const BOOLEAN_UNION: i32 = 0; pub const BOOLEAN_SUBTRACT: i32 = 1; diff --git a/crates/smlib/src/lib.rs b/crates/smlib/src/lib.rs index fcb41dc99..521bda27c 100644 --- a/crates/smlib/src/lib.rs +++ b/crates/smlib/src/lib.rs @@ -49,6 +49,9 @@ pub enum Error { NoRoom, /// SMLib cannot build this exactly yet (a variable radius whose law has a corner). Unsupported, + /// SMLib reported success but the operation did nothing: a blend that made no face, a face + /// move or draft that moved no face. + NoEffect, /// A C++ exception (most likely out of memory) was caught at the boundary. Exception, /// The C API is a different version from the one this crate was written against. @@ -71,6 +74,7 @@ impl std::fmt::Display for Error { Error::Ambiguous { point } => write!(f, "selection point {} is equally near to two edges or faces", point + 1), Error::NoRoom => write!(f, "the offset leaves no room inside the body"), Error::Unsupported => write!(f, "not supported yet: SMLib cannot build this exactly"), + Error::NoEffect => write!(f, "SMLib made no change: it reported success, but the operation did nothing"), Error::Exception => write!(f, "SMLib raised an internal exception"), Error::Version(v) => write!(f, "SMLib C API version {v}, expected {}", ffi::ABI_VERSION), Error::NotBuilt => write!(f, "not supported yet: this build has no SMLib"), @@ -90,6 +94,7 @@ fn error(s: i32) -> Error { ffi::ops::ERR_NOT_SOLID => Error::NotSolid, ffi::ops::ERR_NO_ROOM => Error::NoRoom, ffi::ops::ERR_UNSUPPORTED => Error::Unsupported, + ffi::ops::ERR_NO_EFFECT => Error::NoEffect, ffi::ERR_EXCEPTION => Error::Exception, ffi::NOT_BUILT => Error::NotBuilt, s => Error::Status(s),