forked from 1b-agent/opencadstudio-upstream
Cargo: codec 76d2a1c, kernel e652b4d, graph 0545fa9; text styles, templates, solid edges
- Text styles keep their TrueType typeface through save and reopen (codec reads and writes the STYLE record's ACAD extended data) (#1633) - Unnamed shape-file entries no longer show in text style lists (#1634) - Save As offers DWT 2018; NEW asks for the template to start from, while Ctrl+N and the quick-access New run QNEW with the default template (#1635) - An edge next to an earlier fillet of the same radius rounds together with it (kernel); the solid stays drawn and pickable while edges are chosen (#1625, #1107) - A full cache rebuild drops the B-rep cache too, so an undone fillet does not come back with the next edge operation (#1107) - Selected solids in shaded styles highlight only their visible edges (#1031) - VIEW ISO / SWISO / SEISO / NEISO / NWISO snap to the isometric corners Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1cbcc8f4c5
commit
1eae36e726
43 files changed
+152
-34
No files matched your search
@@ -3,7 +3,25 @@ use super::*;
|
||||
impl OpenCADStudio {
|
||||
pub(super) fn dispatch_fileops(&mut self, cmd: &str, i: usize) -> Option<Task<Message>> {
|
||||
match cmd {
|
||||
"NEW" => return Some(Task::done(Message::TabNew)),
|
||||
// QNEW starts from the default template (Options > Files); NEW
|
||||
// asks which template to start from (#1635).
|
||||
"QNEW" => return Some(Task::done(Message::TabNew)),
|
||||
"NEW" => {
|
||||
return Some(Task::perform(
|
||||
async {
|
||||
crate::sys::file_dialog()
|
||||
.set_title(crate::t!("Select Template").as_ref())
|
||||
.add_filter(
|
||||
crate::t!("Drawing Template (*.dwt)").as_ref(),
|
||||
&["dwt", "DWT", "dwg", "DWG", "dxf", "DXF"],
|
||||
)
|
||||
.pick_file()
|
||||
.await
|
||||
.map(|handle| crate::sys::handle_path(&handle))
|
||||
},
|
||||
Message::NewFromTemplate,
|
||||
));
|
||||
}
|
||||
"OPEN" => return Some(Task::done(Message::OpenFile)),
|
||||
"SAVE" | "QSAVE" => return Some(Task::done(Message::SaveFile)),
|
||||
// SAVEALL — write every open drawing that already has a file path.
|
||||
|
||||
@@ -875,8 +875,25 @@ impl OpenCADStudio {
|
||||
crate::scene::CubeRegion::Face(face),
|
||||
)));
|
||||
}
|
||||
"ISO" | "ISOMETRIC" | "SWISO" => {
|
||||
return Some(Task::done(Message::ViewCubeHome));
|
||||
// Isometric presets snap to the matching ViewCube corner;
|
||||
// ISO alone is the south-west one.
|
||||
"ISO" | "ISOMETRIC" | "SWISO" | "SEISO" | "NEISO" | "NWISO" => {
|
||||
let (x, y) = match sub.as_str() {
|
||||
"SEISO" => (1.0, -1.0),
|
||||
"NEISO" => (1.0, 1.0),
|
||||
"NWISO" => (-1.0, 1.0),
|
||||
_ => (-1.0, -1.0),
|
||||
};
|
||||
let want = glam::Vec3::new(x, y, 1.0).normalize();
|
||||
let corner = (18..26)
|
||||
.map(crate::scene::CubeRegion::Corner)
|
||||
.max_by(|a, b| {
|
||||
a.snap_direction()
|
||||
.dot(want)
|
||||
.total_cmp(&b.snap_direction().dot(want))
|
||||
})
|
||||
.expect("the cube has corners");
|
||||
return Some(Task::done(Message::ViewCubeSnap(corner)));
|
||||
}
|
||||
// VIEW <name> shortcut for restore
|
||||
_ => {
|
||||
|
||||
@@ -850,6 +850,7 @@ inventory::submit!(crate::command::CommandRegistration {
|
||||
"CHSPACE",
|
||||
"NAVVCUBE",
|
||||
"NEW",
|
||||
"QNEW",
|
||||
"OBJIMPORT",
|
||||
"OPEN",
|
||||
"ORTHO",
|
||||
|
||||
Reference in new issue
Block a user