forked from 1b-agent/opencadstudio-upstream
feat(commands): expand standard CAD command coverage
Integrate a large batch of standard CAD commands and fix several name/behaviour mismatches, with no product references in code. 3D solids (reusing the truck B-rep pipeline): - SLICE, INTERFERE, PRESSPULL, POLYSOLID, PYRAMID, SECTION - 3DROTATE, 3DMIRROR, 3DALIGN (cached-solid transforms) Annotation / text: - ARCTEXT, SPLINEFIT (Catmull-Rom to Bezier), DIMJOGGED, OBJECTSCALE (XData markers honoured by the existing geometry-gen / tessellator) Blocks / misc: - NCOPY (block-content extraction via explode_entity) - OPTIONS, SYNCPVIEWPORTS, THICKEN, plus earlier toggles, aliases, system variables, and layer/style/view commands POINTCLOUD/RECAP and UNDERLAYLAYERS/UOSNAP are intentionally left out: they require a proprietary binary / PDF-layer parser, a GPU point renderer, and real test files. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
76ef544cda
commit
c19c18c2f2
24 files changed
+4405
-216
No files matched your search
@@ -391,6 +391,15 @@ impl OpenCADStudio {
|
||||
}
|
||||
|
||||
// ── Named Views (VIEW command) ────────────────────────────────
|
||||
// PLAN — look straight down at the drawing (top view). The optional
|
||||
// World/Ucs/Current keyword is accepted; all map to the world top
|
||||
// view for now.
|
||||
cmd if cmd == "PLAN" || cmd.starts_with("PLAN ") => {
|
||||
return Some(Task::done(Message::ViewCubeSnapWorld(
|
||||
crate::scene::CubeRegion::Face(crate::scene::pipeline::viewcube::FACE_TOP),
|
||||
)));
|
||||
}
|
||||
|
||||
cmd if cmd == "VIEW" || cmd.starts_with("VIEW ") => {
|
||||
let parts: Vec<&str> = cmd.splitn(3, ' ').collect();
|
||||
let sub = parts.get(1).map(|s| s.to_uppercase()).unwrap_or_default();
|
||||
@@ -451,6 +460,28 @@ impl OpenCADStudio {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Standard orientation presets — snap the camera to a world
|
||||
// axis view (these names take precedence over a same-named
|
||||
// saved view, matching the standard orientation behaviour).
|
||||
"TOP" | "FRONT" | "BACK" | "LEFT" | "RIGHT" | "BOTTOM" => {
|
||||
use crate::scene::pipeline::viewcube::{
|
||||
FACE_BACK, FACE_BOTTOM, FACE_FRONT, FACE_LEFT, FACE_RIGHT, FACE_TOP,
|
||||
};
|
||||
let face = match sub.as_str() {
|
||||
"TOP" => FACE_TOP,
|
||||
"BOTTOM" => FACE_BOTTOM,
|
||||
"FRONT" => FACE_FRONT,
|
||||
"BACK" => FACE_BACK,
|
||||
"RIGHT" => FACE_RIGHT,
|
||||
_ => FACE_LEFT,
|
||||
};
|
||||
return Some(Task::done(Message::ViewCubeSnapWorld(
|
||||
crate::scene::CubeRegion::Face(face),
|
||||
)));
|
||||
}
|
||||
"ISO" | "ISOMETRIC" | "SWISO" => {
|
||||
return Some(Task::done(Message::ViewCubeHome));
|
||||
}
|
||||
// VIEW <name> shortcut for restore
|
||||
_ => {
|
||||
let name = sub.clone();
|
||||
|
||||
Reference in new issue
Block a user