Another project
1pub mod aabb;
2mod angles;
3pub mod arc2;
4pub mod arc3;
5pub mod brep;
6pub mod circle2;
7pub mod circle3;
8mod circular3;
9pub mod closest;
10pub mod curvature;
11pub mod curve2;
12pub mod curve3;
13pub mod cylinder_surface;
14pub mod extrude;
15pub mod intersect;
16pub mod intersect3;
17pub mod line2;
18pub mod line3;
19pub mod mesh;
20pub mod plane_surface;
21pub mod polyline3;
22pub mod surface3;
23
24pub use aabb::Aabb2;
25pub use arc2::{Arc2, arc_bounding_box};
26pub use arc3::Arc3;
27pub use brep::eval::evaluate_extrude;
28pub use brep::profile::{ExtrudeProfile, ProfileEdge, ProfileLoop};
29pub use brep::{
30 BrepEdge, BrepError, BrepFace, BrepLoop, BrepReattach, BrepShell, BrepSolid, BrepVertex,
31 EdgeCurve3, EdgePolyline, EdgePolylines, EdgeReattach, FaceMesh, LabelKind, MeshError,
32 ProfileDefect, SolidMesh, TruckGap,
33};
34pub use circle2::Circle2;
35pub use circle3::Circle3;
36pub use closest::{ClosestPoint, ClosestPoint2, ClosestPoint3};
37pub use curvature::Curvature;
38pub use curve2::{Curve2, Curve2Kind};
39pub use curve3::{Curve3, Curve3Kind};
40pub use cylinder_surface::CylinderSurface;
41pub use extrude::{
42 DraftAngle, DraftDirection, DraftMagnitude, ExtrudeDirection, ExtrudeEndCondition,
43 ExtrudeFeature, ExtrudeSense, MergeResult, PlaneRef, ThinWall, ThinWallDirection,
44};
45pub use intersect::{IntersectionSet, IntersectionSet2, intersect_curves};
46pub use intersect3::{IntersectionSet3, intersect_curves_3};
47pub use line2::Line2;
48pub use line3::Line3;
49pub use mesh::{MeshVertex, TriMesh};
50pub use plane_surface::PlaneSurface;
51pub use polyline3::Polyline3;
52pub use surface3::Surface3;
53
54#[derive(Debug, thiserror::Error)]
55pub enum KernelError {
56 #[error("line endpoints coincide within tolerance")]
57 DegenerateLine,
58 #[error("arc sweep is within tolerance of zero or exceeds 2π")]
59 DegenerateArc,
60 #[error("circle radius is within tolerance of zero")]
61 DegenerateCircle,
62 #[error("polyline needs at least two vertices and no zero-length segment")]
63 DegeneratePolyline,
64 #[error("plane surface extent is within tolerance of zero")]
65 DegeneratePlane,
66 #[error("cylinder surface radius, height, or sweep is degenerate")]
67 DegenerateCylinder,
68 #[error("draft angle must be within [0, 90) degrees: {0} deg")]
69 DraftAngleOutOfRange(f64),
70}
71
72pub type Result<T, E = KernelError> = core::result::Result<T, E>;