Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
93c57e6
Restore b10 state
claude Oct 20, 2026
fe63288
Application menu with large icons; Save As/Import/Export icons; TEXT …
luminatiguy Oct 20, 2026
b935527
Text style in Properties (multi-select); arrowhead pictures in arrow …
luminatiguy Oct 21, 2026
95393e0
b13: hatch background colour, SHX Hebrew detection, viewport view tar…
claude Oct 22, 2026
152ef08
fonts: Hebrew code page test with full-size fonts
claude Oct 22, 2026
0cd9f63
b14: TrueType glyphs fill non-zero, editor in drawing fonts, RECTANG …
claude Oct 22, 2026
c8f5247
WIP b15: properties scroll lists, layout fit, recent previews, text j…
claude Oct 23, 2026
57f68a8
doc: text formula field
claude Oct 23, 2026
6922915
b15: text formulas and AutoCAD date fields, completion, help, UPDATEF…
claude Oct 23, 2026
baecf64
b15: clippy fixes, notes
claude Oct 23, 2026
b5a9b7b
b15: clippy
claude Oct 23, 2026
59289e0
b16: editor select-all/undo/redo/I-beam; formulas in dimensions, lead…
claude Oct 23, 2026
c49f0c8
b16: command history on hover, tool descriptions in tooltips
claude Oct 23, 2026
d86a252
b16: TRIM/EXTEND hover glow, TRIM on hatch areas
claude Oct 23, 2026
d0b9b2a
b16: dimension style previews use the drawing's arrow blocks, text st…
claude Oct 23, 2026
6d117f9
b16: WHATS_NEW, text editing test opens selected
claude Oct 23, 2026
6d7f91a
b17: HATCH pick points near the view with boundary warnings, select o…
claude Oct 24, 2026
4df9e7b
b17: trim looks for cutting edges around the object only
claude Oct 24, 2026
210e27f
Merge upstream main into the AutoCAD-parity work
claude Oct 24, 2026
50b9cfc
Hebrew text in the command line and Properties fields reads in readin…
claude Oct 24, 2026
759bf93
Russian interface translations, tool descriptions for the constraint …
claude Oct 24, 2026
e3ded3f
Fix the six major CodeRabbit review findings
claude Oct 24, 2026
f98e811
Merge upstream main (egui 0.37, new PDF writer) into the AutoCAD-pari…
claude Oct 25, 2026
e3b81d3
Fix the nine findings of FredApps' review (#2034)
claude Oct 25, 2026
0d682be
Merge upstream main (startup update prompt) into the AutoCAD-parity work
claude Oct 25, 2026
b1702e4
Merge upstream main (dock columns, native panel windows) into the Aut…
claude Oct 26, 2026
517f716
Fix FredApps' second review and CodeRabbit's remaining findings (#2034)
claude Oct 26, 2026
bb1e266
Merge upstream main (module split #2220) into autocad-parity
claude Oct 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ accessible labels and keyboard focus. CADCraft keeps its multicolor icon painter
disabled tint and tool commands. The native host saves workspace visibility and toolset choices
atomically; `CADCRAFT_CONFIG_DIR` selects an isolated profile. Compact toolbar groups move into a
More menu, and status readouts truncate with a full-value tooltip before they reach layout tabs.
The Tool Bar docks at the top (a row of buttons) or on the left edge (a column): drag its handle,
right-click it, or use **Window ▸ Tool Bar Position**. Drag a button along the bar to reorder it,
right-click it to remove it, right-click any Tool Sets button to add it, or pick commands in
**Window ▸ Customize Tool Bar...**. Every button's tooltip names the tool, its command, alias and
shortcut; the bar's position and buttons are saved with the workspace.
Painted toolbar and tab controls
have accessible labels and visible keyboard focus. Property controls remain application-specific.

Expand Down
711 changes: 711 additions & 0 deletions WHATS_NEW.md

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions apps/cadcraft-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ fn install_io() {
write: |d, name| cadcraft_io::write(d, name).map_err(|e| e.to_string()),
plot: Some(|d, space, opts| cadcraft_io::plotter::plot(d, space, opts).map_err(|e| e.to_string())),
});
cadcraft_engine::cmd::file::set_plot_style_reader(cadcraft_io::pia::read);
cadcraft_engine::cmd::file::set_plot_book(|items, opts| cadcraft_io::plotter::plot_book(items, opts).map_err(|e| e.to_string()));
cadcraft_engine::cmd::file::set_write_as(|d, name, o| {
cadcraft_io::write_with(d, name, &cadcraft_io::SaveOptions { version: o.version, binary: o.binary }).map_err(|e| e.to_string())
});
Expand Down Expand Up @@ -579,6 +581,9 @@ fn synthetic(n: usize, side: f64) -> Result<cadcraft_engine::doc::Drawing, Strin
plinegen: false,
}),
_ => EntityKind::Text(d::Text {
formula: None,
backwards: false,
upside_down: false,
insert: v3(x, y),
align_pt: None,
height: s * 0.2,
Expand Down
8 changes: 8 additions & 0 deletions apps/cadcraft/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ fn main() {
println!("cargo:rerun-if-changed=../../assets/app-icon/cadcraft.ico");
println!("cargo:rerun-if-env-changed=CADCRAFT_REQUIRE_WINRES");
println!("cargo:rerun-if-env-changed=CADCRAFT_BUILD_SHA");
println!("cargo:rerun-if-env-changed=CADCRAFT_VERSION_LABEL");
if std::env::var("CARGO_CFG_TARGET_OS").as_deref() != Ok("windows") {
return;
}
Expand All @@ -18,6 +19,13 @@ fn main() {
.set("LegalCopyright", "Copyright (c) 2026 ArtCraft Team and the CADCraft contributors. MIT OR Apache-2.0.")
.set("OriginalFilename", "cadcraft.exe")
.set("InternalName", "cadcraft");
// A build's own label (`0.9.0-b3`) in the file's Properties ▸ Details.
if let Ok(label) = std::env::var("CADCRAFT_VERSION_LABEL") {
let label: String = label.chars().filter(|c| c.is_ascii_graphic()).take(40).collect();
if !label.is_empty() {
res.set("ProductVersion", &label).set("FileVersion", &label);
}
}
if let Err(e) = res.compile() {
if std::env::var_os("CADCRAFT_REQUIRE_WINRES").is_some() {
eprintln!("embedding Windows resources failed: {e}");
Expand Down
5 changes: 4 additions & 1 deletion apps/cadcraft/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ pub fn install_io() {
write: |d, name| cadcraft_io::write(d, name).map_err(|e| e.to_string()),
plot: Some(|d, space, opts| cadcraft_io::plotter::plot(d, space, opts).map_err(|e| e.to_string())),
});
cadcraft_engine::cmd::file::set_plot_style_reader(cadcraft_io::pia::read);
cadcraft_engine::cmd::file::set_plot_book(|items, opts| cadcraft_io::plotter::plot_book(items, opts).map_err(|e| e.to_string()));
cadcraft_engine::cmd::file::set_write_as(|d, name, o| {
cadcraft_io::write_with(d, name, &cadcraft_io::SaveOptions { version: o.version, binary: o.binary }).map_err(|e| e.to_string())
});
Expand Down Expand Up @@ -166,6 +168,7 @@ fn services() -> Services {
.save_file()
.map(|p| p.to_string_lossy().to_string())
})),
pick_folder: Some(Box::new(|| rfd::FileDialog::new().pick_folder().map(|p| p.to_string_lossy().to_string()))),
// APPLOAD: AutoLISP routines only, starting where the last one was loaded from.
pick_lisp: Some(Box::new(|dir: &str| {
let dialog = rfd::FileDialog::new().add_filter(i18n::t("AutoLISP (LSP)"), &["lsp"]).add_filter(i18n::t("All files"), &["*"]);
Expand Down Expand Up @@ -228,7 +231,7 @@ fn app_icon() -> Option<egui::IconData> {

fn version_string() -> String {
let sha = option_env!("CADCRAFT_BUILD_SHA").unwrap_or("dev");
format!("cadcraft {} ({sha})", env!("CARGO_PKG_VERSION"))
format!("cadcraft {} ({sha})", cadcraft_ui_egui::VERSION)
}

/// The control port from `--control <port>` or `CADCRAFT_CONTROL_PORT` (`source`); a value that is
Expand Down
33 changes: 33 additions & 0 deletions apps/cadcraft/src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,25 @@ fn snapshot(ui: &UiState) -> Result<Value, String> {
if ui.collapsed_groups.len() > 64 || ui.collapsed_groups.iter().any(|name| name.len() > 256) {
return Err("collapsedGroups exceeds the workspace size limit".into());
}
let bars = [&ui.toolbar_items, &ui.toolsets_bar.items, &ui.layers_bar.items];
if bars.iter().any(|items| items.len() > 256 || items.iter().any(|item| item.len() > 64)) {
return Err("toolbarItems exceeds the workspace size limit".into());
}
if ui.history_lines > 12 {
return Err("historyLines must be between 0 and 12".into());
}
Ok(json!({
"docking": ui.docking,
"dockingVersion": cadcraft_ui_egui::docking::LAYOUT_VERSION,
"showToolsets": ui.show_toolsets,
"toolsetsRibbon": ui.toolsets_ribbon,
"ribbonTab": ui.ribbon_tab,
"showPalettes": ui.show_palettes,
"showToolbar": ui.show_toolbar,
"toolbarDock": ui.toolbar_dock,
"toolbarItems": ui.toolbar_items,
"toolsetsBar": ui.toolsets_bar,
"layersBar": ui.layers_bar,
"showFileTabs": ui.show_file_tabs,
"showStatusBar": ui.show_status_bar,
"showCommandLine": ui.show_command_line,
Expand Down Expand Up @@ -232,6 +242,13 @@ mod tests {
show_command_line: false,
toolset_tab: "Modeling".into(),
collapsed_groups: vec!["Solid".into()],
toolbar_dock: cadcraft_ui_egui::toolbar::Dock::Left,
toolbar_items: vec!["line".into(), "|".into(), "circle".into()],
layers_bar: cadcraft_ui_egui::toolbar::BarState {
show: false,
dock: cadcraft_ui_egui::toolbar::Dock::Left,
items: vec!["layoff".into(), cadcraft_ui_egui::toolbar::LAYER_COMBO.into()],
},
history_lines: 5,
dialog: Some("layers".into()),
start_tab: true,
Expand Down Expand Up @@ -283,6 +300,22 @@ mod tests {
fs::remove_dir_all(directory).unwrap();
}

/// The Tool Sets ribbon and its open tab come back after a restart (#2034 review).
#[test]
fn the_tool_sets_ribbon_and_its_tab_survive_a_restart() {
let directory = temp_dir();
let path = directory.join("workspace.json");
let (mut store, _, _) = Workspace::at(Some(path.clone()));
let ui = UiState { toolsets_ribbon: true, ribbon_tab: "Modify".into(), ..UiState::default() };
store.save_if_changed(&ui, Instant::now()).unwrap();
let (_, reloaded, error) = Workspace::at(Some(path));
assert!(error.is_none(), "{error:?}");
let reloaded = reloaded.unwrap();
assert!(reloaded.toolsets_ribbon);
assert_eq!(reloaded.ribbon_tab, "Modify");
fs::remove_dir_all(directory).unwrap();
}

#[test]
fn split_frame_layout_file_loads_as_the_dock_default_with_its_other_settings() {
use cadcraft_ui_egui::docking::default_workspace;
Expand Down
3 changes: 3 additions & 0 deletions crates/constraints/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@ fn invalid_references_and_purge() {
let t = add_e(
&mut d,
EntityKind::Text(cadcraft_doc::Text {
formula: None,
backwards: false,
upside_down: false,
insert: v(0.0, 0.0),
align_pt: None,
height: 1.0,
Expand Down
9 changes: 8 additions & 1 deletion crates/doc/src/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,14 @@ impl EntityKind {
EntityKind::Dimension(d) => vec![d.p13.xy(), d.p14.xy(), d.defpt.xy(), d.text_mid.xy()],
EntityKind::MLine(m) => m.points(),
EntityKind::Leader(l) => l.vertices.iter().map(|v| v.xy()).collect(),
EntityKind::MLeader(m) => m.leaders.iter().flat_map(|l| l.iter().map(|v| v.xy())).chain(std::iter::once(m.landing.xy())).collect(),
// Leader points, the landing, then the text.
EntityKind::MLeader(m) => m
.leaders
.iter()
.flat_map(|l| l.iter().map(|v| v.xy()))
.chain(std::iter::once(m.landing.xy()))
.chain(m.text.as_ref().map(|t| t.insert.xy()))
.collect(),
EntityKind::Hatch(h) => {
let b = Bounds2::from_points(h.loops.iter().flat_map(|l| l.vertices.iter().map(|v| v.p)));
vec![b.center()]
Expand Down
85 changes: 85 additions & 0 deletions crates/doc/src/entity/dim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ pub struct DimMarks {
/// Inspection frame, label and rate (DIMINSPECT).
#[serde(skip_serializing_if = "Option::is_none")]
pub inspect: Option<Inspection>,
/// A formula for the dimension text (`=<>/2`, `=TEXT(<>,"0.0")&" mm"`; `<>` is the
/// measurement); `Dimension::text` holds the last result.
#[serde(skip_serializing_if = "Option::is_none")]
pub formula: Option<String>,
}

impl DimMarks {
Expand Down Expand Up @@ -203,18 +207,99 @@ pub struct MLeader {
pub style: String,
#[serde(default = "one")]
pub arrow_size: f64,
/// Arrowhead of the leader lines: a DIMBLK-style name (`_DotSmall`, `_Open30`, `_None`…) or a
/// user arrowhead block of the drawing; empty for the style's (closed filled by default).
#[serde(default, skip_serializing_if = "String::is_empty")]
pub arrow: String,
/// Leader lines are smooth curves through their points (leader type Spline). An empty
/// `leaders` is a multileader without a leader line (leader type None).
#[serde(default)]
pub spline: bool,
/// Leader type None set on a multileader that has leader lines: they are kept (to come back
/// with Straight or Spline) but not drawn, nor the landing.
#[serde(default, skip_serializing_if = "std::ops::Not::not")]
pub no_leader: bool,
/// Block content in place of the text: a block reference placed at the landing.
#[serde(default)]
pub block: Option<Insert>,
}

impl MLeader {
/// The grip index of the text (after the leader points and the landing), when it has text.
pub fn text_grip(&self) -> Option<usize> {
self.text.as_ref().map(|_| self.leaders.iter().map(Vec::len).sum::<usize>() + 1)
}

/// The gap between the end of the landing and the text, as placed now (never negative).
fn text_gap(&self) -> f64 {
self.text.as_ref().map_or(0.0, |t| ((t.insert.x - self.landing.x).abs() - self.dogleg).max(0.0))
}

/// The side of the landing the text is on: 1 to the right, -1 to the left.
fn text_side(&self) -> f64 {
match &self.text {
Some(t) if t.insert.x < self.landing.x => -1.0,
_ => 1.0,
}
}

/// Move with Leader: the text goes to `to` and the landing follows it (next to the text,
/// at its height), so the leader runs from its last point to the new landing.
pub fn move_with_leader(&mut self, to: Vec2) {
let gap = self.text_gap();
let last = self.leaders.iter().filter_map(|l| l.last()).map(|v| v.xy()).next().unwrap_or(self.landing.xy());
let side = if to.x >= last.x { 1.0 } else { -1.0 };
let old = self.landing.xy();
self.landing.x = to.x - side * (self.dogleg + gap);
self.landing.y = to.y;
if let Some(t) = &mut self.text {
t.insert.x = to.x;
t.insert.y = to.y;
// Attached at its left edge on the right of the landing, its right edge on the left.
let row = (t.attach.clamp(1, 9) - 1) / 3;
t.attach = row * 3 + if side > 0.0 { 1 } else { 3 };
}
if let Some(b) = &mut self.block {
let d = self.landing.xy() - old;
b.insert.x += d.x;
b.insert.y += d.y;
}
}

/// Reset Text Position: the text back beside the landing, on the side it is on.
pub fn reset_text(&mut self) {
let side = self.text_side();
let (lx, ly) = (self.landing.x, self.landing.y);
let dogleg = self.dogleg;
if let Some(t) = &mut self.text {
// The usual landing gap: half the text height.
let gap = t.height.abs() * 0.5;
t.insert.x = lx + side * (dogleg + gap);
t.insert.y = ly;
let row = (t.attach.clamp(1, 9) - 1) / 3;
t.attach = row * 3 + if side > 0.0 { 1 } else { 3 };
}
}

/// It draws no leader line (leader type None).
pub fn leaderless(&self) -> bool {
self.no_leader || self.leaders.is_empty()
}

/// The arrowhead it draws: its own, else its style's (in `d`).
pub fn arrow_in<'a>(&'a self, d: &'a crate::Drawing) -> &'a str {
if self.arrow.trim().is_empty() {
d.mleader_styles.iter().find(|s| s.name.eq_ignore_ascii_case(&self.style)).map_or("", |s| s.arrow_block.as_str())
} else {
&self.arrow
}
}

/// Each leader line as drawn: through its points to the landing, smoothed for spline leaders.
pub fn leader_paths(&self) -> Vec<Vec<Vec2>> {
if self.no_leader {
return Vec::new();
}
self.leaders
.iter()
.map(|l| {
Expand Down
Loading