Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion apps/solidcraft-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ fn cmd_snapshot(args: &[String]) -> Result<(), String> {
None => solidcraft_engine::view::home_camera(&s).map_err(|e| e.to_string())?,
};
let guides = Guides { grid: !args.iter().any(|a| a == "--no-grid"), axes: !args.iter().any(|a| a == "--no-axes") };
let scene = solidcraft_engine::view::scene_with_guides(&s, &cam, s.section, guides).map_err(|e| e.to_string())?;
let scene = solidcraft_engine::view::scene_with_guides(&s, &cam, &s.section, guides).map_err(|e| e.to_string())?;
let png = solidcraft_engine::capture::png(&scene, &cam, w, h)?;
std::fs::write(out, &png.bytes).map_err(|e| format!("{out}: {e}"))?;
let mut reply = json!({"path": out, "width": w, "height": h, "bytes": png.bytes.len(), "renderer": png.renderer});
Expand Down
66 changes: 66 additions & 0 deletions assets/locales/pending/section-view-menu.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"en": {
"browser.section_plane": "Section {number}",
"section.add_hint": "The plane joins the section: what lies beyond any of its planes is hidden.",
"section.edit_hint": "Edits one plane of the section: its other planes stay as they are.",
"ui.section_view": "Section View",
"ui.section_view_edit": "Edit Section View",
"ui.section_view_off": "Turn Off Section View"
},
"ar": {
"browser.section_plane": "المقطع {number}",
"section.add_hint": "يُضاف المستوى إلى المقطع: يُخفى ما يقع خلف أيٍّ من مستوياته.",
"section.edit_hint": "يُعدَّل مستوى واحد من المقطع: تبقى مستوياته الأخرى كما هي.",
"ui.section_view": "عرض المقطع",
"ui.section_view_edit": "تعديل عرض المقطع",
"ui.section_view_off": "إيقاف عرض المقطع"
},
"de": {
"browser.section_plane": "Schnitt {number}",
"section.add_hint": "Die Ebene kommt zum Schnitt hinzu: Was jenseits einer seiner Ebenen liegt, wird ausgeblendet.",
"section.edit_hint": "Bearbeitet eine Ebene des Schnitts: Seine übrigen Ebenen bleiben, wie sie sind.",
"ui.section_view": "Schnittansicht",
"ui.section_view_edit": "Schnittansicht bearbeiten",
"ui.section_view_off": "Schnittansicht ausschalten"
},
"he": {
"browser.section_plane": "חתך {number}",
"section.add_hint": "המישור מצטרף לחתך: מה שנמצא מעבר לאחד המישורים שלו מוסתר.",
"section.edit_hint": "עורך מישור אחד של החתך: שאר המישורים שלו נשארים כפי שהם.",
"ui.section_view": "תצוגת חתך",
"ui.section_view_edit": "עריכת תצוגת החתך",
"ui.section_view_off": "כיבוי תצוגת החתך"
},
"ja": {
"browser.section_plane": "断面 {number}",
"section.add_hint": "平面をセクションに追加します。いずれかの平面の外側にある部分が非表示になります。",
"section.edit_hint": "セクションの平面を 1 つ編集します。ほかの平面はそのまま残ります。",
"ui.section_view": "断面表示",
"ui.section_view_edit": "断面表示を編集",
"ui.section_view_off": "断面表示を解除"
},
"ko": {
"browser.section_plane": "단면 {number}",
"section.add_hint": "평면이 단면에 추가됩니다. 어느 평면이든 그 너머에 있는 부분이 숨겨집니다.",
"section.edit_hint": "단면의 평면 하나를 편집합니다. 다른 평면은 그대로 유지됩니다.",
"ui.section_view": "단면 보기",
"ui.section_view_edit": "단면 보기 편집",
"ui.section_view_off": "단면 보기 끄기"
},
"vi": {
"browser.section_plane": "Mặt cắt {number}",
"section.add_hint": "Mặt phẳng được thêm vào mặt cắt: phần nằm ngoài bất kỳ mặt phẳng nào của nó sẽ bị ẩn.",
"section.edit_hint": "Sửa một mặt phẳng của mặt cắt: các mặt phẳng khác của nó giữ nguyên.",
"ui.section_view": "Hiển thị mặt cắt",
"ui.section_view_edit": "Sửa hiển thị mặt cắt",
"ui.section_view_off": "Tắt hiển thị mặt cắt"
},
"zh": {
"browser.section_plane": "剖面 {number}",
"section.add_hint": "该平面将加入剖面:位于其任一平面外侧的部分将被隐藏。",
"section.edit_hint": "编辑剖面的一个平面:其他平面保持不变。",
"ui.section_view": "剖面视图",
"ui.section_view_edit": "编辑剖面视图",
"ui.section_view_off": "关闭剖面视图"
}
}
2 changes: 1 addition & 1 deletion crates/engine/src/cmd/browser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ fn collect_component_keys(s: &Session, prefix: &str, component: u64, root_extras
if !s.doc.assembly.joints.is_empty() {
keys.open.insert("c0/joints".into());
}
if s.section.is_some() {
if !s.section.is_empty() || !s.section_hidden.is_empty() {
keys.open.insert("analysis".into());
}
}
Expand Down
10 changes: 8 additions & 2 deletions crates/engine/src/cmd/edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,17 +335,23 @@ fn go_to(s: &mut Session, snap: Snapshot) -> Snapshot {
active_sketch: s.active_sketch,
pending_moves: s.pending_moves.clone(),
visibility: s.visibility.clone(),
section: snap.section.as_ref().map(|_| s.section_state()),
};
let same = std::sync::Arc::ptr_eq(&s.doc, &snap.doc);
// Undoing a hide (or a show) leaves the document alone: the model needs no evaluating.
// Undoing a hide (or a show) leaves the document alone: the model needs no evaluating, and
// a section step needs nothing evaluated or drawn again.
let display_only = same && s.visibility != snap.visibility;
let view_only = same && !display_only && snap.active_sketch == s.active_sketch && snap.pending_moves == s.pending_moves && snap.section.is_some();
if let Some(section) = snap.section {
s.set_section_state(section);
}
s.doc = snap.doc;
s.active_sketch = snap.active_sketch;
s.pending_moves = snap.pending_moves;
s.visibility = snap.visibility;
s.selection.clear();
// A new document is evaluated by `execute`.
if same {
if same && !view_only {
if display_only {
s.refresh_display();
} else {
Expand Down
2 changes: 1 addition & 1 deletion crates/engine/src/cmd/motion_animation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ pub(super) fn export_with(s: &Session, p: &Value, renderer: Option<&Renderer>) -
t.pending_moves = exploded_at(moves, if *back { 1.0 - (2.0 * u - 1.0).abs() } else { u });
}
}
let scene = crate::view::scene_with_guides(&t, &cam, s.section, guides)?;
let scene = crate::view::scene_with_guides(&t, &cam, &s.section, guides)?;
let picture = capture::rgba_with(Some(renderer), &scene, &cam, width, height).map_err(|e| bad(cmd, e))?;
drawn_by = picture.renderer;
if gif {
Expand Down
Loading
Loading