blob: 4860518078f99cc95dc64acadcace40069e3d566 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
//! Module for turning a polygon into a number of non-overlapping triangles.
use super::Polygon;
use crate::math::Triangle;
use nalgebra::Scalar;
/// Uses earclipping algorithm (see https://www.geometrictools.com/Documentation/TriangulationByEarClipping.pdf)
/// to find an explanation of what exactly is happening.
/// Currently only handles simple polygons, but once the polygon struct supports holes must be
/// extended to also support those.
pub fn triangulate<T: Scalar + Copy>(_polygon: &Polygon<T>) -> Vec<Triangle<T>> {
unimplemented!()
}
|