mirror of
https://github.com/hannobraun/Fornjot
synced 2025-01-11 10:47:09 +00:00
Add BuildFace::circle
This commit is contained in:
parent
ee15b609a5
commit
a525f8d1b9
@ -1,7 +1,7 @@
|
|||||||
use std::{array, borrow::Borrow};
|
use std::{array, borrow::Borrow};
|
||||||
|
|
||||||
use fj_interop::ext::ArrayExt;
|
use fj_interop::ext::ArrayExt;
|
||||||
use fj_math::Point;
|
use fj_math::{Point, Scalar};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
objects::{Cycle, Face, HalfEdge, Region, Surface, Vertex},
|
objects::{Cycle, Face, HalfEdge, Region, Surface, Vertex},
|
||||||
@ -26,6 +26,17 @@ pub trait BuildFace {
|
|||||||
Face::new(surface, region)
|
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
|
/// Build a triangle
|
||||||
fn triangle(
|
fn triangle(
|
||||||
points: [impl Into<Point<3>>; 3],
|
points: [impl Into<Point<3>>; 3],
|
||||||
|
Loading…
Reference in New Issue
Block a user