fix close arc (#704)
* fix close arc Signed-off-by: Jess Frazelle <github@jessfraz.com> * much bigger radius Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
@ -856,26 +856,6 @@ async fn inner_arc(data: ArcData, sketch_group: Box<SketchGroup>, args: Args) ->
|
|||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
// TODO: Dont do this (move path pen) - mike
|
|
||||||
// lets review what the needs are here and see if any existing arc endpoints can accomplish this
|
|
||||||
|
|
||||||
// Move the path pen to the end of the arc.
|
|
||||||
// Since that is where we want to draw the next path.
|
|
||||||
// TODO: the engine should automatically move the pen to the end of the arc.
|
|
||||||
// This just seems inefficient.
|
|
||||||
args.send_modeling_cmd(
|
|
||||||
id,
|
|
||||||
ModelingCmd::MovePathPen {
|
|
||||||
path: sketch_group.id,
|
|
||||||
to: Point3D {
|
|
||||||
x: end.x,
|
|
||||||
y: end.y,
|
|
||||||
z: 0.0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
)
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
let current_path = Path::ToPoint {
|
let current_path = Path::ToPoint {
|
||||||
base: BasePath {
|
base: BasePath {
|
||||||
from: from.into(),
|
from: from.into(),
|
||||||
|
@ -210,3 +210,20 @@ show(b2)"#;
|
|||||||
1.0,
|
1.0,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test(flavor = "multi_thread")]
|
||||||
|
async fn test_close_arc() {
|
||||||
|
let code = r#"const center = [0,0]
|
||||||
|
const radius = 40
|
||||||
|
const height = 3
|
||||||
|
|
||||||
|
const body = startSketchAt([center[0]+radius, center[1]])
|
||||||
|
|> arc({angle_end: 360, angle_start: 0, radius: radius}, %)
|
||||||
|
|> close(%)
|
||||||
|
|> extrude(height, %)
|
||||||
|
|
||||||
|
show(body)"#;
|
||||||
|
|
||||||
|
let result = execute_and_snapshot(code).await.unwrap();
|
||||||
|
twenty_twenty::assert_image("tests/executor/outputs/close_arc.png", &result, 1.0);
|
||||||
|
}
|
||||||
|
BIN
src/wasm-lib/tests/executor/outputs/close_arc.png
Normal file
BIN
src/wasm-lib/tests/executor/outputs/close_arc.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 95 KiB |
Reference in New Issue
Block a user