mirror of
https://github.com/hannobraun/Fornjot
synced 2025-02-21 14:45:51 +00:00
Accept Vec<Face>
as source in sweep
This commit is contained in:
parent
e75e2e636a
commit
4ad8e50fc8
@ -12,7 +12,7 @@ use super::{CycleApprox, Tolerance};
|
||||
|
||||
/// Create a solid by sweeping a sketch
|
||||
pub fn sweep(
|
||||
source: Shape,
|
||||
source: Vec<Face>,
|
||||
path: impl Into<Vector<3>>,
|
||||
tolerance: Tolerance,
|
||||
color: [u8; 4],
|
||||
@ -455,11 +455,13 @@ mod tests {
|
||||
|
||||
let mut shape = Shape::new();
|
||||
|
||||
let _sketch = Face::builder(Surface::xy_plane(), &mut shape)
|
||||
let sketch = Face::builder(Surface::xy_plane(), &mut shape)
|
||||
.with_exterior_polygon([[0., 0.], [1., 0.], [0., 1.]])
|
||||
.build();
|
||||
.build()
|
||||
.get();
|
||||
|
||||
let solid = super::sweep(shape, direction, tolerance, [255, 0, 0, 255]);
|
||||
let solid =
|
||||
super::sweep(vec![sketch], direction, tolerance, [255, 0, 0, 255]);
|
||||
|
||||
let expected_vertices: Vec<_> = expected_vertices
|
||||
.into_iter()
|
||||
|
@ -1,6 +1,7 @@
|
||||
use fj_interop::debug::DebugInfo;
|
||||
use fj_kernel::{
|
||||
algorithms::{sweep, Tolerance},
|
||||
iter::ObjectIters,
|
||||
shape::Shape,
|
||||
validation::{validate, Validated, ValidationConfig, ValidationError},
|
||||
};
|
||||
@ -19,7 +20,8 @@ impl ToShape for fj::Sweep {
|
||||
let path = Vector::from(self.path());
|
||||
let color = self.shape().color();
|
||||
|
||||
let swept = sweep(shape.into_inner(), path, tolerance, color);
|
||||
let shape = shape.face_iter().collect::<Vec<_>>();
|
||||
let swept = sweep(shape, path, tolerance, color);
|
||||
let swept = validate(swept, config)?;
|
||||
|
||||
Ok(swept)
|
||||
|
Loading…
Reference in New Issue
Block a user