mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-06 10:58:28 +00:00
Remove path
field from HalfEdgeGeom
This is a big milestone, as it means that all curve geometry is now exclusively defined within `CurveGeom`.
This commit is contained in:
parent
082dd9f1a9
commit
72efa214aa
@ -203,7 +203,7 @@ mod tests {
|
|||||||
let curve =
|
let curve =
|
||||||
Curve::from_path_and_surface(path, surface.clone(), &mut core);
|
Curve::from_path_and_surface(path, surface.clone(), &mut core);
|
||||||
let boundary = CurveBoundary::from(boundary);
|
let boundary = CurveBoundary::from(boundary);
|
||||||
let half_edge = HalfEdgeGeom { path, boundary };
|
let half_edge = HalfEdgeGeom { boundary };
|
||||||
|
|
||||||
let tolerance = 1.;
|
let tolerance = 1.;
|
||||||
let approx = (&curve, &half_edge, &surface)
|
let approx = (&curve, &half_edge, &surface)
|
||||||
@ -226,7 +226,7 @@ mod tests {
|
|||||||
let curve =
|
let curve =
|
||||||
Curve::from_path_and_surface(path, surface.clone(), &mut core);
|
Curve::from_path_and_surface(path, surface.clone(), &mut core);
|
||||||
let boundary = CurveBoundary::from(boundary);
|
let boundary = CurveBoundary::from(boundary);
|
||||||
let half_edge = HalfEdgeGeom { path, boundary };
|
let half_edge = HalfEdgeGeom { boundary };
|
||||||
|
|
||||||
let tolerance = 1.;
|
let tolerance = 1.;
|
||||||
let approx = (&curve, &half_edge, &surface)
|
let approx = (&curve, &half_edge, &surface)
|
||||||
@ -248,7 +248,7 @@ mod tests {
|
|||||||
let curve =
|
let curve =
|
||||||
Curve::from_path_and_surface(path, surface.clone(), &mut core);
|
Curve::from_path_and_surface(path, surface.clone(), &mut core);
|
||||||
let boundary = CurveBoundary::from([[0.], [TAU]]);
|
let boundary = CurveBoundary::from([[0.], [TAU]]);
|
||||||
let half_edge = HalfEdgeGeom { path, boundary };
|
let half_edge = HalfEdgeGeom { boundary };
|
||||||
|
|
||||||
let tolerance = 1.;
|
let tolerance = 1.;
|
||||||
let approx = (&curve, &half_edge, &surface)
|
let approx = (&curve, &half_edge, &surface)
|
||||||
@ -279,7 +279,7 @@ mod tests {
|
|||||||
let curve =
|
let curve =
|
||||||
Curve::from_path_and_surface(path, surface.clone(), &mut core);
|
Curve::from_path_and_surface(path, surface.clone(), &mut core);
|
||||||
let boundary = CurveBoundary::from([[0.], [TAU]]);
|
let boundary = CurveBoundary::from([[0.], [TAU]]);
|
||||||
let half_edge = HalfEdgeGeom { path, boundary };
|
let half_edge = HalfEdgeGeom { boundary };
|
||||||
|
|
||||||
let tolerance = 1.;
|
let tolerance = 1.;
|
||||||
let approx = (&curve, &half_edge, &surface)
|
let approx = (&curve, &half_edge, &surface)
|
||||||
|
@ -5,33 +5,6 @@ use super::{CurveBoundary, SurfacePath};
|
|||||||
/// The geometry of a half-edge
|
/// The geometry of a half-edge
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub struct HalfEdgeGeom {
|
pub struct HalfEdgeGeom {
|
||||||
/// # The path of the half-edge
|
|
||||||
///
|
|
||||||
/// ## Implementation Note
|
|
||||||
///
|
|
||||||
/// Currently, all curve-related geometry is defined locally, in terms of
|
|
||||||
/// the surface that the curve is on (or purely in 2D, if there is no
|
|
||||||
/// surface associated with this geometry). However, curves exist globally,
|
|
||||||
/// independently of surfaces. Half-edges in multiple surfaces can refer to
|
|
||||||
/// the same curve, and in fact, that is the whole reason for their
|
|
||||||
/// existence as a topological object.
|
|
||||||
///
|
|
||||||
/// This contradiction, globally defined curves but locally defined curve
|
|
||||||
/// geometry, is the reason that this curve geometry is defined right here,
|
|
||||||
/// associated with a locally existing half-edge. (And, I might add,
|
|
||||||
/// redundantly so, as multiple half-edges within the same surface context
|
|
||||||
/// can refer to the same curve.)
|
|
||||||
///
|
|
||||||
/// Instead, it should be possible to define curve geometry *either* locally
|
|
||||||
/// or globally. Then that respective definition can be associated with the
|
|
||||||
/// curve (and possibly, in addition, a surface). How exactly that is going
|
|
||||||
/// to work is up in the air.
|
|
||||||
///
|
|
||||||
/// The point of all this exposition is to clarify that this field doesn't
|
|
||||||
/// really belong here. It exists here for practical reasons that are,
|
|
||||||
/// hopefully, temporary.
|
|
||||||
pub path: SurfacePath,
|
|
||||||
|
|
||||||
/// # The boundary of the half-edge on its curve
|
/// # The boundary of the half-edge on its curve
|
||||||
pub boundary: CurveBoundary<Point<1>>,
|
pub boundary: CurveBoundary<Point<1>>,
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,6 @@ pub trait BuildHalfEdge {
|
|||||||
core.layers.geometry.define_half_edge(
|
core.layers.geometry.define_half_edge(
|
||||||
half_edge.clone(),
|
half_edge.clone(),
|
||||||
HalfEdgeGeom {
|
HalfEdgeGeom {
|
||||||
path,
|
|
||||||
boundary: boundary.into(),
|
boundary: boundary.into(),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -100,14 +99,6 @@ pub trait BuildHalfEdge {
|
|||||||
core.layers.geometry.define_half_edge(
|
core.layers.geometry.define_half_edge(
|
||||||
half_edge.clone(),
|
half_edge.clone(),
|
||||||
HalfEdgeGeom {
|
HalfEdgeGeom {
|
||||||
path: core
|
|
||||||
.layers
|
|
||||||
.geometry
|
|
||||||
.of_curve(half_edge.curve())
|
|
||||||
.expect("Curve geometry was just defined in same function")
|
|
||||||
.local_on(&surface)
|
|
||||||
.expect("Curve geometry was just defined in same function")
|
|
||||||
.path,
|
|
||||||
boundary: boundary.unwrap_or_default(),
|
boundary: boundary.unwrap_or_default(),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -102,23 +102,7 @@ pub trait BuildShell {
|
|||||||
.update_curve(|_, _| curve.clone(), core)
|
.update_curve(|_, _| curve.clone(), core)
|
||||||
.insert(core)
|
.insert(core)
|
||||||
.set_geometry(
|
.set_geometry(
|
||||||
HalfEdgeGeom {
|
HalfEdgeGeom { boundary },
|
||||||
path: core
|
|
||||||
.layers
|
|
||||||
.geometry
|
|
||||||
.of_curve(&curve)
|
|
||||||
.expect(
|
|
||||||
"Curve geometry was just \
|
|
||||||
defined in same function",
|
|
||||||
)
|
|
||||||
.local_on(&surface)
|
|
||||||
.expect(
|
|
||||||
"Curve geometry was just \
|
|
||||||
defined in same function",
|
|
||||||
)
|
|
||||||
.path,
|
|
||||||
boundary,
|
|
||||||
},
|
|
||||||
&mut core.layers.geometry,
|
&mut core.layers.geometry,
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -17,7 +17,6 @@ impl ReverseCurveCoordinateSystems for (&Handle<HalfEdge>, &Handle<Surface>) {
|
|||||||
let (half_edge, surface) = self;
|
let (half_edge, surface) = self;
|
||||||
|
|
||||||
let mut half_edge_geom = *core.layers.geometry.of_half_edge(half_edge);
|
let mut half_edge_geom = *core.layers.geometry.of_half_edge(half_edge);
|
||||||
half_edge_geom.path = half_edge_geom.path.reverse();
|
|
||||||
half_edge_geom.boundary = half_edge_geom.boundary.reverse();
|
half_edge_geom.boundary = half_edge_geom.boundary.reverse();
|
||||||
|
|
||||||
let curve =
|
let curve =
|
||||||
|
@ -143,23 +143,7 @@ impl SweepHalfEdge for Handle<HalfEdge> {
|
|||||||
.update_curve(|_, _| curve.clone(), core)
|
.update_curve(|_, _| curve.clone(), core)
|
||||||
.insert(core)
|
.insert(core)
|
||||||
.set_geometry(
|
.set_geometry(
|
||||||
HalfEdgeGeom {
|
HalfEdgeGeom { boundary },
|
||||||
path: core
|
|
||||||
.layers
|
|
||||||
.geometry
|
|
||||||
.of_curve(&curve)
|
|
||||||
.expect(
|
|
||||||
"Curve geometry was just defined in same \
|
|
||||||
function",
|
|
||||||
)
|
|
||||||
.local_on(&surface)
|
|
||||||
.expect(
|
|
||||||
"Curve geometry was just defined in same \
|
|
||||||
function",
|
|
||||||
)
|
|
||||||
.path,
|
|
||||||
boundary,
|
|
||||||
},
|
|
||||||
&mut core.layers.geometry,
|
&mut core.layers.geometry,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -212,8 +212,6 @@ mod tests {
|
|||||||
.layers
|
.layers
|
||||||
.geometry
|
.geometry
|
||||||
.of_half_edge(half_edge);
|
.of_half_edge(half_edge);
|
||||||
half_edge_geom.path =
|
|
||||||
half_edge_geom.path.reverse();
|
|
||||||
half_edge_geom.boundary =
|
half_edge_geom.boundary =
|
||||||
half_edge_geom.boundary.reverse();
|
half_edge_geom.boundary.reverse();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user