Skip to main content

Crate brep_blend

Crate brep_blend 

Source
Expand description

Fillets, chamfers and blends of the BREP kernel.

It is one of the implementation crates the kernel is built from. Applications should depend on BREP_kernel, which re-exports the public API of every kernel crate at its root (brep_kernel::…) and adds the feature pipeline and the STEP, IGES, Parasolid (import), 3MF, GLB, STL and OBJ exchange. Many items here are public only so the other kernel crates can reach them; those are hidden from the documentation and carry no stability promise beyond the kernel’s own. The kernel crates are released together, at one version.

It contains:

  • constant, variable (radius-law) and conic edge fillets;
  • chamfers;
  • the blend surfaces, their trims and their junctions with the neighbouring faces.

Kernel crates it requires: BREP_RANSAC, BREP_geometry, BREP_topology, BREP_surface_offset, BREP_boolean, BREP_construction. It is required by BREP_offset, BREP_direct_edit, BREP_kernel.

§Building

The crate builds natively and for wasm32-unknown-unknown. The parallel feature runs some per-face loops on rayon; profile-wall turns on a diagnostic wall-time partition. Both are off by default, and BREP_kernel forwards them.

The packaged crate ships the library sources, the README, the licence and the manifest; it carries no test suite.

§License

The Autodrop3d licence in LICENSE.md, shipped in the crate (license-file in the manifest). Source: https://github.com/mmiscool/next.BREP.io_RUST_BREP_KERNEL

Re-exports§

pub use brep_geometry::*;
pub use brep_topology::*;
pub use brep_surface_offset::*;
pub use brep_boolean::*;
pub use brep_construction::*;

Structs§

BlendSelection
What a blend selection actually achieved.
BlendTiming
One ledger entry: the measure’s name, its accumulated milliseconds (zero for a count.* entry) and how many times it was recorded.
RadiusLaw
A composable radius law over cumulative abscissa [0, total_length].

Enums§

LawSegment
One user segment of a composite radius law, spanning length of abscissa.

Functions§

