From d7d90e8b3615db38d1af238ac9c8193c283ca156 Mon Sep 17 00:00:00 2001 From: Arne Dußin Date: Sat, 21 Nov 2020 00:36:32 +0100 Subject: Add triangle struct and triangulation template --- src/math/triangulate.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/math/triangulate.rs (limited to 'src/math/triangulate.rs') diff --git a/src/math/triangulate.rs b/src/math/triangulate.rs new file mode 100644 index 0000000..8ef92f1 --- /dev/null +++ b/src/math/triangulate.rs @@ -0,0 +1,12 @@ +//! Module for turning a polygon into a number of non-overlapping triangles. + +use super::{Polygon, 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(_polygon: &Polygon) -> Vec> { + unimplemented!() +} -- cgit v1.2.3-70-g09d2