#[allow(dead_code)]
pub(crate) mod adaptive_tolerance;
pub(crate) mod analytic;
pub(crate) mod blend_func;
pub(crate) mod builder_utils;
pub mod chamfer_builder;
pub(crate) mod corner;
pub mod fillet_builder;
#[allow(dead_code)]
pub(crate) mod g1_chain;
pub mod radius_law;
pub(crate) mod section;
pub(crate) mod spherical_triangle;
pub(crate) mod spine;
pub(crate) mod stripe;
pub(crate) mod trimmer;
pub(crate) mod walker;
use brepkit_topology::edge::EdgeId;
use brepkit_topology::face::FaceId;
use brepkit_topology::solid::SolidId;
use brepkit_topology::vertex::VertexId;
#[derive(Debug, thiserror::Error)]
pub enum BlendError {
#[error("no start solution at edge {edge:?}, t={t}")]
StartSolutionFailure {
edge: EdgeId,
t: f64,
},
#[error("walking failure at edge {edge:?}, t={t}, residual={residual}")]
WalkingFailure {
edge: EdgeId,
t: f64,
residual: f64,
},
#[error("twisted surface on stripe {stripe_idx}")]
TwistedSurface {
stripe_idx: usize,
},
#[error("radius too large for edge {edge:?}: max={max_radius}")]
RadiusTooLarge {
edge: EdgeId,
max_radius: f64,
},
#[error("trimming failure on face {face:?}")]
TrimmingFailure {
face: FaceId,
},
#[error("corner failure at vertex {vertex:?}")]
CornerFailure {
vertex: VertexId,
},
#[error("unsupported surface on face {face:?}: {surface_tag}")]
UnsupportedSurface {
face: FaceId,
surface_tag: String,
},
#[error(transparent)]
Topology(#[from] brepkit_topology::TopologyError),
#[error(transparent)]
Math(#[from] brepkit_math::MathError),
}
pub struct BlendResult {
pub solid: SolidId,
pub succeeded: Vec<EdgeId>,
pub failed: Vec<(EdgeId, BlendError)>,
pub is_partial: bool,
}