blend_closed_edge
blend_edge_variable
Variable-radius blend (4.9.5): radius stops as (edge fraction, radius) pairs, linearly interpolated along the edge parameter and clamped at the ends. Closed edges must supply matching first/last radii.
blend_open_edge
General OPEN-edge rolling-ball fillet or chamfer: §4.9 march + §6.9 surgery with transverse edges on the two end faces.
blend_smooth_chain
Blend a chain of conjugated edges with one rolling-ball blend face (Golovanov §6.9.5: all conjugated edges processed together). A CLOSED chain (stadium rim, T-pipe saddle) welds into a periodic blend; an OPEN chain (line->arc->line capped by end faces) rolls a clamped blend that terminates in a transverse edge on each end face.
blend_timing_capture
Turn the ledger on (or off) for the blend operations that FOLLOW on this thread; BREP_PROFILE turns it on for every operation.
chamfer_edge
Equal-leg chamfer of one edge (Golovanov §6.11: the same construction with the arc’s chord).
chamfer_edge_angle
Distance-angle chamfer of one STRAIGHT edge between two planar faces (Golovanov §6.11): setback d1 along face 1 and angle angle_rad between the chamfer face and face 1. d2 is constructed geometrically in the cross-section plane (see chamfer_angle_second_distance), then the two-distance builder is applied.
chamfer_edge_asymmetric
Asymmetric (two-distance) chamfer of one STRAIGHT edge between two planar faces (Golovanov §6.11): setback d1 along face 1 and d2 along face 2 — the standard CAD “d1 × d2” bevel. General/curved edges are out of scope for this slice and return a clear error.
chamfer_edges_angle
Distance-angle chamfer of a GROUP of edges, the app entry: each selected edge (resolved by a point on it) gets a setback d1 on face 1 and a chamfer face at angle_rad from face 1 (§6.11); d2 is constructed per edge.
chamfer_edges_asymmetric
Asymmetric (two-distance) chamfer of a GROUP of edges, the app entry: each selected edge (resolved by a point on it) gets a d1 × d2 bevel (§6.11). Edges are chamfered independently — asymmetric chamfers keep sharp vertices, so there is no shared-corner blending.
chamfer_edges_asymmetric_linear
Two-distance chamfers of the straight edges through edge_points, one after another, each with the distances start ([d1, d2], d1 on the edge’s first face as crate::fillet::chamfer_edges_asymmetric reads it) at the end of the edge nearer start_at and end at its other end, both linear between. Each edge lies between two planes and ends on planes square to it.
fillet_edge
Constant-radius rolling-ball fillet of one edge (Golovanov §4.9 march, §6.9 surgery; the cutter only where the march refuses).
fillet_edge_conic
Conic-section blend of one edge: the rolling ball’s two contacts joined by a conic instead of the ball’s arc.
fillet_edge_g2
A curvature-continuous (order 2) fillet of a straight edge between two planes: its section meets each face where a ball of offset would (offset is the tangent offset), as flat as the face there (contact of order 2), and bends with radius center at its middle (where center is not positive, the thumbweight that takes off what the ball’s round does). The section is the order-2 Gⁿ blend of E. Hartmann (2001), exactly, as a rational quintic.
fillet_edges
Fillet (or chamfer) a GROUP of edges as ONE operation, and — for fillets — round the convex “star” vertices where three or more of the selected edges meet (Golovanov §6.9.7). This is the whole multi-edge fillet in a single kernel call: the caller passes the object plus one 3D point on each edge, and the kernel orchestrates the filleting and corner blending against the full topology (so acute corners resolve coherently instead of being stitched edge-by-edge by the app). A corner the kernel cannot round (e.g. non-orthogonal beyond support, or a general no-common-ball star) is left as the edge fillets rather than failing the whole group.
fillet_edges_conic
fillet_edge_conic for edges picked by a point on each. The edges are blended one after another and independently: where two of them meet, the vertex stays sharp between the two blends (no corner is built).
fillet_edges_conic_distances
A conic-section blend of each edge (resolved by a point on it) with its two contacts set apart: along_reference from the edge on the edge’s face nearest reference (a point on or by that face), along_other on its other face. The section is the rational quadratic of fillet_edge_conic through those contacts, its middle pole the edge’s point, weights 1, rho / (1 − rho), 1; between faces at a right angle rho = √2 − 1 makes it the quarter ellipse of semi-axes along_reference and along_other (an unequal round). Built on the edges fillet_edge_conic builds on: a straight edge between planes, and a circular edge between straight-sided surfaces about its axis. The edges are blended one after another.
fillet_edges_conic_setback
fillet_edges_conic sized by setback: each edge the points lie on is rounded by a conic blend meeting both faces setback from the edge, its shoulder rho of the way from the contacts’ chord to the edge. The edges are blended one after another and independently, as fillet_edges_conic blends them, and on the same edges.
fillet_edges_g2
fillet_edge_g2 for the edges the points lie on, one after another.
fillet_edges_radii
Fillets (or, with chamfer, symmetric chamfers) of a GROUP of edges in one operation, each selected edge (resolved by a point on it) at its own constant size sizes[i]: the variable group core with a constant stop list per edge, so edges of unequal sizes meeting at a vertex are blended together there rather than one after another: unequal fillets at a vertex close on the stripe network’s ribbon fill, chamfers meet in their planes.
fillet_edges_reported
fillet_edges_reported_at_offset
fillet_edges with the selection outcome reported rather than refused.
fillet_edges_setback
fillet_edges of radius whose fillets stop setback short of the corner where three of the selected edges meet (measured along each edge), the corner closed by one smooth patch meeting the three fillets and the three faces there (see blend::setback_corner). The three edges must meet at one vertex.
fillet_edges_variable
Variable-radius fillet/chamfer of a GROUP of edges (§4.9.5), the app entry for tapered blends: each selected edge (resolved by a point on it) is blended with the SAME radius profile radii — a list of (edge-fraction, radius) stops in [0,1] — applied along that edge’s own parameterization. Edges are blended independently (no shared-vertex corner rounding; a variable-radius star has no single tangent ball), so this is the tapered counterpart of fillet_edges for the constant case.
fillet_edges_variable_law
Fillet (or chamfer) a chain of edges under a composable radius law evaluated on the chain’s cumulative arc-length abscissa (the OCCT Law_Composite model; see crate::law::RadiusLaw). The selected edges must form ONE OPEN CHAIN (or be a single edge); the chain starts at the free end of the earliest-selected end edge, and the law’s abscissa maps proportionally onto the chain’s measured arc length (a law built with the chain’s own lengths — e.g. crate::law::RadiusLaw::from_vertex_radii — maps 1:1). Endpoint radii are met exactly; radii at shared chain vertices match by the law’s continuity, so the per-edge blends miter through the corners; a chain whose blends cannot be mitered REFUSES rather than distorting the law through the sequential rebuild.
fillet_edges_variable_vertex_radii
The natural per-vertex user model: radius vertex_radii[i] at chain vertex i (in CHAIN order, starting at the free end of the earliest-selected edge), smoothly interpolated along the chain (monotone C1 — every vertex radius met exactly, no overshoot). Requires exactly one radius per chain vertex (edges + 1).
fillet_faces
Rounds between the faces point_a and point_b lie on by a ball of radius (see the module’s account of what is built and what is refused).
full_round
Replaces the face middle lies on by a round tangent to it and to the faces side_a and side_b lie on (see the module’s account).
round_convex_corner
§6.9.7 vertex (“star”) blend: round a convex trihedral corner whose three incident edges are ALREADY filleted, by pure topology surgery — no booleans. corner is the ORIGINAL sharp corner coordinate (already trimmed away by the edge fillets). A spherical octant of radius, tangent to all three cylindrical fillets along their tangent circles, is sewn into the notch; the three fillet loops are closed on those tangent circles and the leftover flat caps are removed.
take_blend_approximations
Consume EVERY wall-model report recorded on this thread since the last call, in ONE snapshot, against ALL the bodies a call returned ((body name, solid)): a report becomes a typed blend.wall_model crate::Approximation on each body carrying its wall — a face with a bit-identical surface AND the report’s name, exactly or as registration renamed it (NAME[k]) — and is dropped when no returned body carries it (a lane that refused, a body a later step discarded). A wall carried by two returned bodies (one surface, bit for bit, in both) is reported on both: the reading is a property of that surface. Reports for one wall collapse to the last. Never a match by name alone. take_blend_approximations(&[]) discards everything recorded (the history loop’s stale drain before a feature runs).
take_blend_notes
Take every blend note recorded on this thread since the last call. Blending runs on the feature’s own thread (no parallel march), so the history loop’s drain sees every note its feature recorded.
take_blend_timings
Take every entry recorded on this thread since the last call (or the last outermost operation’s start), sorted by measure name.