Expand description
Direct editing of B-rep faces: move, rotate, offset, draft, delete and refit.
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:
- moving, rotating and offsetting faces, each checked against the soundness floor (with
*_uncheckedsiblings); - drafting faces, deleting faces and healing the gap, and refitting the neighbours;
- the typed reasons a face edit is refused.
Kernel crates it requires: BREP_RANSAC, BREP_geometry, BREP_topology, BREP_surface_offset, BREP_boolean, BREP_construction, BREP_blend, BREP_offset. It is required by 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::*;pub use brep_blend::*;pub use brep_offset::*;
Modules§
- face_
refusal_ slugs - The slugs of the direct-edit refusals the app explains to a user (its
face-transform help,
BREP_render::face_transform_help), shared by each mint and byface_transform_reason. - refit_
refusal_ phrases - The phrases a Refit Faces refusal is recognised by (formatted into every refusal that carries it, so a reader and the mint share one definition).
Structs§
- Face
Deform Pick - One pick on the face: the surface point nearest
anchor(which must lie on the face) is moved totarget; withnormal, the face’s normal there is made parallel to it. - Face
Deform Report - What the deformation did, measured on the result.
- Face
Deform Spec - Refit
Report - What a successful refit measured and built.
- Route
Reading - What a Move Face would have to do to the TOPOLOGY, read off the motion before anything is built.
- Shell
Deform Pick - One pick: on face
face_id, the surface point nearestanchor(inside the face) moves totarget; withnormal, the normal there is made parallel. - Shell
Deform Report - What the deformation did.
- Shell
Deform Spec
Enums§
- Face
Transform Reason - Why a Transform Face refused, as far as the app explains it — read off the
refusal’s CLASS and slug, never its text, so a reworded refusal keeps its
explanation and a refusal that merely mentions “parallel” does not borrow
one.
Noneis every other refusal: the app shows the kernel’s own words. - Refit
Carrier - The fitted surface, in the recognition pass’s terms.
- Refit
Surface Kind - The surface family a Refit Faces fit is asked for.
Functions§
- deform_
face - Deform face
face_idofsolidasspecasks; every other record of the body is returned unchanged. Refuses by name: an unknown face, a pick whose anchor is off the face, a trim outside its carrier’s domain, any refusal of the carrier deformation (no free control point under a pick, dependent picks, a fold, …), a displacement larger than the face, and a result that does not validate or passes through itself. - deform_
shell - Deform faces
face_idsofsolidtogether asspecasks. - delete_
face_ and_ heal - Golovanov §6.12 — delete a transition face and heal the hole by extending
and re-intersecting its immediate neighbours. See the module docs for the
covered vs deferred cases. Returns a fresh solid that is guaranteed to
validate()AND to be sound, or a clearErrdescribing why the heal was refused. - delete_
faces_ and_ heal - Delete a SET of faces and heal, in one operation.
- draft_
faces - Draft
face_idsofsolidbyangle_radiansfor the pull directionpull_direction, about the neutral plane throughneutral_pointsquare to the pull. See the contract at the top of this file: a positive angle leans each face into the material as it goes along the pull (a boss narrows, a pocket or a hole widens); a negative one leans it out. - draft_
faces_ parted - A PARTING-LINE draft: the body is split by the neutral plane through
parting_pointsquare topull_direction, the pieces of the selected faces on the+pullside are drafted for+pulland those on the other side for−pull— each leaningangle_radiansaway from the parting line, as the two halves of a two-piece mould pull apart — and the two sides are united again along the parting plane. The selected faces must each be a plane parallel to the pull or a cylinder about it, as fordraft_faces. - draft_
faces_ unchecked draft_faceswithout its soundness floor: returned as soon as its incidences validate. The result can pass through itself; the caller owes it an acceptance scan (crate::accept_sound) before it is used as a body.- face_
deform_ default_ anchor - The face’s deepest interior point: of a 25 x 25 grid over its parameter
box, the point inside the face farthest (in space) from its boundary,
sampled along every coedge.
Nonewhen no grid point is inside. - face_
transform_ reason FaceTransformReasonof a refusal, by class and slug.- move_
faces - Golovanov §6.12 direct editing — translate a group of faces rigidly and heal the adjacency with the faces that stay behind.
- move_
faces_ unchecked move_faceswithout its soundness floor: the direct re-solve, returned as soon as its incidences validate. The result can pass through itself where the motion met a face the selection does not border; the caller owes it an acceptance scan (crate::accept_sound) before it is used as a body.- offset_
freeform_ face - Offset a free-form NURBS face whose boundaries have no other incident face.
The fitted offset must pass a dense same-parameter residual check. Intrinsic
iso boundaries use exact iso-curves; other self-incident trims use
crate::image_curve. Rebuilt topology and volume orientation are validated. Neighbour-trimmed faces require general intersection and are refused. - offset_
freeform_ face_ unchecked offset_freeform_facewithout its soundness floor: returned as soon as its incidences validate. The result can pass through itself; the caller owes it an acceptance scan (crate::accept_sound) before it is used as a body.- offset_
revolution_ face - Push a general surface of revolution with planar neighbours.
- offset_
revolution_ face_ unchecked offset_revolution_facewithout its soundness floor: returned as soon as its incidences validate. The result can pass through itself; the caller owes it an acceptance scan (crate::accept_sound) before it is used as a body.- offset_
ruled_ face - Push a CYLINDER or CONE face along its outward normal by
distance(positive grows the solid) by OFFSETTING its carrier surface and re-deriving the trim as the intersection of that offset surface with the neighbour carriers. - offset_
ruled_ face_ unchecked offset_ruled_facewithout its soundness floor: the offset and re-trim, returned as soon as its incidences validate. The result can pass through itself; the caller owes it an acceptance scan (crate::accept_sound) before it is used as a body.- offset_
sphere_ face - Push a SPHERICAL face along its outward normal by
distance(positive grows the solid) by replacing its carrier with the concentric offset sphere and re-trimming its neighbours: planar caps through the centre keep their exact- scale great-circle rim, while off-centre planes, spheres, and coaxial ruled neighbours have their rim re-derived as S′ ∩ neighbour. - offset_
sphere_ face_ unchecked offset_sphere_facewithout its soundness floor: returned as soon as its incidences validate. The result can pass through itself; the caller owes it an acceptance scan (crate::accept_sound) before it is used as a body.- offset_
torus_ face - Push a toroidal face by changing its tube radius. Boundary edges must be
intrinsic to this face; neighbour-trimmed rims require re-intersection and
are refused. The carrier retains its knot vectors, weights, and UV basis,
keeping pcurves valid. Iso boundaries rebuild exactly; other self-incident
trims use
crate::image_curve. - offset_
torus_ face_ unchecked offset_torus_facewithout its soundness floor: returned as soon as its incidences validate. The result can pass through itself; the caller owes it an acceptance scan (crate::accept_sound) before it is used as a body.- reblend_
lost_ fillets - Put back the fillets a re-cut filled in.
- rebuild_
displaced_ blends - Run a face edit past the variable-radius fillets beside the selection.
- recut_
convex_ body - Re-make a convex body with its selected PLANAR faces carried by the rigid
motion
turn(axis point, unit axis, angle in radians; applied first) thentranslation. See the module comment for what it checks. - recut_
moved_ planes - Re-cut a solid for a pure TRANSLATION of planar faces.
- recut_
moved_ planes_ rigid - Re-cut a solid for a RIGID motion of planar faces:
rotation, when given as(axis point, unit axis, angle in radians), is applied first andtranslationafter it — Transform Face’s rotate-then-translate. - recut_
moved_ planes_ unchecked recut_moved_planeswithout its soundness floor: returned as soon as its incidences validate. The result can pass through itself; the caller owes it an acceptance scan (crate::accept_sound) before it is used as a body.- redrill_
moved_ bore - Re-drill the selected through-bore wall at its carrier carried by the rigid
motion
turn(axis point, unit axis, angle in radians; applied first) thentranslation. See the module comment for what it checks. - refit_
faces_ as_ one - Replace the faces
face_idsofsolidwith one face on a surface of familykindfitted to them, withintolerance(maximum vertex residual, model units). See the module docs for the scope and the refusals. - resolve_
face_ by_ point - Resolve the id of the face nearest a 3D point (used by the app: the picked
point lies on the selected face). Mirrors
resolve_edge_by_point. - rotate_
faces - ROTATE the faces
face_idsofsolidbyangle_radiansabout the axis throughaxis_pointalongaxis_direction(right-handed), re-intersecting the neighbours the rotation moves the selection relative to. - rotate_
faces_ unchecked rotate_faceswithout its soundness floor: the direct re-solve, returned as soon as its incidences validate. The result can pass through itself; the caller owes it an acceptance scan (crate::accept_sound) before it is used as a body.- route_
reading - Which faces a moved selection’s carriers would open a NEW hole in.
- with_
blend_ rebuild_ decline rebuild_displaced_blends’s refusal, as context on the refusal the caller’s own road gave.