-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sweep Faces and Wires along a path (#155)
* Start binding to BRepOffsetAPI_MakePipeShell * get wire sweep working * use the simpler MakePipe instead of MakePipeShell * remove unnecessary include * fix clippy warnings * clang format * Update crates/opencascade/src/primitives/wire.rs Co-authored-by: Brian Schwind <[email protected]> --------- Co-authored-by: Brian Schwind <[email protected]>
- Loading branch information
Showing
8 changed files
with
89 additions
and
0 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
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
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,23 @@ | ||
use glam::DVec3; | ||
use opencascade::{ | ||
angle::{RVec, ToAngle}, | ||
primitives::{Face, IntoShape, Shape, Solid, Wire}, | ||
workplane::Workplane, | ||
}; | ||
|
||
pub fn shape() -> Shape { | ||
let r = 10.0; | ||
let a = 5.0; | ||
|
||
let face_profile: Face = Workplane::xz() | ||
.rotated(RVec::z(45.0.degrees())) | ||
.translated(DVec3::new(-r, 0.0, 0.0)) | ||
.rect(a, a) | ||
.to_face(); | ||
|
||
let path: Wire = Workplane::xy().sketch().arc((-r, 0.0), (0.0, r), (r, 0.0)).wire(); | ||
|
||
let pipe_solid: Solid = face_profile.sweep_along(&path); | ||
|
||
pipe_solid.into_shape() | ||
} |
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,22 @@ | ||
use glam::DVec3; | ||
use opencascade::{ | ||
angle::{RVec, ToAngle}, | ||
primitives::{IntoShape, Shape, Shell, Wire}, | ||
workplane::Workplane, | ||
}; | ||
|
||
pub fn shape() -> Shape { | ||
let r = 10.0; | ||
let a = 5.0; | ||
|
||
let wire_profile: Wire = Workplane::xz() | ||
.rotated(RVec::z(45.0.degrees())) | ||
.translated(DVec3::new(-r, 0.0, 0.0)) | ||
.rect(a, a); | ||
|
||
let path: Wire = Workplane::xy().sketch().arc((-r, 0.0), (0.0, r), (r, 0.0)).wire(); | ||
|
||
let pipe_shell: Shell = wire_profile.sweep_along(&path); | ||
|
||
pipe_shell.into_shape() | ||
} |