mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-10 21:08:27 +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 std::collections::{BTreeMap, BTreeSet};
|
||||||
|
|
||||||
use fj_math::Point;
|
use fj_math::{Point, Scalar};
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
|
|
||||||
use crate::{
|
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 start = start.into();
|
||||||
|
let _ = radius.into();
|
||||||
|
|
||||||
self.segments.push(SketchSegment::Arc { start });
|
self.segments.push(SketchSegment::Arc { start });
|
||||||
|
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,10 +21,10 @@ pub fn model(viewer: &Viewer) -> TriMesh {
|
|||||||
// connection to inner boundary
|
// connection to inner boundary
|
||||||
.line_from([-1., -1.])
|
.line_from([-1., -1.])
|
||||||
// inner boundary
|
// inner boundary
|
||||||
.arc_from([-0.5, -0.5])
|
.arc_from([-0.5, -0.5], 1.)
|
||||||
.arc_from([-0.5, 0.5])
|
.arc_from([-0.5, 0.5], 1.)
|
||||||
.arc_from([0.5, 0.5])
|
.arc_from([0.5, 0.5], 1.)
|
||||||
.arc_from([0.5, -0.5])
|
.arc_from([0.5, -0.5], 1.)
|
||||||
// connection to outer boundary
|
// connection to outer boundary
|
||||||
.line_from([-0.5, -0.5]);
|
.line_from([-0.5, -0.5]);
|
||||||
// The connection between the last and first points is implicit, so
|
// The connection between the last and first points is implicit, so
|
||||||
|
Loading…
Reference in New Issue
Block a user