mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-04 18:08:26 +00:00
Remove unused code
This commit is contained in:
parent
9c056e37da
commit
aae4a12fbc
@ -16,25 +16,6 @@ pub struct LineSegment<const D: usize> {
|
||||
}
|
||||
|
||||
impl<const D: usize> LineSegment<D> {
|
||||
/// Construct a segment from two points
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// Panics, if the points are coincident.
|
||||
pub fn from_points(points: [impl Into<Point<D>>; 2]) -> Self {
|
||||
let points = points.map(Into::into);
|
||||
let [a, b] = points;
|
||||
|
||||
assert!(a != b, "Invalid segment; both points are identical: {a:?}");
|
||||
|
||||
Self { points }
|
||||
}
|
||||
|
||||
/// Access the points of the segment
|
||||
pub fn points(&self) -> [Point<D>; 2] {
|
||||
self.points
|
||||
}
|
||||
|
||||
/// Compute the center point of the segment
|
||||
pub fn center(&self) -> Point<D> {
|
||||
let [a, b] = self.points;
|
||||
|
Loading…
Reference in New Issue
Block a user