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 <[email protected]> Claude-Session: https://claude.ai/code/session_01RjGw4gA5ZvKrU8MQP6sBgT --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
27415e4dd7
commit
296683229d
464 files changed
+3408
-2956
No files matched your search
@@ -1,5 +1,5 @@
|
||||
use super::*;
|
||||
use solvecraft_kernel::BooleanStrategy;
|
||||
use solidcraft_kernel::BooleanStrategy;
|
||||
|
||||
#[test]
|
||||
fn boolean_retry_warning_and_details_survive_cache_undo_and_reopen() {
|
||||
@@ -41,7 +41,7 @@ fn boolean_retry_warning_and_details_survive_cache_undo_and_reopen() {
|
||||
run(&mut session, "edit.undo", json!({}));
|
||||
run(&mut session, "edit.redo", json!({}));
|
||||
assert_eq!(check(&session), original);
|
||||
let reopened_doc = solvecraft_doc::Document::from_json(&session.doc.to_json()).unwrap();
|
||||
let reopened_doc = solidcraft_doc::Document::from_json(&session.doc.to_json()).unwrap();
|
||||
let reopened = Session::new(reopened_doc);
|
||||
assert_eq!(check(&reopened), original);
|
||||
// A later independent feature must not inherit the earlier retry's warning.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use super::*;
|
||||
use solvecraft_doc::{Document, FeatureKind, MeshData};
|
||||
use solvecraft_geom::Vec3;
|
||||
use solidcraft_doc::{Document, FeatureKind, MeshData};
|
||||
use solidcraft_geom::Vec3;
|
||||
|
||||
fn imported_box() -> Session {
|
||||
let body = solvecraft_kernel::box_solid(Vec3::ZERO, Vec3::new(10., 20., 30.)).unwrap();
|
||||
let body = solidcraft_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(
|
||||
@@ -78,7 +78,7 @@ fn exported_binary_stl_with_a_bore_reconstructs_analytic_faces() {
|
||||
run(&mut s, "sketch.circle.center", json!({"center":[10,10],"radius":4}));
|
||||
run(&mut s, "sketch.finish", json!({}));
|
||||
run(&mut s, "solid.extrude", json!({"sketch":"Section","profiles":[{"point":[30,10]}],"distance":15,"body_name":"Bracket"}));
|
||||
let path = std::env::temp_dir().join(format!("solvecraft-mesh-convert-{}.stl", std::process::id()));
|
||||
let path = std::env::temp_dir().join(format!("solidcraft-mesh-convert-{}.stl", std::process::id()));
|
||||
run(&mut s, "file.save_mesh", json!({"path":path}));
|
||||
run(&mut s, "doc.open", json!({"path":path}));
|
||||
let name = s.model.state().bodies[0].name.clone();
|
||||
@@ -87,7 +87,7 @@ fn exported_binary_stl_with_a_bore_reconstructs_analytic_faces() {
|
||||
let body = &state.bodies[0].body;
|
||||
assert!(!body.is_mesh());
|
||||
assert!(body.validity().is_empty());
|
||||
assert_eq!(solvecraft_kernel::measure(body).unwrap().merged.face_types.get("cylinder"), Some(&1));
|
||||
assert_eq!(solidcraft_kernel::measure(body).unwrap().merged.face_types.get("cylinder"), Some(&1));
|
||||
assert_eq!(body.faces(0.01).unwrap().len(), 10);
|
||||
std::fs::remove_file(path).unwrap();
|
||||
}
|
||||
@@ -9,7 +9,7 @@ use crate::*;
|
||||
|
||||
fn min_x(s: &Session, body: &str) -> f64 {
|
||||
let b = s.model.state().body(body).map(|b| b.body.clone()).unwrap();
|
||||
solvecraft_kernel::measure(&b).unwrap().bbox.min.x
|
||||
solidcraft_kernel::measure(&b).unwrap().bbox.min.x
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -9,7 +9,7 @@ use crate::*;
|
||||
|
||||
fn bbox(s: &Session, body: &str) -> ([f64; 3], [f64; 3]) {
|
||||
let b = s.model.state().body(body).map(|b| b.body.clone()).unwrap();
|
||||
let m = solvecraft_kernel::measure(&b).unwrap();
|
||||
let m = solidcraft_kernel::measure(&b).unwrap();
|
||||
([m.bbox.min.x, m.bbox.min.y, m.bbox.min.z], [m.bbox.max.x, m.bbox.max.y, m.bbox.max.z])
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ fn cylinder_base_expressions_follow_parameters() {
|
||||
// And it survives a save and reopen.
|
||||
let text = s.doc.to_json();
|
||||
assert!(text.contains("basin_width/2"), "{text}");
|
||||
let s2 = Session::new(solvecraft_doc::Document::from_json(&text).unwrap());
|
||||
let s2 = Session::new(solidcraft_doc::Document::from_json(&text).unwrap());
|
||||
let (lo, _) = bbox(&s2, "Pin");
|
||||
assert!(near(lo, [25.0, 5.0, -2.0]), "{lo:?}");
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! Cases found by the robustness runs (`solvecraft-cli fuzz`, docs/robustness.md), cut down to
|
||||
//! Cases found by the robustness runs (`solidcraft-cli fuzz`, docs/robustness.md), cut down to
|
||||
//! the steps that matter, and a fixed set of seeds that must keep running clean.
|
||||
|
||||
use std::f64::consts::PI;
|
||||
@@ -114,7 +114,7 @@ fn samples_build_without_panics() {
|
||||
}
|
||||
|
||||
fn total_volume(s: &Session) -> f64 {
|
||||
s.model.state().bodies.iter().map(|b| solvecraft_kernel::measure(&b.body).map(|m| m.volume).unwrap_or(0.0)).sum()
|
||||
s.model.state().bodies.iter().map(|b| solidcraft_kernel::measure(&b.body).map(|m| m.volume).unwrap_or(0.0)).sum()
|
||||
}
|
||||
|
||||
/// Volume of a box L×W×H with its vertical edges rounded (R) and its bottom loop filleted
|
||||
|
||||
@@ -63,9 +63,9 @@ fn positive_extrude_from_xz_goes_plus_y() {
|
||||
|
||||
#[test]
|
||||
fn format_5_xz_design_opens_where_it_was_saved() {
|
||||
let dir = std::env::temp_dir().join(format!("solvecraft-xz78-{}", std::process::id()));
|
||||
let dir = std::env::temp_dir().join(format!("solidcraft-xz78-{}", std::process::id()));
|
||||
std::fs::create_dir_all(&dir).unwrap();
|
||||
let path = dir.join("old-xz.solvecraft");
|
||||
let path = dir.join("old-xz.solidcraft");
|
||||
let mut s = Session::default();
|
||||
build(&mut s);
|
||||
run(&mut s, "file.save_as", json!({"path": path.to_string_lossy()}));
|
||||
@@ -73,7 +73,7 @@ fn format_5_xz_design_opens_where_it_was_saved() {
|
||||
// normal −Y), which is what a build before format 6 wrote and evaluated.
|
||||
let mut v: Value = serde_json::from_str(&std::fs::read_to_string(&path).unwrap()).unwrap();
|
||||
assert!(v.to_string().contains("\"XZ\""), "the saved design names the XZ plane");
|
||||
v["format"] = Value::from("solvecraft/5");
|
||||
v["format"] = Value::from("solidcraft/5");
|
||||
std::fs::write(&path, v.to_string()).unwrap();
|
||||
|
||||
let mut old = Session::default();
|
||||
@@ -86,10 +86,10 @@ fn format_5_xz_design_opens_where_it_was_saved() {
|
||||
expect(&bodies(&mut old), &want);
|
||||
|
||||
// Saving the migrated design writes the current format and keeps the geometry.
|
||||
let resaved = dir.join("resaved.solvecraft");
|
||||
let resaved = dir.join("resaved.solidcraft");
|
||||
run(&mut old, "file.save_as", json!({"path": resaved.to_string_lossy()}));
|
||||
let text = std::fs::read_to_string(&resaved).unwrap();
|
||||
assert!(text.contains(&format!("\"solvecraft/{}\"", solvecraft_doc::format::FORMAT)), "resaved at the current format");
|
||||
assert!(text.contains(&format!("\"solidcraft/{}\"", solidcraft_doc::format::FORMAT)), "resaved at the current format");
|
||||
let mut again = Session::default();
|
||||
run(&mut again, "doc.open", json!({"path": resaved.to_string_lossy()}));
|
||||
expect(&bodies(&mut again), &want);
|
||||
|
||||
Reference in new issue
Block a user