mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-09 12:28:29 +00:00
Return Option
from Geometry::of_curve
This makes the method more flexible and error messages about missing curve geometry more targetted.
This commit is contained in:
parent
b5bcd2cf99
commit
3f4a92e6c9
@ -108,10 +108,8 @@ impl Geometry {
|
||||
/// ## Panics
|
||||
///
|
||||
/// Panics, if the geometry of the curve is not defined.
|
||||
pub fn of_curve(&self, curve: &Handle<Curve>) -> &CurveGeom {
|
||||
self.curve
|
||||
.get(curve)
|
||||
.expect("Expected geometry of half-edge to be defined")
|
||||
pub fn of_curve(&self, curve: &Handle<Curve>) -> Option<&CurveGeom> {
|
||||
self.curve.get(curve)
|
||||
}
|
||||
|
||||
/// # Access the geometry of the provided half-edge
|
||||
|
@ -133,6 +133,7 @@ pub trait BuildHalfEdge {
|
||||
.layers
|
||||
.geometry
|
||||
.of_curve(half_edge.curve())
|
||||
.expect("Curve geometry was just defined in same function")
|
||||
.local_on(&surface)
|
||||
.path,
|
||||
boundary: boundary.unwrap_or_default(),
|
||||
|
@ -107,6 +107,10 @@ pub trait BuildShell {
|
||||
.layers
|
||||
.geometry
|
||||
.of_curve(&curve)
|
||||
.expect(
|
||||
"Curve geometry was just \
|
||||
defined in same function",
|
||||
)
|
||||
.local_on(&surface)
|
||||
.path,
|
||||
boundary,
|
||||
|
Loading…
Reference in New Issue
Block a user