refactor(modules): rename home module to draw, restore first-tab order

The Home tab was already titled "Draw"; rename the module to match:
folder modules/home → modules/draw, HomeModule → DrawModule, id "home"
→ "draw". The inner draw/ command folder is kept (modules::draw::draw).

Update build.rs PRIORITY ("home" → "draw") so the tab returns to the
front of the ribbon; registry.rs regenerates accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-06-16 11:49:14 +03:00
1 parent c6152ef705
commit 3666c7fa69
85 files changed
+141 -141

No files matched your search

+1 -1
View File
@@ -23,7 +23,7 @@ use std::fs;
use std::path::Path; use std::path::Path;
// Display order for known modules; unknown modules follow alphabetically. // Display order for known modules; unknown modules follow alphabetically.
const PRIORITY: &[&str] = &["home", "model", "insert", "annotate", "view", "manage"]; const PRIORITY: &[&str] = &["draw", "model", "insert", "annotate", "view", "manage"];
fn main() { fn main() {
// Windows: embed AppIcon.ico into the .exe so the executable carries its // Windows: embed AppIcon.ico into the .exe so the executable carries its
+8 -8
View File
@@ -291,7 +291,7 @@ impl OpenCADStudio {
if let Some(encoded) = layer.strip_prefix("__ATTEDIT__") { if let Some(encoded) = layer.strip_prefix("__ATTEDIT__") {
let label = self.history_label_from_active_cmd(i, "ATTEDIT"); let label = self.history_label_from_active_cmd(i, "ATTEDIT");
self.push_undo_snapshot(i, label); self.push_undo_snapshot(i, label);
crate::modules::home::modify::attedit::apply_attedit( crate::modules::draw::modify::attedit::apply_attedit(
&mut self.tabs[i].scene.document, &mut self.tabs[i].scene.document,
handle, handle,
encoded, encoded,
@@ -313,7 +313,7 @@ impl OpenCADStudio {
if op.starts_with("__SPLINEDIT_") { if op.starts_with("__SPLINEDIT_") {
let label = self.history_label_from_active_cmd(i, "SPLINEDIT"); let label = self.history_label_from_active_cmd(i, "SPLINEDIT");
self.push_undo_snapshot(i, label); self.push_undo_snapshot(i, label);
crate::modules::home::modify::splinedit::apply_spline_op( crate::modules::draw::modify::splinedit::apply_spline_op(
&mut self.tabs[i].scene.document, &mut self.tabs[i].scene.document,
handle, handle,
&op, &op,
@@ -772,7 +772,7 @@ impl OpenCADStudio {
pick_pt, pick_pt,
mode, mode,
} => { } => {
use crate::modules::home::modify::lengthen::lengthen_entity; use crate::modules::draw::modify::lengthen::lengthen_entity;
let result = self.tabs[i] let result = self.tabs[i]
.scene .scene
.document .document
@@ -799,7 +799,7 @@ impl OpenCADStudio {
self.restore_pre_cmd_tangent(); self.restore_pre_cmd_tangent();
} }
CmdResult::DivideEntity { handle, n } => { CmdResult::DivideEntity { handle, n } => {
use crate::modules::home::inquiry::divide::divide_entity; use crate::modules::draw::inquiry::divide::divide_entity;
let pts = self.tabs[i] let pts = self.tabs[i]
.scene .scene
.document .document
@@ -828,7 +828,7 @@ impl OpenCADStudio {
handle, handle,
segment_length, segment_length,
} => { } => {
use crate::modules::home::inquiry::divide::measure_entity; use crate::modules::draw::inquiry::divide::measure_entity;
let pts = self.tabs[i] let pts = self.tabs[i]
.scene .scene
.document .document
@@ -854,7 +854,7 @@ impl OpenCADStudio {
self.restore_pre_cmd_tangent(); self.restore_pre_cmd_tangent();
} }
CmdResult::PeditOp { handle, op } => { CmdResult::PeditOp { handle, op } => {
use crate::modules::home::modify::pedit::apply_pedit; use crate::modules::draw::modify::pedit::apply_pedit;
let changed = self.tabs[i] let changed = self.tabs[i]
.scene .scene
.document .document
@@ -875,7 +875,7 @@ impl OpenCADStudio {
.push_info("PEDIT Enter option [C=Close O=Open W=Width X=Exit]:"); .push_info("PEDIT Enter option [C=Close O=Open W=Width X=Exit]:");
} }
CmdResult::JoinEntities(handles) => { CmdResult::JoinEntities(handles) => {
use crate::modules::home::modify::join::join_entities; use crate::modules::draw::modify::join::join_entities;
let pairs: Vec<_> = handles let pairs: Vec<_> = handles
.iter() .iter()
.filter_map(|&h| self.tabs[i].scene.document.get_entity(h).map(|e| (h, e))) .filter_map(|&h| self.tabs[i].scene.document.get_entity(h).map(|e| (h, e)))
@@ -912,7 +912,7 @@ impl OpenCADStudio {
} }
} }
CmdResult::BreakEntity { handle, p1, p2 } => { CmdResult::BreakEntity { handle, p1, p2 } => {
use crate::modules::home::modify::break_cmd::break_entity; use crate::modules::draw::modify::break_cmd::break_entity;
let replacement = self.tabs[i] let replacement = self.tabs[i]
.scene .scene
.document .document
+103 -103
View File
@@ -145,7 +145,7 @@ impl OpenCADStudio {
.map(|(h, _)| h) .map(|(h, _)| h)
.collect(); .collect();
if handles.is_empty() { if handles.is_empty() {
use crate::modules::home::select::SelectObjectsCommand; use crate::modules::draw::select::SelectObjectsCommand;
let cmd = SelectObjectsCommand::new("LAYOFF"); let cmd = SelectObjectsCommand::new("LAYOFF");
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
@@ -180,7 +180,7 @@ impl OpenCADStudio {
.map(|(h, _)| h) .map(|(h, _)| h)
.collect(); .collect();
if handles.is_empty() { if handles.is_empty() {
use crate::modules::home::select::SelectObjectsCommand; use crate::modules::draw::select::SelectObjectsCommand;
let cmd = SelectObjectsCommand::new("LAYFRZ"); let cmd = SelectObjectsCommand::new("LAYFRZ");
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
@@ -215,7 +215,7 @@ impl OpenCADStudio {
.map(|(h, _)| h) .map(|(h, _)| h)
.collect(); .collect();
if handles.is_empty() { if handles.is_empty() {
use crate::modules::home::select::SelectObjectsCommand; use crate::modules::draw::select::SelectObjectsCommand;
let cmd = SelectObjectsCommand::new("LAYLCK"); let cmd = SelectObjectsCommand::new("LAYLCK");
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
@@ -242,7 +242,7 @@ impl OpenCADStudio {
"LAYMCUR" => { "LAYMCUR" => {
let entities = self.tabs[i].scene.selected_entities(); let entities = self.tabs[i].scene.selected_entities();
if entities.is_empty() { if entities.is_empty() {
use crate::modules::home::select::SelectObjectsCommand; use crate::modules::draw::select::SelectObjectsCommand;
let cmd = SelectObjectsCommand::new("LAYMCUR"); let cmd = SelectObjectsCommand::new("LAYMCUR");
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
@@ -319,7 +319,7 @@ impl OpenCADStudio {
.map(|(h, _)| h) .map(|(h, _)| h)
.collect(); .collect();
if handles.is_empty() { if handles.is_empty() {
use crate::modules::home::select::SelectObjectsCommand; use crate::modules::draw::select::SelectObjectsCommand;
let cmd = SelectObjectsCommand::new("LAYULK"); let cmd = SelectObjectsCommand::new("LAYULK");
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
@@ -439,7 +439,7 @@ impl OpenCADStudio {
} }
"LAYMATCH" | "LAYMCH" => { "LAYMATCH" | "LAYMCH" => {
use crate::modules::home::layers::match_layer::LayMatchCommand; use crate::modules::draw::layers::match_layer::LayMatchCommand;
let dest: Vec<_> = self.tabs[i] let dest: Vec<_> = self.tabs[i]
.scene .scene
.selected_entities() .selected_entities()
@@ -452,7 +452,7 @@ impl OpenCADStudio {
} }
"MATCHPROP" | "MA" => { "MATCHPROP" | "MA" => {
use crate::modules::home::properties::match_prop::MatchPropCommand; use crate::modules::draw::properties::match_prop::MatchPropCommand;
self.tabs[i].scene.deselect_all(); self.tabs[i].scene.deselect_all();
let cmd = MatchPropCommand::new(); let cmd = MatchPropCommand::new();
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
@@ -467,13 +467,13 @@ impl OpenCADStudio {
.map(|(h, _)| h) .map(|(h, _)| h)
.collect(); .collect();
if handles.is_empty() { if handles.is_empty() {
use crate::modules::home::select::SelectObjectsCommand; use crate::modules::draw::select::SelectObjectsCommand;
let cmd = SelectObjectsCommand::new("GROUP"); let cmd = SelectObjectsCommand::new("GROUP");
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
} else { } else {
let auto_name = super::helpers::next_group_auto_name(&self.tabs[i].scene); let auto_name = super::helpers::next_group_auto_name(&self.tabs[i].scene);
use crate::modules::home::groups::group::GroupCommand; use crate::modules::draw::groups::group::GroupCommand;
let cmd = GroupCommand::new(handles, auto_name); let cmd = GroupCommand::new(handles, auto_name);
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
@@ -488,7 +488,7 @@ impl OpenCADStudio {
.map(|(h, _)| h) .map(|(h, _)| h)
.collect(); .collect();
if handles.is_empty() { if handles.is_empty() {
use crate::modules::home::groups::ungroup::UngroupCommand; use crate::modules::draw::groups::ungroup::UngroupCommand;
let cmd = UngroupCommand::new(); let cmd = UngroupCommand::new();
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
@@ -514,7 +514,7 @@ impl OpenCADStudio {
.map(|(h, _)| h) .map(|(h, _)| h)
.collect(); .collect();
if handles.is_empty() { if handles.is_empty() {
use crate::modules::home::select::SelectObjectsCommand; use crate::modules::draw::select::SelectObjectsCommand;
let cmd = SelectObjectsCommand::new("COPYCLIP"); let cmd = SelectObjectsCommand::new("COPYCLIP");
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
@@ -542,7 +542,7 @@ impl OpenCADStudio {
.map(|(h, _)| h) .map(|(h, _)| h)
.collect(); .collect();
if handles.is_empty() { if handles.is_empty() {
use crate::modules::home::select::SelectObjectsCommand; use crate::modules::draw::select::SelectObjectsCommand;
let cmd = SelectObjectsCommand::new("CUTCLIP"); let cmd = SelectObjectsCommand::new("CUTCLIP");
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
@@ -571,7 +571,7 @@ impl OpenCADStudio {
self.command_line.push_error("Clipboard is empty."); self.command_line.push_error("Clipboard is empty.");
} else { } else {
let wires = self.tabs[i].scene.wires_for_entities(&self.clipboard); let wires = self.tabs[i].scene.wires_for_entities(&self.clipboard);
use crate::modules::home::clipboard::paste::PasteCommand; use crate::modules::draw::clipboard::paste::PasteCommand;
let cmd = PasteCommand::new(wires, self.clipboard_centroid); let cmd = PasteCommand::new(wires, self.clipboard_centroid);
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
@@ -605,7 +605,7 @@ impl OpenCADStudio {
.map(|(h, _)| h) .map(|(h, _)| h)
.collect(); .collect();
if handles.is_empty() { if handles.is_empty() {
use crate::modules::home::select::SelectObjectsCommand; use crate::modules::draw::select::SelectObjectsCommand;
let cmd = SelectObjectsCommand::new("BLOCK"); let cmd = SelectObjectsCommand::new("BLOCK");
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
@@ -723,14 +723,14 @@ impl OpenCADStudio {
// ── Draw commands ────────────────────────────────────────────── // ── Draw commands ──────────────────────────────────────────────
"LINE" | "L" => { "LINE" | "L" => {
use crate::modules::home::draw::line::LineCommand; use crate::modules::draw::draw::line::LineCommand;
let new_cmd = LineCommand::new(); let new_cmd = LineCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"MLINE" | "ML" => { "MLINE" | "ML" => {
use crate::modules::home::draw::mline::MlineCommand; use crate::modules::draw::draw::mline::MlineCommand;
let style = self.tabs[i].scene.document.header.multiline_style.clone(); let style = self.tabs[i].scene.document.header.multiline_style.clone();
let cmd_obj = MlineCommand::with_style(style); let cmd_obj = MlineCommand::with_style(style);
self.command_line.push_info(&cmd_obj.prompt()); self.command_line.push_info(&cmd_obj.prompt());
@@ -738,7 +738,7 @@ impl OpenCADStudio {
} }
cmd if cmd == "WIPEOUT" || cmd == "WO" || cmd.starts_with("WIPEOUT ") => { cmd if cmd == "WIPEOUT" || cmd == "WO" || cmd.starts_with("WIPEOUT ") => {
use crate::modules::home::draw::wipeout::WipeoutCommand; use crate::modules::draw::draw::wipeout::WipeoutCommand;
let args = cmd let args = cmd
.split_once(' ') .split_once(' ')
.map(|(_, r)| r.trim().to_uppercase()) .map(|(_, r)| r.trim().to_uppercase())
@@ -757,14 +757,14 @@ impl OpenCADStudio {
} }
"REVCLOUD" => { "REVCLOUD" => {
use crate::modules::home::draw::revcloud::RevCloudCommand; use crate::modules::draw::draw::revcloud::RevCloudCommand;
let cmd = RevCloudCommand::new(); let cmd = RevCloudCommand::new();
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
} }
"ATTDEF" => { "ATTDEF" => {
use crate::modules::home::draw::attdef::AttdefCommand; use crate::modules::draw::draw::attdef::AttdefCommand;
let cmd = AttdefCommand::new(); let cmd = AttdefCommand::new();
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
@@ -894,38 +894,38 @@ impl OpenCADStudio {
} }
"DONUT" | "DO" => { "DONUT" | "DO" => {
use crate::modules::home::draw::donut::DonutCommand; use crate::modules::draw::draw::donut::DonutCommand;
let cmd = DonutCommand::new(); let cmd = DonutCommand::new();
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
} }
"CIRCLE" | "C" => { "CIRCLE" | "C" => {
use crate::modules::home::draw::circle::CircleCommand; use crate::modules::draw::draw::circle::CircleCommand;
let new_cmd = CircleCommand::new(); let new_cmd = CircleCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"CIRCLE_CD" => { "CIRCLE_CD" => {
use crate::modules::home::draw::circle::CircleCDCommand; use crate::modules::draw::draw::circle::CircleCDCommand;
let new_cmd = CircleCDCommand::new(); let new_cmd = CircleCDCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"CIRCLE_2P" => { "CIRCLE_2P" => {
use crate::modules::home::draw::circle::Circle2PCommand; use crate::modules::draw::draw::circle::Circle2PCommand;
let new_cmd = Circle2PCommand::new(); let new_cmd = Circle2PCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"CIRCLE_3P" => { "CIRCLE_3P" => {
use crate::modules::home::draw::circle::Circle3PCommand; use crate::modules::draw::draw::circle::Circle3PCommand;
let new_cmd = Circle3PCommand::new(); let new_cmd = Circle3PCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"CIRCLE_TTR" => { "CIRCLE_TTR" => {
use crate::modules::home::draw::circle::CircleTTRCommand; use crate::modules::draw::draw::circle::CircleTTRCommand;
let new_cmd = CircleTTRCommand::new(); let new_cmd = CircleTTRCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.pre_cmd_tangent = Some(self.snapper.is_on(crate::snap::SnapType::Tangent)); self.pre_cmd_tangent = Some(self.snapper.is_on(crate::snap::SnapType::Tangent));
@@ -933,7 +933,7 @@ impl OpenCADStudio {
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"CIRCLE_TTT" => { "CIRCLE_TTT" => {
use crate::modules::home::draw::circle::CircleTTTCommand; use crate::modules::draw::draw::circle::CircleTTTCommand;
let new_cmd = CircleTTTCommand::new(); let new_cmd = CircleTTTCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.pre_cmd_tangent = Some(self.snapper.is_on(crate::snap::SnapType::Tangent)); self.pre_cmd_tangent = Some(self.snapper.is_on(crate::snap::SnapType::Tangent));
@@ -942,105 +942,105 @@ impl OpenCADStudio {
} }
"ARC" | "A" => { "ARC" | "A" => {
use crate::modules::home::draw::arc::ArcCommand; use crate::modules::draw::draw::arc::ArcCommand;
let new_cmd = ArcCommand::new(); let new_cmd = ArcCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"ARC_3P" => { "ARC_3P" => {
use crate::modules::home::draw::arc::Arc3PCommand; use crate::modules::draw::draw::arc::Arc3PCommand;
let new_cmd = Arc3PCommand::new(); let new_cmd = Arc3PCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"ARC_SCE" => { "ARC_SCE" => {
use crate::modules::home::draw::arc::ArcSCECommand; use crate::modules::draw::draw::arc::ArcSCECommand;
let new_cmd = ArcSCECommand::new(); let new_cmd = ArcSCECommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"ARC_SCA" => { "ARC_SCA" => {
use crate::modules::home::draw::arc::ArcSCACommand; use crate::modules::draw::draw::arc::ArcSCACommand;
let new_cmd = ArcSCACommand::new(); let new_cmd = ArcSCACommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"ARC_SCL" => { "ARC_SCL" => {
use crate::modules::home::draw::arc::ArcSCLCommand; use crate::modules::draw::draw::arc::ArcSCLCommand;
let new_cmd = ArcSCLCommand::new(); let new_cmd = ArcSCLCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"ARC_SEA" => { "ARC_SEA" => {
use crate::modules::home::draw::arc::ArcSEACommand; use crate::modules::draw::draw::arc::ArcSEACommand;
let new_cmd = ArcSEACommand::new(); let new_cmd = ArcSEACommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"ARC_SER" => { "ARC_SER" => {
use crate::modules::home::draw::arc::ArcSERCommand; use crate::modules::draw::draw::arc::ArcSERCommand;
let new_cmd = ArcSERCommand::new(); let new_cmd = ArcSERCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"ARC_SED" => { "ARC_SED" => {
use crate::modules::home::draw::arc::ArcSEDCommand; use crate::modules::draw::draw::arc::ArcSEDCommand;
let new_cmd = ArcSEDCommand::new(); let new_cmd = ArcSEDCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"ARC_CSA" => { "ARC_CSA" => {
use crate::modules::home::draw::arc::ArcCSACommand; use crate::modules::draw::draw::arc::ArcCSACommand;
let new_cmd = ArcCSACommand::new(); let new_cmd = ArcCSACommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"ARC_CSL" => { "ARC_CSL" => {
use crate::modules::home::draw::arc::ArcCSLCommand; use crate::modules::draw::draw::arc::ArcCSLCommand;
let new_cmd = ArcCSLCommand::new(); let new_cmd = ArcCSLCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"RECT" | "RECTANG" | "REC" => { "RECT" | "RECTANG" | "REC" => {
use crate::modules::home::draw::shapes::RectCommand; use crate::modules::draw::draw::shapes::RectCommand;
let new_cmd = RectCommand::new(); let new_cmd = RectCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"RECT_ROT" => { "RECT_ROT" => {
use crate::modules::home::draw::shapes::RectRotCommand; use crate::modules::draw::draw::shapes::RectRotCommand;
let new_cmd = RectRotCommand::new(); let new_cmd = RectRotCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"RECT_CEN" => { "RECT_CEN" => {
use crate::modules::home::draw::shapes::RectCenCommand; use crate::modules::draw::draw::shapes::RectCenCommand;
let new_cmd = RectCenCommand::new(); let new_cmd = RectCenCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"POLY" | "POLYGON" | "POL" => { "POLY" | "POLYGON" | "POL" => {
use crate::modules::home::draw::shapes::PolyCommand; use crate::modules::draw::draw::shapes::PolyCommand;
let new_cmd = PolyCommand::new(); let new_cmd = PolyCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"POLY_C" => { "POLY_C" => {
use crate::modules::home::draw::shapes::PolyCCommand; use crate::modules::draw::draw::shapes::PolyCCommand;
let new_cmd = PolyCCommand::new(); let new_cmd = PolyCCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"POLY_E" => { "POLY_E" => {
use crate::modules::home::draw::shapes::PolyECommand; use crate::modules::draw::draw::shapes::PolyECommand;
let new_cmd = PolyECommand::new(); let new_cmd = PolyECommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"PLINE" | "PL" => { "PLINE" | "PL" => {
use crate::modules::home::draw::polyline::PlineCommand; use crate::modules::draw::draw::polyline::PlineCommand;
let new_cmd = PlineCommand::new(); let new_cmd = PlineCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
@@ -1055,12 +1055,12 @@ impl OpenCADStudio {
.map(|(h, _)| h) .map(|(h, _)| h)
.collect(); .collect();
if handles.is_empty() { if handles.is_empty() {
use crate::modules::home::select::SelectObjectsCommand; use crate::modules::draw::select::SelectObjectsCommand;
let cmd = SelectObjectsCommand::new("MOVE"); let cmd = SelectObjectsCommand::new("MOVE");
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
} else { } else {
use crate::modules::home::modify::translate::MoveCommand; use crate::modules::draw::modify::translate::MoveCommand;
let wires = self.tabs[i].scene.wire_models_for(&handles); let wires = self.tabs[i].scene.wire_models_for(&handles);
let new_cmd = MoveCommand::new(handles, wires); let new_cmd = MoveCommand::new(handles, wires);
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
@@ -1076,12 +1076,12 @@ impl OpenCADStudio {
.map(|(h, _)| h) .map(|(h, _)| h)
.collect(); .collect();
if handles.is_empty() { if handles.is_empty() {
use crate::modules::home::select::SelectObjectsCommand; use crate::modules::draw::select::SelectObjectsCommand;
let cmd = SelectObjectsCommand::new("COPY"); let cmd = SelectObjectsCommand::new("COPY");
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
} else { } else {
use crate::modules::home::modify::copy::CopyCommand; use crate::modules::draw::modify::copy::CopyCommand;
let wires = self.tabs[i].scene.wire_models_for(&handles); let wires = self.tabs[i].scene.wire_models_for(&handles);
let new_cmd = CopyCommand::new(handles, wires); let new_cmd = CopyCommand::new(handles, wires);
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
@@ -1097,12 +1097,12 @@ impl OpenCADStudio {
.map(|(h, _)| h) .map(|(h, _)| h)
.collect(); .collect();
if handles.is_empty() { if handles.is_empty() {
use crate::modules::home::select::SelectObjectsCommand; use crate::modules::draw::select::SelectObjectsCommand;
let cmd = SelectObjectsCommand::new("ROTATE"); let cmd = SelectObjectsCommand::new("ROTATE");
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
} else { } else {
use crate::modules::home::modify::rotate::RotateCommand; use crate::modules::draw::modify::rotate::RotateCommand;
let wires = self.tabs[i].scene.wire_models_for(&handles); let wires = self.tabs[i].scene.wire_models_for(&handles);
let new_cmd = RotateCommand::new(handles, wires); let new_cmd = RotateCommand::new(handles, wires);
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
@@ -1111,28 +1111,28 @@ impl OpenCADStudio {
} }
"POINT" | "PO" => { "POINT" | "PO" => {
use crate::modules::home::draw::point::PointCommand; use crate::modules::draw::draw::point::PointCommand;
let new_cmd = PointCommand::new(); let new_cmd = PointCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"RAY" => { "RAY" => {
use crate::modules::home::draw::ray::RayCommand; use crate::modules::draw::draw::ray::RayCommand;
let new_cmd = RayCommand::new(); let new_cmd = RayCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"XLINE" | "XL" | "CONSTRUCTIONLINE" => { "XLINE" | "XL" | "CONSTRUCTIONLINE" => {
use crate::modules::home::draw::ray::XLineCommand; use crate::modules::draw::draw::ray::XLineCommand;
let new_cmd = XLineCommand::new(); let new_cmd = XLineCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"HATCH" | "H" => { "HATCH" | "H" => {
use crate::modules::home::draw::hatch::HatchCommand; use crate::modules::draw::draw::hatch::HatchCommand;
let outlines = self.tabs[i].scene.closed_outlines(); let outlines = self.tabs[i].scene.closed_outlines();
let new_cmd = HatchCommand::new(outlines); let new_cmd = HatchCommand::new(outlines);
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
@@ -1140,7 +1140,7 @@ impl OpenCADStudio {
} }
"HATCHEDIT" | "HE" => { "HATCHEDIT" | "HE" => {
use crate::modules::home::draw::hatchedit::HatcheditCommand; use crate::modules::draw::draw::hatchedit::HatcheditCommand;
// If a single hatch is already selected, skip the pick step. // If a single hatch is already selected, skip the pick step.
let sel = self.tabs[i].scene.selected_entities(); let sel = self.tabs[i].scene.selected_entities();
if sel.len() == 1 { if sel.len() == 1 {
@@ -1166,7 +1166,7 @@ impl OpenCADStudio {
} }
"GRADIENT" => { "GRADIENT" => {
use crate::modules::home::draw::hatch::GradientCommand; use crate::modules::draw::draw::hatch::GradientCommand;
let outlines = self.tabs[i].scene.closed_outlines(); let outlines = self.tabs[i].scene.closed_outlines();
let new_cmd = GradientCommand::new(outlines); let new_cmd = GradientCommand::new(outlines);
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
@@ -1174,7 +1174,7 @@ impl OpenCADStudio {
} }
"BOUNDARY" => { "BOUNDARY" => {
use crate::modules::home::draw::hatch::BoundaryCommand; use crate::modules::draw::draw::hatch::BoundaryCommand;
let outlines = self.tabs[i].scene.closed_outlines(); let outlines = self.tabs[i].scene.closed_outlines();
let new_cmd = BoundaryCommand::new(outlines); let new_cmd = BoundaryCommand::new(outlines);
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
@@ -1182,28 +1182,28 @@ impl OpenCADStudio {
} }
"ELLIPSE" | "EL" => { "ELLIPSE" | "EL" => {
use crate::modules::home::draw::ellipse::EllipseCommand; use crate::modules::draw::draw::ellipse::EllipseCommand;
let new_cmd = EllipseCommand::new(); let new_cmd = EllipseCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"ELLIPSE_AXIS" => { "ELLIPSE_AXIS" => {
use crate::modules::home::draw::ellipse::EllipseAxisCommand; use crate::modules::draw::draw::ellipse::EllipseAxisCommand;
let new_cmd = EllipseAxisCommand::new(); let new_cmd = EllipseAxisCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"ELLIPSE_ARC" => { "ELLIPSE_ARC" => {
use crate::modules::home::draw::ellipse::EllipseArcCommand; use crate::modules::draw::draw::ellipse::EllipseArcCommand;
let new_cmd = EllipseArcCommand::new(); let new_cmd = EllipseArcCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
} }
"SPLINE" | "SPL" => { "SPLINE" | "SPL" => {
use crate::modules::home::draw::spline::SplineCommand; use crate::modules::draw::draw::spline::SplineCommand;
let new_cmd = SplineCommand::new(); let new_cmd = SplineCommand::new();
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
@@ -1217,12 +1217,12 @@ impl OpenCADStudio {
.map(|(h, _)| h) .map(|(h, _)| h)
.collect(); .collect();
if handles.is_empty() { if handles.is_empty() {
use crate::modules::home::select::SelectObjectsCommand; use crate::modules::draw::select::SelectObjectsCommand;
let cmd = SelectObjectsCommand::new("SCALE"); let cmd = SelectObjectsCommand::new("SCALE");
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
} else { } else {
use crate::modules::home::modify::scale::ScaleCommand; use crate::modules::draw::modify::scale::ScaleCommand;
let wires = self.tabs[i].scene.wire_models_for(&handles); let wires = self.tabs[i].scene.wire_models_for(&handles);
let new_cmd = ScaleCommand::new(handles, wires); let new_cmd = ScaleCommand::new(handles, wires);
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
@@ -1238,12 +1238,12 @@ impl OpenCADStudio {
.map(|(h, _)| h) .map(|(h, _)| h)
.collect(); .collect();
if handles.is_empty() { if handles.is_empty() {
use crate::modules::home::select::SelectObjectsCommand; use crate::modules::draw::select::SelectObjectsCommand;
let cmd = SelectObjectsCommand::new("MIRROR"); let cmd = SelectObjectsCommand::new("MIRROR");
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
} else { } else {
use crate::modules::home::modify::mirror::MirrorCommand; use crate::modules::draw::modify::mirror::MirrorCommand;
let wires = self.tabs[i].scene.wire_models_for(&handles); let wires = self.tabs[i].scene.wire_models_for(&handles);
let new_cmd = MirrorCommand::new(handles, wires); let new_cmd = MirrorCommand::new(handles, wires);
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
@@ -1259,7 +1259,7 @@ impl OpenCADStudio {
.map(|(h, _)| h) .map(|(h, _)| h)
.collect(); .collect();
if handles.is_empty() { if handles.is_empty() {
use crate::modules::home::select::SelectObjectsCommand; use crate::modules::draw::select::SelectObjectsCommand;
let cmd = SelectObjectsCommand::new("ERASE"); let cmd = SelectObjectsCommand::new("ERASE");
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
@@ -1561,12 +1561,12 @@ impl OpenCADStudio {
.map(|(h, _)| h) .map(|(h, _)| h)
.collect(); .collect();
if handles.is_empty() { if handles.is_empty() {
use crate::modules::home::select::SelectObjectsCommand; use crate::modules::draw::select::SelectObjectsCommand;
let cmd = SelectObjectsCommand::new("STRETCH"); let cmd = SelectObjectsCommand::new("STRETCH");
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
} else { } else {
use crate::modules::home::modify::stretch::StretchCommand; use crate::modules::draw::modify::stretch::StretchCommand;
let wires = self.tabs[i].scene.wire_models_for(&handles); let wires = self.tabs[i].scene.wire_models_for(&handles);
let new_cmd = StretchCommand::new(handles, wires); let new_cmd = StretchCommand::new(handles, wires);
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
@@ -1575,7 +1575,7 @@ impl OpenCADStudio {
} }
"FILLET" | "F" => { "FILLET" | "F" => {
use crate::modules::home::modify::fillet::FilletCommand; use crate::modules::draw::modify::fillet::FilletCommand;
let entities: Vec<_> = self.tabs[i] let entities: Vec<_> = self.tabs[i]
.scene .scene
.entity_wires() .entity_wires()
@@ -1592,7 +1592,7 @@ impl OpenCADStudio {
.collect(); .collect();
let all_entities: Vec<_> = entities.into_iter().map(|(_, e)| e).collect(); let all_entities: Vec<_> = entities.into_iter().map(|(_, e)| e).collect();
let new_cmd = FilletCommand::new( let new_cmd = FilletCommand::new(
crate::modules::home::defaults::get_fillet_radius(), crate::modules::draw::defaults::get_fillet_radius(),
all_entities, all_entities,
); );
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
@@ -1607,12 +1607,12 @@ impl OpenCADStudio {
.map(|(h, _)| h) .map(|(h, _)| h)
.collect(); .collect();
if handles.is_empty() { if handles.is_empty() {
use crate::modules::home::select::SelectObjectsCommand; use crate::modules::draw::select::SelectObjectsCommand;
let cmd = SelectObjectsCommand::new("ARRAYRECT"); let cmd = SelectObjectsCommand::new("ARRAYRECT");
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
} else { } else {
use crate::modules::home::modify::array::ArrayRectCommand; use crate::modules::draw::modify::array::ArrayRectCommand;
let wires = self.tabs[i].scene.wire_models_for(&handles); let wires = self.tabs[i].scene.wire_models_for(&handles);
let new_cmd = ArrayRectCommand::new(handles, wires); let new_cmd = ArrayRectCommand::new(handles, wires);
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
@@ -1628,12 +1628,12 @@ impl OpenCADStudio {
.map(|(h, _)| h) .map(|(h, _)| h)
.collect(); .collect();
if handles.is_empty() { if handles.is_empty() {
use crate::modules::home::select::SelectObjectsCommand; use crate::modules::draw::select::SelectObjectsCommand;
let cmd = SelectObjectsCommand::new("ARRAYPOLAR"); let cmd = SelectObjectsCommand::new("ARRAYPOLAR");
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
} else { } else {
use crate::modules::home::modify::array::ArrayPolarCommand; use crate::modules::draw::modify::array::ArrayPolarCommand;
let wires = self.tabs[i].scene.wire_models_for(&handles); let wires = self.tabs[i].scene.wire_models_for(&handles);
let new_cmd = ArrayPolarCommand::new(handles, wires); let new_cmd = ArrayPolarCommand::new(handles, wires);
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
@@ -1649,12 +1649,12 @@ impl OpenCADStudio {
.map(|(h, _)| h) .map(|(h, _)| h)
.collect(); .collect();
if handles.is_empty() { if handles.is_empty() {
use crate::modules::home::select::SelectObjectsCommand; use crate::modules::draw::select::SelectObjectsCommand;
let cmd = SelectObjectsCommand::new("ARRAYPATH"); let cmd = SelectObjectsCommand::new("ARRAYPATH");
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
} else { } else {
use crate::modules::home::modify::array::ArrayPathCommand; use crate::modules::draw::modify::array::ArrayPathCommand;
let wires = self.tabs[i].scene.wire_models_for(&handles); let wires = self.tabs[i].scene.wire_models_for(&handles);
let all_entities: Vec<_> = self.tabs[i] let all_entities: Vec<_> = self.tabs[i]
.scene .scene
@@ -1679,12 +1679,12 @@ impl OpenCADStudio {
.map(|(h, _)| h) .map(|(h, _)| h)
.collect(); .collect();
if handles.is_empty() { if handles.is_empty() {
use crate::modules::home::select::SelectObjectsCommand; use crate::modules::draw::select::SelectObjectsCommand;
let cmd = SelectObjectsCommand::new("ARRAY3D"); let cmd = SelectObjectsCommand::new("ARRAY3D");
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
} else { } else {
use crate::modules::home::modify::array::Array3DCommand; use crate::modules::draw::modify::array::Array3DCommand;
let new_cmd = Array3DCommand::new(handles); let new_cmd = Array3DCommand::new(handles);
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(new_cmd)); self.tabs[i].active_cmd = Some(Box::new(new_cmd));
@@ -1692,7 +1692,7 @@ impl OpenCADStudio {
} }
"CHAMFER" | "CHA" => { "CHAMFER" | "CHA" => {
use crate::modules::home::modify::fillet::ChamferCommand; use crate::modules::draw::modify::fillet::ChamferCommand;
let entities: Vec<_> = self.tabs[i] let entities: Vec<_> = self.tabs[i]
.scene .scene
.entity_wires() .entity_wires()
@@ -1709,7 +1709,7 @@ impl OpenCADStudio {
.collect(); .collect();
let all_entities: Vec<_> = entities.into_iter().map(|(_, e)| e).collect(); let all_entities: Vec<_> = entities.into_iter().map(|(_, e)| e).collect();
let new_cmd = ChamferCommand::new( let new_cmd = ChamferCommand::new(
crate::modules::home::defaults::get_chamfer_dist1(), crate::modules::draw::defaults::get_chamfer_dist1(),
all_entities, all_entities,
); );
self.command_line.push_info(&new_cmd.prompt()); self.command_line.push_info(&new_cmd.prompt());
@@ -1717,10 +1717,10 @@ impl OpenCADStudio {
} }
"EXPLODE" | "X" => { "EXPLODE" | "X" => {
use crate::modules::home::modify::explode::explode_entity; use crate::modules::draw::modify::explode::explode_entity;
let entities: Vec<_> = self.tabs[i].scene.selected_entities().into_iter().collect(); let entities: Vec<_> = self.tabs[i].scene.selected_entities().into_iter().collect();
if entities.is_empty() { if entities.is_empty() {
use crate::modules::home::select::SelectObjectsCommand; use crate::modules::draw::select::SelectObjectsCommand;
let cmd = SelectObjectsCommand::new("EXPLODE"); let cmd = SelectObjectsCommand::new("EXPLODE");
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
@@ -1759,7 +1759,7 @@ impl OpenCADStudio {
} }
"OFFSET" | "O" => { "OFFSET" | "O" => {
use crate::modules::home::modify::offset::OffsetCommand; use crate::modules::draw::modify::offset::OffsetCommand;
let all_entities: Vec<_> = self.tabs[i] let all_entities: Vec<_> = self.tabs[i]
.scene .scene
.entity_wires() .entity_wires()
@@ -1775,7 +1775,7 @@ impl OpenCADStudio {
} }
"TRIM" | "TR" => { "TRIM" | "TR" => {
use crate::modules::home::modify::trim::TrimCommand; use crate::modules::draw::modify::trim::TrimCommand;
let entities: Vec<_> = self.tabs[i] let entities: Vec<_> = self.tabs[i]
.scene .scene
.entity_wires() .entity_wires()
@@ -1797,7 +1797,7 @@ impl OpenCADStudio {
} }
"EXTEND" | "EX" => { "EXTEND" | "EX" => {
use crate::modules::home::modify::trim::ExtendCommand; use crate::modules::draw::modify::trim::ExtendCommand;
let entities: Vec<_> = self.tabs[i] let entities: Vec<_> = self.tabs[i]
.scene .scene
.entity_wires() .entity_wires()
@@ -1901,42 +1901,42 @@ impl OpenCADStudio {
// ── Break / Join ───────────────────────────────────────────────── // ── Break / Join ─────────────────────────────────────────────────
"JOIN" | "J" => { "JOIN" | "J" => {
use crate::modules::home::modify::join::JoinCommand; use crate::modules::draw::modify::join::JoinCommand;
let cmd = JoinCommand::new(); let cmd = JoinCommand::new();
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
} }
"BREAK" | "BR" => { "BREAK" | "BR" => {
use crate::modules::home::modify::break_cmd::BreakInteractiveCommand; use crate::modules::draw::modify::break_cmd::BreakInteractiveCommand;
let cmd = BreakInteractiveCommand::new(); let cmd = BreakInteractiveCommand::new();
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
} }
"BREAKATPOINT" | "BAP" => { "BREAKATPOINT" | "BAP" => {
use crate::modules::home::modify::break_cmd::BreakAtPointCommand; use crate::modules::draw::modify::break_cmd::BreakAtPointCommand;
let cmd = BreakAtPointCommand::new(); let cmd = BreakAtPointCommand::new();
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
} }
"PEDIT" | "PE" => { "PEDIT" | "PE" => {
use crate::modules::home::modify::pedit::PeditCommand; use crate::modules::draw::modify::pedit::PeditCommand;
let cmd_obj = PeditCommand::new(); let cmd_obj = PeditCommand::new();
self.command_line.push_info(&cmd_obj.prompt()); self.command_line.push_info(&cmd_obj.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd_obj)); self.tabs[i].active_cmd = Some(Box::new(cmd_obj));
} }
"SPLINEDIT" | "SPE" => { "SPLINEDIT" | "SPE" => {
use crate::modules::home::modify::splinedit::SplineditCommand; use crate::modules::draw::modify::splinedit::SplineditCommand;
let cmd_obj = SplineditCommand::new(); let cmd_obj = SplineditCommand::new();
self.command_line.push_info(&cmd_obj.prompt()); self.command_line.push_info(&cmd_obj.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd_obj)); self.tabs[i].active_cmd = Some(Box::new(cmd_obj));
} }
"ATTEDIT" | "ATE" | "-ATTEDIT" => { "ATTEDIT" | "ATE" | "-ATTEDIT" => {
use crate::modules::home::modify::attedit::AtteditCommand; use crate::modules::draw::modify::attedit::AtteditCommand;
let cmd_obj = AtteditCommand::new(); let cmd_obj = AtteditCommand::new();
self.command_line.push_info(&cmd_obj.prompt()); self.command_line.push_info(&cmd_obj.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd_obj)); self.tabs[i].active_cmd = Some(Box::new(cmd_obj));
@@ -1944,7 +1944,7 @@ impl OpenCADStudio {
// ── REFEDIT — in-place block editing ───────────────────────────── // ── REFEDIT — in-place block editing ─────────────────────────────
"REFEDIT" => { "REFEDIT" => {
use crate::modules::home::modify::refedit::RefEditPickCommand; use crate::modules::draw::modify::refedit::RefEditPickCommand;
// If a session is already active, tell the user. // If a session is already active, tell the user.
if self.tabs[i].refedit_session.is_some() { if self.tabs[i].refedit_session.is_some() {
self.command_line self.command_line
@@ -1971,7 +1971,7 @@ impl OpenCADStudio {
} }
cmd if cmd.starts_with("REFEDIT_BEGIN:") => { cmd if cmd.starts_with("REFEDIT_BEGIN:") => {
use crate::modules::home::modify::refedit::{ use crate::modules::draw::modify::refedit::{
apply_insert_transform, RefEditSession, apply_insert_transform, RefEditSession,
}; };
use acadrust::Handle; use acadrust::Handle;
@@ -2079,7 +2079,7 @@ impl OpenCADStudio {
"REFEDIT: Editing block \"{}\". Use REFCLOSE when done.", "REFEDIT: Editing block \"{}\". Use REFCLOSE when done.",
insert.block_name insert.block_name
)); ));
use crate::modules::home::modify::refedit::RefCloseCommand; use crate::modules::draw::modify::refedit::RefCloseCommand;
let cmd_obj = RefCloseCommand::new(); let cmd_obj = RefCloseCommand::new();
self.command_line.push_info(&cmd_obj.prompt()); self.command_line.push_info(&cmd_obj.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd_obj)); self.tabs[i].active_cmd = Some(Box::new(cmd_obj));
@@ -2087,7 +2087,7 @@ impl OpenCADStudio {
"REFCLOSE" => { "REFCLOSE" => {
if self.tabs[i].refedit_session.is_some() { if self.tabs[i].refedit_session.is_some() {
use crate::modules::home::modify::refedit::RefCloseCommand; use crate::modules::draw::modify::refedit::RefCloseCommand;
let cmd_obj = RefCloseCommand::new(); let cmd_obj = RefCloseCommand::new();
self.command_line.push_info(&cmd_obj.prompt()); self.command_line.push_info(&cmd_obj.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd_obj)); self.tabs[i].active_cmd = Some(Box::new(cmd_obj));
@@ -2098,8 +2098,8 @@ impl OpenCADStudio {
} }
"REFCLOSE_SAVE" => { "REFCLOSE_SAVE" => {
use crate::modules::home::modify::explode::normalize_entity_for_block; use crate::modules::draw::modify::explode::normalize_entity_for_block;
use crate::modules::home::modify::refedit::apply_insert_inverse_transform; use crate::modules::draw::modify::refedit::apply_insert_inverse_transform;
let session = match self.tabs[i].refedit_session.take() { let session = match self.tabs[i].refedit_session.take() {
Some(s) => s, Some(s) => s,
@@ -2188,28 +2188,28 @@ impl OpenCADStudio {
} }
"ALIGN" | "AL" => { "ALIGN" | "AL" => {
use crate::modules::home::modify::align::AlignCommand; use crate::modules::draw::modify::align::AlignCommand;
let cmd = AlignCommand::new(); let cmd = AlignCommand::new();
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
} }
"LENGTHEN" | "LEN" => { "LENGTHEN" | "LEN" => {
use crate::modules::home::modify::lengthen::LengthenCommand; use crate::modules::draw::modify::lengthen::LengthenCommand;
let cmd = LengthenCommand::new(); let cmd = LengthenCommand::new();
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
} }
"DIVIDE" | "DIV" => { "DIVIDE" | "DIV" => {
use crate::modules::home::inquiry::divide::DivideCommand; use crate::modules::draw::inquiry::divide::DivideCommand;
let cmd = DivideCommand::new(); let cmd = DivideCommand::new();
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
} }
"MEASURE" | "ME" => { "MEASURE" | "ME" => {
use crate::modules::home::inquiry::divide::MeasureCommand; use crate::modules::draw::inquiry::divide::MeasureCommand;
let cmd = MeasureCommand::new(); let cmd = MeasureCommand::new();
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
@@ -2217,21 +2217,21 @@ impl OpenCADStudio {
// ── Inquiry ────────────────────────────────────────────────────── // ── Inquiry ──────────────────────────────────────────────────────
"DIST" | "DI" => { "DIST" | "DI" => {
use crate::modules::home::inquiry::dist::DistCommand; use crate::modules::draw::inquiry::dist::DistCommand;
let cmd = DistCommand::new(); let cmd = DistCommand::new();
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
} }
"ID" => { "ID" => {
use crate::modules::home::inquiry::id::IdCommand; use crate::modules::draw::inquiry::id::IdCommand;
let cmd = IdCommand::new(); let cmd = IdCommand::new();
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
} }
"AREA" => { "AREA" => {
use crate::modules::home::inquiry::area::AreaCommand; use crate::modules::draw::inquiry::area::AreaCommand;
let cmd = AreaCommand::new(); let cmd = AreaCommand::new();
self.command_line.push_info(&cmd.prompt()); self.command_line.push_info(&cmd.prompt());
self.tabs[i].active_cmd = Some(Box::new(cmd)); self.tabs[i].active_cmd = Some(Box::new(cmd));
+1 -1
View File
@@ -1,6 +1,6 @@
use crate::command::CadCommand; use crate::command::CadCommand;
use crate::linetypes; use crate::linetypes;
use crate::modules::home::modify::refedit::RefEditSession; use crate::modules::draw::modify::refedit::RefEditSession;
use crate::scene::pick::grip::GripEdit; use crate::scene::pick::grip::GripEdit;
use crate::scene::GripDef; use crate::scene::GripDef;
use crate::scene::Scene; use crate::scene::Scene;
+2 -2
View File
@@ -375,7 +375,7 @@ impl OpenCADStudio {
Message::ImagePickResult(Ok((path, pw, ph))) => { Message::ImagePickResult(Ok((path, pw, ph))) => {
use crate::command::CadCommand; use crate::command::CadCommand;
use crate::modules::home::draw::raster_image::ImageCommand; use crate::modules::draw::draw::raster_image::ImageCommand;
let path_str = path.to_string_lossy().into_owned(); let path_str = path.to_string_lossy().into_owned();
let short = std::path::Path::new(&path_str) let short = std::path::Path::new(&path_str)
.file_name() .file_name()
@@ -3220,7 +3220,7 @@ impl OpenCADStudio {
self.tabs[i].scene.hatches.get(&handle).cloned() self.tabs[i].scene.hatches.get(&handle).cloned()
{ {
use crate::command::CadCommand; use crate::command::CadCommand;
use crate::modules::home::draw::hatchedit::HatcheditCommand; use crate::modules::draw::draw::hatchedit::HatcheditCommand;
let cmd: Box<dyn CadCommand> = let cmd: Box<dyn CadCommand> =
Box::new(HatcheditCommand::with_handle( Box::new(HatcheditCommand::with_handle(
handle, handle,
+2 -2
View File
@@ -129,7 +129,7 @@ pub enum CmdResult {
/// Apply a polyline-edit operation to one entity; keep command active. /// Apply a polyline-edit operation to one entity; keep command active.
PeditOp { PeditOp {
handle: Handle, handle: Handle,
op: crate::modules::home::modify::pedit::PeditOp, op: crate::modules::draw::modify::pedit::PeditOp,
}, },
/// Place Point entities at N equal intervals along the entity. /// Place Point entities at N equal intervals along the entity.
DivideEntity { handle: Handle, n: usize }, DivideEntity { handle: Handle, n: usize },
@@ -139,7 +139,7 @@ pub enum CmdResult {
LengthenEntity { LengthenEntity {
handle: Handle, handle: Handle,
pick_pt: Vec3, pick_pt: Vec3,
mode: crate::modules::home::modify::lengthen::LenMode, mode: crate::modules::draw::modify::lengthen::LenMode,
}, },
/// Align selected entities: translate to dst1, rotate by angle_rad, optional scale. /// Align selected entities: translate to dst1, rotate by angle_rad, optional scale.
AlignSelected { AlignSelected {
+1 -1
View File
@@ -1328,7 +1328,7 @@ impl MultiLeaderTess for MultiLeader {
let _ = ml.block_connection_type; let _ = ml.block_connection_type;
for sub in synth_ins.explode_from_document(document) { for sub in synth_ins.explode_from_document(document) {
let normalized = let normalized =
crate::modules::home::modify::explode::normalize_insert_entity(sub); crate::modules::draw::modify::explode::normalize_insert_entity(sub);
let mut sub_wires = tessellate( let mut sub_wires = tessellate(
document, document,
handle, handle,
+1 -1
View File
@@ -38,7 +38,7 @@ impl CadModule for AnnotateModule {
} }
fn ribbon_groups(&self) -> Vec<RibbonGroup> { fn ribbon_groups(&self) -> Vec<RibbonGroup> {
use crate::modules::home::draw::{revcloud, wipeout}; use crate::modules::draw::draw::{revcloud, wipeout};
vec![ vec![
// ── Text ───────────────────────────────────────────────────── // ── Text ─────────────────────────────────────────────────────
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -12,7 +12,7 @@ use acadrust::types::Vector3;
use acadrust::{Circle, EntityType}; use acadrust::{Circle, EntityType};
use crate::command::{CadCommand, CmdResult, DynField, TangentObject}; use crate::command::{CadCommand, CmdResult, DynField, TangentObject};
use crate::modules::home::defaults; use crate::modules::draw::defaults;
use crate::modules::IconKind; use crate::modules::IconKind;
use crate::scene::model::wire_model::WireModel; use crate::scene::model::wire_model::WireModel;
use glam::Vec3; use glam::Vec3;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,4 @@
// Home module — Draw, Modify, Annotation and Layer tools. // Draw module — Draw, Modify, Annotation and Layer tools.
mod about; mod about;
mod changelog; mod changelog;
@@ -16,11 +16,11 @@ pub mod select;
use crate::modules::{CadModule, RibbonGroup, RibbonItem}; use crate::modules::{CadModule, RibbonGroup, RibbonItem};
pub struct HomeModule; pub struct DrawModule;
impl CadModule for HomeModule { impl CadModule for DrawModule {
fn id(&self) -> &'static str { fn id(&self) -> &'static str {
"home" "draw"
} }
fn title(&self) -> &'static str { fn title(&self) -> &'static str {
"Draw" "Draw"
@@ -220,7 +220,7 @@ impl CadModule for HomeModule {
], ],
}, },
// Support group lives on the Start tab now (see view.rs: // Support group lives on the Start tab now (see view.rs:
// start_page_view). Removed from the Home ribbon to declutter. // start_page_view). Removed from the Draw ribbon to declutter.
] ]
} }
} }
File renamed without changes.
@@ -17,7 +17,7 @@ use acadrust::Handle;
use glam::Vec3; use glam::Vec3;
use crate::command::{CadCommand, CmdResult, EntityTransform}; use crate::command::{CadCommand, CmdResult, EntityTransform};
use crate::modules::home::defaults; use crate::modules::draw::defaults;
use crate::modules::IconKind; use crate::modules::IconKind;
use crate::scene::model::wire_model::WireModel; use crate::scene::model::wire_model::WireModel;
File renamed without changes.
@@ -7,7 +7,7 @@
// //
// BREAK @ (at-sign as second point) → Break at a single point (splits without gap). // BREAK @ (at-sign as second point) → Break at a single point (splits without gap).
use crate::modules::home::modify::spline_ops::{ use crate::modules::draw::modify::spline_ops::{
bspline_to_spline, spline_nearest_t, spline_to_bspline, bspline_to_spline, spline_nearest_t, spline_to_bspline,
}; };
use acadrust::entities::{ use acadrust::entities::{
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -17,7 +17,7 @@ use glam::Vec3;
const TAU: f64 = std::f64::consts::TAU; const TAU: f64 = std::f64::consts::TAU;
use crate::command::{CadCommand, CmdResult}; use crate::command::{CadCommand, CmdResult};
use crate::modules::home::defaults; use crate::modules::draw::defaults;
use crate::modules::IconKind; use crate::modules::IconKind;
use crate::scene::model::wire_model::WireModel; use crate::scene::model::wire_model::WireModel;
File renamed without changes.
@@ -7,7 +7,7 @@
// //
// The entity is modified at whichever end is closest to the pick point. // The entity is modified at whichever end is closest to the pick point.
use crate::modules::home::modify::spline_ops::{bspline_to_spline, spline_to_bspline}; use crate::modules::draw::modify::spline_ops::{bspline_to_spline, spline_to_bspline};
use acadrust::entities::{ use acadrust::entities::{
Arc as ArcEnt, Ellipse as EllipseEnt, Line as LineEnt, LwPolyline, Spline as SplineEnt, Arc as ArcEnt, Ellipse as EllipseEnt, Line as LineEnt, LwPolyline, Spline as SplineEnt,
}; };
File renamed without changes.
File renamed without changes.
@@ -11,7 +11,7 @@
use std::f64::consts::TAU; use std::f64::consts::TAU;
use crate::modules::home::modify::spline_ops::{spline_pts_wire, spline_sample_xy}; use crate::modules::draw::modify::spline_ops::{spline_pts_wire, spline_sample_xy};
use acadrust::entities::LwVertex; use acadrust::entities::LwVertex;
use acadrust::entities::{ use acadrust::entities::{
Arc as ArcEnt, Circle as CircleEnt, Ellipse as EllipseEnt, Line as LineEnt, LwPolyline, Arc as ArcEnt, Circle as CircleEnt, Ellipse as EllipseEnt, Line as LineEnt, LwPolyline,
@@ -21,7 +21,7 @@ use acadrust::{EntityType, Handle};
use glam::Vec3; use glam::Vec3;
use crate::command::{CadCommand, CmdResult}; use crate::command::{CadCommand, CmdResult};
use crate::modules::home::defaults; use crate::modules::draw::defaults;
use crate::modules::{IconKind, ModuleEvent, ToolDef}; use crate::modules::{IconKind, ModuleEvent, ToolDef};
use crate::scene::model::wire_model::WireModel; use crate::scene::model::wire_model::WireModel;
File renamed without changes.
File renamed without changes.
@@ -10,7 +10,7 @@ use acadrust::Handle;
use glam::Vec3; use glam::Vec3;
use crate::command::{CadCommand, CmdResult, DynField, EntityTransform}; use crate::command::{CadCommand, CmdResult, DynField, EntityTransform};
use crate::modules::home::defaults; use crate::modules::draw::defaults;
use crate::modules::{IconKind, ModuleEvent, ToolDef}; use crate::modules::{IconKind, ModuleEvent, ToolDef};
use crate::scene::model::wire_model::WireModel; use crate::scene::model::wire_model::WireModel;
@@ -16,7 +16,7 @@ use acadrust::Handle;
use glam::Vec3; use glam::Vec3;
use crate::command::{CadCommand, CmdResult, EntityTransform}; use crate::command::{CadCommand, CmdResult, EntityTransform};
use crate::modules::home::defaults; use crate::modules::draw::defaults;
use crate::modules::{IconKind, ModuleEvent, ToolDef}; use crate::modules::{IconKind, ModuleEvent, ToolDef};
use crate::scene::model::wire_model::WireModel; use crate::scene::model::wire_model::WireModel;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -20,7 +20,7 @@ use glam::Vec3;
use truck_modeling::base::{BoundedCurve, Cut, ParametricCurve}; use truck_modeling::base::{BoundedCurve, Cut, ParametricCurve};
use crate::command::{CadCommand, CmdResult}; use crate::command::{CadCommand, CmdResult};
use crate::modules::home::modify::spline_ops::{ use crate::modules::draw::modify::spline_ops::{
bspline_to_spline, spline_nearest_t, spline_pts_wire, spline_sample_xy, spline_to_bspline, bspline_to_spline, spline_nearest_t, spline_pts_wire, spline_sample_xy, spline_to_bspline,
t_to_rel, t_to_rel,
}; };
@@ -281,7 +281,7 @@ fn build_geos(entities: &[EntityType]) -> Vec<Geo> {
| EntityType::Polyline(_) | EntityType::Polyline(_)
| EntityType::Polyline2D(_) | EntityType::Polyline2D(_)
| EntityType::Polyline3D(_) => { | EntityType::Polyline3D(_) => {
for seg in crate::modules::home::modify::explode::explode_polyline_segments(e) { for seg in crate::modules::draw::modify::explode::explode_polyline_segments(e) {
if let Some(g) = geo_from_entity(h, &seg) { if let Some(g) = geo_from_entity(h, &seg) {
out.push(g); out.push(g);
} }
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1 -1
View File
@@ -25,7 +25,7 @@ pub use ocs_plugin_api::ribbon::{
// ── Module declarations ─────────────────────────────────────────────────── // ── Module declarations ───────────────────────────────────────────────────
pub mod annotate; pub mod annotate;
pub mod home; pub mod draw;
pub mod insert; pub mod insert;
pub mod model; pub mod model;
pub mod layout; pub mod layout;
+1 -1
View File
@@ -7,7 +7,7 @@ use crate::modules::CadModule;
/// Called once at startup by `Ribbon::new()`. /// Called once at startup by `Ribbon::new()`.
pub fn all_modules() -> Vec<Box<dyn CadModule>> { pub fn all_modules() -> Vec<Box<dyn CadModule>> {
vec![ vec![
Box::new(super::home::HomeModule), Box::new(super::draw::DrawModule),
Box::new(super::model::ModelModule), Box::new(super::model::ModelModule),
Box::new(super::insert::InsertModule), Box::new(super::insert::InsertModule),
Box::new(super::annotate::AnnotateModule), Box::new(super::annotate::AnnotateModule),
+4 -4
View File
@@ -2045,7 +2045,7 @@ impl Scene {
for sub in ins for sub in ins
.explode_from_document(&self.document) .explode_from_document(&self.document)
.into_iter() .into_iter()
.map(crate::modules::home::modify::explode::normalize_insert_entity) .map(crate::modules::draw::modify::explode::normalize_insert_entity)
{ {
let EntityType::Hatch(dxf) = sub else { let EntityType::Hatch(dxf) = sub else {
continue; continue;
@@ -3572,7 +3572,7 @@ impl Scene {
let local = EntityTransform::Translate(-base); let local = EntityTransform::Translate(-base);
for (old_handle, mut entity) in source_entities { for (old_handle, mut entity) in source_entities {
view::dispatch::apply_transform(&mut entity, &local); view::dispatch::apply_transform(&mut entity, &local);
entity = crate::modules::home::modify::explode::normalize_entity_for_block(entity); entity = crate::modules::draw::modify::explode::normalize_entity_for_block(entity);
entity.common_mut().handle = Handle::NULL; entity.common_mut().handle = Handle::NULL;
entity.common_mut().owner_handle = br_handle; entity.common_mut().owner_handle = br_handle;
self.document self.document
@@ -3697,7 +3697,7 @@ impl Scene {
// bakes its transform into the children it returns, so nested // bakes its transform into the children it returns, so nested
// hatches land in the correct world position. A depth guard keeps // hatches land in the correct world position. A depth guard keeps
// a malformed cyclic block reference from looping forever. // a malformed cyclic block reference from looping forever.
let normalize = crate::modules::home::modify::explode::normalize_insert_entity; let normalize = crate::modules::draw::modify::explode::normalize_insert_entity;
let mut stack: Vec<(EntityType, usize)> = ins let mut stack: Vec<(EntityType, usize)> = ins
.explode_from_document(&self.document) .explode_from_document(&self.document)
.into_iter() .into_iter()
@@ -7392,7 +7392,7 @@ fn tessellate_entity(
.explode_from_document(document) .explode_from_document(document)
.iter() .iter()
.cloned() .cloned()
.map(crate::modules::home::modify::explode::normalize_insert_entity) .map(crate::modules::draw::modify::explode::normalize_insert_entity)
.flat_map(|sub| { .flat_map(|sub| {
let (sub_color, sub_pattern_length, sub_pattern, sub_line_weight_px, sub_aci) = let (sub_color, sub_pattern_length, sub_pattern, sub_line_weight_px, sub_aci) =
view::render::render_style_for_block_sub( view::render::render_style_for_block_sub(