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
@@ -7,7 +7,7 @@ use std::cell::{Cell, RefCell};
|
||||
|
||||
use egui::{Pos2, Stroke};
|
||||
use serde_json::{Value, json};
|
||||
use solvecraft_engine::geom::{Vec2, Vec3};
|
||||
use solidcraft_engine::geom::{Vec2, Vec3};
|
||||
|
||||
use crate::SolveApp;
|
||||
use crate::tools::{Kind, Tool};
|
||||
@@ -55,9 +55,9 @@ const ALSO_IN: &[(&str, &str, &str)] = &[
|
||||
pub fn also_in<'a>(
|
||||
tab: &str,
|
||||
panel: &str,
|
||||
mut cmds: Vec<&'a solvecraft_engine::CommandSpec>,
|
||||
specs: &[&'a solvecraft_engine::CommandSpec],
|
||||
) -> Vec<&'a solvecraft_engine::CommandSpec> {
|
||||
mut cmds: Vec<&'a solidcraft_engine::CommandSpec>,
|
||||
specs: &[&'a solidcraft_engine::CommandSpec],
|
||||
) -> Vec<&'a solidcraft_engine::CommandSpec> {
|
||||
for (t, p, id) in ALSO_IN {
|
||||
if *t == tab
|
||||
&& *p == panel
|
||||
@@ -132,7 +132,7 @@ pub fn start_hook(app: &mut SolveApp, id: &str) -> bool {
|
||||
return false;
|
||||
}
|
||||
// Surface analyses toggle: a second click turns the same one off.
|
||||
use solvecraft_engine::SurfaceAnalysis as A;
|
||||
use solidcraft_engine::SurfaceAnalysis as A;
|
||||
let same = match (id, app.session.analysis) {
|
||||
("inspect.zebra", Some(A::Zebra { .. })) => Some(true),
|
||||
("inspect.draft", Some(A::Draft { .. })) => Some(true),
|
||||
@@ -201,8 +201,8 @@ fn combs(app: &SolveApp, painter: &egui::Painter, proj: &Proj) {
|
||||
pub fn refine_snap(
|
||||
app: &SolveApp,
|
||||
proj: &Proj,
|
||||
sk: &solvecraft_engine::sketch::Sketch,
|
||||
plane: &solvecraft_engine::geom::Plane,
|
||||
sk: &solidcraft_engine::sketch::Sketch,
|
||||
plane: &solidcraft_engine::geom::Plane,
|
||||
lp: Vec2,
|
||||
) -> Option<(Vec2, Option<String>)> {
|
||||
crate::inference::clear();
|
||||
@@ -220,8 +220,8 @@ pub fn refine_snap(
|
||||
let mut best: Option<(f64, &'static str, Vec2)> = None;
|
||||
let mut mid_of: Option<String> = None;
|
||||
for (i, c) in sk.curves.iter().enumerate() {
|
||||
if let solvecraft_engine::sketch::CurveKind::Line { .. } = c.kind
|
||||
&& let Some(solvecraft_engine::sketch::Shape::Line { a, b }) = sk.shape(i)
|
||||
if let solidcraft_engine::sketch::CurveKind::Line { .. } = c.kind
|
||||
&& let Some(solidcraft_engine::sketch::Shape::Line { a, b }) = sk.shape(i)
|
||||
{
|
||||
let m = (a + b) * 0.5;
|
||||
let d = m.dist(lp);
|
||||
@@ -267,7 +267,7 @@ pub fn refine_snap(
|
||||
{
|
||||
let (dx, dy) = ((lp.x - prev.x).abs(), (lp.y - prev.y).abs());
|
||||
// The free coordinate still follows the grid.
|
||||
let step = solvecraft_engine::view::grid_step(app.cam.half_height()).0 / 10.0;
|
||||
let step = solidcraft_engine::view::grid_step(app.cam.half_height()).0 / 10.0;
|
||||
let g = |v: f64| (v / step).round() * step;
|
||||
if dy < tol && dx > tol {
|
||||
best = Some((dy, "H", Vec2::new(g(lp.x), prev.y)));
|
||||
@@ -372,7 +372,7 @@ fn mode(id: &str) -> Option<Mode> {
|
||||
/// A tool for one of the extra sketch commands.
|
||||
pub fn tool_for(id: &str) -> Option<Tool> {
|
||||
mode(id)?;
|
||||
let spec = solvecraft_engine::find_command(id)?;
|
||||
let spec = solidcraft_engine::find_command(id)?;
|
||||
Some(Tool {
|
||||
cmd: spec.id,
|
||||
kind: Kind::Ext,
|
||||
@@ -490,8 +490,8 @@ pub(super) fn corner_point(app: &SolveApp, proj: &Proj, pos: Pos2, cmd: &str) ->
|
||||
.collect();
|
||||
if curves.len() != 2
|
||||
|| curves.iter().any(|(_, c)| {
|
||||
!matches!(c.kind, solvecraft_engine::sketch::CurveKind::Line { .. })
|
||||
&& (cmd != "sketch.fillet" || !matches!(c.kind, solvecraft_engine::sketch::CurveKind::Arc { .. }))
|
||||
!matches!(c.kind, solidcraft_engine::sketch::CurveKind::Line { .. })
|
||||
&& (cmd != "sketch.fillet" || !matches!(c.kind, solidcraft_engine::sketch::CurveKind::Arc { .. }))
|
||||
})
|
||||
{
|
||||
return None;
|
||||
@@ -529,7 +529,7 @@ fn corner_len(app: &SolveApp, point: &str) -> f64 {
|
||||
sk.curves
|
||||
.iter()
|
||||
.enumerate()
|
||||
.filter(|(_, c)| c.kind.uses(q) && matches!(c.kind, solvecraft_engine::sketch::CurveKind::Line { .. }))
|
||||
.filter(|(_, c)| c.kind.uses(q) && matches!(c.kind, solidcraft_engine::sketch::CurveKind::Line { .. }))
|
||||
.map(|(i, _)| sk.polyline(i).windows(2).map(|w| w[0].dist(w[1])).sum::<f64>())
|
||||
.fold(f64::INFINITY, f64::min)
|
||||
.min(1e6)
|
||||
@@ -988,7 +988,7 @@ pub fn preview(app: &SolveApp, t: &Tool, painter: &egui::Painter, proj: &Proj) {
|
||||
crate::tools::paint_preview_curve(&curve, &ss.plane, painter, proj, stroke);
|
||||
}
|
||||
// Picked curves highlighted.
|
||||
let mut display_budget = solvecraft_engine::render::SamplingBudget::new(32_768, 65_536);
|
||||
let mut display_budget = solidcraft_engine::render::SamplingBudget::new(32_768, 65_536);
|
||||
for id in t.picks.iter().filter(|x| *x != "|") {
|
||||
if let Some(ci) = ss.sketch.curve_index(id) {
|
||||
crate::tools::paint_curve(&ss.sketch, ci, &ss.plane, painter, proj, Stroke::new(3.0, tk.accent.gamma_multiply(0.7)), &mut display_budget);
|
||||
@@ -1060,7 +1060,7 @@ fn glyphs(app: &SolveApp, painter: &egui::Painter, proj: &Proj, hover: Option<Po
|
||||
&& let Some(c) = ss.sketch.constraints.iter().find(|c| &c.id == id)
|
||||
{
|
||||
let (cs, ps) = constraint_entities(&c.kind);
|
||||
let mut display_budget = solvecraft_engine::render::SamplingBudget::new(32_768, 65_536);
|
||||
let mut display_budget = solidcraft_engine::render::SamplingBudget::new(32_768, 65_536);
|
||||
for ci in cs {
|
||||
crate::tools::paint_curve(&ss.sketch, ci, &ss.plane, painter, proj, Stroke::new(3.0, tk.accent.gamma_multiply(0.7)), &mut display_budget);
|
||||
}
|
||||
@@ -1075,7 +1075,7 @@ fn glyphs(app: &SolveApp, painter: &egui::Painter, proj: &Proj, hover: Option<Po
|
||||
let Some(c) = ss.sketch.constraints.iter().find(|c| &c.id == id) else { continue };
|
||||
let failing = ss.report.failing.contains(id);
|
||||
let selected = picked.as_deref() == Some(id.as_str())
|
||||
|| app.session.selection.iter().any(|s| matches!(s, solvecraft_engine::Sel::SketchConstraint { id: x } if x == id));
|
||||
|| app.session.selection.iter().any(|s| matches!(s, solidcraft_engine::Sel::SketchConstraint { id: x } if x == id));
|
||||
let lit = selected || hovered.as_deref() == Some(id.as_str());
|
||||
let col = if failing {
|
||||
tk.error
|
||||
@@ -1130,8 +1130,8 @@ fn glyph_icon(name: &str) -> Option<&'static str> {
|
||||
}
|
||||
|
||||
/// The curves and points a constraint ties together.
|
||||
fn constraint_entities(k: &solvecraft_engine::sketch::ConstraintKind) -> (Vec<usize>, Vec<usize>) {
|
||||
use solvecraft_engine::sketch::ConstraintKind::*;
|
||||
fn constraint_entities(k: &solidcraft_engine::sketch::ConstraintKind) -> (Vec<usize>, Vec<usize>) {
|
||||
use solidcraft_engine::sketch::ConstraintKind::*;
|
||||
match *k {
|
||||
Coincident { p, q } | HorizontalPoints { p, q } | VerticalPoints { p, q } => (vec![], vec![p, q]),
|
||||
Fix { p } => (vec![], vec![p]),
|
||||
@@ -1160,8 +1160,8 @@ fn glyph_letter(name: &str) -> &'static str {
|
||||
|
||||
/// Where a constraint's glyphs go: one per entity (the middle of a curve, with its direction
|
||||
/// there; a point, without).
|
||||
fn glyph_anchors(sk: &solvecraft_engine::sketch::Sketch, k: &solvecraft_engine::sketch::ConstraintKind) -> Vec<(Vec2, Option<Vec2>)> {
|
||||
use solvecraft_engine::sketch::ConstraintKind::*;
|
||||
fn glyph_anchors(sk: &solidcraft_engine::sketch::Sketch, k: &solidcraft_engine::sketch::ConstraintKind) -> Vec<(Vec2, Option<Vec2>)> {
|
||||
use solidcraft_engine::sketch::ConstraintKind::*;
|
||||
// Half way along the curve, and the direction there.
|
||||
let mid = |c: usize| -> Option<(Vec2, Option<Vec2>)> {
|
||||
let poly = sk.polyline(c);
|
||||
|
||||
Reference in new issue
Block a user