Skip to content
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
de73d8c
Text formulas and fields: =... in text, dimensions and leaders; UPDAT…
claude Oct 27, 2026
124b7b4
HATCH: pick points near the view, boundary warnings, open-curve and b…
claude Oct 27, 2026
453f62c
TRIM/EXTEND: hover glow, trimming hatches, blocks as edges
claude Oct 27, 2026
cd15b3e
Keep the hatch background helpers beside the other xdata applications
claude Oct 27, 2026
43087b5
Register the CADCRAFTFORMULA xdata application in the APPID table
claude Oct 27, 2026
cc4157c
Merge branch 'split/hatch' into split/trim-extend
claude Oct 27, 2026
826e71f
Merge branch 'split/text-formulas' into split/hatch
claude Oct 27, 2026
35b7a35
Export Glow on a line of its own
claude Oct 27, 2026
70c1858
Same description of the folder picker in every part
claude Oct 27, 2026
5e4fb91
Merge branch 'split/hatch' into split/trim-extend
claude Oct 27, 2026
8675424
Text formulas: review fixes
claude Oct 27, 2026
a59dfd1
Merge the text-formula review fixes
claude Oct 27, 2026
5af81ab
Hatch: review fixes
claude Oct 27, 2026
3bcfb17
Text formulas: ^ left to right; a replaced AutoCAD field is not writt…
claude Oct 27, 2026
670e041
Merge the text-formula review fixes
claude Oct 27, 2026
817266e
Merge the hatch and text-formula review fixes
claude Oct 27, 2026
31e3194
TRIM on a hatch: about linear work for the hover preview
claude Oct 27, 2026
428eb13
TRIM on a hatch: a test angle clippy reads as a constant
claude Oct 27, 2026
6616657
Custom patterns: the folder isn't read on every keystroke
claude Oct 27, 2026
b2f0386
Merge the review fixes of split/hatch
claude Oct 27, 2026
f20306e
Merge upstream main (release 0.14.0)
claude Oct 28, 2026
3fa4ecf
Merge the text-formula part (with upstream main 0.14.0)
claude Oct 28, 2026
18c9731
Merge the hatch part (with upstream main 0.14.0)
claude Oct 28, 2026
ec32ad2
Keep DXF finishing within upstream's complexity limit
claude Oct 28, 2026
2fc041b
CLI perf drawing: the text formula field
claude Oct 28, 2026
ca8f2b3
Merge the review fixes of split/text-formulas
claude Oct 28, 2026
044cadf
Merge the review fixes of split/hatch
claude Oct 28, 2026
aa8c500
fmt
claude Oct 28, 2026
bc01adf
Merge the review fixes of split/hatch
claude Oct 28, 2026
ae9e57f
Merge upstream main (0.15.1) into the text formula part
claude Oct 31, 2026
039a064
Merge split/text-formulas (with upstream main 0.15.1)
claude Oct 31, 2026
44cd098
Merge split/hatch (with upstream main 0.15.1)
claude Oct 31, 2026
98139c3
Text formulas: the formula field in upstream 0.15's new objects and r…
claude Oct 31, 2026
b8603b3
Merge split/text-formulas (with upstream main 0.15.1)
claude Oct 31, 2026
5be5527
Merge split/hatch (with upstream main 0.15.1)
claude Oct 31, 2026
90c9d06
Text formulas: an AutoCAD field the reader declines is kept on save
claude Oct 31, 2026
fded7c0
Hatch: a numeric background outside 0..=256 is refused
claude Oct 31, 2026
780f469
Merge upstream main into split/text-formulas
claude Oct 31, 2026
2b2879f
Merge split/text-formulas into split/hatch
claude Oct 31, 2026
a402a0c
Merge split/hatch into split/trim-extend
claude Oct 31, 2026
466fe69
Merge upstream main into split/text-formulas
claude Nov 2, 2026
f90bc00
Merge split/text-formulas into split/hatch
claude Nov 2, 2026
af4dabd
Merge split/hatch into split/trim-extend
claude Nov 2, 2026
ffa7310
Text formulas: Chinese labels for Text Formulas and Update Fields
claude Nov 2, 2026
eb87356
Fit upstream 0.15.1: the new fields in its added objects and tests
claude Nov 2, 2026
60709f6
Text formulas: an AutoCAD field's text is saved as read while the fie…
claude Nov 2, 2026
56da08c
Merge split/text-formulas into split/hatch
claude Nov 2, 2026
723dbf8
Merge split/hatch into split/trim-extend
claude Nov 2, 2026
5fe9571
Merge upstream main into split/text-formulas
claude Nov 4, 2026
c96a06e
Merge split/text-formulas into split/hatch
claude Nov 4, 2026
94b5d0c
Merge split/hatch into split/trim-extend
claude Nov 4, 2026
140936d
EXTEND: pass the edges on (clippy needless_borrow after #2656)
claude Nov 4, 2026
3bf07c1
Fit main: the new fields in its added tests
claude Nov 4, 2026
748d920
Text formulas: a block reference's attribute formulas are worked out …
claude Nov 4, 2026
5836826
HATCH: a block reference's closed outline bounds a hatch picked by Se…
claude Nov 4, 2026
3b251ee
Merge split/hatch into split/trim-extend
claude Nov 4, 2026
ddcb031
Merge split/text-formulas into split/hatch
claude Nov 4, 2026
1951a6c
TRIM: a hatch's glow is kept while the cursor stays in the area it wa…
claude Nov 4, 2026
2144528
Merge upstream main into split/text-formulas
claude Nov 4, 2026
f22ff80
Fit main: the new fields in its added code and tests
claude Nov 4, 2026
fe50a54
Merge split/text-formulas into split/hatch
claude Nov 4, 2026
df0ddf6
Merge split/hatch into split/trim-extend
claude Nov 4, 2026
0c0d027
Merge upstream main into split/text-formulas
claude Nov 5, 2026
90cb853
Merge split/text-formulas into split/hatch
claude Nov 5, 2026
637cede
Merge split/hatch into split/trim-extend
claude Nov 5, 2026
420d851
Merge remote-tracking branch 'upstream/main' into split/text-formulas
claude Nov 13, 2026
1fe6131
Merge branch 'split/text-formulas' into split/hatch
claude Nov 13, 2026
5c4aaaa
Merge branch 'split/hatch' into split/trim-extend
claude Nov 13, 2026
63848a7
EXTEND: a click shows the extension, a second click extends (no work …
claude Nov 17, 2026
57783dc
Merge upstream main into split/text-formulas
claude Nov 17, 2026
29472ae
Merge split/text-formulas into split/hatch
claude Nov 17, 2026
e1df565
Merge split/hatch into split/trim-extend
claude Nov 17, 2026
4c6774c
Merge upstream/main into split/text-formulas
claude Nov 20, 2026
2f5d3ad
Merge text-formulas into split/hatch
claude Nov 20, 2026
c20ffb8
Merge hatch into split/trim-extend
claude Nov 20, 2026
d48d599
Merge upstream/main into split/text-formulas (with FredApps's fixes f…
claude Nov 20, 2026
2187800
Merge text-formulas into split/hatch
claude Nov 20, 2026
64a2d34
Hatch background: its APPID is written again after the merge
claude Nov 20, 2026
212a480
Merge split/hatch into split/trim-extend
claude Nov 20, 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.

1 change: 1 addition & 0 deletions apps/cadcraft-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ fn synthetic(n: usize, side: f64) -> Result<cadcraft_engine::doc::Drawing, Strin
plinegen: false,
}),
_ => EntityKind::Text(d::Text {
formula: None,
insert: v3(x, y),
align_pt: None,
height: s * 0.2,
Expand Down
1 change: 1 addition & 0 deletions apps/cadcraft/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,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
1 change: 1 addition & 0 deletions crates/constraints/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ fn invalid_references_and_purge() {
let t = add_e(
&mut d,
EntityKind::Text(cadcraft_doc::Text {
formula: None,
insert: v(0.0, 0.0),
align_pt: None,
height: 1.0,
Expand Down
4 changes: 4 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
8 changes: 8 additions & 0 deletions crates/doc/src/entity/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ pub struct Text {
pub halign: HAlign,
#[serde(default)]
pub valign: VAlign,
/// The formula the text shows the result of: `=...` (CADCraft text formulas) or an AutoCAD
/// field code (`%<\AcVar date \f "dd.MM.yyyy">%`). `value` holds the last result.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub formula: Option<String>,
}

impl Text {
Expand Down Expand Up @@ -83,6 +87,10 @@ pub struct MText {
/// one column.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub columns: Option<MTextColumns>,
/// The formula the text shows the result of (see [`Text::formula`]); `contents` holds the
/// last result.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub formula: Option<String>,
}

fn attach_tl() -> u8 {
Expand Down
2 changes: 2 additions & 0 deletions crates/doc/src/extents.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ mod tests {

fn text(halign: HAlign, valign: VAlign) -> Text {
Text {
formula: None,
insert: Vec3::new(0.0, 0.0, 0.0),
align_pt: Some(Vec3::new(0.0, 0.0, 0.0)),
height: 1.0,
Expand Down Expand Up @@ -346,6 +347,7 @@ mod tests {
#[test]
fn multileader_text_is_inside_its_bounds() {
let mtext = crate::MText {
formula: None,
insert: Vec3::new(25.45, 0.0, 0.0),
height: 5.0,
width: 0.0,
Expand Down
4 changes: 4 additions & 0 deletions crates/doc/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ fn visible_attributes_of_a_missing_block_still_count() {
let attrib = |invisible: bool| Attrib {
tag: "TAG".into(),
text: Text {
formula: None,
insert: Vec3::new(1000.0, 1000.0, 0.0),
align_pt: None,
height: 10.0,
Expand Down Expand Up @@ -441,6 +442,7 @@ fn attdef_in_block_is_ignored_in_insert_extents() {
EntityKind::AttDef(Attrib {
tag: "TAG".into(),
text: Text {
formula: None,
insert: Vec3::new(5000.0, 5000.0, 0.0),
align_pt: None,
height: 1.0,
Expand All @@ -466,6 +468,7 @@ fn attdef_in_block_is_ignored_in_insert_extents() {

fn text_kind(value: &str) -> EntityKind {
EntityKind::Text(Text {
formula: None,
insert: Vec3::new(10.0, 10.0, 0.0),
align_pt: None,
height: 2.0,
Expand All @@ -481,6 +484,7 @@ fn text_kind(value: &str) -> EntityKind {

fn mtext_kind(contents: &str) -> EntityKind {
EntityKind::MText(MText {
formula: None,
insert: Vec3::new(10.0, 10.0, 0.0),
height: 2.0,
width: 0.0,
Expand Down
1 change: 1 addition & 0 deletions crates/engine/src/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ mod settings;
mod spline_opts;
mod table;
mod tolerance;
mod trim_hatch;
mod trimextend;
mod txt2mtxt;
pub use txt2mtxt::Txt2MtxtOptions;
Expand Down
2 changes: 2 additions & 0 deletions crates/engine/src/cmd/annotate/mleader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ fn mleader_kind(s: &Session, pts: &[Vec2], text: &str, landing: bool) -> Option<
landing: v3(*landing_pt),
dogleg,
text: (!text.is_empty()).then(|| MText {
formula: None,
insert: v3(tpos),
height: th,
width: 0.0,
Expand Down Expand Up @@ -66,6 +67,7 @@ pub(super) fn run_leader(s: &mut Session, p: &Value) -> Result<Value> {
let th = s.doc()?.dim_style(&style(s)).map(|d| d.text_height).unwrap_or(0.18);
out.push(
s.add_entity(EntityKind::MText(MText {
formula: None,
insert: v3(*last + Vec2::new(th * 0.5, th * 0.5)),
height: th,
width: 0.0,
Expand Down
1 change: 1 addition & 0 deletions crates/engine/src/cmd/blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ fn attdef_kind(s: &Session, tag: &str, prompt: &str, default: &str, at: Vec2, he
EntityKind::AttDef(Attrib {
tag: tag.to_ascii_uppercase(),
text: Text {
formula: None,
insert: v3(at),
align_pt: None,
height,
Expand Down
2 changes: 2 additions & 0 deletions crates/engine/src/cmd/draw/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub(crate) fn make_text(s: &Session, at: Vec2, value: &str, height: f64, rotatio
let (h, v) = j;
let left = h == HAlign::Left && v == VAlign::Baseline;
EntityKind::Text(Text {
formula: None,
insert: v3(at),
align_pt: if left { None } else { Some(v3(at)) },
height,
Expand Down Expand Up @@ -69,6 +70,7 @@ pub(super) fn run_mtext(s: &mut Session, p: &Value) -> Result<Value> {
};
let width = f64_or(p, "width", 0.0).max(0.0);
let k = EntityKind::MText(MText {
formula: None,
insert: v3(at),
height,
width,
Expand Down
5 changes: 4 additions & 1 deletion crates/engine/src/cmd/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,10 @@ fn read_bytes(bytes: &[u8], name: &str, path: Option<String>) -> Result<ReadFile
Ok(ReadFile { drawing, binary_dxf: cadcraft_dxf::is_binary(bytes), name: name.to_string(), path })
}

fn add_read(s: &mut Session, drawing: Drawing, binary_dxf: bool, name: &str, path: Option<String>) -> usize {
fn add_read(s: &mut Session, mut drawing: Drawing, binary_dxf: bool, name: &str, path: Option<String>) -> usize {
// Formulas and fields (dates) worked out for today.
let env = crate::textformula::Env { now: crate::textformula::local_now(), file: file_name(name), sheet: "Model".into(), measured: None };
crate::textformula::refresh(&mut drawing, &env);
let notes = drawing.read_notes.clone();
let i = s.open_drawing(drawing, &file_name(name), path);
if let Some(st) = s.docs.get_mut(i) {
Expand Down
Loading