Skip to content

Commit

Permalink
Merge pull request #2276 from hannobraun/build
Browse files Browse the repository at this point in the history
Add `BuildFace::circle`
  • Loading branch information
hannobraun authored Mar 21, 2024
2 parents ee15b60 + a525f8d commit fee4dba
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion crates/fj-core/src/operations/build/face.rs
Original file line number Diff line number Diff line change
@@ -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},
Expand All @@ -26,6 +26,17 @@ pub trait BuildFace {
Face::new(surface, region)
}

/// Build a circle
fn circle(
surface: Handle<Surface>,
center: impl Into<Point<2>>,
radius: impl Into<Scalar>,
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<Point<3>>; 3],
Expand Down

0 comments on commit fee4dba

Please sign in to comment.