Module pix_engine::shape::quad

source ·
Expand description

A shape type representing quadrilaterals used for drawing.

Quad is similar to Rect but the angles between edges are not constrained to 90 degrees and can also be used to represent a Plane in 3D space.

Examples

You can create a Quad using Quad::new:

use pix_engine::prelude::*;

let quad = Quad::new(
    [10, 20],
    [30, 10],
    [20, 25],
    [15, 15]
);

let plane = Quad::new(
    [10, 20, 10],
    [30, 10, 5],
    [20, 25, 20],
    [15, 15, 10],
);

Structs

  • A Quad or quadrilateral, a four-sided polygon.