Compare commits
3 Commits
main
...
jtran/fill
Author | SHA1 | Date | |
---|---|---|---|
d3b932e7a7 | |||
4fad383081 | |||
f4cf0d0d88 |
@ -674,3 +674,36 @@ extrude(profile001, length = 100)"#
|
|||||||
assert!(first.1 != last.1, "The images should be different for the grid");
|
assert!(first.1 != last.1, "The images should be different for the grid");
|
||||||
assert_eq!(first.2, last.2, "The outcomes should be the same");
|
assert_eq!(first.2, last.2, "The outcomes should be the same");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test(flavor = "multi_thread")]
|
||||||
|
async fn kcl_test_cache_fillet_error_opening_closing_specific_files() {
|
||||||
|
let main_code = include_str!("../../tests/fillet_error_switch_files/main.kcl");
|
||||||
|
let switch_code = include_str!("../../tests/fillet_error_switch_files/switch_protector.kcl");
|
||||||
|
|
||||||
|
let result = cache_test(
|
||||||
|
"fillet_error_opening_closing_specific_files",
|
||||||
|
vec![
|
||||||
|
Variation {
|
||||||
|
code: main_code,
|
||||||
|
other_files: Vec::new(),
|
||||||
|
settings: &Default::default(),
|
||||||
|
},
|
||||||
|
Variation {
|
||||||
|
code: switch_code,
|
||||||
|
other_files: Vec::new(),
|
||||||
|
settings: &Default::default(),
|
||||||
|
},
|
||||||
|
Variation {
|
||||||
|
code: main_code,
|
||||||
|
other_files: Vec::new(),
|
||||||
|
settings: &Default::default(),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
)
|
||||||
|
.await;
|
||||||
|
|
||||||
|
// Make sure nothing failed.
|
||||||
|
result.first().unwrap();
|
||||||
|
result.get(1).unwrap();
|
||||||
|
result.last().unwrap();
|
||||||
|
}
|
||||||
|
Binary file not shown.
After Width: | Height: | Size: 56 KiB |
Binary file not shown.
After Width: | Height: | Size: 98 KiB |
Binary file not shown.
After Width: | Height: | Size: 56 KiB |
@ -775,6 +775,10 @@ impl ExecutorContext {
|
|||||||
.await;
|
.await;
|
||||||
|
|
||||||
let outcome = exec_state.to_exec_outcome(result.0).await;
|
let outcome = exec_state.to_exec_outcome(result.0).await;
|
||||||
|
|
||||||
|
println!("batch_end: {:#?}", self.engine.batch_end().read().await);
|
||||||
|
println!("responses: {:#?}", self.engine.responses().read().await);
|
||||||
|
println!("batch: {:#?}", self.engine.batch().read().await);
|
||||||
Ok(outcome)
|
Ok(outcome)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
70
rust/kcl-lib/tests/fillet_error_switch_files/main.kcl
Normal file
70
rust/kcl-lib/tests/fillet_error_switch_files/main.kcl
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
holeFudge = 0.4
|
||||||
|
frontBarD = 5.0
|
||||||
|
yBarD = 6.7
|
||||||
|
slideGap = 0.7
|
||||||
|
lowerBlockTransHole = {
|
||||||
|
r = (frontBarD + slideGap + holeFudge) / 2
|
||||||
|
}
|
||||||
|
upperBlockLongHole = { r = (yBarD + holeFudge) / 2 }
|
||||||
|
|
||||||
|
upperBlockTransHole = { r = (yBarD + holeFudge) / 2 }
|
||||||
|
tubeClr = 1.5
|
||||||
|
lowerBlock = {
|
||||||
|
h = 2 * lowerBlockTransHole.r + 2 * tubeClr,
|
||||||
|
l = 70
|
||||||
|
}
|
||||||
|
upperBlock = {
|
||||||
|
h = 2 * upperBlockLongHole.r + 2 * tubeClr,
|
||||||
|
l = 25
|
||||||
|
}
|
||||||
|
elevate = { h = 5 }
|
||||||
|
|
||||||
|
blockSz = max([upperBlock.h, lowerBlock.h])
|
||||||
|
|
||||||
|
slot = { l = 10, h = 1 }
|
||||||
|
|
||||||
|
sketch001 = startSketchOn(XZ)
|
||||||
|
|> startProfile(at = [0, 0])
|
||||||
|
|> yLine(length = blockSz, tag = $edgeA)
|
||||||
|
|> xLine(length = blockSz, tag = $edgeB)
|
||||||
|
|> yLine(length = -blockSz, tag = $edgeC)
|
||||||
|
|> xLine(length = upperBlock.l - blockSz, tag = $edge1)
|
||||||
|
|> yLine(length = -(elevate.h + blockSz), tag = $edge2)
|
||||||
|
|> xLine(length = lowerBlock.l - blockSz, tag = $edge3)
|
||||||
|
|> yLine(length = -blockSz, tag = $edge4)
|
||||||
|
|> xLine(length = -lowerBlock.l, tag = $edge5)
|
||||||
|
|> yLine(length = blockSz + elevate.h, tag = $edge6)
|
||||||
|
|> xLine(length = -(upperBlock.l - blockSz), tag = $edge7)
|
||||||
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg01)
|
||||||
|
|> close()
|
||||||
|
|> subtract2d(tool = circle(center = [blockSz / 2, blockSz / 2], radius = upperBlockTransHole.r))
|
||||||
|
|> subtract2d(tool = circle(
|
||||||
|
center = [
|
||||||
|
upperBlock.l + lowerBlock.l - blockSz - lowerBlockTransHole.r - tubeClr,
|
||||||
|
-(blockSz + elevate.h + blockSz / 2)
|
||||||
|
],
|
||||||
|
radius = lowerBlockTransHole.r,
|
||||||
|
))
|
||||||
|
rad = 3
|
||||||
|
|
||||||
|
extrude001 = extrude(sketch001, length = blockSz)
|
||||||
|
|> fillet(
|
||||||
|
radius = rad,
|
||||||
|
tags = [
|
||||||
|
getNextAdjacentEdge(edgeA),
|
||||||
|
getNextAdjacentEdge(edgeB),
|
||||||
|
getNextAdjacentEdge(edgeC),
|
||||||
|
getNextAdjacentEdge(edge1),
|
||||||
|
getNextAdjacentEdge(edge2),
|
||||||
|
getNextAdjacentEdge(edge3),
|
||||||
|
getNextAdjacentEdge(edge4),
|
||||||
|
getNextAdjacentEdge(edge5),
|
||||||
|
getNextAdjacentEdge(edge6),
|
||||||
|
getNextAdjacentEdge(edge7)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
sketch002 = startSketchOn(extrude001, face = seg01)
|
||||||
|
|> startProfile(at = [0, 0])
|
||||||
|
|> circle(center = [blockSz / 2, -blockSz / 2], radius = upperBlockLongHole.r)
|
||||||
|
|> extrude(length = -upperBlock.l)
|
@ -0,0 +1,22 @@
|
|||||||
|
holeFudgeD = 0.4
|
||||||
|
holeFudgeR = holeFudgeD / 2
|
||||||
|
|
||||||
|
totalH = 12.5
|
||||||
|
switchNutD = 9.5
|
||||||
|
switchNutR = switchNutD / 2
|
||||||
|
bottomInnerR = switchNutR + holeFudgeR
|
||||||
|
bottomOuterR = 13.5
|
||||||
|
topInnerR = switchNutR + 1.5 + holeFudgeR
|
||||||
|
topFlatL = 1
|
||||||
|
topOuterR = topInnerR + topFlatL
|
||||||
|
baseH = 1
|
||||||
|
coneH = totalH - baseH
|
||||||
|
|
||||||
|
sketch001 = startSketchOn(XZ)
|
||||||
|
|> startProfile(at = [bottomInnerR, 0])
|
||||||
|
|> xLine(endAbsolute = bottomOuterR)
|
||||||
|
|> yLine(length = baseH)
|
||||||
|
|> line(end = [-(bottomOuterR - topOuterR), coneH])
|
||||||
|
|> line(end = [-(topOuterR - topInnerR), 0])
|
||||||
|
|> close()
|
||||||
|
|> revolve(axis = Y)
|
Reference in New Issue
Block a user