Rename SolveCraft to SolidCraft everywhere, with compatibility shims (#389)
* WIP deep rename (not for push) * WIP2 * WIP3 * WIP4 wxs fix * rustfmt * Rename the remaining identifiers in merged crash-report code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RjGw4gA5ZvKrU8MQP6sBgT --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
27415e4dd7
commit
296683229d
464 files changed
+3408
-2956
No files matched your search
@@ -1,8 +1,8 @@
|
||||
//! Coincident accepts clicked line bodies as well as explicit sketch points.
|
||||
|
||||
use serde_json::json;
|
||||
use solvecraft_engine::sketch::ConstraintKind;
|
||||
use solvecraft_ui_egui::scenario::Harness;
|
||||
use solidcraft_engine::sketch::ConstraintKind;
|
||||
use solidcraft_ui_egui::scenario::Harness;
|
||||
|
||||
fn setup() -> Harness {
|
||||
let mut h = Harness::new();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//! Constraint tools accept a selected curve pair as well as tool-first clicks.
|
||||
|
||||
use serde_json::json;
|
||||
use solvecraft_engine::{Sel, sketch::ConstraintKind};
|
||||
use solvecraft_ui_egui::scenario::Harness;
|
||||
use solidcraft_engine::{Sel, sketch::ConstraintKind};
|
||||
use solidcraft_ui_egui::scenario::Harness;
|
||||
|
||||
fn lines() -> Harness {
|
||||
let mut h = Harness::new();
|
||||
@@ -170,7 +170,7 @@ fn curvature_polygon_and_fix_consume_clicked_operands_atomically() {
|
||||
};
|
||||
h.call("ui.view", json!({"view":"top"}));
|
||||
h.app.cam.distance = 80.0;
|
||||
h.app.cam.target = solvecraft_engine::geom::Vec3::new(30.0, 15.0, 0.0);
|
||||
h.app.cam.target = solidcraft_engine::geom::Vec3::new(30.0, 15.0, 0.0);
|
||||
h.settle();
|
||||
for (i, p) in picks.iter().enumerate() {
|
||||
h.step(&json!({"click":{"sketch":p},"shift":i>0})).unwrap();
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
use serde_json::json;
|
||||
use solvecraft_engine::doc::{Document, FeatureKind, MeshData};
|
||||
use solvecraft_engine::geom::Vec3;
|
||||
use solvecraft_engine::{Sel, Session};
|
||||
use solvecraft_ui_egui::scenario::Harness;
|
||||
use solidcraft_engine::doc::{Document, FeatureKind, MeshData};
|
||||
use solidcraft_engine::geom::Vec3;
|
||||
use solidcraft_engine::{Sel, Session};
|
||||
use solidcraft_ui_egui::scenario::Harness;
|
||||
|
||||
#[test]
|
||||
fn convert_mesh_uses_preselection_and_reopens_its_timeline_dialog() {
|
||||
let body = solvecraft_engine::kernel::box_solid(Vec3::ZERO, Vec3::new(10., 20., 30.)).unwrap();
|
||||
let body = solidcraft_engine::kernel::box_solid(Vec3::ZERO, Vec3::new(10., 20., 30.)).unwrap();
|
||||
let mesh = body.tessellate(0.01).unwrap();
|
||||
let mut doc = Document::default();
|
||||
doc.add_feature(
|
||||
@@ -36,7 +36,7 @@ fn convert_mesh_uses_preselection_and_reopens_its_timeline_dialog() {
|
||||
assert_eq!(response["ok"], true, "{response}");
|
||||
let dialog = h.app.dialog.as_ref().unwrap();
|
||||
assert!(
|
||||
matches!(&dialog.kind,solvecraft_ui_egui::dialogs::Kind::Surface(solvecraft_ui_egui::dialogs_surface::Surf::ConvertMesh { tolerance }) if tolerance=="0.05 mm")
|
||||
matches!(&dialog.kind,solidcraft_ui_egui::dialogs::Kind::Surface(solidcraft_ui_egui::dialogs_surface::Surf::ConvertMesh { tolerance }) if tolerance=="0.05 mm")
|
||||
);
|
||||
assert!(h.app.session.model.state().body("Mesh").unwrap().body.is_mesh());
|
||||
h.step(&json!({"key":"Escape"})).unwrap();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Enter submits only the focused Parameters editor row.
|
||||
use egui::{Event, Key, Modifiers};
|
||||
use serde_json::json;
|
||||
use solvecraft_ui_egui::scenario::Harness;
|
||||
use solidcraft_ui_egui::scenario::Harness;
|
||||
|
||||
fn open() -> Harness {
|
||||
let mut h = Harness::new();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//! Horizontal/Vertical accepts either one line or two distinct sketch points.
|
||||
|
||||
use serde_json::json;
|
||||
use solvecraft_engine::sketch::ConstraintKind;
|
||||
use solvecraft_ui_egui::scenario::Harness;
|
||||
use solidcraft_engine::sketch::ConstraintKind;
|
||||
use solidcraft_ui_egui::scenario::Harness;
|
||||
|
||||
#[test]
|
||||
fn horizontal_vertical_uses_preselected_line_and_preserves_rejection() {
|
||||
@@ -42,7 +42,7 @@ fn horizontal_vertical_uses_preselected_line_and_preserves_rejection() {
|
||||
|
||||
#[test]
|
||||
fn horizontal_vertical_leaves_ambiguous_preselection_to_pick_tool() {
|
||||
use solvecraft_engine::Sel;
|
||||
use solidcraft_engine::Sel;
|
||||
for selection in [
|
||||
vec![Sel::SketchPoint { id: "origin".into() }],
|
||||
vec![Sel::SketchPoint { id: "origin".into() }, Sel::SketchCurve { id: "c1".into() }],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use serde_json::json;
|
||||
use solvecraft_engine::{Sel, sketch::ConstraintKind};
|
||||
use solvecraft_ui_egui::scenario::Harness;
|
||||
use solidcraft_engine::{Sel, sketch::ConstraintKind};
|
||||
use solidcraft_ui_egui::scenario::Harness;
|
||||
|
||||
fn setup() -> Harness {
|
||||
let mut h = Harness::new();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use serde_json::json;
|
||||
use solvecraft_engine::Sel;
|
||||
use solvecraft_ui_egui::scenario::Harness;
|
||||
use solidcraft_engine::Sel;
|
||||
use solidcraft_ui_egui::scenario::Harness;
|
||||
|
||||
fn setup() -> (Harness, u64) {
|
||||
let mut h = Harness::new();
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
//! User scenarios in the real UI, headless (see `solvecraft_ui_egui::scenario`). Each JSON file
|
||||
//! User scenarios in the real UI, headless (see `solidcraft_ui_egui::scenario`). Each JSON file
|
||||
//! under `tests/scenarios/` is one workflow done with clicks, keys and drags, and one test here:
|
||||
//! `build.rs` makes a test per file, named after it. A scenario waiting for a fix starts with a
|
||||
//! `{"pending": "why"}` step (its test is ignored with that reason). Adding a scenario is adding
|
||||
//! its file.
|
||||
|
||||
use solvecraft_ui_egui::scenario::Harness;
|
||||
use solidcraft_ui_egui::scenario::Harness;
|
||||
|
||||
fn run(name: &str) {
|
||||
let path = format!("{}/tests/scenarios/{name}.json", env!("CARGO_MANIFEST_DIR"));
|
||||
@@ -18,12 +18,12 @@ fn run(name: &str) {
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/scenario_tests.rs"));
|
||||
|
||||
/// A scenario file named by `SOLVECRAFT_SCENARIO_FILE` (for trying one out):
|
||||
/// `SOLVECRAFT_SCENARIO_FILE=x.json cargo test --test scenarios adhoc -- --ignored --nocapture`.
|
||||
/// A scenario file named by `SOLIDCRAFT_SCENARIO_FILE` (for trying one out):
|
||||
/// `SOLIDCRAFT_SCENARIO_FILE=x.json cargo test --test scenarios adhoc -- --ignored --nocapture`.
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn adhoc() {
|
||||
let Ok(path) = std::env::var("SOLVECRAFT_SCENARIO_FILE") else { return };
|
||||
let Ok(path) = solidcraft_engine::geom::env::var("SCENARIO_FILE").ok_or(()) else { return };
|
||||
let text = std::fs::read_to_string(&path).unwrap_or_else(|e| panic!("{path}: {e}"));
|
||||
let steps: serde_json::Value = serde_json::from_str(&text).unwrap_or_else(|e| panic!("{path}: {e}"));
|
||||
let mut h = Harness::new();
|
||||
@@ -62,7 +62,7 @@ fn angle_dimension_both_interactive_workflows() {
|
||||
]))
|
||||
.unwrap();
|
||||
let sk = &h.app.session.model.state().sketches[0].sketch;
|
||||
assert!(sk.constraints.iter().any(|c| matches!(c.kind, solvecraft_engine::sketch::ConstraintKind::Angle { .. })));
|
||||
assert!(sk.constraints.iter().any(|c| matches!(c.kind, solidcraft_engine::sketch::ConstraintKind::Angle { .. })));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ fn angle_dimension_both_interactive_workflows() {
|
||||
fn home_tab_and_file_recent_open_designs() {
|
||||
use serde_json::json;
|
||||
let mut h = Harness::new();
|
||||
let path = h.dir.join("recent.solvecraft").to_string_lossy().into_owned();
|
||||
let path = h.dir.join("recent.solidcraft").to_string_lossy().into_owned();
|
||||
h.run(&json!([
|
||||
{"call":"engine.execute","params":{"command":"solid.box","params":{"length":10,"width":10,"height":10}}},
|
||||
{"call":"engine.execute","params":{"command":"file.save_as","params":{"path":path}}},
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
"params": {
|
||||
"command": "file.save_as",
|
||||
"params": {
|
||||
"path": "$DIR/enclosure.solvecraft"
|
||||
"path": "$DIR/enclosure.solidcraft"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -165,7 +165,7 @@
|
||||
"params": {
|
||||
"command": "doc.open",
|
||||
"params": {
|
||||
"path": "$DIR/enclosure.solvecraft"
|
||||
"path": "$DIR/enclosure.solidcraft"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
{"widget": "Close window"},
|
||||
{"expect": {"param": {"width": 100}, "errors": 0}},
|
||||
{"key": "S", "cmd": true},
|
||||
{"expect": {"file": "Sample Plate.solvecraft"}},
|
||||
{"expect": {"file": "Sample Plate.solidcraft"}},
|
||||
{"key": "N", "cmd": true},
|
||||
{"expect": {"bodies": 0}},
|
||||
{"choose_file": "Sample Plate.solvecraft"},
|
||||
{"choose_file": "Sample Plate.solidcraft"},
|
||||
{"key": "O", "cmd": true},
|
||||
{"until": {"file_busy": false}},
|
||||
{"debug": 1},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[
|
||||
{
|
||||
"note": "Target: sheet metal plate folded along a sketch line (sheet.fold, solvecraft-params; dialog by solvecraft-dialogs). Adjust the dialog steps when it lands."
|
||||
"note": "Target: sheet metal plate folded along a sketch line (sheet.fold, solidcraft-params; dialog by solidcraft-dialogs). Adjust the dialog steps when it lands."
|
||||
},
|
||||
{
|
||||
"call": "ui.set",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[
|
||||
{
|
||||
"note": "User bug 1 (owner solvecraft-sketch): Create Sketch on a body face projects the face's loops as reference geometry (linked), with no big square of real lines, and the face stays pickable for Project."
|
||||
"note": "User bug 1 (owner solidcraft-sketch): Create Sketch on a body face projects the face's loops as reference geometry (linked), with no big square of real lines, and the face stays pickable for Project."
|
||||
},
|
||||
{
|
||||
"start": "sketch.create"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[
|
||||
{
|
||||
"note": "User bug 2 (owner solvecraft-params): with two components, a cut made in the active one leaves the other untouched."
|
||||
"note": "User bug 2 (owner solidcraft-params): with two components, a cut made in the active one leaves the other untouched."
|
||||
},
|
||||
{
|
||||
"start": "component.create"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[
|
||||
{"note": "User bug 3 (owner solvecraft-ui): Move opens at 0, and dragging its X arrow moves only along X. The X arrow must be published as handle move_x (scenario::publish_handle)."},
|
||||
{"note": "User bug 3 (owner solidcraft-ui): Move opens at 0, and dragging its X arrow moves only along X. The X arrow must be published as handle move_x (scenario::publish_handle)."},
|
||||
{"start": "sketch.create"},
|
||||
{"click": {"plane": "XY"}},
|
||||
{"start": "sketch.rectangle.two_point"},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[
|
||||
{
|
||||
"note": "User bug 4 (owner solvecraft-repo): moving a component carries its sketches, and a sketch on a body face follows the body."
|
||||
"note": "User bug 4 (owner solidcraft-repo): moving a component carries its sketches, and a sketch on a body face follows the body."
|
||||
},
|
||||
{
|
||||
"start": "component.create"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
//! Layout checks over every toolbar command, headless (see `solvecraft_ui_egui::scenario`):
|
||||
//! Layout checks over every toolbar command, headless (see `solidcraft_ui_egui::scenario`):
|
||||
//! each command's dialog opens docked at the viewport's right within its width limits, and
|
||||
//! every window it opens fits on screen.
|
||||
|
||||
use serde_json::{Value, json};
|
||||
use solvecraft_ui_egui::scenario::{Harness, check};
|
||||
use solidcraft_ui_egui::scenario::{Harness, check};
|
||||
|
||||
/// A box body (its sketch finished) to give feature dialogs something to work on.
|
||||
fn harness() -> Harness {
|
||||
@@ -21,11 +21,11 @@ fn harness() -> Harness {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore = "pending: the exploded view dialog opens 635 px wide (solvecraft-ui)"]
|
||||
#[ignore = "pending: the exploded view dialog opens 635 px wide (solidcraft-ui)"]
|
||||
fn every_dialog_opens_docked_within_its_width_limits() {
|
||||
let mut bad = Vec::new();
|
||||
let mut seen = 0;
|
||||
for spec in solvecraft_engine::command_specs() {
|
||||
for spec in solidcraft_engine::command_specs() {
|
||||
if spec.tab.is_empty() || spec.tab == "SKETCH" {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
//! through the control channel (the toolbar's way) and measured as drawn.
|
||||
|
||||
use serde_json::json;
|
||||
use solvecraft_ui_egui::frame::{DIALOG_MAX_W, DIALOG_MIN_W, DIALOG_WIDE_MAX_W, WINDOW_WIDE_MAX_W};
|
||||
use solvecraft_ui_egui::scenario::Harness;
|
||||
use solidcraft_ui_egui::frame::{DIALOG_MAX_W, DIALOG_MIN_W, DIALOG_WIDE_MAX_W, WINDOW_WIDE_MAX_W};
|
||||
use solidcraft_ui_egui::scenario::Harness;
|
||||
|
||||
/// Widths of the windows on screen (their areas in the middle layer).
|
||||
fn window_widths(h: &Harness) -> Vec<(String, f32)> {
|
||||
@@ -30,7 +30,7 @@ fn command_dialogs_shrink_to_their_content_within_limits() {
|
||||
let mut bad = Vec::new();
|
||||
// The frame border and shadow add a little to the content limits.
|
||||
let slack = 4.0;
|
||||
for spec in solvecraft_engine::command_specs() {
|
||||
for spec in solidcraft_engine::command_specs() {
|
||||
h.call("ui.start", json!({"command": spec.id}));
|
||||
h.frames(4);
|
||||
let wide = h.app.dialog.as_ref().is_some_and(|d| d.is_wide());
|
||||
@@ -82,7 +82,7 @@ fn floating_windows_stay_within_limits() {
|
||||
h.app.keymap.open = true;
|
||||
h.app.help.about = true;
|
||||
h.app.ui.palette_open = true;
|
||||
solvecraft_ui_egui::params_dialog::open(&mut h.app);
|
||||
solidcraft_ui_egui::params_dialog::open(&mut h.app);
|
||||
h.frames(6);
|
||||
let ws = window_widths(&h);
|
||||
// Keyboard Shortcuts is a page of Preferences (one window, #36).
|
||||
|
||||
Reference in new issue
Block a user