fn polygon(n: usize) -> Self {
        assert!(n >= 2, "A polygon must have at least 2 sides.");
        let mut edges = SubelementList::with_capacity(n);

        // We add the edges with their indices sorted.
        for i in 1..n {
            edges.push(vec![i - 1, i].into());
        }
        edges.push(vec![0, n - 1].into());

        let mut builder = AbstractBuilder::with_rank_capacity(3);
        builder.push_min();
        builder.push_vertices(n);
        builder.push(edges);
        builder.push_max();

        // Safety: a polygon is a valid polytope, and its indices are sorted.
        unsafe {
            let mut poly = builder.build();
            poly.set_sorted(true);
            poly
        }
    }
/// Returns an instance of a [polygon](https://polytope.miraheze.org/wiki/Polygon)
/// with a given number of sides.
Returns an instance of a [polygon]
with a given number of sides.
Returns an instance of a [ polygon ] with a given number of sides .
fn polygon(n: usize) -> Self {
        assert!(n >= 2, "A polygon must have at least 2 sides.");
        let mut edges = SubelementList::with_capacity(n);
        // We add the edges with their indices sorted.
        for i in 1..n {
            edges.push(vec![i - 1, i].into());
        }
        edges.push(vec![0, n - 1].into());
        let mut builder = AbstractBuilder::with_rank_capacity(3);
        builder.push_min();
        builder.push_vertices(n);
        builder.push(edges);
        builder.push_max();
        // Safety: a polygon is a valid polytope, and its indices are sorted.
        unsafe {
            let mut poly = builder.build();
            poly.set_sorted(true);
            poly
        }
    }
fn polygon ( n : usize ) -> Self { assert ! ( n 2 " " ) ; let mut edges = SubelementList :: with_capacity ( n ) ; // We add the edges with their indices sorted. for i in 1 .. n { edges . push ( vec ! [ i 1 i ] . into ( ) ) ; } edges . push ( vec ! [ 0 n 1 ] . into ( ) ) ; let mut builder = AbstractBuilder :: with_rank_capacity ( 3 ) ; builder . push_min ( ) ; builder . push_vertices ( n ) ; builder . push ( edges ) ; builder . push_max ( ) ; // Safety: a polygon is a valid polytope, and its indices are sorted. unsafe { let mut poly = builder . build ( ) ; poly . set_sorted ( true ) ; poly } }
Returns an instance of a [polygon](https://polytope.miraheze.org/wiki/Polygon)
with a given number of sides.
Returns an instance of a [ polygon ] ( https : // polytope . miraheze . org / wiki / Polygon ) with a given number of sides .
n
usize
n
usize