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    clip_less_on, screw_profile_brep, sweep_clip_less, sweep_solid_within, OutlinePiece, ScrewStep, SolidMotion, SweepClip, SweptTool, SOLID_SWEEP_REFUSAL,
61};
62pub use planar_region::{cut_planar_sweep_from_prism, region_cut_on, swept_region_holds, target_outline_holds};
63#[path = "construction/turn_window.rs"]
64mod turn_window;
65#[path = "construction/turned_disc.rs"]
66mod turned_disc;
67#[path = "construction/slide_prism.rs"]
68mod slide_prism;
69#[path = "construction/solid_sweep_bar.rs"]
70mod solid_sweep_bar;
71#[path = "construction/solid_sweep_turn_shadow.rs"]
72pub mod solid_sweep_turn_shadow;
73#[path = "construction/solid_sweep_caps.rs"]
74#[doc(hidden)]
75pub mod solid_sweep_caps;
76#[path = "construction/solid_sweep_one_pass.rs"]
77mod solid_sweep_one_pass;
78#[path = "construction/solid_sweep_trim.rs"]
79#[doc(hidden)]
80pub mod solid_sweep_trim;
81#[path = "construction/solid_sweep_thread.rs"]
82#[doc(hidden)]
83pub mod solid_sweep_thread;
84#[path = "construction/solid_sweep_tube.rs"]
85#[doc(hidden)]
86pub mod solid_sweep_tube;
87#[path = "construction/mill_envelope.rs"]
88pub mod mill_envelope;
89#[path = "construction/mill_plan.rs"]
90pub mod mill_plan;
91#[path = "construction/mill_faces.rs"]
92pub mod mill_faces;
93#[path = "construction/mill_dome.rs"]
94pub mod mill_dome;
95#[path = "construction/solid_sweep_apex.rs"]
96pub mod solid_sweep_apex;
97pub use solid_sweep_apex::{sweep_pyramid_within, Pyramid, APEX_SWEEP_REFUSAL};
98#[path = "construction/solid_sweep_upright.rs"]
99pub mod solid_sweep_upright;
100#[path = "construction/solid_sweep_planar_ring.rs"]
101pub mod solid_sweep_planar_ring;
102pub use solid_sweep_upright::sweep_upright_along;
103#[path = "construction/solid_sweep_notch.rs"]
104#[doc(hidden)]
105pub mod solid_sweep_notch;
106pub use solid_sweep_notch::{notch_less, notch_less_on};
107#[path = "construction/planar_region.rs"]
108#[doc(hidden)]
109pub mod planar_region;
110pub use solid_sweep_caps::{sweep_solid, sweep_prism_along, sweep_solid_along, sweep_solid_clipped, sweep_solid_parts, sweep_solid_rising, sweep_solid_tumbled, sweep_tube_slid_across, FrameCurve, RisingTurn, TwoTurns, SolidTool, SOLID_SWEEP_WHOLE_REFUSAL};
111#[path = "construction/mill_program.rs"]
112pub mod mill_program;
113pub use mill_program::{flat_mill_region_prisms, MillMove, MILL_REGION_REFUSAL};
114#[path = "geometry/closed_curves.rs"]
115#[doc(hidden)]
116pub mod closed_curves;
117pub use closed_curves::{make_ellipse, make_ellipse_arc, make_ellipsoid_brep, make_periodic_bspline};
118#[path = "construction/surface_faces.rs"]
119#[doc(hidden)]
120pub mod surface_faces;
121pub use surface_faces::{face_from_surface, face_from_surface_trimmed, sheet_from_sheets, solid_from_sheets, SURFACE_FACE_REFUSAL};
122#[path = "construction/slab.rs"]
123pub mod slab;
124pub use slab::{make_slab_brep, SLAB_REFUSAL};
125#[path = "construction/polyhedron.rs"]
126pub mod polyhedron;
127pub use polyhedron::{make_polyhedron_brep, POLYHEDRON_REFUSAL};
128#[path = "construction/polygon_solids.rs"]
129#[doc(hidden)]
130pub mod polygon_solids;
131pub use polygon_solids::{make_pyramid_on_polygon, solid_from_polygons};
132#[path = "construction/loft_guide_chain.rs"]
133#[doc(hidden)]
134pub mod loft_guide_chain;
135pub use loft_guide_chain::loft_profile_brep_guided_chain;
136#[path = "construction/loft_guides.rs"]
137#[doc(hidden)]
138pub mod loft_guides;
139pub 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};
140#[path = "construction/extrude_up_to.rs"]
141#[doc(hidden)]
142pub mod extrude_up_to;
143pub use extrude_up_to::{extrude_profile_up_to_face, solid_pieces, EXTRUDE_UP_TO_REFUSAL};
144#[path = "construction/sweep_round_corners.rs"]
145#[doc(hidden)]
146pub mod sweep_round_corners;
147pub use sweep_round_corners::{sweep_profile_round_corners, SWEEP_ROUND_CORNERS_REFUSAL};
148#[path = "construction/sweep_ellipsoid.rs"]
149#[doc(hidden)]
150pub mod sweep_ellipsoid;
151pub use sweep_ellipsoid::sweep_ellipsoid_along_line;
152#[path = "construction/sweep_topology.rs"]
153#[doc(hidden)]
154pub mod sweep_topology;
155pub use sweep_topology::is_sweep_tight_bend;
156pub use sweep_topology::{
157    extrude_profile_brep, extrude_profile_brep_draft, fit_helix_curve, helix_sample_points,
158    profile_anchor, rib_from_profile, sweep_bend_profile, sweep_closure, BendStation,
159    JointContinuity, PathJoint, SweepClosure,
160    RibExtrusion, RibNames, SweepPath, MAX_JOINT_TANGENT_BREAK, SWEEP_TIGHT_BEND_REFUSAL,
161    SWEEP_TWIST_CLOSURE_REFUSAL,
162    build_swept_envelope, recognize_swept_envelope, swept_envelope_volume, SweptEnvelope,
163    SWEEP_ENVELOPE_REFUSAL, sweep_envelope_bodies,
164    sweep_profile_along_chain, sweep_profile_along_chain_reported,
165    sweep_profile_along_chain_with_stations, sweep_profile_along_chain_with_stations_reported,
166    sweep_profile_along_path,
167    sweep_profile_along_path_anchored,
168    sweep_profile_helix,
169    sweep_profile_twisted, sweep_profile_twisted_anchored, sweep_profile_twisted_within, sweep_profile_twisted_scaled,
170    ProfileAnchor, SectionPlacement,
171    StationBudget, SweepStationReport, SweptChain, SWEEP_DEFAULT_TOLERANCE, SWEEP_MAX_STATIONS,
172    SWEEP_REFINEMENT_ROUNDS,
173};
174#[path = "construction/gears.rs"]
175pub mod gears;
176#[path = "construction/profile_holes.rs"]
177pub mod profile_holes;
178pub use profile_holes::{extrude_profile_with_holes, revolve_profile_with_holes};
179pub use gears::{spur_sector_solid, lobed_section, lobed_sizes, lobed_solid, beveloid_solid, BeveloidGear, star_wheel_section, star_wheel_solid, StarWheel, lantern_solid, LanternPinion, flanged_prism, hollow_prism, crown_limits, crown_sizes, crown_solid, CrownGear, worm_wheel_sizes, worm_wheel_solid, WormWheel, elliptical_section, elliptical_sizes, elliptical_solid, EllipticalGear, bevel_cones, bevel_section, bevel_solid, prism_by_rows, BevelGear, cycloidal_gear_section, cycloidal_gear_solid, CycloidalGear, cycloidal_disc_section, cycloidal_disc_solid, cycloidal_pin_ring, CycloidalDisc, worm_section, worm_solid, Worm, geneva_section, geneva_sizes, geneva_solid, GenevaWheel, ratchet_section, ratchet_solid, Ratchet, timing_pulley_section, timing_pulley_solid, TimingPulley, hub_from_section, straight_spline_hub, straight_spline_section, straight_spline_shaft, StraightSpline, helical_solid, helical_transverse, twisted_prism, Hand, HelicalGear, Twist, rack_section, rack_solid, ring_section, ring_solid, ring_solid_helical, sprocket_section, sprocket_solid, spur_section, spur_solid, GearData, GearSection, Rack, RingGear, SectionCurve, Sprocket, SprocketForm, SpurGear, GEAR_FIT_TOLERANCE};
180#[path = "construction/revolve_topology.rs"]
181#[doc(hidden)]
182pub mod revolve_topology;
183pub use revolve_topology::{revolve_profile_brep, revolve_profile_brep_named};
184#[path = "construction/loft_topology.rs"]
185#[doc(hidden)]
186pub mod loft_topology;
187pub use loft_topology::{
188    loft_profile_brep, loft_profile_brep_closed, loft_profile_brep_guided,
189    loft_profile_brep_guided_frame, loft_profile_brep_tangent,
190};
191pub use loft_topology::loft_profile_brep_closed_shifted;
192
193/// Hash of this crate's source (`build.rs`), one part of the kernel's source stamp.
194#[doc(hidden)]
195pub const SOURCE_HASH: Option<&str> = option_env!("BREP_KERNEL_SOURCE_HASH");