mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-05 02:18:28 +00:00
Make Point
generic over dimensionality
This commit is contained in:
parent
ca72d1e897
commit
b75389d622
@ -9,12 +9,12 @@ use super::{
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
|
||||
pub struct Vertex {
|
||||
pub point: Point,
|
||||
pub point: Point<3>,
|
||||
}
|
||||
|
||||
impl<P> From<P> for Vertex
|
||||
where
|
||||
P: Into<Point>,
|
||||
P: Into<Point<3>>,
|
||||
{
|
||||
fn from(point: P) -> Self {
|
||||
Self {
|
||||
|
@ -3,11 +3,11 @@ use std::ops;
|
||||
use super::Vector;
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
|
||||
pub struct Point {
|
||||
pub coords: Vector<3>,
|
||||
pub struct Point<const D: usize> {
|
||||
pub coords: Vector<D>,
|
||||
}
|
||||
|
||||
impl<T> From<T> for Point
|
||||
impl<T> From<T> for Point<3>
|
||||
where
|
||||
T: Into<Vector<3>>,
|
||||
{
|
||||
@ -18,7 +18,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> ops::Add<T> for Point
|
||||
impl<T> ops::Add<T> for Point<3>
|
||||
where
|
||||
T: Into<Vector<3>>,
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user