Skip to main content

Crate brep_direct_edit

Crate brep_direct_edit 

Source
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 *_unchecked siblings);
  • 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 by face_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§

FaceDeformPick
One pick on the face: the surface point nearest anchor (which must lie on the face) is moved to target; with normal, the face’s normal there is made parallel to it.
FaceDeformReport
What the deformation did, measured on the result.
FaceDeformSpec
RefitReport
What a successful refit measured and built.
RouteReading
What a Move Face would have to do to the TOPOLOGY, read off the motion before anything is built.
ShellDeformPick
One pick: on face face_id, the surface point nearest anchor (inside the face) moves to target; with normal, the normal there is made parallel.
ShellDeformReport
What the deformation did.
ShellDeformSpec

Enums§

FaceTransformReason
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. None is every other refusal: the app shows the kernel’s own words.
RefitCarrier
The fitted surface, in the recognition pass’s terms.
RefitSurfaceKind
The surface family a Refit Faces fit is asked for.

Functions§

deform_face
Deform face face_id of solid as spec asks; 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_ids of solid together as spec asks.
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 clear Err describing why the heal was refused.
delete_faces_and_heal
Delete a SET of faces and heal, in one operation.
draft_faces
Draft face_ids of solid by angle_radians for the pull direction pull_direction, about the neutral plane through neutral_point square 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_point square to pull_direction, the pieces of the selected faces on the +pull side are drafted for +pull and those on the other side for −pull — each leaning angle_radians away 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 for draft_faces.
draft_faces_unchecked
draft_faces without 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. None when no grid point is inside.
face_transform_reason
FaceTransformReason of 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_faces without 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_face without 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_face without 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_face without 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_face without 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_face without 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) then translation. 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 and translation after it — Transform Face’s rotate-then-translate.
recut_moved_planes_unchecked
recut_moved_planes without 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) then translation. See the module comment for what it checks.
refit_faces_as_one
Replace the faces face_ids of solid with one face on a surface of family kind fitted to them, within tolerance (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_ids of solid by angle_radians about the axis through axis_point along axis_direction (right-handed), re-intersecting the neighbours the rotation moves the selection relative to.
rotate_faces_unchecked
rotate_faces without 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.