Skip to main content

KernelQueries

Trait KernelQueries 

Source
pub trait KernelQueries: Send + Sync {
Show 15 methods // Required method fn project_edge( &self, brep: &[u8], near: [f64; 3], plane: &ProfilePlane, ) -> KernelResult<ProjectedEdge>; // Provided methods fn continuity(&self, _brep: &[u8]) -> KernelResult<Vec<EdgeContinuity>> { ... } fn face_edges( &self, _brep: &[u8], _near: [f64; 3], ) -> KernelResult<Vec<([f64; 3], [f64; 3])>> { ... } fn recognize_holes( &self, _brep: &[u8], ) -> KernelResult<(Vec<RecognizedHole>, usize)> { ... } fn overlap( &self, _a: &[u8], _b: &[u8], _b_in_a: &[[f64; 4]; 4], ) -> KernelResult<Option<Overlap>> { ... } fn gap( &self, _a: &[u8], _b: &[u8], _b_in_a: &[[f64; 4]; 4], ) -> KernelResult<Gap> { ... } fn mirror( &self, _brep: &[u8], _point: [f64; 3], _normal: [f64; 3], ) -> KernelResult<Vec<u8>> { ... } fn measure(&self, _brep: &[u8]) -> KernelResult<PhysicalProperties> { ... } fn face_of(&self, _brep: &[u8], _near: [f64; 3]) -> KernelResult<Vec<u8>> { ... } fn section_face( &self, _brep: &[u8], _near: [f64; 3], _plane: &ProfilePlane, ) -> KernelResult<Vec<ProjectedEdge>> { ... } fn read_dxf(&self, _text: &str) -> KernelResult<Drawing2d> { ... } fn profile_mesh(&self, _profile: &Profile) -> KernelResult<TriMesh> { ... } fn medial_axis( &self, _profile: &Profile, _tolerance: f64, ) -> KernelResult<Vec<MedialRegion>> { ... } fn centre_line( &self, _brep: &[u8], _from: &FaceProbe, _to: &FaceProbe, _tolerance: f64, ) -> KernelResult<CentreLine> { ... } fn probe( &self, _brep: &[u8], _probe: &ShapeProbe, ) -> KernelResult<ProbeAnswer> { ... }
}

Required Methods§

Source

fn project_edge( &self, brep: &[u8], near: [f64; 3], plane: &ProfilePlane, ) -> KernelResult<ProjectedEdge>

The edge of brep nearest near, projected orthogonally onto plane. Both are in the shape’s own frame.

Provided Methods§

Source

fn continuity(&self, _brep: &[u8]) -> KernelResult<Vec<EdgeContinuity>>

Every edge two faces of brep share, with how they meet there.

Source

fn face_edges( &self, _brep: &[u8], _near: [f64; 3], ) -> KernelResult<Vec<([f64; 3], [f64; 3])>>

The edges bounding the face of brep nearest near: a point on each, halfway along, and its direction there, in the shape’s own frame. A seam (the edge a round face meets itself along) and an edge with no curve (a pole) are left out.

Source

fn recognize_holes( &self, _brep: &[u8], ) -> KernelResult<(Vec<RecognizedHole>, usize)>

The round holes of brep, in its own frame, and how many bores it has that are not holes it can describe (a counterbore, a slot).

Source

fn overlap( &self, _a: &[u8], _b: &[u8], _b_in_a: &[[f64; 4]; 4], ) -> KernelResult<Option<Overlap>>

What a and b share when b sits where b_in_a (a rigid row-major 4×4 matrix) puts it in a’s frame; None when they only touch or are apart.

Source

fn gap( &self, _a: &[u8], _b: &[u8], _b_in_a: &[[f64; 4]; 4], ) -> KernelResult<Gap>

How near a and b come when b sits where b_in_a puts it in a’s frame.

Source

fn mirror( &self, _brep: &[u8], _point: [f64; 3], _normal: [f64; 3], ) -> KernelResult<Vec<u8>>

brep mirrored across the plane through point with normal, in its own frame, as a snapshot of its own.

Source

fn measure(&self, _brep: &[u8]) -> KernelResult<PhysicalProperties>

The volume, area and centre of mass of brep, in its own frame.

Source

fn face_of(&self, _brep: &[u8], _near: [f64; 3]) -> KernelResult<Vec<u8>>

The face of brep nearest near (in the shape’s own frame), as a native-format snapshot of its own: what a face taken from a solid keeps once the solid moves on.

Source

fn section_face( &self, _brep: &[u8], _near: [f64; 3], _plane: &ProfilePlane, ) -> KernelResult<Vec<ProjectedEdge>>

Where the face of brep nearest near crosses plane, as the curves the plane cuts from it, in the plane’s own 2D coordinates: each the exact line, circle or ellipse it is, or points along any other. Empty when the face does not reach the plane. Both are in the shape’s own frame.

Source

fn read_dxf(&self, _text: &str) -> KernelResult<Drawing2d>

The curves of a DXF drawing, given as its text.

Source

fn profile_mesh(&self, _profile: &Profile) -> KernelResult<TriMesh>

The regions profile encloses, meshed where they stand in its plane: what a feature swept from it takes, holes left open.

Source

fn medial_axis( &self, _profile: &Profile, _tolerance: f64, ) -> KernelResult<Vec<MedialRegion>>

The medial axis of each region of profile, held to tolerance (mm), in the profile plane’s own 2D coordinates.

Source

fn centre_line( &self, _brep: &[u8], _from: &FaceProbe, _to: &FaceProbe, _tolerance: f64, ) -> KernelResult<CentreLine>

The centre line of the solid in brep from the face from names to the face to names, held to tolerance (mm). Everything is in the shape’s own frame.

Source

fn probe(&self, _brep: &[u8], _probe: &ShapeProbe) -> KernelResult<ProbeAnswer>

What the shape in brep answers to probe, in the shape’s own frame.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§