Move vertex approximation out of half-edge approx

This commit is contained in:
Hanno Braun 2024-06-25 20:28:54 +02:00
parent f1e1b3ed63
commit 0fcd1faafe
2 changed files with 14 additions and 14 deletions

View File

@ -12,6 +12,7 @@ use crate::{
use super::{
half_edge::{approx_half_edge, HalfEdgeApprox},
vertex::approx_vertex,
ApproxCache, ApproxPoint, Tolerance,
};
@ -30,12 +31,23 @@ pub fn approx_cycle(
.iter()
.map(|half_edge| {
let boundary = geometry.of_half_edge(half_edge).boundary;
let [start_position_curve, _] = boundary.inner;
let start = approx_vertex(
half_edge.start_vertex().clone(),
half_edge.curve(),
surface,
start_position_curve,
&mut cache.vertex,
geometry,
);
approx_half_edge(
half_edge,
surface,
start,
boundary,
tolerance,
&mut cache.vertex,
&mut cache.curve,
geometry,
)

View File

@ -14,7 +14,6 @@ use crate::{
use super::{
curve::{approx_curve_with_cache, CurveApproxCache},
vertex::{approx_vertex, VertexApproxCache},
ApproxPoint, Tolerance,
};
@ -22,25 +21,14 @@ use super::{
pub fn approx_half_edge(
half_edge: &Handle<HalfEdge>,
surface: &Handle<Surface>,
start: ApproxPoint<1>,
boundary: CurveBoundary<Point<1>>,
tolerance: impl Into<Tolerance>,
vertex_cache: &mut VertexApproxCache,
curve_cache: &mut CurveApproxCache,
geometry: &Geometry,
) -> HalfEdgeApprox {
let tolerance = tolerance.into();
let [start_position_curve, _] = boundary.inner;
let start = approx_vertex(
half_edge.start_vertex().clone(),
half_edge.curve(),
surface,
start_position_curve,
vertex_cache,
geometry,
);
let rest = approx_curve_with_cache(
half_edge.curve(),
surface,