mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-09 20:38:30 +00:00
Prepare for follow-on change
This commit is contained in:
parent
b0bbd5fd68
commit
4381bb1c3a
@ -184,14 +184,16 @@ fn distances(
|
||||
half_edge: &Handle<HalfEdge>,
|
||||
surface: &Handle<Surface>,
|
||||
geometry: &Geometry,
|
||||
) -> Point<3> {
|
||||
) -> Option<Point<3>> {
|
||||
let [start, end] = geometry.of_half_edge(half_edge).boundary.inner;
|
||||
let path_coords = start + (end - start) * percent;
|
||||
let path = geometry.of_half_edge(half_edge).path;
|
||||
let surface_coords = path.point_from_path_coords(path_coords);
|
||||
geometry
|
||||
.of_surface(surface)
|
||||
.point_from_surface_coords(surface_coords)
|
||||
Some(
|
||||
geometry
|
||||
.of_surface(surface)
|
||||
.point_from_surface_coords(surface_coords),
|
||||
)
|
||||
}
|
||||
|
||||
// Three samples (start, middle, end), are enough to detect weather lines
|
||||
@ -203,8 +205,8 @@ fn distances(
|
||||
let mut distances = Vec::new();
|
||||
for i in 0..sample_count {
|
||||
let percent = i as f64 * step;
|
||||
let sample1 = sample(percent, &half_edge_a, surface_a, geometry);
|
||||
let sample2 = sample(1.0 - percent, &half_edge_b, surface_b, geometry);
|
||||
let sample1 = sample(percent, &half_edge_a, surface_a, geometry)?;
|
||||
let sample2 = sample(1.0 - percent, &half_edge_b, surface_b, geometry)?;
|
||||
distances.push(sample1.distance_to(&sample2))
|
||||
}
|
||||
Some(distances.into_iter())
|
||||
|
Loading…
Reference in New Issue
Block a user