forked from 1b-agent/opencadstudio-upstream
feat(otrack): polar coordinates from tracking point (#69)
OTRACK alignment was computed in the wrong plane (it used Z as the second axis while the model is XY / Z-up), so tracking never aligned correctly and the aligned point was never fed to a pick. Rework it: project the cursor onto a ray from a tracking point in the XY plane — horizontal/vertical by default, or every POLAR increment when POLAR is on. The aligned point is now used for both the live preview and the committed click, and a dashed guide shows the ray. While aligned, a typed distance places the point along the ray from the tracking point, via the command line and the dynamic-input box (which shows a single Distance field). The alignment clears with the command. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
d62690b652
commit
f2fd36b5fa
3 files changed
+195
-46
No files matched your search
@@ -198,6 +198,10 @@ pub(super) struct OpenCADStudio {
|
||||
/// Last persisted user preferences (DYN/OSNAP/OTRACK/POLAR/…). Compared
|
||||
/// after each message so a change is written to disk exactly once.
|
||||
last_saved_settings: Option<settings::UserSettings>,
|
||||
/// Active OTRACK alignment `(tracking_point, unit_direction)` when the
|
||||
/// cursor is on a tracking ray. Lets a typed distance place a point along
|
||||
/// the ray from the tracking point (issue #69). `None` when not aligned.
|
||||
otrack_active: Option<(glam::Vec3, glam::Vec3)>,
|
||||
/// Whether Tangent snap was enabled before a tangent-pick command started.
|
||||
pre_cmd_tangent: Option<bool>,
|
||||
/// Orthogonal drawing constraint (F8): constrains picks to 0°/90°/180°/270°.
|
||||
@@ -1271,6 +1275,7 @@ impl OpenCADStudio {
|
||||
selection_filter_popup_open: false,
|
||||
statusbar_config: crate::ui::statusbar_config::StatusBarConfig::load(),
|
||||
last_saved_settings: None,
|
||||
otrack_active: None,
|
||||
clean_screen: false,
|
||||
quick_properties: false,
|
||||
selection_cycling: false,
|
||||
|
||||
Reference in new issue
Block a user