diff --git a/fj-math/src/poly_chain.rs b/fj-math/src/poly_chain.rs index 8f566cb58..f9726384e 100644 --- a/fj-math/src/poly_chain.rs +++ b/fj-math/src/poly_chain.rs @@ -11,6 +11,11 @@ pub struct PolyChain { } impl PolyChain { + /// Create an empty `PolyChain` + pub fn new() -> Self { + Self { points: Vec::new() } + } + /// Construct a polygonal chain from a number of points pub fn from_points( points: impl IntoIterator>>, @@ -48,6 +53,12 @@ impl PolyChain { } } +impl Default for PolyChain { + fn default() -> Self { + Self::new() + } +} + impl From for PolyChain where P: Into>,