Merge pull request #1152 from ramox81

This commit is contained in:
Hakan Seven committed 2026-09-10 17:16:01 +03:00
commit 1b3efb84de
3 files changed
+20 -5

No files matched your search

+7 -4
View File
@@ -62,7 +62,7 @@ impl OpenCADStudio {
return Some(Task::done(Message::ImagePick)); return Some(Task::done(Message::ImagePick));
} }
"REVCLOUD" => { "REVCLOUD" | "REVCLOUD_RECTANGULAR" | "REVCLOUD_POLYGONAL" | "REVCLOUD_FREEHAND" => {
use crate::modules::draw::draw::revcloud::RevCloudCommand; use crate::modules::draw::draw::revcloud::RevCloudCommand;
let view_height = self.tabs[i].scene.camera.borrow().ortho_size() as f64 * 2.0; let view_height = self.tabs[i].scene.camera.borrow().ortho_size() as f64 * 2.0;
let default_arc_length = (view_height * 0.0125).max(1.0e-6); let default_arc_length = (view_height * 0.0125).max(1.0e-6);
@@ -72,9 +72,12 @@ impl OpenCADStudio {
.entities() .entities()
.map(|entity| (entity.common().handle, entity.clone())) .map(|entity| (entity.common().handle, entity.clone()))
.collect(); .collect();
let cmd = RevCloudCommand::new(default_arc_length, sources); let mut command = RevCloudCommand::new(default_arc_length, sources);
self.command_line.push_info(&cmd.prompt()); if let Some(mode) = cmd.strip_prefix("REVCLOUD_") {
self.tabs[i].active_cmd = Some(Box::new(cmd)); command.on_text_input(mode);
}
self.command_line.push_info(&command.prompt());
self.tabs[i].active_cmd = Some(Box::new(command));
} }
"ATTDEF" => { "ATTDEF" => {
+3 -1
View File
@@ -933,4 +933,6 @@ fn style_from_entity(entity: &EntityType) -> Option<CloudStyle> {
}) })
} }
inventory::submit!(crate::command::CommandRegistration { names: &["REVCLOUD"] }); inventory::submit!(crate::command::CommandRegistration {
names: &["REVCLOUD", "REVCLOUD_RECTANGULAR", "REVCLOUD_POLYGONAL", "REVCLOUD_FREEHAND"]
});
+10
View File
@@ -0,0 +1,10 @@
Tool {
command: "REVCLOUD",
label: "Revision Cloud",
icon: include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/assets/icons/revcloud.svg")),
options: &[
("REVCLOUD_RECTANGULAR", "Rectangular"),
("REVCLOUD_POLYGONAL", "Polygonal"),
("REVCLOUD_FREEHAND", "Freehand"),
],
}