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§
Sourcefn project_edge(
&self,
brep: &[u8],
near: [f64; 3],
plane: &ProfilePlane,
) -> KernelResult<ProjectedEdge>
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§
Sourcefn continuity(&self, _brep: &[u8]) -> KernelResult<Vec<EdgeContinuity>>
fn continuity(&self, _brep: &[u8]) -> KernelResult<Vec<EdgeContinuity>>
Every edge two faces of brep share, with how they meet there.
Sourcefn face_edges(
&self,
_brep: &[u8],
_near: [f64; 3],
) -> KernelResult<Vec<([f64; 3], [f64; 3])>>
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.
Sourcefn recognize_holes(
&self,
_brep: &[u8],
) -> KernelResult<(Vec<RecognizedHole>, usize)>
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).
Sourcefn overlap(
&self,
_a: &[u8],
_b: &[u8],
_b_in_a: &[[f64; 4]; 4],
) -> KernelResult<Option<Overlap>>
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.
Sourcefn gap(
&self,
_a: &[u8],
_b: &[u8],
_b_in_a: &[[f64; 4]; 4],
) -> KernelResult<Gap>
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.
Sourcefn mirror(
&self,
_brep: &[u8],
_point: [f64; 3],
_normal: [f64; 3],
) -> KernelResult<Vec<u8>>
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.
Sourcefn measure(&self, _brep: &[u8]) -> KernelResult<PhysicalProperties>
fn measure(&self, _brep: &[u8]) -> KernelResult<PhysicalProperties>
The volume, area and centre of mass of brep, in its own frame.
Sourcefn face_of(&self, _brep: &[u8], _near: [f64; 3]) -> KernelResult<Vec<u8>>
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.
Sourcefn section_face(
&self,
_brep: &[u8],
_near: [f64; 3],
_plane: &ProfilePlane,
) -> KernelResult<Vec<ProjectedEdge>>
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.
Sourcefn read_dxf(&self, _text: &str) -> KernelResult<Drawing2d>
fn read_dxf(&self, _text: &str) -> KernelResult<Drawing2d>
The curves of a DXF drawing, given as its text.
Sourcefn profile_mesh(&self, _profile: &Profile) -> KernelResult<TriMesh>
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.
Sourcefn medial_axis(
&self,
_profile: &Profile,
_tolerance: f64,
) -> KernelResult<Vec<MedialRegion>>
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.
Sourcefn centre_line(
&self,
_brep: &[u8],
_from: &FaceProbe,
_to: &FaceProbe,
_tolerance: f64,
) -> KernelResult<CentreLine>
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.
Sourcefn probe(&self, _brep: &[u8], _probe: &ShapeProbe) -> KernelResult<ProbeAnswer>
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".