Skip to main content

MeshHiddenLines

Trait MeshHiddenLines 

Source
pub trait MeshHiddenLines: Backend {
    // Required method
    fn hidden_lines(
        &self,
        request: &HiddenLineRequest<'_>,
        options: &ExecutionOptions,
    ) -> Result<HiddenLineOutcome, 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 hidden-line drawings of triangle meshes.

Provider obligations beyond the types:

  • each segment is a maximal positive-length piece of one edge with one visibility, finite, with start != end;
  • a selected edge whose image is a point is counted in point_edges and not drawn;
  • with edges.hidden == false no hidden segment is returned;
  • flipping every triangle gives identical segments and identical evidence except exact_escalations;
  • with edges.group_boundary the groups are resolved exactly as for MeshVisibleFaces, and a PerTriangle group slice whose length differs from the triangle count is InvalidInput naming the mesh; without it the groups are not read;
  • endpoints are the exact points rounded once to nearest (see HiddenLineSegment);
  • the tolerance of options applies to mesh audit and frame validation only, never to a visibility decision;
  • input that cannot be decided is refused with a typed error naming the mesh (HiddenLineError::mesh) where one mesh is at fault; no substitute drawing is returned;
  • output storage is outside the scratch budget.

Required Methods§

Source

fn hidden_lines( &self, request: &HiddenLineRequest<'_>, options: &ExecutionOptions, ) -> Result<HiddenLineOutcome, HiddenLineError>

Draw the selected edges 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 draws views of this projection. The default is true for ViewProjection::Orthographic only, so a provider written before ViewProjection existed, which ignores the field, is never given a perspective view by a registry (ADR 0107). A provider that returns true for a projection must draw it exactly and pass that projection’s conformance suite.

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§