Skip to main content

ConvexPolygon

Type Alias ConvexPolygon 

Source
pub type ConvexPolygon = ConvexPolytope<2>;
Expand description

A faceted convex body in two dimensions.

use hoomd_geometry::shape::ConvexPolygon;

let hexagon = ConvexPolygon::regular(6);
let square = ConvexPolygon::with_vertices([
    [-1.0, -1.0].into(),
    [1.0, -1.0].into(),
    [1.0, 1.0].into(),
    [-1.0, 1.0].into(),
])?;

Aliased Typeยง

pub struct ConvexPolygon { /* private fields */ }