From cc503f18477fc1223f50b7d219bd4a663a5621c4 Mon Sep 17 00:00:00 2001 From: ramox81 <184937705+ramox81@users.noreply.github.com> Date: Thu, 10 Sep 2026 15:55:07 +0300 Subject: [PATCH] feat: expose Ray in the Draw expansion --- assets/icons/ray.svg | 3 +++ src/modules/draw/draw/ray.rs | 4 +--- src/ui/ribbon/draw_tools/04_ray.rs | 6 ++++++ 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 assets/icons/ray.svg create mode 100644 src/ui/ribbon/draw_tools/04_ray.rs diff --git a/assets/icons/ray.svg b/assets/icons/ray.svg new file mode 100644 index 000000000..9a560c793 --- /dev/null +++ b/assets/icons/ray.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/modules/draw/draw/ray.rs b/src/modules/draw/draw/ray.rs index 0b349b42e..725ffaed8 100644 --- a/src/modules/draw/draw/ray.rs +++ b/src/modules/draw/draw/ray.rs @@ -61,9 +61,7 @@ impl CadCommand for RayCommand { Vector3::new(base.x, base.y, base.z), Vector3::new(dir_n.x, dir_n.y, dir_n.z), ); - // Stay active: new base = same base (can keep clicking through points) - // Actually AutoCAD prompts for new start after each ray — reset base. - self.base = None; + // Repeated through points share the original start point. CmdResult::CommitEntity(EntityType::Ray(ray)) } else { self.base = Some(pt); diff --git a/src/ui/ribbon/draw_tools/04_ray.rs b/src/ui/ribbon/draw_tools/04_ray.rs new file mode 100644 index 000000000..3fc739731 --- /dev/null +++ b/src/ui/ribbon/draw_tools/04_ray.rs @@ -0,0 +1,6 @@ +Tool { + command: "RAY", + label: "Ray", + icon: include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/assets/icons/ray.svg")), + options: &[], +}