mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-04 18:08:26 +00:00
Update name of struct
This commit is contained in:
parent
34e911a2a3
commit
57649f1ece
@ -5,6 +5,6 @@ mod surface;
|
||||
mod tri_mesh;
|
||||
|
||||
pub use self::{
|
||||
curve::CurveGeometry, plane::Plane, sketch::Sketch,
|
||||
curve::CurveGeometry, plane::SweptCurve, sketch::Sketch,
|
||||
surface::SurfaceGeometry, tri_mesh::ToTriMesh,
|
||||
};
|
||||
|
@ -1,12 +1,12 @@
|
||||
use fj_math::{Line, Point, Transform, Vector};
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct Plane {
|
||||
pub struct SweptCurve {
|
||||
pub curve: Line<3>,
|
||||
pub v: Vector<3>,
|
||||
}
|
||||
|
||||
impl Plane {
|
||||
impl SweptCurve {
|
||||
pub fn from_points([a, b, c]: [Point<3>; 3]) -> Self {
|
||||
let (curve, _) = Line::from_points([a, b]);
|
||||
Self { curve, v: c - a }
|
||||
@ -65,11 +65,11 @@ impl Plane {
|
||||
mod tests {
|
||||
use fj_math::{Line, Point, Vector};
|
||||
|
||||
use super::Plane;
|
||||
use super::SweptCurve;
|
||||
|
||||
#[test]
|
||||
fn project_point() {
|
||||
let plane = Plane {
|
||||
let plane = SweptCurve {
|
||||
curve: Line::from_origin_and_direction([1., 1., 1.], [1., 0., 0.]),
|
||||
v: Vector::from([0., 1., 0.]),
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
use fj_math::{Point, Vector};
|
||||
use geo::Polygon;
|
||||
|
||||
use crate::geometry::Plane;
|
||||
use crate::geometry::SweptCurve;
|
||||
|
||||
pub trait SurfaceGeometry {
|
||||
fn point_from_local(&self, point: Point<2>) -> Point<3>;
|
||||
@ -23,7 +23,7 @@ pub trait SurfaceGeometry {
|
||||
fn approximate(&self, boundary: &Polygon) -> Vec<Point<2>>;
|
||||
}
|
||||
|
||||
impl SurfaceGeometry for Plane {
|
||||
impl SurfaceGeometry for SweptCurve {
|
||||
fn point_from_local(&self, point: Point<2>) -> Point<3> {
|
||||
self.point_from_local(point)
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ use fj_math::{Line, Vector};
|
||||
use fj_viewer::Viewer;
|
||||
|
||||
use crate::{
|
||||
geometry::{Plane, Sketch, ToTriMesh},
|
||||
geometry::{Sketch, SweptCurve, ToTriMesh},
|
||||
handle::Handle,
|
||||
operations::sweep::SweepExt,
|
||||
topology::surface::Surface,
|
||||
@ -31,7 +31,7 @@ pub fn model(viewer: &Viewer) -> TriMesh {
|
||||
]);
|
||||
|
||||
let surface = Handle::new(Surface {
|
||||
geometry: Box::new(Plane {
|
||||
geometry: Box::new(SweptCurve {
|
||||
curve: Line::from_origin_and_direction(
|
||||
[0., 0., 1.],
|
||||
[1., 0., 0.],
|
||||
|
@ -1,7 +1,7 @@
|
||||
use itertools::Itertools;
|
||||
|
||||
use crate::{
|
||||
geometry::Plane,
|
||||
geometry::SweptCurve,
|
||||
handle::Handle,
|
||||
topology::{
|
||||
curve::Curve,
|
||||
@ -112,7 +112,7 @@ fn build_single_connecting_face(
|
||||
};
|
||||
|
||||
let surface = Handle::new(Surface {
|
||||
geometry: Box::new(Plane::from_points(
|
||||
geometry: Box::new(SweptCurve::from_points(
|
||||
[
|
||||
&bottom.half_edge.start,
|
||||
bottom.end_vertex,
|
||||
|
Loading…
Reference in New Issue
Block a user