From c50610e37b9f52e2859a461feacd5728109a3a1f Mon Sep 17 00:00:00 2001 From: ramox81 <184937705+ramox81@users.noreply.github.com> Date: Thu, 10 Sep 2026 15:55:09 +0300 Subject: [PATCH] feat: expose Region in the Draw expansion --- assets/icons/region.svg | 3 +++ src/app/commands/draw.rs | 7 +++++++ src/ui/ribbon/draw_tools/08_region.rs | 6 ++++++ 3 files changed, 16 insertions(+) create mode 100644 assets/icons/region.svg create mode 100644 src/ui/ribbon/draw_tools/08_region.rs diff --git a/assets/icons/region.svg b/assets/icons/region.svg new file mode 100644 index 000000000..fa9a6d339 --- /dev/null +++ b/assets/icons/region.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/app/commands/draw.rs b/src/app/commands/draw.rs index 6807abfa1..b031fda55 100644 --- a/src/app/commands/draw.rs +++ b/src/app/commands/draw.rs @@ -1110,6 +1110,13 @@ impl OpenCADStudio { // REGION — convert selected closed boundaries (closed polylines / // circles) into Region entities (one wire loop each). "REGION" | "REG" => { + if self.tabs[i].scene.selected_entities().is_empty() { + use crate::modules::draw::select::SelectObjectsCommand; + let command = SelectObjectsCommand::new("REGION"); + self.command_line.push_info(&command.prompt()); + self.tabs[i].active_cmd = Some(Box::new(command)); + return Some(iced::Task::none()); + } use acadrust::entities::Region; use acadrust::types::Vector3; let mut regions = Vec::new(); diff --git a/src/ui/ribbon/draw_tools/08_region.rs b/src/ui/ribbon/draw_tools/08_region.rs new file mode 100644 index 000000000..a09ec4dea --- /dev/null +++ b/src/ui/ribbon/draw_tools/08_region.rs @@ -0,0 +1,6 @@ +Tool { + command: "REGION", + label: "Region", + icon: include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/assets/icons/region.svg")), + options: &[], +}