mirror of
https://github.com/hannobraun/Fornjot
synced 2025-02-26 09:05:52 +00:00
Add PolyChain::new
This commit is contained in:
parent
0b445e2a89
commit
e01e14d4da
@ -11,6 +11,11 @@ pub struct PolyChain<const D: usize> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<const D: usize> PolyChain<D> {
|
impl<const D: usize> PolyChain<D> {
|
||||||
|
/// Create an empty `PolyChain`
|
||||||
|
pub fn new() -> Self {
|
||||||
|
Self { points: Vec::new() }
|
||||||
|
}
|
||||||
|
|
||||||
/// Construct a polygonal chain from a number of points
|
/// Construct a polygonal chain from a number of points
|
||||||
pub fn from_points(
|
pub fn from_points(
|
||||||
points: impl IntoIterator<Item = impl Into<Point<D>>>,
|
points: impl IntoIterator<Item = impl Into<Point<D>>>,
|
||||||
@ -48,6 +53,12 @@ impl<const D: usize> PolyChain<D> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<const D: usize> Default for PolyChain<D> {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<P, Ps, const D: usize> From<Ps> for PolyChain<D>
|
impl<P, Ps, const D: usize> From<Ps> for PolyChain<D>
|
||||||
where
|
where
|
||||||
P: Into<Point<D>>,
|
P: Into<Point<D>>,
|
||||||
|
Loading…
Reference in New Issue
Block a user