1#[allow(dead_code)]
8pub(crate) mod adaptive_tolerance;
9pub(crate) mod analytic;
10pub(crate) mod blend_func;
11pub(crate) mod builder_utils;
12pub mod chamfer_builder;
13pub(crate) mod corner;
14pub mod fillet_builder;
15#[allow(dead_code)]
16pub(crate) mod g1_chain;
17pub mod radius_law;
18pub(crate) mod section;
19pub(crate) mod spherical_triangle;
20pub(crate) mod spine;
21pub(crate) mod stripe;
22pub(crate) mod trimmer;
23pub(crate) mod walker;
24
25use brepkit_topology::edge::EdgeId;
26use brepkit_topology::face::FaceId;
27use brepkit_topology::solid::SolidId;
28use brepkit_topology::vertex::VertexId;
29
30#[derive(Debug, thiserror::Error)]
32pub enum BlendError {
33 #[error("no start solution at edge {edge:?}, t={t}")]
35 StartSolutionFailure {
36 edge: EdgeId,
38 t: f64,
40 },
41
42 #[error("walking failure at edge {edge:?}, t={t}, residual={residual}")]
44 WalkingFailure {
45 edge: EdgeId,
47 t: f64,
49 residual: f64,
51 },
52
53 #[error("twisted surface on stripe {stripe_idx}")]
55 TwistedSurface {
56 stripe_idx: usize,
58 },
59
60 #[error("radius too large for edge {edge:?}: max={max_radius}")]
62 RadiusTooLarge {
63 edge: EdgeId,
65 max_radius: f64,
67 },
68
69 #[error("trimming failure on face {face:?}")]
71 TrimmingFailure {
72 face: FaceId,
74 },
75
76 #[error("corner failure at vertex {vertex:?}")]
78 CornerFailure {
79 vertex: VertexId,
81 },
82
83 #[error("unsupported surface on face {face:?}: {surface_tag}")]
85 UnsupportedSurface {
86 face: FaceId,
88 surface_tag: String,
90 },
91
92 #[error(transparent)]
94 Topology(#[from] brepkit_topology::TopologyError),
95
96 #[error(transparent)]
98 Math(#[from] brepkit_math::MathError),
99}
100
101pub struct BlendResult {
103 pub solid: SolidId,
105 pub succeeded: Vec<EdgeId>,
107 pub failed: Vec<(EdgeId, BlendError)>,
109 pub is_partial: bool,
111}