kernel: surfaces and SMLib blends without the smlib feature gate

solidcraft-smlib is a dependency of every build (it answers NotBuilt without
SMLib), so the SMLib sides of surfaces.rs and blend_smlib.rs no longer sit
behind cfg(feature = "smlib"), and their stub modules go; blend_smlib's tests
run in every build like the rest. This also uses offset_backend::thicken and
the smlib_sweeps curve conversions in builds without the feature, which left
them unused there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017itGh5fpMEousnZ91cYcVt
This commit is contained in:
jyviko
2026-10-22 07:53:28 -04:00
parent dead22ba7a
commit 1b7fda4d33
2 changed files with 1 additions and 74 deletions
+1 -28
View File
@@ -71,7 +71,6 @@ enum Kind {
Chamfer,
}
#[cfg(feature = "smlib")]
mod imp {
use std::collections::BTreeSet;
@@ -284,33 +283,7 @@ mod imp {
}
}
#[cfg(not(feature = "smlib"))]
mod imp {
use solidcraft_geom::Vec3;
use super::Kind;
use crate::blend_variable::RadiusSpline;
use crate::body::Body;
use crate::{KernelError, Result};
fn not_built() -> KernelError {
KernelError::Invalid("not supported yet: this build has no SMLib".into())
}
pub(super) fn blend(_: &Body, _: &str, _: Kind, _: &[Vec3], _: &[f64]) -> Result<Body> {
Err(not_built())
}
pub(super) fn variable(_: &Body, _: Vec3, _: Vec3, _: &RadiusSpline) -> Result<Body> {
Err(not_built())
}
pub(super) fn sides(_: &Body, _: &[Vec3], _: f64, _: crate::ChamferSide, _: bool) -> Result<Body> {
Err(not_built())
}
}
#[cfg(all(test, feature = "smlib"))]
#[cfg(test)]
#[allow(clippy::unwrap_used, clippy::expect_used)]
mod tests {
use solidcraft_geom::Vec3;
-46
View File
@@ -1194,7 +1194,6 @@ fn open_sections(sections: &[(Plane, Vec<Seg2>)]) -> Result<Vec<crate::loft_rail
}
/// SMLib's side of this module.
#[cfg(feature = "smlib")]
mod imp {
use solidcraft_smlib::sweeps::{Affine, Curve, Ends, SweepFrame};
use solidcraft_smlib::{Brep as SmBrep, CheckLevel};
@@ -1547,51 +1546,6 @@ mod imp {
}
}
#[cfg(not(feature = "smlib"))]
mod imp {
use super::*;
fn not_built() -> KernelError {
refuse("surfaces: this build has no SMLib (feature `smlib`)")
}
pub(super) fn refuse(what: &str) -> KernelError {
crate::smlib_sweeps::refuse(what)
}
pub(super) fn stitched(_: &Brep, _: f64) -> Result<(Body, Option<History>)> {
Err(not_built())
}
pub(super) fn thicken(_: &Body, _: f64, _: bool) -> Result<Body> {
Err(not_built())
}
pub(super) fn offset_face(_: &Brep, _: usize, _: f64) -> Result<Brep> {
Err(not_built())
}
pub(super) fn extruded(_: &Plane, _: &[Numbered], _: Vec3, _: f64) -> Result<Brep> {
Err(not_built())
}
pub(super) fn revolved(_: &Plane, _: &[Numbered], _: Vec3, _: Vec3, _: f64) -> Result<Brep> {
Err(not_built())
}
pub(super) fn swept(_: &Plane, _: &[Numbered], _: &[crate::PathSeg], _: bool) -> Result<Brep> {
Err(not_built())
}
pub(super) fn cornered(
_: &Plane,
_: &[Numbered],
_: &[crate::PathSeg],
_: &[std::ops::Range<usize>],
_: bool,
) -> Result<Vec<(Brep, Vec<FaceProv>)>> {
Err(not_built())
}
pub(super) fn swept_stations(_: &Plane, _: &[Numbered], _: &[crate::PathSeg], _: &crate::SweepControl) -> Result<Brep> {
Err(not_built())
}
pub(super) fn lofted(_: &[&solidcraft_geom::bspline::CurveN<4>]) -> Result<Brep> {
Err(not_built())
}
}
#[cfg(test)]
mod tests {
use super::*;