mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-06 19:08:28 +00:00
Provide &Handle<Surface>
to half-edge approx
This commit is contained in:
parent
757a3980fa
commit
35d763c18b
@ -32,8 +32,7 @@ impl Approx for (&Cycle, &Handle<Surface>) {
|
||||
.half_edges()
|
||||
.iter()
|
||||
.map(|half_edge| {
|
||||
(half_edge, &core.layers.geometry.of_surface(surface))
|
||||
.approx_with_cache(tolerance, cache, core)
|
||||
(half_edge, surface).approx_with_cache(tolerance, cache, core)
|
||||
})
|
||||
.collect();
|
||||
|
||||
|
@ -6,7 +6,9 @@
|
||||
//! the caller doesn't have to deal with duplicate vertices.
|
||||
|
||||
use crate::{
|
||||
geometry::SurfaceGeometry, storage::Handle, topology::HalfEdge, Core,
|
||||
storage::Handle,
|
||||
topology::{HalfEdge, Surface},
|
||||
Core,
|
||||
};
|
||||
|
||||
use super::{
|
||||
@ -14,7 +16,7 @@ use super::{
|
||||
Tolerance,
|
||||
};
|
||||
|
||||
impl Approx for (&Handle<HalfEdge>, &SurfaceGeometry) {
|
||||
impl Approx for (&Handle<HalfEdge>, &Handle<Surface>) {
|
||||
type Approximation = HalfEdgeApprox;
|
||||
type Cache = HalfEdgeApproxCache;
|
||||
|
||||
@ -36,7 +38,10 @@ impl Approx for (&Handle<HalfEdge>, &SurfaceGeometry) {
|
||||
match cache.start_position.get(half_edge.start_vertex()) {
|
||||
Some(position) => position,
|
||||
None => {
|
||||
let position_global = surface
|
||||
let position_global = core
|
||||
.layers
|
||||
.geometry
|
||||
.of_surface(surface)
|
||||
.point_from_surface_coords(start_position_surface);
|
||||
cache.start_position.insert(
|
||||
half_edge.start_vertex().clone(),
|
||||
@ -51,7 +56,7 @@ impl Approx for (&Handle<HalfEdge>, &SurfaceGeometry) {
|
||||
let approx = (
|
||||
half_edge.curve(),
|
||||
&core.layers.geometry.of_half_edge(half_edge),
|
||||
surface,
|
||||
&core.layers.geometry.of_surface(surface),
|
||||
)
|
||||
.approx_with_cache(
|
||||
tolerance,
|
||||
|
Loading…
Reference in New Issue
Block a user