mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-06 19:08:28 +00:00
Prepare to support arcs in sketches
This commit is contained in:
parent
83febdae02
commit
94bd019099
@ -1,6 +1,6 @@
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
|
||||
use fj_math::Point;
|
||||
use fj_math::{Point, Scalar};
|
||||
use itertools::Itertools;
|
||||
|
||||
use crate::{
|
||||
@ -22,9 +22,16 @@ impl Sketch {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn arc_from(mut self, start: impl Into<Point<2>>) -> Self {
|
||||
pub fn arc_from(
|
||||
mut self,
|
||||
start: impl Into<Point<2>>,
|
||||
radius: impl Into<Scalar>,
|
||||
) -> Self {
|
||||
let start = start.into();
|
||||
let _ = radius.into();
|
||||
|
||||
self.segments.push(SketchSegment::Arc { start });
|
||||
|
||||
self
|
||||
}
|
||||
|
||||
|
@ -21,10 +21,10 @@ pub fn model(viewer: &Viewer) -> TriMesh {
|
||||
// connection to inner boundary
|
||||
.line_from([-1., -1.])
|
||||
// inner boundary
|
||||
.arc_from([-0.5, -0.5])
|
||||
.arc_from([-0.5, 0.5])
|
||||
.arc_from([0.5, 0.5])
|
||||
.arc_from([0.5, -0.5])
|
||||
.arc_from([-0.5, -0.5], 1.)
|
||||
.arc_from([-0.5, 0.5], 1.)
|
||||
.arc_from([0.5, 0.5], 1.)
|
||||
.arc_from([0.5, -0.5], 1.)
|
||||
// connection to outer boundary
|
||||
.line_from([-0.5, -0.5]);
|
||||
// The connection between the last and first points is implicit, so
|
||||
|
Loading…
Reference in New Issue
Block a user