#![cfg_attr(not(debug_assertions), deny(warnings))]
#![deny(clippy::all, rust_2018_idioms)]
#![warn(
missing_docs,
missing_debug_implementations,
trivial_casts,
trivial_numeric_casts,
unsafe_code,
unstable_features,
unused_import_braces,
unused_qualifications
)]
pub mod base {
pub use truck_base::{
assert_near, assert_near2, bounding_box::BoundingBox, cgmath64::*, tolerance::*,
};
pub use truck_geotrait::*;
}
pub use base::*;
pub mod geometry;
pub use geometry::*;
pub mod topology {
use super::*;
pub type Vertex = truck_topology::Vertex<Point3>;
pub type Edge = truck_topology::Edge<Point3, Curve>;
pub type Wire = truck_topology::Wire<Point3, Curve>;
pub type Face = truck_topology::Face<Point3, Curve, Surface>;
pub type Shell = truck_topology::Shell<Point3, Curve, Surface>;
pub type Solid = truck_topology::Solid<Point3, Curve, Surface>;
pub type VertexID = truck_topology::VertexID<Point3>;
pub type EdgeID = truck_topology::EdgeID<Curve>;
pub type FaceID = truck_topology::FaceID<Surface>;
pub use truck_topology::shell::ShellCondition;
}
pub use topology::*;
pub mod topo_traits {
pub trait Mapped<P, C, S>: Sized {
#[doc(hidden)]
fn mapped<FP: Fn(&P) -> P, FC: Fn(&C) -> C, FS: Fn(&S) -> S>(
&self,
point_mapping: &FP,
curve_mapping: &FC,
surface_mapping: &FS,
) -> Self;
fn topological_clone(&self) -> Self
where
P: Clone,
C: Clone,
S: Clone, {
self.mapped(&Clone::clone, &Clone::clone, &Clone::clone)
}
}
pub trait Sweep<P, C, S> {
type Swept;
fn sweep<
FP: Fn(&P) -> P,
FC: Fn(&C) -> C,
FS: Fn(&S) -> S,
CP: Fn(&P, &P) -> C,
CE: Fn(&C, &C) -> S,
>(
&self,
point_mapping: &FP,
curve_mapping: &FC,
surface_mapping: &FS,
connect_points: &CP,
connect_curve: &CE,
) -> Self::Swept;
}
pub trait MultiSweep<P, C, S> {
type Swept;
fn multi_sweep<
FP: Fn(&P) -> P,
FC: Fn(&C) -> C,
FS: Fn(&S) -> S,
CP: Fn(&P, &P) -> C,
CE: Fn(&C, &C) -> S,
>(
&self,
point_mapping: &FP,
curve_mapping: &FC,
surface_mapping: &FS,
connect_points: &CP,
connect_curve: &CE,
division: usize,
) -> Self::Swept;
}
pub trait ClosedSweep<P, C, S>: MultiSweep<P, C, S> {
fn closed_sweep<
FP: Fn(&P) -> P,
FC: Fn(&C) -> C,
FS: Fn(&S) -> S,
CP: Fn(&P, &P) -> C,
CE: Fn(&C, &C) -> S,
>(
&self,
point_mapping: &FP,
curve_mapping: &FC,
surface_mapping: &FS,
connect_points: &CP,
connect_curves: &CE,
division: usize,
) -> Self::Swept;
}
}
pub use topo_traits::*;
pub type Result<T> = std::result::Result<T, errors::Error>;
pub mod builder;
mod closed_sweep;
pub mod errors;
mod geom_impls;
mod mapped;
mod multi_sweep;
mod sweep;
mod topo_impls;