Skip to main content

geop_ops_hole/
lib.rs

1//! Holes and threads, the way a hole wizard makes them: the [`Hole`]
2//! operation drills simple, counterbored, countersunk and tapped holes at
3//! points on a planar face, sized by ISO tables ([`iso`]) or by hand, or
4//! tapped for an NPT pipe thread ([`pipe`]) and reamed to its taper, each a
5//! revolved solid cut away (`hole`); the [`Thread`] operation puts an ISO
6//! metric or a pipe thread on a round face, straight or tapered, recorded as
7//! a cosmetic thread or modelled by sweeping its profile along a helix
8//! (`thread`).
9
10#[cfg(test)]
11mod editor_tests;
12#[cfg(any(test, feature = "examples"))]
13pub mod examples;
14mod hole;
15mod icons;
16pub mod iso;
17pub mod operation;
18#[cfg(test)]
19mod pattern_tests;
20pub mod pipe;
21#[cfg(test)]
22mod program_tests;
23#[cfg(test)]
24mod regression_tests;
25#[cfg(test)]
26mod testing;
27mod thread;
28
29pub use operation::{
30    FaceRef, Hole, HoleArgs, HoleCentre, HoleKind, PlaneRef, Standard, Thread, ThreadArgs,
31};
32
33use geop_core_editor::registry::Registry;
34use geop_core_math::geop_error::GeopResult;
35
36/// Adds what this crate offers an editor to `r`: holes and threads.
37pub fn register(r: Registry) -> GeopResult<Registry> {
38    let r = r.operation(Hole)?.operation(Thread)?;
39    #[cfg(any(test, feature = "examples"))]
40    let r = r.examples(examples::set())?;
41    Ok(r)
42}