diff --git a/locales/ar-SA/opencadstudio.ftl b/locales/ar-SA/opencadstudio.ftl index 6dd0fd5c2..b54a45dad 100644 --- a/locales/ar-SA/opencadstudio.ftl +++ b/locales/ar-SA/opencadstudio.ftl @@ -29,9 +29,10 @@ action = ribbon-tab = .draw = رسم + .parametric = بارامتري .annotate = تعليقات توضيحية .insert = إدراج - .model = النمذجة + .model = نموذج .layout = تخطيط .manage = إدارة .view = عرض diff --git a/locales/bg-BG/opencadstudio.ftl b/locales/bg-BG/opencadstudio.ftl index cb93e9870..ad0be6bca 100644 --- a/locales/bg-BG/opencadstudio.ftl +++ b/locales/bg-BG/opencadstudio.ftl @@ -29,9 +29,10 @@ action = ribbon-tab = .draw = Чертане + .parametric = Параметричен .annotate = Анотиране .insert = Вмъкване - .model = Моделиране + .model = Модел .layout = Оформление .manage = Управление .view = Изглед diff --git a/locales/cs-CZ/opencadstudio.ftl b/locales/cs-CZ/opencadstudio.ftl index 16f1737ec..4fb2655f0 100644 --- a/locales/cs-CZ/opencadstudio.ftl +++ b/locales/cs-CZ/opencadstudio.ftl @@ -29,9 +29,10 @@ action = ribbon-tab = .draw = Kreslení + .parametric = Parametrické .annotate = Poznámky .insert = Vložit - .model = Modelování + .model = Model .layout = Rozvržení .manage = Správa .view = Zobrazení diff --git a/locales/de-DE/opencadstudio.ftl b/locales/de-DE/opencadstudio.ftl index 6560a0558..cef710d64 100644 --- a/locales/de-DE/opencadstudio.ftl +++ b/locales/de-DE/opencadstudio.ftl @@ -29,6 +29,7 @@ action = ribbon-tab = .draw = Zeichnen + .parametric = Parametrisch .annotate = Beschriften .insert = Einfügen .model = Modell diff --git a/locales/el-GR/opencadstudio.ftl b/locales/el-GR/opencadstudio.ftl index 4adf40ce0..3390d369f 100644 --- a/locales/el-GR/opencadstudio.ftl +++ b/locales/el-GR/opencadstudio.ftl @@ -29,9 +29,10 @@ action = ribbon-tab = .draw = Σχεδίαση + .parametric = Παραμετρικό .annotate = Επισημείωση .insert = Εισαγωγή - .model = Μοντελοποίηση + .model = Μοντέλο .layout = Διάταξη .manage = Διαχείριση .view = Προβολή diff --git a/locales/en-US/opencadstudio.ftl b/locales/en-US/opencadstudio.ftl index fb8218ddc..4b0008de3 100644 --- a/locales/en-US/opencadstudio.ftl +++ b/locales/en-US/opencadstudio.ftl @@ -29,9 +29,10 @@ action = ribbon-tab = .draw = Draw + .parametric = Parametric .annotate = Annotate .insert = Insert - .model = Modelling + .model = Model .layout = Layout .manage = Manage .view = View diff --git a/locales/es-ES/opencadstudio.ftl b/locales/es-ES/opencadstudio.ftl index c53101c47..c06c6e8d3 100644 --- a/locales/es-ES/opencadstudio.ftl +++ b/locales/es-ES/opencadstudio.ftl @@ -29,9 +29,10 @@ action = ribbon-tab = .draw = Dibujo + .parametric = Paramétrico .annotate = Anotar .insert = Insertar - .model = Modelado + .model = Modelo .layout = Presentación .manage = Administrar .view = Vista diff --git a/locales/fi-FI/opencadstudio.ftl b/locales/fi-FI/opencadstudio.ftl index cc2df4dd5..5944347b6 100644 --- a/locales/fi-FI/opencadstudio.ftl +++ b/locales/fi-FI/opencadstudio.ftl @@ -29,9 +29,10 @@ action = ribbon-tab = .draw = Piirrä + .parametric = Parametrinen .annotate = Merkinnät .insert = Lisää - .model = Mallinnus + .model = Malli .layout = Asettelu .manage = Hallinta .view = Näkymä diff --git a/locales/fr-FR/opencadstudio.ftl b/locales/fr-FR/opencadstudio.ftl index 34b31d280..4458464c8 100644 --- a/locales/fr-FR/opencadstudio.ftl +++ b/locales/fr-FR/opencadstudio.ftl @@ -29,9 +29,10 @@ action = ribbon-tab = .draw = Dessin + .parametric = Paramétrique .annotate = Annoter .insert = Insérer - .model = Modélisation + .model = Modèle .layout = Mise en page .manage = Gérer .view = Affichage diff --git a/locales/hi-IN/opencadstudio.ftl b/locales/hi-IN/opencadstudio.ftl index 6f6f276e0..72f75f672 100644 --- a/locales/hi-IN/opencadstudio.ftl +++ b/locales/hi-IN/opencadstudio.ftl @@ -29,9 +29,10 @@ action = ribbon-tab = .draw = ड्रॉ + .parametric = पैरामीट्रिक .annotate = एनोटेट .insert = सम्मिलित करें - .model = मॉडलिंग + .model = मॉडल .layout = लेआउट .manage = प्रबंधित करें .view = देखें diff --git a/locales/hu-HU/opencadstudio.ftl b/locales/hu-HU/opencadstudio.ftl index 9f8e66a81..286520448 100644 --- a/locales/hu-HU/opencadstudio.ftl +++ b/locales/hu-HU/opencadstudio.ftl @@ -29,9 +29,10 @@ action = ribbon-tab = .draw = Rajz + .parametric = Parametrikus .annotate = Feliratozás .insert = Beszúrás - .model = Modellezés + .model = Modell .layout = Elrendezés .manage = Kezelés .view = Nézet diff --git a/locales/it-IT/opencadstudio.ftl b/locales/it-IT/opencadstudio.ftl index 264c68dc2..ca4425e2d 100644 --- a/locales/it-IT/opencadstudio.ftl +++ b/locales/it-IT/opencadstudio.ftl @@ -29,9 +29,10 @@ action = ribbon-tab = .draw = Disegno + .parametric = Parametrico .annotate = Annotazione .insert = Inserisci - .model = Modellazione + .model = Modello .layout = Disposizione .manage = Gestisci .view = Vista diff --git a/locales/ja-JP/opencadstudio.ftl b/locales/ja-JP/opencadstudio.ftl index a1e8ace50..da633d8ed 100644 --- a/locales/ja-JP/opencadstudio.ftl +++ b/locales/ja-JP/opencadstudio.ftl @@ -29,9 +29,10 @@ action = ribbon-tab = .draw = 作図 + .parametric = パラメトリック .annotate = 注釈 .insert = 挿入 - .model = モデリング + .model = モデル .layout = レイアウト .manage = 管理 .view = 表示 diff --git a/locales/ko-KR/opencadstudio.ftl b/locales/ko-KR/opencadstudio.ftl index 2a1c41d76..043b4239c 100644 --- a/locales/ko-KR/opencadstudio.ftl +++ b/locales/ko-KR/opencadstudio.ftl @@ -29,9 +29,10 @@ action = ribbon-tab = .draw = 그리기 + .parametric = 파라메트릭 .annotate = 주석 .insert = 삽입 - .model = 모델링 + .model = 모델 .layout = 배치 .manage = 관리 .view = 보기 diff --git a/locales/nl-NL/opencadstudio.ftl b/locales/nl-NL/opencadstudio.ftl index 9f7b7c1fe..92eeea1de 100644 --- a/locales/nl-NL/opencadstudio.ftl +++ b/locales/nl-NL/opencadstudio.ftl @@ -29,6 +29,7 @@ action = ribbon-tab = .draw = Tekenen + .parametric = Parametrisch .annotate = Annoteren .insert = Invoegen .model = Model diff --git a/locales/pl-PL/opencadstudio.ftl b/locales/pl-PL/opencadstudio.ftl index 03d2eeddd..08c348dd8 100644 --- a/locales/pl-PL/opencadstudio.ftl +++ b/locales/pl-PL/opencadstudio.ftl @@ -29,9 +29,10 @@ action = ribbon-tab = .draw = Rysowanie + .parametric = Parametryczne .annotate = Opisy .insert = Wstaw - .model = Modelowanie + .model = Model .layout = Układ .manage = Zarządzaj .view = Widok diff --git a/locales/pt-BR/opencadstudio.ftl b/locales/pt-BR/opencadstudio.ftl index fefe16cea..fc8eb131a 100644 --- a/locales/pt-BR/opencadstudio.ftl +++ b/locales/pt-BR/opencadstudio.ftl @@ -29,9 +29,10 @@ action = ribbon-tab = .draw = Desenhar + .parametric = Paramétrico .annotate = Anotar .insert = Inserir - .model = Modelagem + .model = Modelo .layout = Layout .manage = Gerenciar .view = Exibir diff --git a/locales/ru-RU/opencadstudio.ftl b/locales/ru-RU/opencadstudio.ftl index 8c0d1656f..eb21fa689 100644 --- a/locales/ru-RU/opencadstudio.ftl +++ b/locales/ru-RU/opencadstudio.ftl @@ -29,9 +29,10 @@ action = ribbon-tab = .draw = Начертить + .parametric = Параметрический .annotate = Аннотации .insert = Вставка - .model = Моделирование + .model = Модель .layout = Расположение .manage = Управление .view = Просмотр diff --git a/locales/tr-TR/opencadstudio.ftl b/locales/tr-TR/opencadstudio.ftl index 07441cb23..fc8274482 100644 --- a/locales/tr-TR/opencadstudio.ftl +++ b/locales/tr-TR/opencadstudio.ftl @@ -29,9 +29,10 @@ action = ribbon-tab = .draw = Çizim + .parametric = Parametrik .annotate = Açıklama .insert = Ekle - .model = Modelleme + .model = Model .layout = Yerleşim .manage = Yönet .view = Görünüm diff --git a/locales/zh-CN/opencadstudio.ftl b/locales/zh-CN/opencadstudio.ftl index e7a4a81a2..b1840049e 100644 --- a/locales/zh-CN/opencadstudio.ftl +++ b/locales/zh-CN/opencadstudio.ftl @@ -29,9 +29,10 @@ action = ribbon-tab = .draw = 绘制 + .parametric = 参数化 .annotate = 注释 .insert = 插入 - .model = 建模 + .model = 模型 .layout = 布局 .manage = 管理 .view = 视图 diff --git a/locales/zh-TW/opencadstudio.ftl b/locales/zh-TW/opencadstudio.ftl index 446aa9b4f..acf355918 100644 --- a/locales/zh-TW/opencadstudio.ftl +++ b/locales/zh-TW/opencadstudio.ftl @@ -29,9 +29,10 @@ action = ribbon-tab = .draw = 繪製 + .parametric = 參數化 .annotate = 註解 .insert = 插入 - .model = 建模 + .model = 模型 .layout = 配置 .manage = 管理 .view = 視圖 diff --git a/src/app/commands/draw.rs b/src/app/commands/draw.rs index 6e0c93301..05e05a4e7 100644 --- a/src/app/commands/draw.rs +++ b/src/app/commands/draw.rs @@ -1006,14 +1006,14 @@ impl OpenCADStudio { } "CCONSTRAINT" => { - use crate::modules::draw::constrain::CoincidentConstraintCommand; + use crate::modules::parametric::CoincidentConstraintCommand; let new_cmd = CoincidentConstraintCommand::new(); self.command_line.push_info(&new_cmd.prompt()); self.tabs[i].active_cmd = Some(Box::new(new_cmd)); } "EDCONSTRAINT" => { - use crate::modules::draw::constrain::EqualDistanceConstraintCommand; + use crate::modules::parametric::EqualDistanceConstraintCommand; let new_cmd = EqualDistanceConstraintCommand::new(); self.command_line.push_info(&new_cmd.prompt()); self.tabs[i].active_cmd = Some(Box::new(new_cmd)); @@ -1106,7 +1106,7 @@ impl OpenCADStudio { "Select exactly one entity (the circle or line the point should attach to), then run this constraint again.", ); } else { - use crate::modules::draw::constrain::PointOnEntityConstraintCommand; + use crate::modules::parametric::PointOnEntityConstraintCommand; use crate::scene::sketch_constraints::ConstraintKind; let (name, kind, label) = match cmd { "CPCONSTRAINT" => ("CPCONSTRAINT", ConstraintKind::CenterPoint, "Center point constraint"), @@ -1130,7 +1130,7 @@ impl OpenCADStudio { self.command_line .push_output("Select exactly one line or circle, then run this constraint again."); } else { - use crate::modules::draw::constrain::DistanceConstraintCommand; + use crate::modules::parametric::DistanceConstraintCommand; match DistanceConstraintCommand::new(&self.tabs[i].scene, handles[0]) { Some(new_cmd) => { self.command_line.push_info(&new_cmd.prompt()); @@ -1153,7 +1153,7 @@ impl OpenCADStudio { "Select exactly two lines (first = reference, second = the one that rotates), then run this constraint again.", ); } else { - use crate::modules::draw::constrain::AngleConstraintCommand; + use crate::modules::parametric::AngleConstraintCommand; match AngleConstraintCommand::new(&self.tabs[i].scene, handles[0], handles[1]) { Some(new_cmd) => { self.command_line.push_info(&new_cmd.prompt()); diff --git a/src/command.rs b/src/command.rs index 06c669d14..a6761926a 100644 --- a/src/command.rs +++ b/src/command.rs @@ -1446,7 +1446,7 @@ pub enum CmdResult { label: &'static str, }, /// Add a persistent `CenterPoint`/`Midpoint`/`PointOnCurve` constraint - /// (`crate::modules::draw::constrain::point_on_entity`) between one + /// (`crate::modules::parametric::point_on_entity`) between one /// picked point and `target`, a whole entity selected before the tool /// ran. Like `AddCoincidentConstraint`, the host resolves `point` via /// `sketch_constraints::nearest_sketch_point` (a `CadCommand` has no @@ -1462,7 +1462,7 @@ pub enum CmdResult { label: &'static str, }, /// Add a persistent `EqualDistance` constraint - /// (`crate::modules::draw::constrain::equal_distance`): the distance + /// (`crate::modules::parametric::equal_distance`): the distance /// between `points[0]`/`points[1]` equals the distance between /// `points[2]`/`points[3]`. The host resolves each point via /// `sketch_constraints::nearest_sketch_point`, same reasoning as diff --git a/src/i18n.rs b/src/i18n.rs index e8c1a26f8..73b64c48c 100644 --- a/src/i18n.rs +++ b/src/i18n.rs @@ -339,6 +339,7 @@ fn format_values(template: &str, rendered: &str) -> Option> { pub fn ribbon_module_title(id: &str, fallback: &str) -> String { match id { "draw" => crate::tr!("ribbon-tab", "draw"), + "parametric" => crate::tr!("ribbon-tab", "parametric"), "annotate" => crate::tr!("ribbon-tab", "annotate"), "insert" => crate::tr!("ribbon-tab", "insert"), "model" => crate::tr!("ribbon-tab", "model"), diff --git a/src/modules/draw/mod.rs b/src/modules/draw/mod.rs index 23f8f5bb0..a9db09f43 100644 --- a/src/modules/draw/mod.rs +++ b/src/modules/draw/mod.rs @@ -2,7 +2,6 @@ mod changelog; pub mod clipboard; -pub mod constrain; pub mod defaults; mod donate; pub mod draw; @@ -34,11 +33,6 @@ impl CadModule for DrawModule { }; use crate::modules::insert::{create_block, insert_block}; use clipboard::{copy_clip, cut, paste}; - use constrain::{ - angle_tool, center_point_tool, coincident_tool, colinear, concentric, distance_tool, equal, - equal_distance_tool, fixed, horizontal, midpoint_tool, normal, parallel, perpendicular, point_on_curve_tool, - symmetric, tangent, vertical, - }; use draw::{arc, circle, ellipse, hatch, line, polyline, shapes}; use groups::{group, ungroup}; use layers::{ @@ -126,29 +120,6 @@ impl CadModule for DrawModule { offset::tool().into(), ], }, - RibbonGroup { - title: "Constraints", - tools: vec![ - horizontal::tool().into(), - vertical::tool().into(), - parallel::tool().into(), - perpendicular::tool().into(), - equal::tool().into(), - tangent::tool().into(), - normal::tool().into(), - coincident_tool::tool().into(), - distance_tool::tool().into(), - angle_tool::tool().into(), - concentric::tool().into(), - colinear::tool().into(), - fixed::tool().into(), - symmetric::tool().into(), - center_point_tool::tool().into(), - midpoint_tool::tool().into(), - point_on_curve_tool::tool().into(), - equal_distance_tool::tool().into(), - ], - }, RibbonGroup { title: "Annotation", tools: vec![ diff --git a/src/modules/mod.rs b/src/modules/mod.rs index e517bf80c..d97deaca3 100644 --- a/src/modules/mod.rs +++ b/src/modules/mod.rs @@ -27,6 +27,7 @@ pub use ocs_plugin_api::ribbon::{ pub mod annotate; pub mod draw; pub mod insert; +pub mod parametric; pub mod model; pub mod layout; pub mod manage; diff --git a/src/modules/model/mod.rs b/src/modules/model/mod.rs index 8c18f7486..f28ad352b 100644 --- a/src/modules/model/mod.rs +++ b/src/modules/model/mod.rs @@ -47,7 +47,7 @@ impl CadModule for ModelModule { "model" } fn title(&self) -> &'static str { - "Modelling" + "Model" } fn ribbon_groups(&self) -> &[RibbonGroup] { diff --git a/src/modules/draw/constrain/coincident.rs b/src/modules/parametric/coincident.rs similarity index 97% rename from src/modules/draw/constrain/coincident.rs rename to src/modules/parametric/coincident.rs index 8f166d554..eccad85ba 100644 --- a/src/modules/draw/constrain/coincident.rs +++ b/src/modules/parametric/coincident.rs @@ -24,7 +24,7 @@ pub mod coincident_tool { id: "CCONSTRAINT", label: "Coincident", icon: IconKind::Svg(include_bytes!( - "../../../../assets/icons/constrain/coincident.svg" + "../../../assets/icons/constrain/coincident.svg" )), event: ModuleEvent::Command("CCONSTRAINT".to_string()), } diff --git a/src/modules/draw/constrain/equal_distance.rs b/src/modules/parametric/equal_distance.rs similarity index 97% rename from src/modules/draw/constrain/equal_distance.rs rename to src/modules/parametric/equal_distance.rs index 89287745b..d928d2bcb 100644 --- a/src/modules/draw/constrain/equal_distance.rs +++ b/src/modules/parametric/equal_distance.rs @@ -17,7 +17,7 @@ pub mod equal_distance_tool { id: "EDCONSTRAINT", label: "Equal Distance", icon: IconKind::Svg(include_bytes!( - "../../../../assets/icons/constrain/equal_distance.svg" + "../../../assets/icons/constrain/equal_distance.svg" )), event: ModuleEvent::Command("EDCONSTRAINT".to_string()), } diff --git a/src/modules/draw/constrain/mod.rs b/src/modules/parametric/mod.rs similarity index 58% rename from src/modules/draw/constrain/mod.rs rename to src/modules/parametric/mod.rs index 7c594094d..0736a42bb 100644 --- a/src/modules/draw/constrain/mod.rs +++ b/src/modules/parametric/mod.rs @@ -36,3 +36,46 @@ pub use tools::{ tangent, vertical, }; pub use value::{angle_tool, distance_tool, AngleConstraintCommand, DistanceConstraintCommand}; + +use crate::modules::{CadModule, RibbonGroup}; + +pub struct ParametricModule; + +impl CadModule for ParametricModule { + fn id(&self) -> &'static str { + "parametric" + } + + fn title(&self) -> &'static str { + "Parametric" + } + + fn ribbon_groups(&self) -> &[RibbonGroup] { + static GROUPS: std::sync::OnceLock> = std::sync::OnceLock::new(); + GROUPS.get_or_init(|| { + vec![RibbonGroup { + title: "Constraints", + tools: vec![ + horizontal::tool().into(), + vertical::tool().into(), + parallel::tool().into(), + perpendicular::tool().into(), + equal::tool().into(), + tangent::tool().into(), + normal::tool().into(), + coincident_tool::tool().into(), + distance_tool::tool().into(), + angle_tool::tool().into(), + concentric::tool().into(), + colinear::tool().into(), + fixed::tool().into(), + symmetric::tool().into(), + center_point_tool::tool().into(), + midpoint_tool::tool().into(), + point_on_curve_tool::tool().into(), + equal_distance_tool::tool().into(), + ], + }] + }) + } +} diff --git a/src/modules/draw/constrain/point_on_entity.rs b/src/modules/parametric/point_on_entity.rs similarity index 94% rename from src/modules/draw/constrain/point_on_entity.rs rename to src/modules/parametric/point_on_entity.rs index c3ed411d9..1ce9ac91e 100644 --- a/src/modules/draw/constrain/point_on_entity.rs +++ b/src/modules/parametric/point_on_entity.rs @@ -25,7 +25,7 @@ pub mod center_point_tool { id: "CPCONSTRAINT", label: "Center Point", icon: IconKind::Svg(include_bytes!( - "../../../../assets/icons/constrain/center_point.svg" + "../../../assets/icons/constrain/center_point.svg" )), event: ModuleEvent::Command("CPCONSTRAINT".to_string()), } @@ -39,7 +39,7 @@ pub mod midpoint_tool { id: "MPCONSTRAINT", label: "Midpoint", icon: IconKind::Svg(include_bytes!( - "../../../../assets/icons/constrain/midpoint.svg" + "../../../assets/icons/constrain/midpoint.svg" )), event: ModuleEvent::Command("MPCONSTRAINT".to_string()), } @@ -53,7 +53,7 @@ pub mod point_on_curve_tool { id: "OCCONSTRAINT", label: "Point on Curve", icon: IconKind::Svg(include_bytes!( - "../../../../assets/icons/constrain/point_on_curve.svg" + "../../../assets/icons/constrain/point_on_curve.svg" )), event: ModuleEvent::Command("OCCONSTRAINT".to_string()), } diff --git a/src/modules/draw/constrain/tools.rs b/src/modules/parametric/tools.rs similarity index 85% rename from src/modules/draw/constrain/tools.rs rename to src/modules/parametric/tools.rs index 0f62d0881..32b886b3c 100644 --- a/src/modules/draw/constrain/tools.rs +++ b/src/modules/parametric/tools.rs @@ -9,7 +9,7 @@ pub mod horizontal { id: "HCONSTRAINT", label: "Horizontal", icon: IconKind::Svg(include_bytes!( - "../../../../assets/icons/constrain/horizontal.svg" + "../../../assets/icons/constrain/horizontal.svg" )), event: ModuleEvent::Command("HCONSTRAINT".to_string()), } @@ -23,7 +23,7 @@ pub mod vertical { id: "VCONSTRAINT", label: "Vertical", icon: IconKind::Svg(include_bytes!( - "../../../../assets/icons/constrain/vertical.svg" + "../../../assets/icons/constrain/vertical.svg" )), event: ModuleEvent::Command("VCONSTRAINT".to_string()), } @@ -37,7 +37,7 @@ pub mod parallel { id: "PCONSTRAINT", label: "Parallel", icon: IconKind::Svg(include_bytes!( - "../../../../assets/icons/constrain/parallel.svg" + "../../../assets/icons/constrain/parallel.svg" )), event: ModuleEvent::Command("PCONSTRAINT".to_string()), } @@ -51,7 +51,7 @@ pub mod perpendicular { id: "QCONSTRAINT", label: "Perpendicular", icon: IconKind::Svg(include_bytes!( - "../../../../assets/icons/constrain/perpendicular.svg" + "../../../assets/icons/constrain/perpendicular.svg" )), event: ModuleEvent::Command("QCONSTRAINT".to_string()), } @@ -65,7 +65,7 @@ pub mod equal { id: "ECONSTRAINT", label: "Equal", icon: IconKind::Svg(include_bytes!( - "../../../../assets/icons/constrain/equal.svg" + "../../../assets/icons/constrain/equal.svg" )), event: ModuleEvent::Command("ECONSTRAINT".to_string()), } @@ -79,7 +79,7 @@ pub mod tangent { id: "TCONSTRAINT", label: "Tangent", icon: IconKind::Svg(include_bytes!( - "../../../../assets/icons/constrain/tangent.svg" + "../../../assets/icons/constrain/tangent.svg" )), event: ModuleEvent::Command("TCONSTRAINT".to_string()), } @@ -93,7 +93,7 @@ pub mod concentric { id: "NCONSTRAINT", label: "Concentric", icon: IconKind::Svg(include_bytes!( - "../../../../assets/icons/constrain/concentric.svg" + "../../../assets/icons/constrain/concentric.svg" )), event: ModuleEvent::Command("NCONSTRAINT".to_string()), } @@ -114,7 +114,7 @@ pub mod normal { id: "NRCONSTRAINT", label: "Normal", icon: IconKind::Svg(include_bytes!( - "../../../../assets/icons/constrain/normal.svg" + "../../../assets/icons/constrain/normal.svg" )), event: ModuleEvent::Command("NRCONSTRAINT".to_string()), } @@ -128,7 +128,7 @@ pub mod colinear { id: "LCONSTRAINT", label: "Colinear", icon: IconKind::Svg(include_bytes!( - "../../../../assets/icons/constrain/colinear.svg" + "../../../assets/icons/constrain/colinear.svg" )), event: ModuleEvent::Command("LCONSTRAINT".to_string()), } @@ -142,7 +142,7 @@ pub mod fixed { id: "FXCONSTRAINT", label: "Fixed", icon: IconKind::Svg(include_bytes!( - "../../../../assets/icons/constrain/fixed.svg" + "../../../assets/icons/constrain/fixed.svg" )), event: ModuleEvent::Command("FXCONSTRAINT".to_string()), } @@ -156,7 +156,7 @@ pub mod symmetric { id: "SYCONSTRAINT", label: "Symmetric", icon: IconKind::Svg(include_bytes!( - "../../../../assets/icons/constrain/symmetric.svg" + "../../../assets/icons/constrain/symmetric.svg" )), event: ModuleEvent::Command("SYCONSTRAINT".to_string()), } diff --git a/src/modules/draw/constrain/value.rs b/src/modules/parametric/value.rs similarity index 99% rename from src/modules/draw/constrain/value.rs rename to src/modules/parametric/value.rs index e7262176e..71e741351 100644 --- a/src/modules/draw/constrain/value.rs +++ b/src/modules/parametric/value.rs @@ -53,7 +53,7 @@ pub mod distance_tool { id: "DCONSTRAINT", label: "Distance", icon: IconKind::Svg(include_bytes!( - "../../../../assets/icons/constrain/distance.svg" + "../../../assets/icons/constrain/distance.svg" )), event: ModuleEvent::Command("DCONSTRAINT".to_string()), } @@ -67,7 +67,7 @@ pub mod angle_tool { id: "ACONSTRAINT", label: "Angle", icon: IconKind::Svg(include_bytes!( - "../../../../assets/icons/constrain/angle.svg" + "../../../assets/icons/constrain/angle.svg" )), event: ModuleEvent::Command("ACONSTRAINT".to_string()), } diff --git a/src/modules/registry.rs b/src/modules/registry.rs index c9ff55f7d..cb2ce90ff 100644 --- a/src/modules/registry.rs +++ b/src/modules/registry.rs @@ -14,6 +14,7 @@ use crate::modules::CadModule; pub fn all_modules() -> Vec> { vec![ Box::new(super::draw::DrawModule), + Box::new(super::parametric::ParametricModule), Box::new(super::model::ModelModule), Box::new(super::insert::InsertModule), Box::new(super::annotate::AnnotateModule), diff --git a/src/scene/sketch_constraints.rs b/src/scene/sketch_constraints.rs index fbf35c0a0..b4a723187 100644 --- a/src/scene/sketch_constraints.rs +++ b/src/scene/sketch_constraints.rs @@ -57,7 +57,7 @@ impl SketchRef { /// click" vocabulary, one layer above the `cadkernel_constraints` primitives each maps /// onto (that mapping is `constraint_map`, a later stage; see the design /// doc §2). Named and grouped the same way the existing one-shot ribbon -/// tools are (`crate::modules::draw::constrain::tools`), plus the +/// tools are (`crate::modules::parametric::tools`), plus the /// endpoint-picking kinds (`Coincident`, `Radius`, `Tangent`) that one-shot /// group never needed. #[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)] @@ -390,7 +390,7 @@ pub(crate) fn infer_coincident_refs( impl ConstraintKind { /// The short symbol a constraint glyph shows — matches the existing - /// ribbon icons (`crate::modules::draw::constrain::{tools,value}`) for + /// ribbon icons (`crate::modules::parametric::{tools,value}`) for /// the kinds that have a one-click button, so the same glyph means the /// same thing in both places. pub fn glyph_symbol(&self) -> &'static str {