Fix bad example (#2120)
* fix example Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix example Signed-off-by: Jess Frazelle <github@jessfraz.com> * fxi Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com>
@ -26564,7 +26564,7 @@
|
|||||||
"unpublished": false,
|
"unpublished": false,
|
||||||
"deprecated": false,
|
"deprecated": false,
|
||||||
"examples": [
|
"examples": [
|
||||||
"const box = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line([0, 10], %)\n |> line([10, 0], %)\n |> line([0, -10], %, 'revolveAxis')\n |> close(%)\n |> extrude(10, %)\n\nconst sketch001 = startSketchOn(box, \"revolveAxis\")\n |> startProfileAt([5, 10], %)\n |> line([0, -10], %)\n |> line([2, 0], %)\n |> line([0, 10], %)\n |> close(%)\n |> revolve({\n axis: getEdge('revolveAxis', box),\n angle: 90\n }, %)"
|
"const box = startSketchOn('XY')\n |> startProfileAt([0, 0], %)\n |> line([0, 10], %)\n |> line([10, 0], %)\n |> line([0, -10], %, 'revolveAxis')\n |> close(%)\n |> extrude(10, %)\n\nconst sketch001 = startSketchOn('XY')\n |> startProfileAt([0, -10], %)\n |> line([0, -10], %)\n |> line([2, 0], %)\n |> line([0, 10], %)\n |> close(%)\n |> revolve({\n axis: getEdge('revolveAxis', box),\n angle: 90\n }, %)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -299,8 +299,8 @@ pub async fn get_edge(args: Args) -> Result<MemoryItem, KclError> {
|
|||||||
/// |> close(%)
|
/// |> close(%)
|
||||||
/// |> extrude(10, %)
|
/// |> extrude(10, %)
|
||||||
///
|
///
|
||||||
/// const sketch001 = startSketchOn(box, "revolveAxis")
|
/// const sketch001 = startSketchOn('XY')
|
||||||
/// |> startProfileAt([5, 10], %)
|
/// |> startProfileAt([0, -10], %)
|
||||||
/// |> line([0, -10], %)
|
/// |> line([0, -10], %)
|
||||||
/// |> line([2, 0], %)
|
/// |> line([2, 0], %)
|
||||||
/// |> line([0, 10], %)
|
/// |> line([0, 10], %)
|
||||||
|
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 98 KiB |
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 125 KiB |
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 94 KiB |
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 94 KiB |
@ -1737,10 +1737,13 @@ const sketch001 = startSketchOn(box, "revolveAxis")
|
|||||||
|
|
||||||
"#;
|
"#;
|
||||||
|
|
||||||
let result = execute_and_snapshot(code, kittycad::types::UnitLength::Mm)
|
let result = execute_and_snapshot(code, kittycad::types::UnitLength::Mm).await;
|
||||||
.await
|
|
||||||
.unwrap();
|
assert!(result.is_err());
|
||||||
twenty_twenty::assert_image("tests/executor/outputs/revolve_on_edge_get_edge.png", &result, 1.0);
|
assert_eq!(
|
||||||
|
result.err().unwrap().to_string(),
|
||||||
|
r#"engine: KclErrorDetails { source_ranges: [SourceRange([349, 409])], message: "Modeling command failed: Some([ApiError { error_code: InternalEngine, message: \"Solid3D revolve failed: sketch profile must lie entirely on one side of the revolution axis\" }])" }"#
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test(flavor = "multi_thread")]
|
#[tokio::test(flavor = "multi_thread")]
|
||||||
|
Before Width: | Height: | Size: 126 KiB After Width: | Height: | Size: 125 KiB |
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 125 KiB |
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 125 KiB |
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 104 KiB |
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 93 KiB |
Before Width: | Height: | Size: 163 KiB After Width: | Height: | Size: 168 KiB |
Before Width: | Height: | Size: 163 KiB After Width: | Height: | Size: 168 KiB |
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 96 KiB |
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 106 KiB |