mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-09 12:28:29 +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
|
||||||
///
|
///
|
||||||
/// Panics, if the curve has not been defined on that surface.
|
/// Panics, if the curve has not been defined on that surface.
|
||||||
pub fn local_on(&self, surface: &Handle<Surface>) -> &LocalCurveGeom {
|
pub fn local_on(
|
||||||
self.definitions
|
&self,
|
||||||
.get(surface)
|
surface: &Handle<Surface>,
|
||||||
.expect("Curve not defined on provided surface")
|
) -> Option<&LocalCurveGeom> {
|
||||||
|
self.definitions.get(surface)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,6 +135,7 @@ pub trait BuildHalfEdge {
|
|||||||
.of_curve(half_edge.curve())
|
.of_curve(half_edge.curve())
|
||||||
.expect("Curve geometry was just defined in same function")
|
.expect("Curve geometry was just defined in same function")
|
||||||
.local_on(&surface)
|
.local_on(&surface)
|
||||||
|
.expect("Curve geometry was just defined in same function")
|
||||||
.path,
|
.path,
|
||||||
boundary: boundary.unwrap_or_default(),
|
boundary: boundary.unwrap_or_default(),
|
||||||
},
|
},
|
||||||
|
@ -112,6 +112,10 @@ pub trait BuildShell {
|
|||||||
defined in same function",
|
defined in same function",
|
||||||
)
|
)
|
||||||
.local_on(&surface)
|
.local_on(&surface)
|
||||||
|
.expect(
|
||||||
|
"Curve geometry was just \
|
||||||
|
defined in same function",
|
||||||
|
)
|
||||||
.path,
|
.path,
|
||||||
boundary,
|
boundary,
|
||||||
},
|
},
|
||||||
|
@ -141,10 +141,14 @@ impl SweepHalfEdge for Handle<HalfEdge> {
|
|||||||
.geometry
|
.geometry
|
||||||
.of_curve(&curve)
|
.of_curve(&curve)
|
||||||
.expect(
|
.expect(
|
||||||
"Curve geometry was just \
|
"Curve geometry was just defined in same \
|
||||||
defined in same function",
|
function",
|
||||||
)
|
)
|
||||||
.local_on(&surface)
|
.local_on(&surface)
|
||||||
|
.expect(
|
||||||
|
"Curve geometry was just defined in same \
|
||||||
|
function",
|
||||||
|
)
|
||||||
.path,
|
.path,
|
||||||
boundary,
|
boundary,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user