Wave 132/509: solidcraft-smlib: SMLib's "no change" as Error::NoEffect, the fork pinned at its integration head (and 1 more)
2 commits, squashed; the originals stay reachable from tag archive/merge-main-develop. - cbf28a4fd jyviko: kernel: the prism boolean modules are gone from the crate root - 9268a1e88 jyviko: solidcraft-smlib: SMLib's "no change" as Error::NoEffect, the fork pinned at its integration head Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ
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))?;
|
||||
|
||||
@@ -113,7 +113,6 @@ mod polybool;
|
||||
mod polyhedron;
|
||||
mod prism;
|
||||
mod prism_curve;
|
||||
mod prism_local;
|
||||
mod prism_measure;
|
||||
pub mod profile;
|
||||
pub mod provenance;
|
||||
@@ -206,7 +205,7 @@ pub use ops::{
|
||||
place_matrix, split_by_plane, transform, transform_matrix, union_apart, with_attempt_budget,
|
||||
};
|
||||
pub use point_path::{PathPiece, PointPath, sweep_point_path_with};
|
||||
pub use polybool::{faceted_boolean, planar_boolean};
|
||||
pub use polybool::faceted_boolean;
|
||||
pub use polyhedron::{HalfSpace, convex_polyhedron, draft, offset_faces, shell};
|
||||
pub use prism::{PLANAR_FIT_TOL, extrude_planar_regions, planar_regions_boolean};
|
||||
pub use prism_measure::certified_prism_equivalent;
|
||||
|
||||
@@ -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