From fb77439fd95094af6213ba0c28e2eb1dcf27c73e Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 4 May 2023 10:12:59 +0200 Subject: [PATCH] Remove obsolete builder API --- crates/fj-kernel/src/builder/cycle.rs | 52 --------------------------- crates/fj-kernel/src/builder/mod.rs | 5 --- crates/fj-kernel/src/lib.rs | 1 - 3 files changed, 58 deletions(-) delete mode 100644 crates/fj-kernel/src/builder/cycle.rs delete mode 100644 crates/fj-kernel/src/builder/mod.rs diff --git a/crates/fj-kernel/src/builder/cycle.rs b/crates/fj-kernel/src/builder/cycle.rs deleted file mode 100644 index e3f052e70..000000000 --- a/crates/fj-kernel/src/builder/cycle.rs +++ /dev/null @@ -1,52 +0,0 @@ -use fj_math::Point; -use itertools::Itertools; - -use crate::{ - geometry::curve::Curve, - objects::{Cycle, HalfEdge}, - operations::{BuildHalfEdge, Insert, UpdateHalfEdge}, - services::Services, - storage::Handle, -}; - -/// Builder API for [`Cycle`] -#[derive(Default)] -pub struct CycleBuilder { - half_edges: Vec, -} - -impl CycleBuilder { - /// Create a cycle whose half-edges are connected to the provided half-edges - /// - /// The half-edges of the new circle will be coincident with the provided - /// half-edges, but will point in the opposite direction. - /// - /// Assumes that the provided half-edges, once translated into local - /// equivalents of this cycle, form a cycle themselves. - pub fn connect_to_edges(edges: Es, services: &mut Services) -> Self - where - Es: IntoIterator, Curve, [Point<1>; 2])>, - Es::IntoIter: Clone + ExactSizeIterator, - { - let half_edges = edges - .into_iter() - .circular_tuple_windows() - .map(|((prev, _, _), (half_edge, curve, boundary))| { - HalfEdge::unjoined(curve, boundary, services) - .replace_start_vertex(prev.start_vertex().clone()) - .replace_global_form(half_edge.global_form().clone()) - }) - .collect(); - - Self { half_edges } - } - - /// Build the cycle - pub fn build(self, services: &mut Services) -> Cycle { - let half_edges = self - .half_edges - .into_iter() - .map(|half_edge| half_edge.insert(services)); - Cycle::new(half_edges) - } -} diff --git a/crates/fj-kernel/src/builder/mod.rs b/crates/fj-kernel/src/builder/mod.rs deleted file mode 100644 index 453523ff1..000000000 --- a/crates/fj-kernel/src/builder/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -//! API for building objects - -mod cycle; - -pub use self::cycle::CycleBuilder; diff --git a/crates/fj-kernel/src/lib.rs b/crates/fj-kernel/src/lib.rs index 952e0fb27..0996e6dd3 100644 --- a/crates/fj-kernel/src/lib.rs +++ b/crates/fj-kernel/src/lib.rs @@ -88,7 +88,6 @@ #![warn(missing_docs)] pub mod algorithms; -pub mod builder; pub mod geometry; pub mod objects; pub mod operations;