extern crate core;
use std::error::Error;
pub mod airfoil2;
pub mod common;
pub mod errors;
pub mod func1;
pub mod geom2;
pub mod geom3;
pub mod io;
pub mod metrology;
pub mod raster2;
pub mod raster3;
pub mod sensors;
pub mod stats;
pub mod utility;
pub type Result<T> = std::result::Result<T, Box<dyn Error>>;
pub type ResultCode<T> = std::result::Result<T, usize>;
pub use alum;
pub use colorgrad;
pub use imageproc;
pub use imageproc::image;
pub use levenberg_marquardt;
pub use parry2d_f64 as parry2d;
pub use parry3d_f64 as parry3d;
pub use parry3d_f64::na;
pub use rayon;
pub use serde;
pub use serde_json;
pub use tol_compress;
pub use func1::{Func1, Gaussian1, Line1, Polynomial, Series1};
pub use common::{AngleDir, AngleInterval, IndexMask, IntervalOps};
pub type DVector = na::DVector<f64>;
pub type DMatrix = na::DMatrix<f64>;
pub use geom2::{
Arc2, Circle2, Curve2, CurveGroup2, CurveStation2, Iso2, KdTree2, Line2, Point2, SurfacePoint2,
SvdBasis2, UnitVec2, Vector2,
};
pub use geom3::{
Aabb3, CloudIndex3, Curve3, CurveGroup3, CurveStation3, FaceAttrSet3, FlatDomain,
HalfEdgeMesh3, Iso3, KdTree3, Line3, Manifold1Pos3, Mesh3, MeshData3, MeshView3, PlanarMap,
PlanarSection, Plane3, PlaneFrame, Point3, PointAttrSet3, PointCloud3, PointCloudOverlap,
Sphere3, SurfacePoint3, SvdBasis3, UnitVec3, VOXEL_COHERENCE_ATTR, VOXEL_COUNT_ATTR, Vector3,
};
pub use common::{To2D, To3D};
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum VecDot {
AsIs,
Abs,
ClampPos,
}
#[derive(Debug, Clone)]
pub enum Selection {
None,
All,
Indices(Vec<usize>),
Mask(IndexMask),
}
#[derive(Debug, Clone, Copy)]
pub enum SelectOp {
Add,
Remove,
KeepOnly,
}
pub enum Resample {
ByCount(usize),
BySpacing(f64),
ByMaxSpacing(f64),
}
pub enum Smoothing {
Gaussian(f64),
Quadratic(f64),
Cubic(f64),
}
#[cfg(test)]
pub mod tests {
use crate::io::{read_tc_curve2_from, read_tc_mesh_from};
use crate::{Curve2, Mesh3};
pub fn stanford_bun_4() -> Mesh3 {
embedded_mesh(include_bytes!("../tests/data/stanford_bun_4.tcmesh"))
}
pub fn stanford_bun_2() -> Mesh3 {
embedded_mesh(include_bytes!("../tests/data/stanford_bun_2.tcmesh"))
}
pub fn stanford_bun_3() -> Mesh3 {
embedded_mesh(include_bytes!("../tests/data/stanford_bun_3.tcmesh"))
}
pub fn engine_blade() -> Mesh3 {
embedded_mesh(include_bytes!("../tests/data/engine-blade.tcmesh"))
}
fn embedded_mesh(bytes: &[u8]) -> Mesh3 {
let data = read_tc_mesh_from(&mut { bytes }).unwrap();
Mesh3::from_data(data, false).unwrap()
}
pub fn airfoil_curve() -> Curve2 {
let bytes = include_bytes!("../tests/data/airfoil-0.tccurve2");
let mut working = bytes.as_slice();
read_tc_curve2_from(&mut working).unwrap()
}
pub fn get_test_data_path() -> std::path::PathBuf {
let mut path = std::env::current_dir().unwrap();
path.push("tests");
path.push("data");
path
}
pub fn get_test_file_path(str: &str) -> std::path::PathBuf {
let mut path = get_test_data_path();
path.push(str);
path
}
}