pub trait Kernel: Send {
// Required methods
fn name(&self) -> &str;
fn initialize(&mut self) -> KernelResult<()>;
fn rebuild(
&mut self,
request: &RebuildRequest,
) -> KernelResult<RebuildResponse>;
fn tessellate(
&self,
body: BodyHandle,
detail: &TessellationSettings,
) -> KernelResult<TriMesh>;
// Provided method
fn import_step(
&mut self,
_path: &Path,
_detail: &TessellationSettings,
) -> KernelResult<ImportedModel> { ... }
}Expand description
Trait implemented by any geometry kernel that can serve the application.
Required Methods§
Sourcefn initialize(&mut self) -> KernelResult<()>
fn initialize(&mut self) -> KernelResult<()>
Called once before any geometry work happens.
Sourcefn rebuild(&mut self, request: &RebuildRequest) -> KernelResult<RebuildResponse>
fn rebuild(&mut self, request: &RebuildRequest) -> KernelResult<RebuildResponse>
Recompute dirty features/bodies and return the affected handles.
Sourcefn tessellate(
&self,
body: BodyHandle,
detail: &TessellationSettings,
) -> KernelResult<TriMesh>
fn tessellate( &self, body: BodyHandle, detail: &TessellationSettings, ) -> KernelResult<TriMesh>
Produce a triangular mesh for the provided body handle.
Provided Methods§
Sourcefn import_step(
&mut self,
_path: &Path,
_detail: &TessellationSettings,
) -> KernelResult<ImportedModel>
fn import_step( &mut self, _path: &Path, _detail: &TessellationSettings, ) -> KernelResult<ImportedModel>
Read a STEP/STP file from disk and return tessellated bodies.
Implementations that do not support STEP import should return
KernelError::Unsupported.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".