Skip to main content

MeshVisibleFaces

Trait MeshVisibleFaces 

Source
pub trait MeshVisibleFaces: Backend {
    // Required method
    fn visible_faces(
        &self,
        request: &VisibleFaceRequest<'_>,
        options: &ExecutionOptions,
    ) -> Result<VisibleFaceOutcome, HiddenLineError>;

    // Provided methods
    fn supports_projection(&self, projection: ViewProjection) -> bool { ... }
    fn scratch_requirement(&self) -> ScratchRequirement { ... }
    fn cancellation_granularity(&self) -> CancellationGranularity { ... }
}
Expand description

Provider for deterministic visible-face regions of triangle meshes.

Provider obligations beyond the types:

  • a FaceSource::Cap region exists only for a MeshRole::Solid that view.near cuts, and has no triangles;
  • regions of one source never overlap; regions of different sources overlap only where they tie in depth;
  • flipping every triangle gives identical regions and identical evidence except exact_escalations;
  • the regions are the exact regions snap-rounded to the binary64 grid (ADR 0100), with the rings of VisibleRegion and the evidence of VisibleFaceEvidence; a region is never refused because rounding collapses it, and where no edge was rerouted the ring vertices are the exact points rounded once to nearest;
  • the tolerance of options applies to mesh audit and frame validation only, never to a visibility decision;
  • the same input refusals as MeshHiddenLines, and a PerTriangle group slice whose length differs from the triangle count is InvalidInput naming the mesh; no substitute result is returned;
  • FaceGroups::Planar is resolved by the provider as documented there, exactly, with polled cancellation and a memory-budget refusal, and the result equals the PerTriangle request with the resolved groups, except exact_escalations;
  • output storage is outside the scratch budget.

Required Methods§

Source

fn visible_faces( &self, request: &VisibleFaceRequest<'_>, options: &ExecutionOptions, ) -> Result<VisibleFaceOutcome, HiddenLineError>

Find the visible face regions of request.meshes in request.view. Implementations must enforce request.limits before growing output.

Provided Methods§

Source

fn supports_projection(&self, projection: ViewProjection) -> bool

Whether the provider computes regions for views of this projection. The default is true for ViewProjection::Orthographic only; see MeshHiddenLines::supports_projection (ADR 0107).

Source

fn scratch_requirement(&self) -> ScratchRequirement

Scratch needed beyond inputs and result.

Source

fn cancellation_granularity(&self) -> CancellationGranularity

How finely the provider polls cancellation.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§