Update next/prev adjacency + tests to match engine (#3706)

* update next/prev adjacency + tests to match engine

* quick tests fix post engine merge
This commit is contained in:
Mike Farrell
2024-09-03 13:34:31 -07:00
committed by GitHub
parent 0f3432b5a0
commit 3cbda10eab
4 changed files with 17 additions and 21 deletions

View File

@ -56,10 +56,10 @@ const bracketBody = bs
|> fillet({
radius: radius,
tags: [
getNextAdjacentEdge(bs.sketchGroup.tags.edge7),
getNextAdjacentEdge(bs.sketchGroup.tags.edge2),
getNextAdjacentEdge(bs.sketchGroup.tags.edge3),
getNextAdjacentEdge(bs.sketchGroup.tags.edge6)
getPreviousAdjacentEdge(bs.sketchGroup.tags.edge7),
getPreviousAdjacentEdge(bs.sketchGroup.tags.edge2),
getPreviousAdjacentEdge(bs.sketchGroup.tags.edge3),
getPreviousAdjacentEdge(bs.sketchGroup.tags.edge6)
]
}, %)

View File

@ -56,10 +56,10 @@ const bracketBody = bs
|> fillet({
radius: radius,
tags: [
getNextAdjacentEdge(bs.tags.edge7),
getNextAdjacentEdge(bs.tags.edge2),
getNextAdjacentEdge(bs.tags.edge3),
getNextAdjacentEdge(bs.tags.edge6)
getPreviousAdjacentEdge(bs.tags.edge7),
getPreviousAdjacentEdge(bs.tags.edge2),
getPreviousAdjacentEdge(bs.tags.edge3),
getPreviousAdjacentEdge(bs.tags.edge6)
]
}, %)
@ -89,7 +89,7 @@ const tabsR = startSketchOn(tabPlane)
radius: holeDiam / 2,
tags: [
getNextAdjacentEdge(edge12),
getNextAdjacentEdge(edge13)
getNextAdjacentEdge(edge11)
]
}, %)
|> patternLinear3d({

View File

@ -1287,7 +1287,7 @@ capScrew([0, 0.5, 0], 50, 37.5, 50, 25)
}
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_bracket_with_fillets_ensure_fail_on_flush_source_ranges() {
async fn kcl_test_bracket_with_fillets() {
let code = r#"// Shelf Bracket
// This is a shelf bracket made out of 6061-T6 aluminum sheet metal. The required thickness is calculated based on a point load of 300 lbs applied to the end of the shelf. There are two brackets holding up the shelf, so the moment experienced is divided by 2. The shelf is 1 foot long from the wall.
@ -1328,11 +1328,7 @@ const bracket = startSketchOn('XY')
"#;
let result = execute_and_snapshot(code, UnitLength::Mm).await;
assert!(result.is_err());
assert_eq!(
result.err().unwrap().to_string(),
r#"engine: KclErrorDetails { source_ranges: [SourceRange([1329, 1430])], message: "Modeling command failed: [ApiError { error_code: BadRequest, message: \"Fillet failed\" }]" }"#
);
assert!(result.is_ok());
}
#[tokio::test(flavor = "multi_thread")]
@ -1536,13 +1532,13 @@ const bracket = startSketchOn('XY')
|> fillet({
radius: filletR,
tags: [
getPreviousAdjacentEdge(innerEdge)
getNextAdjacentEdge(innerEdge)
]
}, %)
|> fillet({
radius: filletR + thickness,
tags: [
getPreviousAdjacentEdge(outerEdge)
getNextAdjacentEdge(outerEdge)
]
}, %)