forked from 1b-agent/opencadstudio-upstream
feat: HATCHEDIT command to edit existing hatch pattern, scale, and angle
Add HATCHEDIT (HE alias) command. Works on pre-selected hatch or via entity pick. Accepts text options: P <pattern>, S <scale>, A <angle>. Enter applies changes; rebuilds hatch entity and GPU model via add_hatch. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
1 parent
8078c4c9da
commit
f6d716dfc5
7 files changed
+206
-2
No files matched your search
@@ -802,6 +802,28 @@ impl H7CAD {
|
||||
self.tabs[i].active_cmd = Some(Box::new(new_cmd));
|
||||
}
|
||||
|
||||
"HATCHEDIT"|"HE" => {
|
||||
use crate::modules::home::draw::hatchedit::HatcheditCommand;
|
||||
// If a single hatch is already selected, skip the pick step.
|
||||
let sel = self.tabs[i].scene.selected_entities();
|
||||
if sel.len() == 1 {
|
||||
let (h, _) = sel[0];
|
||||
if let Some(model) = self.tabs[i].scene.hatches.get(&h).cloned() {
|
||||
let cmd = HatcheditCommand::with_handle(
|
||||
h, model.name.clone(), model.scale, model.angle_offset,
|
||||
);
|
||||
self.command_line.push_info(&cmd.prompt());
|
||||
self.tabs[i].active_cmd = Some(Box::new(cmd));
|
||||
} else {
|
||||
self.command_line.push_error("HATCHEDIT: selected entity is not a hatch.");
|
||||
}
|
||||
} else {
|
||||
let cmd = HatcheditCommand::new();
|
||||
self.command_line.push_info(&cmd.prompt());
|
||||
self.tabs[i].active_cmd = Some(Box::new(cmd));
|
||||
}
|
||||
}
|
||||
|
||||
"GRADIENT" => {
|
||||
use crate::modules::home::draw::hatch::GradientCommand;
|
||||
let outlines = self.tabs[i].scene.closed_outlines();
|
||||
|
||||
Reference in new issue
Block a user