Skip to main content

brep_construction/
lib.rs

1//! Solid construction of the BREP kernel: extrusions, revolutions, sweeps and lofts.
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//! - extrusions (including up to a face), revolutions and lofts, with lofts along guide curves and guide chains;
15//! - sweeps of a profile along a path, with round corners, and solid sweeps of a body along a motion;
16//! - ellipses, ellipsoids and periodic B-splines;
17//! - faces and solids from surfaces, sheets and polygons.
18//!
19//! 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), [`BREP_boolean`](https://crates.io/crates/BREP_boolean). It is required by [`BREP_blend`](https://crates.io/crates/BREP_blend), [`BREP_offset`](https://crates.io/crates/BREP_offset), [`BREP_direct_edit`](https://crates.io/crates/BREP_direct_edit), [`BREP_kernel`](https://crates.io/crates/BREP_kernel).
20//!
21//! ## Building
22//!
23//! The crate builds natively and for `wasm32-unknown-unknown`. The `parallel`
24//! feature runs some per-face loops on rayon; `profile-wall` turns on a diagnostic
25//! wall-time partition. Both are off by default, and `BREP_kernel` forwards them.
26//!
27//! The packaged crate ships the library sources, the README, the licence and the
28//! manifest; it carries no test suite.
29//!
30//! ## License
31//!
32//! The Autodrop3d licence in `LICENSE.md`, shipped in the crate (`license-file` in
33//! the manifest). Source: <https://github.com/mmiscool/next.BREP.io_RUST_BREP_KERNEL>
34// Implementation crate of the kernel: its formerly crate-private items are public for the crates above
35// (documented hidden), and their docs may name private helpers.
36#![allow(rustdoc::private_intra_doc_links)]
37use serde::{Deserialize, Serialize};
38#[allow(unused_imports)]
39use wasm_bindgen::prelude::*;
40#[macro_use]
41extern crate brep_geometry;
42#[allow(unused_imports)]
43#[doc(no_inline)]
44pub use brep_geometry::*;
45#[macro_use]
46extern crate brep_topology;
47#[allow(unused_imports)]
48#[doc(no_inline)]
49pub use brep_topology::*;
50#[macro_use]
51extern crate brep_boolean;
52#[allow(unused_imports)]
53#[doc(no_inline)]
54pub use brep_boolean::*;
55
56#[path = "construction/solid_sweep.rs"]
57#[doc(hidden)]
58pub mod solid_sweep;
59pub use solid_sweep::{
60    sweep_solid_within, OutlinePiece, ScrewStep, SolidMotion, SweepClip, SweptTool, SOLID_SWEEP_REFUSAL,
61};
62#[path = "construction/solid_sweep_caps.rs"]
63#[doc(hidden)]
64pub mod solid_sweep_caps;
65pub use solid_sweep_caps::{sweep_solid, sweep_prism_along, sweep_solid_along, sweep_solid_clipped, sweep_solid_parts, sweep_solid_rising, sweep_solid_tumbled, FrameCurve, RisingTurn, TwoTurns, SolidTool, SOLID_SWEEP_WHOLE_REFUSAL};
66#[path = "geometry/closed_curves.rs"]
67#[doc(hidden)]
68pub mod closed_curves;
69pub use closed_curves::{make_ellipse, make_ellipse_arc, make_ellipsoid_brep, make_periodic_bspline};
70#[path = "construction/surface_faces.rs"]
71#[doc(hidden)]
72pub mod surface_faces;
73pub use surface_faces::{face_from_surface, face_from_surface_trimmed, solid_from_sheets, SURFACE_FACE_REFUSAL};
74#[path = "construction/polygon_solids.rs"]
75#[doc(hidden)]
76pub mod polygon_solids;
77pub use polygon_solids::{make_pyramid_on_polygon, solid_from_polygons};
78#[path = "construction/loft_guide_chain.rs"]
79#[doc(hidden)]
80pub mod loft_guide_chain;
81pub use loft_guide_chain::loft_profile_brep_guided_chain;
82#[path = "construction/loft_guides.rs"]
83#[doc(hidden)]
84pub mod loft_guides;
85pub use loft_guides::{loft_profile_brep_on_guide_chains, loft_profile_brep_on_guides, loft_profile_brep_on_loose_guide_chains, GuideLoftWall, LOFT_ON_GUIDES_REFUSAL};
86#[path = "construction/extrude_up_to.rs"]
87#[doc(hidden)]
88pub mod extrude_up_to;
89pub use extrude_up_to::{extrude_profile_up_to_face, solid_pieces, EXTRUDE_UP_TO_REFUSAL};
90#[path = "construction/sweep_round_corners.rs"]
91#[doc(hidden)]
92pub mod sweep_round_corners;
93pub use sweep_round_corners::{sweep_profile_round_corners, SWEEP_ROUND_CORNERS_REFUSAL};
94#[path = "construction/sweep_ellipsoid.rs"]
95#[doc(hidden)]
96pub mod sweep_ellipsoid;
97pub use sweep_ellipsoid::sweep_ellipsoid_along_line;
98#[path = "construction/sweep_topology.rs"]
99#[doc(hidden)]
100pub mod sweep_topology;
101pub use sweep_topology::is_sweep_tight_bend;
102pub use sweep_topology::{
103    extrude_profile_brep, extrude_profile_brep_draft, fit_helix_curve, helix_sample_points,
104    profile_anchor, rib_from_profile, sweep_bend_profile, sweep_closure, BendStation,
105    JointContinuity, PathJoint, SweepClosure,
106    RibExtrusion, RibNames, SweepPath, MAX_JOINT_TANGENT_BREAK, SWEEP_TIGHT_BEND_REFUSAL,
107    SWEEP_TWIST_CLOSURE_REFUSAL,
108    build_swept_envelope, recognize_swept_envelope, swept_envelope_volume, SweptEnvelope,
109    SWEEP_ENVELOPE_REFUSAL, sweep_envelope_bodies,
110    sweep_profile_along_chain, sweep_profile_along_chain_reported,
111    sweep_profile_along_chain_with_stations, sweep_profile_along_chain_with_stations_reported,
112    sweep_profile_along_path,
113    sweep_profile_along_path_anchored,
114    sweep_profile_helix,
115    sweep_profile_twisted, sweep_profile_twisted_anchored, sweep_profile_twisted_scaled,
116    ProfileAnchor, SectionPlacement,
117    StationBudget, SweepStationReport, SweptChain, SWEEP_DEFAULT_TOLERANCE, SWEEP_MAX_STATIONS,
118    SWEEP_REFINEMENT_ROUNDS,
119};
120#[path = "construction/revolve_topology.rs"]
121#[doc(hidden)]
122pub mod revolve_topology;
123pub use revolve_topology::{revolve_profile_brep, revolve_profile_brep_named};
124#[path = "construction/loft_topology.rs"]
125#[doc(hidden)]
126pub mod loft_topology;
127pub use loft_topology::{
128    loft_profile_brep, loft_profile_brep_closed, loft_profile_brep_guided,
129    loft_profile_brep_guided_frame, loft_profile_brep_tangent,
130};
131pub use loft_topology::loft_profile_brep_closed_shifted;
132
133/// Hash of this crate's source (`build.rs`), one part of the kernel's source stamp.
134#[doc(hidden)]
135pub const SOURCE_HASH: Option<&str> = option_env!("BREP_KERNEL_SOURCE_HASH");