pub trait KernelQueries: Send + Sync {
Show 22 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 curvature(
&self,
_brep: &[u8],
_faces: &[FacePoints],
) -> KernelResult<Vec<Vec<Option<[f64; 2]>>>> { ... }
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 edge_frames(
&self,
_brep: &[u8],
_near: [f64; 3],
_stations: &[f64],
) -> KernelResult<PathFrames> { ... }
fn wire_frames(
&self,
_plane: &ProfilePlane,
_wire: &ProfileWire,
_stations: &[f64],
) -> KernelResult<PathFrames> { ... }
fn pattern_transforms(
&self,
_brep: Option<&[u8]>,
_steps: &[PatternStep],
) -> KernelResult<Vec<[[f64; 4]; 4]>> { ... }
fn face_of(&self, _brep: &[u8], _near: [f64; 3]) -> KernelResult<Vec<u8>> { ... }
fn edge_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 section(
&self,
_brep: &[u8],
_plane: &ProfilePlane,
_near: Option<[f64; 3]>,
) -> KernelResult<Vec<SectionRun>> { ... }
fn face_loops(
&self,
_brep: &[u8],
_near: [f64; 3],
) -> KernelResult<Vec<Vec<LoopEdge>>> { ... }
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 curvature(
&self,
_brep: &[u8],
_faces: &[FacePoints],
) -> KernelResult<Vec<Vec<Option<[f64; 2]>>>>
fn curvature( &self, _brep: &[u8], _faces: &[FacePoints], ) -> KernelResult<Vec<Vec<Option<[f64; 2]>>>>
The principal curvatures of brep’s faces at points on them. Each
entry names a face by a point inside it (the face nearest that
point) and lists points on it, each with the normal it is signed
against, in the shape’s own frame; the answer gives, per point, the
largest and the smallest normal curvature (1/mm): negative where the
face bulges toward that normal, positive where it hollows away.
None where the surface has no normal (a pole, an apex).
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 edge_frames(
&self,
_brep: &[u8],
_near: [f64; 3],
_stations: &[f64],
) -> KernelResult<PathFrames>
fn edge_frames( &self, _brep: &[u8], _near: [f64; 3], _stations: &[f64], ) -> KernelResult<PathFrames>
Points and tangents along the edge of brep nearest near (within
a pick’s reach of it), from the start of its curve: one per entry of
stations, each a fraction of the edge’s length (0 its start, 1 its
end) placed by arc length, not by the curve’s parameter. Everything
is in the shape’s own frame.
Sourcefn wire_frames(
&self,
_plane: &ProfilePlane,
_wire: &ProfileWire,
_stations: &[f64],
) -> KernelResult<PathFrames>
fn wire_frames( &self, _plane: &ProfilePlane, _wire: &ProfileWire, _stations: &[f64], ) -> KernelResult<PathFrames>
Points and tangents along wire on plane, walked from its first
segment’s start: one per entry of stations, each a fraction of the
wire’s whole length placed by arc length, as edge_frames.
Sourcefn pattern_transforms(
&self,
_brep: Option<&[u8]>,
_steps: &[PatternStep],
) -> KernelResult<Vec<[[f64; 4]; 4]>>
fn pattern_transforms( &self, _brep: Option<&[u8]>, _steps: &[PatternStep], ) -> KernelResult<Vec<[[f64; 4]; 4]>>
Where every occurrence of a SolidOp::Pattern with steps stands,
as row-major transforms from the original’s place, the original’s
(the identity) first: what the chain works out, with brep (in the
pattern’s frame) as the solid a step’s edge is found on.
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 edge_of(&self, _brep: &[u8], _near: [f64; 3]) -> KernelResult<Vec<u8>>
fn edge_of(&self, _brep: &[u8], _near: [f64; 3]) -> KernelResult<Vec<u8>>
The edge of brep nearest near (in the shape’s own frame), as a
native-format snapshot of its own.
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 section(
&self,
_brep: &[u8],
_plane: &ProfilePlane,
_near: Option<[f64; 3]>,
) -> KernelResult<Vec<SectionRun>>
fn section( &self, _brep: &[u8], _plane: &ProfilePlane, _near: Option<[f64; 3]>, ) -> KernelResult<Vec<SectionRun>>
Where plane crosses brep, chained end to end, each curve exact
in the plane’s own 2D coordinates and drawn in the shape’s own
frame: the whole shape’s section, or with near only the face
nearest it. Empty when the plane misses.
Sourcefn face_loops(
&self,
_brep: &[u8],
_near: [f64; 3],
) -> KernelResult<Vec<Vec<LoopEdge>>>
fn face_loops( &self, _brep: &[u8], _near: [f64; 3], ) -> KernelResult<Vec<Vec<LoopEdge>>>
The boundary loops of the face of brep nearest near, the outer
one first, each edge in loop order, 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".