mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-03 18:45:55 +00:00
solidcraft-smlib: SMLib's "no change" as Error::NoEffect, the fork pinned at its integration head
The fork's shims now hold an operation SMLib reports done to having done something (SMLIB_ERR_NO_EFFECT, -1107: a blend that made no face, a face move or draft that moved no face). It maps to Error::NoEffect, and the kernel says "SMLib made no change: ..." for blends and for offset, shell and draft. Case 1080 (chamfer over openings) returned an unchanged body as success. The fork pin moves to 6bb2938: the chamfer side fix of the piecewise merge, the no-effect contract, and SmStatus marked must-use with the dropped statuses of the shims and of the fillet, boolean, offset and sweep code passed on. (not built: base in progress) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017itGh5fpMEousnZ91cYcVt
This commit is contained in:
@@ -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))?;
|
||||
|
||||
@@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
a6a0c024fd455adc9f98c6076806db7ea7164e2d
|
||||
e7522f4e7917fe817643ff691f2860c310038c27
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user