Only consider staight lines for colinear check when doing a full revolve (#7209)
* Only consider staight lines for colinear check * Neaten up code and add test * Sir, a second sphere has hit the unit test * Update test snapshots --------- Co-authored-by: Adam Chalmers <adam.chalmers@zoo.dev>
This commit is contained in:
@ -1348,6 +1348,11 @@ impl Path {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// i.e. not a curve
|
||||
pub(crate) fn is_straight_line(&self) -> bool {
|
||||
matches!(self, Path::AngledLineTo { .. } | Path::ToPoint { .. })
|
||||
}
|
||||
}
|
||||
|
||||
/// Compute the straight-line distance between a pair of (2D) points.
|
||||
|
@ -3456,3 +3456,24 @@ mod subtract_regression12 {
|
||||
super::execute(TEST_NAME, true).await
|
||||
}
|
||||
}
|
||||
mod spheres {
|
||||
const TEST_NAME: &str = "spheres";
|
||||
|
||||
/// Test parsing KCL.
|
||||
#[test]
|
||||
fn parse() {
|
||||
super::parse(TEST_NAME)
|
||||
}
|
||||
|
||||
/// Test that parsing and unparsing KCL produces the original KCL input.
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn unparse() {
|
||||
super::unparse(TEST_NAME).await
|
||||
}
|
||||
|
||||
/// Test that KCL is executed correctly.
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn kcl_test_execute() {
|
||||
super::execute(TEST_NAME, true).await
|
||||
}
|
||||
}
|
||||
|
@ -182,6 +182,11 @@ async fn inner_revolve(
|
||||
// If an edge lies on the axis of revolution it will not exist after the revolve, so
|
||||
// it cannot be used to retrieve data about the solid
|
||||
for path in sketch.paths.clone() {
|
||||
if !path.is_straight_line() {
|
||||
edge_id = Some(path.get_id());
|
||||
break;
|
||||
}
|
||||
|
||||
let from = path.get_from();
|
||||
let to = path.get_to();
|
||||
|
||||
|
Reference in New Issue
Block a user