Add Vertex::new

This commit is contained in:
Hanno Braun 2025-02-24 19:20:58 +01:00
parent 58902150ba
commit 07096243b1
2 changed files with 6 additions and 1 deletions

View File

@ -12,7 +12,7 @@ impl Sketch {
pub fn to_face(&self, surface: Plane) -> Face {
let vertices = self.points.iter().copied().map(|point| {
let point = surface.point_from_local(point);
let vertex = Vertex::from(point);
let vertex = Vertex::new(point);
Handle::new(vertex)
});

View File

@ -12,6 +12,11 @@ pub struct Vertex {
}
impl Vertex {
pub fn new(point: impl Into<Point<3>>) -> Self {
let point = point.into();
Self { point }
}
pub fn translate(self, offset: impl Into<Vector<3>>) -> Self {
Self {
point: self.point + offset,