-
-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2324 from hannobraun/geometry
Define curve geometry in curve approximation tests
- Loading branch information
Showing
4 changed files
with
55 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use crate::{ | ||
geometry::{CurveGeom, SurfacePath}, | ||
operations::insert::Insert, | ||
storage::Handle, | ||
topology::{Curve, Surface}, | ||
Core, | ||
}; | ||
|
||
/// Build a [`Curve`] | ||
/// | ||
/// See [module-level documentation] for context. | ||
/// | ||
/// [module-level documentation]: super | ||
pub trait BuildCurve { | ||
/// Build a curve from the provided path and surface | ||
fn from_path_and_surface( | ||
path: SurfacePath, | ||
surface: Handle<Surface>, | ||
core: &mut Core, | ||
) -> Handle<Curve> { | ||
let curve = Curve::new().insert(core); | ||
|
||
core.layers.geometry.define_curve( | ||
curve.clone(), | ||
CurveGeom::from_path_and_surface(path, surface), | ||
); | ||
|
||
curve | ||
} | ||
} | ||
|
||
impl BuildCurve for Curve {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters