From a525f8d1b97988504a018acc3fae1959c98674dc Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 21 Mar 2024 11:41:05 +0100 Subject: [PATCH] Add `BuildFace::circle` --- crates/fj-core/src/operations/build/face.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/crates/fj-core/src/operations/build/face.rs b/crates/fj-core/src/operations/build/face.rs index 27fa94b62..5bd6b3f93 100644 --- a/crates/fj-core/src/operations/build/face.rs +++ b/crates/fj-core/src/operations/build/face.rs @@ -1,7 +1,7 @@ use std::{array, borrow::Borrow}; use fj_interop::ext::ArrayExt; -use fj_math::Point; +use fj_math::{Point, Scalar}; use crate::{ objects::{Cycle, Face, HalfEdge, Region, Surface, Vertex}, @@ -26,6 +26,17 @@ pub trait BuildFace { Face::new(surface, region) } + /// Build a circle + fn circle( + surface: Handle, + center: impl Into>, + radius: impl Into, + core: &mut Core, + ) -> Face { + let region = Region::circle(center, radius, core).insert(core); + Face::new(surface, region) + } + /// Build a triangle fn triangle( points: [impl Into>; 3],