brep_solvers/lib.rs
1//! Constraint solvers of the BREP kernel: 2D and 3D sketches and assemblies.
2//!
3//! It is one of the implementation crates the kernel is built from. Applications
4//! should depend on [`BREP_kernel`](https://crates.io/crates/BREP_kernel), which
5//! re-exports the public API of every kernel crate at its root (`brep_kernel::…`)
6//! and adds the feature pipeline and the STEP, IGES, Parasolid (import), 3MF,
7//! GLB, STL and OBJ exchange.
8//! Many items here are public only so the other kernel crates can reach them;
9//! those are hidden from the documentation and carry no stability promise beyond
10//! the kernel's own. The kernel crates are released together, at one version.
11//!
12//! It contains:
13//!
14//! - the 2D sketch solver;
15//! - the 3D sketch solver;
16//! - the assembly mate solver, its resolution of mates against parts, and assembly ids.
17//!
18//! Kernel crates it requires: [`BREP_RANSAC`](https://crates.io/crates/BREP_RANSAC), [`BREP_geometry`](https://crates.io/crates/BREP_geometry), [`BREP_topology`](https://crates.io/crates/BREP_topology). It is required by [`BREP_kernel`](https://crates.io/crates/BREP_kernel).
19//!
20//! ## Building
21//!
22//! The crate builds natively and for `wasm32-unknown-unknown`. The `parallel`
23//! feature runs some per-face loops on rayon; `profile-wall` turns on a diagnostic
24//! wall-time partition. Both are off by default, and `BREP_kernel` forwards them.
25//!
26//! The packaged crate ships the library sources, the README, the licence and the
27//! manifest; it carries no test suite.
28//!
29//! ## License
30//!
31//! The Autodrop3d licence in `LICENSE.md`, shipped in the crate (`license-file` in
32//! the manifest). Source: <https://github.com/mmiscool/next.BREP.io_RUST_BREP_KERNEL>
33// Implementation crate of the kernel: its formerly crate-private items are public for the crates above
34// (documented hidden), and their docs may name private helpers.
35#![allow(rustdoc::private_intra_doc_links)]
36use serde::{Deserialize, Serialize};
37#[allow(unused_imports)]
38use wasm_bindgen::prelude::*;
39#[macro_use]
40extern crate brep_geometry;
41#[allow(unused_imports)]
42#[doc(no_inline)]
43pub use brep_geometry::*;
44#[macro_use]
45extern crate brep_topology;
46#[allow(unused_imports)]
47#[doc(no_inline)]
48pub use brep_topology::*;
49
50#[path = "solvers/sketch_solver.rs"]
51#[doc(hidden)]
52pub mod sketch_solver;
53pub use sketch_solver::{
54 is_sketch_origin_point_id, sketch_id_key, mint_sketch_id, solve_sketch, solve_sketch_from_json,
55 SketchSolverSettings, SolveSketchRequest, SKETCH_ORIGIN_POINT_ID,
56};
57#[path = "solvers/assembly_solver.rs"]
58#[doc(hidden)]
59pub mod assembly_solver;
60pub use assembly_solver::{
61 solve_assembly, AssemblyBody, AssemblyMate, AssemblySolution, AssemblySolveOptions, BodyFreedom, BodyPose,
62 LinearAlgebra, MateAlign, MateAxis, MateCurve, MateKind, MatePlane, MateResidualReport,
63 SolveStrategy, SymmetricElement,
64};
65// Assembly selection resolution: a namespaced selection ref resolved to an
66// analytic frame (plane/axis/sphere/circle/line/point) read from the exact
67// BREP, feeding `MateKind` inputs in component-local coordinates.
68#[path = "solvers/sketch3d_solver.rs"]
69#[doc(hidden)]
70pub mod sketch3d_solver;
71pub use sketch3d_solver::{
72 sketch3d_constraint_type, solve_sketch3d, solve_sketch3d_doc, solve_sketch3d_from_json,
73 Sketch3dConstraint, Sketch3dConstraintType, Sketch3dDiagnostics, Sketch3dDoc,
74 Sketch3dGeometry, Sketch3dPoint, Sketch3dSolveOptions, SolveSketch3dRequest,
75 SKETCH3D_CONSTRAINT_TYPES,
76};
77#[path = "solvers/assembly_resolve.rs"]
78#[doc(hidden)]
79pub mod assembly_resolve;
80pub use assembly_resolve::{
81 is_component_reference, resolve_component_point, resolve_edge_selection,
82 resolve_face_selection, resolve_named_selection, resolve_vertex_selection,
83 split_component_namespace, ResolveError, SelectionGeometry,
84};
85
86/// Hash of this crate's source (`build.rs`), one part of the kernel's source stamp.
87#[doc(hidden)]
88pub const SOURCE_HASH: Option<&str> = option_env!("BREP_KERNEL_SOURCE_HASH");
89#[doc(hidden)]
90#[path = "solvers/assembly_ids.rs"]
91pub mod assembly_ids;