* claim: #2987 * Flange on a plain solid says how to start sheet metal (#2987) Flange, Flat Pattern, and Export DXF on a design with no sheet metal body now say how to make one: Flange > Base, or Convert to Sheet Metal on a plate's large flat face. An edge flange checks for a sheet metal body before it adds a feature. The message is in the catalogs, and engine messages that match a catalog entry are shown in the interface language. * Dialogs show a refusal without the engine's parameter prefix (#2987) The Flange dialog showed "invalid parameters for `sheet.flange`: " in front of the new guidance. The dialog already names its command, so the red refusal text leaves that prefix out and follows the interface language when the message is in the catalogs. Create Issue still gets the full text.
This commit is contained in:
@@ -37,6 +37,27 @@ fn rectangle_tool(s: &mut Session, name: &str, p0: [f64; 2], p1: [f64; 2]) {
|
||||
run(s, "sketch.finish", json!({}));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn plain_solid_sheet_operations_explain_how_to_start_sheet_metal() {
|
||||
let mut s = Session::default();
|
||||
run(&mut s, "solid.box", json!({"length": 100, "width": 60, "height": 2.5}));
|
||||
let before = s.doc.to_json();
|
||||
for (command, params) in [
|
||||
("sheet.flange", json!({"type": "edge", "edges": [[50, 0, 2.5]], "height": 15})),
|
||||
("sheet.flat_pattern", json!({})),
|
||||
("sheet.export_dxf", json!({"per_body": true})),
|
||||
] {
|
||||
let error = s.execute(command, ¶ms).unwrap_err();
|
||||
let crate::EngineError::BadParams { cmd, msg } = error else { panic!("{error}") };
|
||||
assert_eq!(cmd, command);
|
||||
assert_eq!(
|
||||
msg,
|
||||
"there is no sheet metal body: start one with Flange > Base, or turn a plate into sheet metal with Convert to Sheet Metal (pick its large flat face)"
|
||||
);
|
||||
assert_eq!(s.doc.to_json(), before);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn side_edge_flanges_across_a_bend_keep_their_relief_through_rebuild_and_reopen() {
|
||||
use solidcraft_geom::Vec3;
|
||||
|
||||
Reference in New Issue
Block a user