mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-03 17:38:27 +00:00
Rename HalfEdgeApproxCache
to ApproxCache
This commit is contained in:
parent
afa741d29f
commit
b17b3b0d96
@ -11,7 +11,7 @@ use crate::{
|
||||
};
|
||||
|
||||
use super::{
|
||||
half_edge::{approx_half_edge, HalfEdgeApprox, HalfEdgeApproxCache},
|
||||
half_edge::{approx_half_edge, HalfEdgeApprox, ApproxCache},
|
||||
ApproxPoint, Tolerance,
|
||||
};
|
||||
|
||||
@ -20,7 +20,7 @@ pub fn approx_cycle(
|
||||
cycle: &Cycle,
|
||||
surface: &Handle<Surface>,
|
||||
tolerance: impl Into<Tolerance>,
|
||||
cache: &mut HalfEdgeApproxCache,
|
||||
cache: &mut ApproxCache,
|
||||
geometry: &Geometry,
|
||||
) -> CycleApprox {
|
||||
let tolerance = tolerance.into();
|
||||
|
@ -13,13 +13,13 @@ use crate::{
|
||||
|
||||
use super::{
|
||||
cycle::{approx_cycle, CycleApprox},
|
||||
half_edge::HalfEdgeApproxCache,
|
||||
half_edge::ApproxCache,
|
||||
Approx, ApproxPoint, Tolerance,
|
||||
};
|
||||
|
||||
impl Approx for &ObjectSet<Face> {
|
||||
type Approximation = BTreeSet<FaceApprox>;
|
||||
type Cache = HalfEdgeApproxCache;
|
||||
type Cache = ApproxCache;
|
||||
|
||||
fn approx_with_cache(
|
||||
self,
|
||||
@ -68,7 +68,7 @@ impl Approx for &ObjectSet<Face> {
|
||||
pub fn approx_face(
|
||||
face: Handle<Face>,
|
||||
tolerance: impl Into<Tolerance>,
|
||||
cache: &mut HalfEdgeApproxCache,
|
||||
cache: &mut ApproxCache,
|
||||
geometry: &Geometry,
|
||||
) -> FaceApprox {
|
||||
let tolerance = tolerance.into();
|
||||
|
@ -24,7 +24,7 @@ pub fn approx_half_edge(
|
||||
surface: &Handle<Surface>,
|
||||
boundary: CurveBoundary<Point<1>>,
|
||||
tolerance: impl Into<Tolerance>,
|
||||
cache: &mut HalfEdgeApproxCache,
|
||||
cache: &mut ApproxCache,
|
||||
geometry: &Geometry,
|
||||
) -> HalfEdgeApprox {
|
||||
let tolerance = tolerance.into();
|
||||
@ -81,7 +81,7 @@ pub struct HalfEdgeApprox {
|
||||
|
||||
/// Cache for half-edge approximations
|
||||
#[derive(Default)]
|
||||
pub struct HalfEdgeApproxCache {
|
||||
pub struct ApproxCache {
|
||||
/// Cache for vertex approximations
|
||||
pub vertex: VertexApproxCache,
|
||||
|
||||
|
@ -4,13 +4,11 @@ use std::collections::BTreeSet;
|
||||
|
||||
use crate::{geometry::Geometry, topology::Shell};
|
||||
|
||||
use super::{
|
||||
face::FaceApprox, half_edge::HalfEdgeApproxCache, Approx, Tolerance,
|
||||
};
|
||||
use super::{face::FaceApprox, half_edge::ApproxCache, Approx, Tolerance};
|
||||
|
||||
impl Approx for &Shell {
|
||||
type Approximation = BTreeSet<FaceApprox>;
|
||||
type Cache = HalfEdgeApproxCache;
|
||||
type Cache = ApproxCache;
|
||||
|
||||
fn approx_with_cache(
|
||||
self,
|
||||
|
@ -4,13 +4,11 @@ use std::collections::BTreeSet;
|
||||
|
||||
use crate::{geometry::Geometry, topology::Sketch};
|
||||
|
||||
use super::{
|
||||
face::FaceApprox, half_edge::HalfEdgeApproxCache, Approx, Tolerance,
|
||||
};
|
||||
use super::{face::FaceApprox, half_edge::ApproxCache, Approx, Tolerance};
|
||||
|
||||
impl Approx for &Sketch {
|
||||
type Approximation = BTreeSet<FaceApprox>;
|
||||
type Cache = HalfEdgeApproxCache;
|
||||
type Cache = ApproxCache;
|
||||
|
||||
fn approx_with_cache(
|
||||
self,
|
||||
|
@ -5,12 +5,12 @@ use std::collections::BTreeSet;
|
||||
use crate::{geometry::Geometry, topology::Solid};
|
||||
|
||||
use super::{
|
||||
face::FaceApprox, half_edge::HalfEdgeApproxCache, Approx, Tolerance,
|
||||
face::FaceApprox, half_edge::ApproxCache, Approx, Tolerance,
|
||||
};
|
||||
|
||||
impl Approx for &Solid {
|
||||
type Approximation = BTreeSet<FaceApprox>;
|
||||
type Cache = HalfEdgeApproxCache;
|
||||
type Cache = ApproxCache;
|
||||
|
||||
fn approx_with_cache(
|
||||
self,
|
||||
|
@ -81,7 +81,7 @@ mod tests {
|
||||
|
||||
use crate::{
|
||||
algorithms::approx::{
|
||||
face::approx_face, half_edge::HalfEdgeApproxCache, Tolerance,
|
||||
face::approx_face, half_edge::ApproxCache, Tolerance,
|
||||
},
|
||||
operations::{
|
||||
build::{BuildCycle, BuildFace},
|
||||
@ -314,7 +314,7 @@ mod tests {
|
||||
Ok(approx_face(
|
||||
face,
|
||||
tolerance,
|
||||
&mut HalfEdgeApproxCache::default(),
|
||||
&mut ApproxCache::default(),
|
||||
&core.layers.geometry,
|
||||
)
|
||||
.triangulate(core))
|
||||
|
Loading…
Reference in New Issue
Block a user