Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
472a330
Drawings saved inside the design's file, in both forms (#3890)
CamWight Oct 26, 2026
e0cb46c
Drawing commands on the design's own drawings, each drawing its own u…
CamWight Oct 26, 2026
36cf48a
Unknown-command tests: the closest id first (#3890)
CamWight Oct 27, 2026
30906de
Model bodies: their extents seen on a plane, for a drawing view's siz…
CamWight Oct 25, 2026
bedae91
Drawing views: projected views in first or third angle, lined up with…
CamWight Oct 26, 2026
cfa5602
Drawing dimensions: measurement on view frames (#4896, W19a)
CamWight Oct 26, 2026
cce39b4
drawing.view.snapshot: a view's scale, place and boundary on its shee…
CamWight Oct 25, 2026
16c0dcb
Drawing views in the drawing record: base and projected views, and th…
CamWight Oct 26, 2026
92d8d0e
Engine tests: one temporary folder helper and the schema check for ev…
CamWight Oct 26, 2026
75449a6
Drawing views: inspect and edit a saved view (#4816, W17c)
CamWight Oct 26, 2026
2ccae89
Drawing views: where a saved view sits on its sheet (#4816)
CamWight Oct 26, 2026
b02660e
Projection of new drawings: a preference, and drawing.set takes the p…
CamWight Oct 26, 2026
8c713b8
Drawing sheets: one edit, one lookup, a border that lays out, and sch…
CamWight Oct 26, 2026
57b12ee
Drawing ids: one id source per session, its seed kept for replays (#3…
CamWight Oct 26, 2026
0821f91
Drawing sheets: add, change, reorder and delete a drawing's sheets (#…
CamWight Oct 25, 2026
6a23686
Drawing sheets: a new sheet's id from the session's id source (#3875)
CamWight Oct 26, 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
4 changes: 4 additions & 0 deletions apps/solidcraft-cli/src/crashes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ fn replay(report: &Value) -> Result<(), String> {
Some(d) => super::load(d)?,
None => solidcraft_engine::Session::default(),
};
// The ids the session drew from there, so the commands give the same objects the same ids.
if let Some(seed) = script["ids"].as_u64() {
s.seed_ids(seed);
}
std::panic::set_hook(Box::new(|info| {
let loc = info.location().map_or_else(|| "(unknown)".to_string(), |l| format!("{}:{}", l.file(), l.line()));
let msg = info.payload_as_str().unwrap_or("(not a text message)").to_string();
Expand Down
5 changes: 3 additions & 2 deletions apps/solidcraft-cli/tests/run_results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,13 @@ fn snapshot_runs_its_script_on_the_in_design() {
}
}

/// An unknown command's error suggests the id that was meant.
/// An unknown command's error suggests the id that was meant first; other close ids (such as
/// `drawing.open`) may follow it.
#[test]
fn unknown_command_suggests_the_closest_id() {
let output = cli().args(["exec", "file.open"]).output().unwrap();
assert_eq!(output.status.code(), Some(1));
assert!(String::from_utf8_lossy(&output.stderr).contains("did you mean `doc.open`?"), "{}", String::from_utf8_lossy(&output.stderr));
assert!(String::from_utf8_lossy(&output.stderr).contains("did you mean `doc.open`"), "{}", String::from_utf8_lossy(&output.stderr));
}

/// #1833: `--timings` reports each command's time instead of the measurement, `--profile` adds
Expand Down
4 changes: 4 additions & 0 deletions assets/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,7 @@
"pick a hole to seat it, or OK places it at the origin": "Wählen Sie eine Bohrung zum Einsetzen, oder OK platziert es im Ursprung",
"pick one or two vertices, edges or faces": "Wählen Sie ein oder zwei Ecken, Kanten oder Flächen",
"prefs.cpu": "CPU (Software)",
"prefs.drawings": "Zeichnungen",
"prefs.minutes_suffix": " min",
"properties.title": "Eigenschaften: {name}",
"recovery.days_ago": "vor {count} Tagen",
Expand Down Expand Up @@ -1486,6 +1487,7 @@
"ui.findInTimeline": "In der Zeitleiste suchen",
"ui.findInWindow": "Im Fenster suchen",
"ui.finish_sketch": "Skizze beenden",
"ui.first_angle": "Erster Winkel",
"ui.fit": "Einpassen",
"ui.fix_unfix": "Fixieren/Lösen",
"ui.flat": "Flach",
Expand Down Expand Up @@ -1706,6 +1708,7 @@
"ui.profiles": "Profile",
"ui.project": "Projizieren",
"ui.project_face_edges_sketch": "Flächenkanten in neue Skizzen projizieren",
"ui.projection_of_new_drawings": "Projektion neuer Zeichnungen",
"ui.properties": "Eigenschaften",
"ui.pull_direction": "Entformungsrichtung",
"ui.quantity": "Anzahl",
Expand Down Expand Up @@ -1878,6 +1881,7 @@
"ui.text": "Text",
"ui.theme": "Design",
"ui.thickness": "Dicke",
"ui.third_angle": "Dritter Winkel",
"ui.thread": "Gewinde",
"ui.tie_ends": "Verknüpfen",
"ui.tie_ends_tip": "Alle unverknüpften Enden mit Abhängigkeiten versehen",
Expand Down
21 changes: 21 additions & 0 deletions assets/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,23 @@
"cmd.document_metadata_remove": "Remove Design Property",
"cmd.document_metadata_set": "Change Design Properties",
"cmd.document_units": "Change Design Units",
"cmd.drawing_close": "Close Drawing",
"cmd.drawing_create": "Create Drawing",
"cmd.drawing_delete": "Delete Drawing",
"cmd.drawing_inspect": "Inspect Drawing",
"cmd.drawing_list": "List Drawings",
"cmd.drawing_open": "Open Drawing",
"cmd.drawing_properties": "Drawing Properties",
"cmd.drawing_properties_remove": "Remove Drawing Property",
"cmd.drawing_properties_set": "Change Drawing Properties",
"cmd.drawing_set": "Drawing Settings",
"cmd.drawing_sheet_add": "Add Sheet",
"cmd.drawing_sheet_delete": "Delete Sheet",
"cmd.drawing_sheet_reorder": "Reorder Sheets",
"cmd.drawing_sheet_set": "Sheet Settings",
"cmd.drawing_view_edit": "Edit Drawing View",
"cmd.drawing_view_inspect": "Inspect Drawing View",
"cmd.drawing_view_snapshot": "Drawing View Snapshot",
"cmd.edit_checkpoint": "Checkpoint",
"cmd.edit_restore_checkpoint": "Restore Checkpoint",
"cmd.engine_commands": "List Commands",
Expand Down Expand Up @@ -1075,6 +1092,7 @@
"prefs.design_note": "What new designs start with. Open designs keep their own.",
"prefs.devices": "3D mouse",
"prefs.display": "Display",
"prefs.drawings": "Drawings",
"prefs.edges": "Edges and shading",
"prefs.extend": "Extend",
"prefs.extra_navigation": "Ctrl+left drag on empty space orbits; hold Space to pan.",
Expand Down Expand Up @@ -1663,6 +1681,7 @@
"ui.findInTimeline": "Find in Timeline",
"ui.findInWindow": "Find in Window",
"ui.finish_sketch": "Finish Sketch",
"ui.first_angle": "First angle",
"ui.fit": "Fit",
"ui.fix_unfix": "Fix/Unfix",
"ui.flat": "Flat",
Expand Down Expand Up @@ -1890,6 +1909,7 @@
"ui.profiles": "Profiles",
"ui.project": "Project",
"ui.project_face_edges_sketch": "Project face edges into new sketches",
"ui.projection_of_new_drawings": "Projection of new drawings",
"ui.properties": "Properties",
"ui.pull_direction": "Pull direction",
"ui.quantity": "Quantity",
Expand Down Expand Up @@ -2062,6 +2082,7 @@
"ui.text": "Text",
"ui.theme": "Theme",
"ui.thickness": "Thickness",
"ui.third_angle": "Third angle",
"ui.thread": "Thread",
"ui.tie_ends": "Tie",
"ui.tie_ends_tip": "Constrain all untied ends",
Expand Down
21 changes: 21 additions & 0 deletions assets/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,23 @@
"cmd.document_metadata_remove": "デザインのプロパティを削除",
"cmd.document_metadata_set": "デザインのプロパティを変更",
"cmd.document_units": "デザインの単位を変更",
"cmd.drawing_close": "図面を閉じる",
"cmd.drawing_create": "図面を作成",
"cmd.drawing_delete": "図面を削除",
"cmd.drawing_inspect": "図面を確認",
"cmd.drawing_list": "図面を一覧表示",
"cmd.drawing_open": "図面を開く",
"cmd.drawing_properties": "図面のプロパティ",
"cmd.drawing_properties_remove": "図面のプロパティを削除",
"cmd.drawing_properties_set": "図面のプロパティを変更",
"cmd.drawing_set": "図面設定",
"cmd.drawing_sheet_add": "シートを追加",
"cmd.drawing_sheet_delete": "シートを削除",
"cmd.drawing_sheet_reorder": "シートを並べ替え",
"cmd.drawing_sheet_set": "シート設定",
"cmd.drawing_view_edit": "図面ビューを編集",
"cmd.drawing_view_inspect": "図面ビューを確認",
"cmd.drawing_view_snapshot": "図面ビューのスナップショット",
"cmd.edit_checkpoint": "チェックポイント",
"cmd.edit_restore_checkpoint": "チェックポイントを復元",
"cmd.engine_commands": "コマンドを一覧表示",
Expand Down Expand Up @@ -1075,6 +1092,7 @@
"prefs.design_note": "新しいデザインの初期設定です。開いているデザインはそれぞれの設定を保持します。",
"prefs.devices": "3D マウス",
"prefs.display": "表示",
"prefs.drawings": "図面",
"prefs.edges": "エッジと陰影",
"prefs.extend": "拡張",
"prefs.extra_navigation": "何もない場所でCtrl+左ドラッグすると回転し、Spaceを押しながらドラッグすると移動します。",
Expand Down Expand Up @@ -1663,6 +1681,7 @@
"ui.findInTimeline": "タイムラインで検索",
"ui.findInWindow": "ウィンドウで検索",
"ui.finish_sketch": "スケッチを終了",
"ui.first_angle": "第一角法",
"ui.fit": "フィット",
"ui.fix_unfix": "固定/固定解除",
"ui.flat": "展開",
Expand Down Expand Up @@ -1890,6 +1909,7 @@
"ui.profiles": "プロファイル",
"ui.project": "投影",
"ui.project_face_edges_sketch": "新規スケッチに面のエッジを自動投影",
"ui.projection_of_new_drawings": "新規図面の投影法",
"ui.properties": "プロパティ",
"ui.pull_direction": "抜き方向",
"ui.quantity": "数量",
Expand Down Expand Up @@ -2062,6 +2082,7 @@
"ui.text": "テキスト",
"ui.theme": "テーマ",
"ui.thickness": "厚さ",
"ui.third_angle": "第三角法",
"ui.thread": "ねじ",
"ui.tie_ends": "拘束",
"ui.tie_ends_tip": "未拘束をすべて拘束",
Expand Down
4 changes: 4 additions & 0 deletions assets/locales/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,7 @@
"pick a hole to seat it, or OK places it at the origin": "안착시킬 구멍을 선택하거나, 확인을 누르면 원점에 배치됩니다",
"pick one or two vertices, edges or faces": "꼭짓점, 모서리 또는 면을 하나나 두 개 선택하세요",
"prefs.cpu": "CPU (소프트웨어)",
"prefs.drawings": "도면",
"prefs.minutes_suffix": " min",
"properties.title": "속성: {name}",
"recovery.days_ago": "{count}일 전",
Expand Down Expand Up @@ -1486,6 +1487,7 @@
"ui.findInTimeline": "타임라인에서 찾기",
"ui.findInWindow": "창에서 찾기",
"ui.finish_sketch": "스케치 종료",
"ui.first_angle": "제1각법",
"ui.fit": "맞춤",
"ui.fix_unfix": "고정/고정 해제",
"ui.flat": "플랫",
Expand Down Expand Up @@ -1706,6 +1708,7 @@
"ui.profiles": "프로파일",
"ui.project": "투영",
"ui.project_face_edges_sketch": "면 모서리를 새 스케치로 투영",
"ui.projection_of_new_drawings": "새 도면의 투상법",
"ui.properties": "속성",
"ui.pull_direction": "빼기 방향",
"ui.quantity": "수량",
Expand Down Expand Up @@ -1878,6 +1881,7 @@
"ui.text": "텍스트",
"ui.theme": "테마",
"ui.thickness": "두께",
"ui.third_angle": "제3각법",
"ui.thread": "나사산",
"ui.tie_ends": "연결",
"ui.tie_ends_tip": "연결되지 않은 모든 끝점 구속",
Expand Down
21 changes: 21 additions & 0 deletions assets/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,23 @@
"cmd.document_metadata_remove": "删除设计属性",
"cmd.document_metadata_set": "更改设计属性",
"cmd.document_units": "更改设计单位",
"cmd.drawing_close": "关闭绘图",
"cmd.drawing_create": "创建绘图",
"cmd.drawing_delete": "删除绘图",
"cmd.drawing_inspect": "检查绘图",
"cmd.drawing_list": "列出绘图",
"cmd.drawing_open": "打开绘图",
"cmd.drawing_properties": "绘图属性",
"cmd.drawing_properties_remove": "删除绘图属性",
"cmd.drawing_properties_set": "更改绘图属性",
"cmd.drawing_set": "绘图设置",
"cmd.drawing_sheet_add": "添加图纸",
"cmd.drawing_sheet_delete": "删除图纸",
"cmd.drawing_sheet_reorder": "重新排列图纸",
"cmd.drawing_sheet_set": "图纸设置",
"cmd.drawing_view_edit": "编辑绘图视图",
"cmd.drawing_view_inspect": "检查绘图视图",
"cmd.drawing_view_snapshot": "绘图视图快照",
"cmd.edit_checkpoint": "检查点",
"cmd.edit_restore_checkpoint": "恢复检查点",
"cmd.engine_commands": "列出命令",
Expand Down Expand Up @@ -1075,6 +1092,7 @@
"prefs.design_note": "新建设计的初始设置。已打开的设计保留各自的设置。",
"prefs.devices": "3D 鼠标",
"prefs.display": "显示",
"prefs.drawings": "绘图",
"prefs.edges": "边缘与着色",
"prefs.extend": "扩展",
"prefs.extra_navigation": "在空白处按住Ctrl并用鼠标左键拖动可旋转;按住空格键可平移。",
Expand Down Expand Up @@ -1663,6 +1681,7 @@
"ui.findInTimeline": "在时间线中查找",
"ui.findInWindow": "在窗口中查找",
"ui.finish_sketch": "完成草图",
"ui.first_angle": "第一角投影",
"ui.fit": "适合",
"ui.fix_unfix": "固定/取消固定",
"ui.flat": "平面",
Expand Down Expand Up @@ -1890,6 +1909,7 @@
"ui.profiles": "轮廓",
"ui.project": "投影",
"ui.project_face_edges_sketch": "将面的边投影到新草图",
"ui.projection_of_new_drawings": "新绘图的投影法",
"ui.properties": "属性",
"ui.pull_direction": "拔模方向",
"ui.quantity": "数量",
Expand Down Expand Up @@ -2062,6 +2082,7 @@
"ui.text": "文本",
"ui.theme": "主题",
"ui.thickness": "厚度",
"ui.third_angle": "第三角投影",
"ui.thread": "螺纹",
"ui.tie_ends": "约束",
"ui.tie_ends_tip": "约束全部未约束端点",
Expand Down
13 changes: 13 additions & 0 deletions crates/doc/src/assembly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,19 @@ impl Document {
out
}

/// Whether [`Document::placements`] reaches every placement. Its walk stops at
/// [`MAX_PLACEMENTS`], and a branch past [`MAX_PLACEMENT_DEPTH`] levels, so a placement it
/// holds may have occurrences it never walked; the walk is whole when none does.
pub fn placements_complete(&self) -> bool {
let mut children = std::collections::HashMap::<u64, usize>::new();
for o in &self.occurrences {
*children.entry(o.parent).or_default() += 1;
}
let walk = self.placements();
let reached = walk.iter().fold(0usize, |n, (c, _, _)| n.saturating_add(children.get(c).copied().unwrap_or(0)));
walk.len() == reached.saturating_add(1)
}

/// Every body as the world shows it: its world name ("Body1", or "Body1 (Occ:2)" for a
/// further instance), its component, the occurrence path, and the transform from the frame
/// its geometry is in to the world.
Expand Down
33 changes: 33 additions & 0 deletions crates/doc/src/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2486,6 +2486,12 @@ pub struct Document {
/// a document in a session leaves this empty; the session puts it back when it saves.
#[serde(default, skip_serializing_if = "Visibility::is_empty")]
pub visibility: Visibility,
/// The design's drawings (#3890), by name, then id ([`crate::drawing::in_design`]), each behind
/// its own `Arc`, so an undo step shares every drawing it didn't change. Each is read by its own
/// family's rules ([`crate::format::read`]), never as a field of the design; a container keeps
/// each in its own entry.
#[serde(skip_deserializing, skip_serializing_if = "Vec::is_empty")]
pub drawings: Vec<std::sync::Arc<crate::drawing::Drawing>>,
}

/// Items hidden or shown one by one. Saved with the design, but not an undo step.
Expand Down Expand Up @@ -2686,6 +2692,7 @@ impl Document {
browser_order: Default::default(),
named_views: Vec::new(),
visibility: Visibility::default(),
drawings: Vec::new(),
}
}

Expand Down Expand Up @@ -2815,6 +2822,32 @@ impl Document {
*self == normalized
}

/// Only drawings changed: nothing to evaluate, as a drawing reads the model and never changes
/// it. The same whole-Document proof as [`Document::differs_only_in_render`]; a model edit
/// shares every drawing's `Arc`, so it costs nothing here.
pub fn differs_only_in_drawings(&self, previous: &Document) -> bool {
let shared =
self.drawings.len() == previous.drawings.len() && self.drawings.iter().zip(&previous.drawings).all(|(a, b)| std::sync::Arc::ptr_eq(a, b));
if shared || self.drawings == previous.drawings {
return false;
}
let mut normalized = previous.clone();
normalized.drawings = self.drawings.clone();
*self == normalized
}

/// The design's drawing `id`.
pub fn drawing(&self, id: u64) -> Option<&std::sync::Arc<crate::drawing::Drawing>> {
self.drawings.iter().find(|d| d.id == id)
}

/// Put `drawing` in, in place of the one with its id if there is one, in the drawings' order.
pub fn put_drawing(&mut self, drawing: std::sync::Arc<crate::drawing::Drawing>) {
self.drawings.retain(|d| d.id != drawing.id);
self.drawings.push(drawing);
crate::drawing::sort(&mut self.drawings);
}

/// The colour a body is shown and exported in (sRGB as 0–1 fractions): its appearance,
/// else its component's, else its material's look, else the colour it was imported with.
/// (Faces may have their own: `face_looks`.)
Expand Down
Loading