mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-05 10:28:27 +00:00
Merge pull request #2350 from hannobraun/geometry
Return `Option` from `CurveGeom::local_on`
This commit is contained in:
commit
8ca2fbb7e6
@ -33,10 +33,11 @@ impl CurveGeom {
|
||||
/// ## Panics
|
||||
///
|
||||
/// Panics, if the curve has not been defined on that surface.
|
||||
pub fn local_on(&self, surface: &Handle<Surface>) -> &LocalCurveGeom {
|
||||
self.definitions
|
||||
.get(surface)
|
||||
.expect("Curve not defined on provided surface")
|
||||
pub fn local_on(
|
||||
&self,
|
||||
surface: &Handle<Surface>,
|
||||
) -> Option<&LocalCurveGeom> {
|
||||
self.definitions.get(surface)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -135,6 +135,7 @@ pub trait BuildHalfEdge {
|
||||
.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(),
|
||||
},
|
||||
|
@ -112,6 +112,10 @@ pub trait BuildShell {
|
||||
defined in same function",
|
||||
)
|
||||
.local_on(&surface)
|
||||
.expect(
|
||||
"Curve geometry was just \
|
||||
defined in same function",
|
||||
)
|
||||
.path,
|
||||
boundary,
|
||||
},
|
||||
|
@ -141,10 +141,14 @@ impl SweepHalfEdge for Handle<HalfEdge> {
|
||||
.geometry
|
||||
.of_curve(&curve)
|
||||
.expect(
|
||||
"Curve geometry was just \
|
||||
defined in same function",
|
||||
"Curve geometry was just defined in same \
|
||||
function",
|
||||
)
|
||||
.local_on(&surface)
|
||||
.expect(
|
||||
"Curve geometry was just defined in same \
|
||||
function",
|
||||
)
|
||||
.path,
|
||||
boundary,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user