Commit Graph
1214 Commits
Author SHA1 Message Date
Hakan Seven 92e1dfd685 Merge PR #1000: cache selection filter entity types 2026-09-04 20:06:56 +03:00
Hakan Seven 90761904a9 Merge reviewed modeling PRs with Unicode and PRESSPULL fixes 2026-09-04 19:49:55 +03:00
Hakan Seven d8790ef433 Use exact kernel curves for PRESSPULL area containment 2026-09-04 19:34:38 +03:00
Karim Jerbi a9fda66ac0 fix(ui): add non-color marker to CLI info entries and drop dead desk parameter
- Add 'i  ' prefix to EntryKind::Info and coordinate set_step_prompt deduplication to satisfy WCAG 1.4.1 across all 22 themes
- Drop unused _desk parameter from crosshair_background and clean up its call sites
- Document AutoCAD-standard context-based crosshair drafting surface architecture in crosshair_background
- Add doc comments documenting deliberate alpha omission in canvas_is_light and backlog scope in is_wide
2026-09-04 16:26:13 +01:00
Karim Jerbi b53cd580f6 feat(ui): shared dropdown popup width calculation with wide-character support
- Add dropdown_popup_width helper in common.rs replacing magic formula heuristics
- Implement is_wide range table to count East Asian Wide/Fullwidth (CJK) glyphs double for localized strings
- Calibrate unit scale factor to 0.68 * font_size preserving existing width behavior at font size 11
- Apply shared calculation across viewport controls and ribbon dropdowns
- Update unit tests to verify width calculation on standard and CJK labels
2026-09-04 16:26:12 +01:00
Karim Jerbi a7e3cf3a6d fix(ui): enforce WCAG AA contrast thresholds across UI themes
- Raise accessible_accent default threshold from 2.0 to 3.0 (WCAG 1.4.11 UI state indicators)
- Raise EntryKind::Info command line history threshold from 3.0 to 4.5 (WCAG 1.4.3 normal text)
- Update themed_check_cell to verify >= 3.0:1 contrast across both weak popup panel and strong highlighted rows
- Replace fully-qualified accessible_accent_threshold calls inside closures with use imports
- Add comprehensive 9-suite theme accessibility contrast test suite covering all 22 themes across core surfaces
2026-09-04 15:34:24 +01:00
Karim Jerbi 23a9884f90 fix(ui): canvas-aware selection colors and paper space detection
- Add canvas_is_light helper based on WCAG luminance (> 0.5)
- Ensure crosshair_background always returns sheet white in paper space
- Update resolve_selection_base_color to resolve user ACI -> light-canvas palette -> theme palette
- Add light_canvas_color with curated deep-green/deep-blue pairs for light surfaces
- Extract selection_fill_alpha with 1.35x contrast compensation on light surfaces
- Thread canvas_bg through draw_marquee and poly selection
- Note deliberate limitation for desk-spanning marquee edge case
- Add test coverage for paper space, ClassicDark, custom light bg, and fill alpha clamping
2026-09-04 15:28:25 +01:00
PanosandClaude Opus 5 f1efc73cbe perf: stop rescanning every entity to fill the selection-filter menu
Pan and even plain cursor movement over the canvas ran at ~8 fps on a
large drawing. Nothing rendered was responsible: the GPU idled at 0-8%,
encoding no scene at all changed nothing, and vertices, pixels and draw
calls could each be cut without moving the number. `view` was the frame
-- 110 ms of it against 3-6 ms on a small drawing -- and inside `view`
it was the status bar.

The status bar builds the selection-filter menu, which asks for the
distinct entity type names in the layout. That call cloned the layout's
entire handle list (1 166 357 handles, ~9 MB), then did a map lookup, a
String allocation and a BTreeSet insert for each one. About 107 ms of a
110 ms frame, to produce roughly twenty names, for a menu that is only
visible when opened.

Cache the result against geometry_epoch and the layout block, since it
only changes when entities are added or removed, and make the scan
itself borrow the handle list rather than clone it and collect &str,
allocating only for the names it returns.

The immediate-mode UI rebuilds every widget on every mouse move, which is
fine as long as nothing in that path is O(document). This was.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-04 16:20:30 +03:00
ramox81 9279384e9a Complete PRESSPULL selection, face editing and extrusion history 2026-09-04 15:31:30 +03:00
ramox81 479bf87988 Complete LOFT commands, surfaces, previews and editable history 2026-09-04 13:03:33 +03:00
Karim Jerbi 886d5777d8 fix(ViewCube): WCS dropdown no longer appears to clip view cube
- enlarged render area for the viewcube container, and increased the gap between cube region and WCS dropdown
2026-09-04 10:21:33 +01:00
ramox81 8e3d851133 Fix SWEEP result counter formatting 2026-09-04 11:32:05 +03:00
ramox81 ad47b17603 Complete SWEEP command options and kernel integration 2026-09-04 11:15:44 +03:00
gianlucafiore 71d1d18f89 fix(grips): clear OTRACK after typed stretch commit 2026-09-03 17:23:11 -03:00
gianlucafiore 2885898da6 fix(trim): honor preselected cutting boundaries 2026-09-03 17:02:06 -03:00
gianlucafiore 5ed508ce76 fix(offset): preserve source entity layer 2026-09-03 16:33:03 -03:00
Hakan Seven 611ea0696b revert: restore thumbnail capture for native saves (#956) 2026-09-03 21:11:00 +03:00
Hakan Seven edd3faeeae fix(save): decouple native saves from screenshots (#956) 2026-09-03 21:06:19 +03:00
Hakan Seven 3088e641aa fix(view): stabilize 3D navigation and hidden lines
Refresh stale depth bounds after geometry edits, allow orbiting through camera poles, and preserve hidden-line occlusion for selected solids.\n\nFixes #957
2026-09-03 20:22:35 +03:00
Hakan Seven 1d8494099d Fix revolve cursor plane 2026-09-03 20:02:11 +03:00
Hakan Seven b5a926cc20 Merge remote-tracking branch 'origin/main' into review/pr-986
# Conflicts:
#	Cargo.lock
#	Cargo.toml
2026-09-03 19:52:20 +03:00
Karim Jerbi 688785a6cf feat(model-space): theme-aware model space canvas and CAD selection/grip sysvars
Model space appearance now follows the active UI theme instead of a
hardcoded dark background. Canvas mode is user-selectable (Match Theme /
Classic CAD Dark / Custom RGB), with matching controls for the paper
sheet and desk surround backgrounds and grid opacity.
Implements industry-standard CAD system variables, all settable via
command name, SETVAR, and the Options dialog:
- COLORTHEME (0/1 dark/light UI scheme, preserves custom palettes)
- COLORSCHEME (interactive named-theme selection)
- BACKGROUND (THEME/CLASSIC/DEFAULT/DESK presets, RGB triplets)
- SELECTIONAREA, SELECTIONAREAOPACITY (translucent marquee fill)
- WINDOWSAREACOLOR/WINDOWAREACOLOR, CROSSINGAREACOLOR (ACI or theme)
- SELECTIONEFFECT, SELECTIONEFFECTCOLOR (GPU highlight pass, driven by
  selection_generation invalidation — no retessellation)
- SELECTIONPREVIEW (bit 0 = idle rollover, bit 1 = in-command hover)
- GRIPSIZE, GRIPCOLOR, GRIPHOT, GRIPHOVER (grip overlay styling)
2026-09-03 17:44:44 +01:00
Hakan Seven 4bdbc0e5f6 fix: prefer high-performance GPU adapters 2026-09-03 19:27:15 +03:00
ramox81 1a913ee640 Fix revolve angle and wireframe display 2026-09-03 16:24:43 +03:00
ramox81 5bbb0bbe1f Harden revolve validation and properties 2026-09-03 15:01:38 +03:00
ramox81 2e112f9aeb Complete revolve workflow and properties 2026-09-03 13:40:23 +03:00
Hakan Seven 4679eb2a5e fix: finish extrude grip preview integration 2026-09-03 12:52:03 +03:00
Hakan Seven 46323379b3 Merge remote-tracking branch 'origin/main' into codex/extrude-grip-preview 2026-09-03 12:50:52 +03:00
NgoQuocViet2001 9db030eb1f fix(expr-eval): make ^ right-associative
parse_power accepted a single exponent (`unary ('^' unary)?`), so a
chained power stopped after the first `^`. The remaining `^2` was left
unconsumed, and eval_to_string's embedded-expression scan then handed it
back as literal text: typing `2^3^2` into a coordinate or distance field
produced the string "8^2" rather than 512, and `2^3^2+1" produced "8^3".

Recurse into parse_power for the exponent so `2^3^2` reads as
`2^(3^2)", the standard right-associative meaning, and the whole
expression is consumed.
2026-09-03 15:32:56 +07:00
ramox81 37a60329b1 fix: preserve grip clicks when dismissing hover menu 2026-09-03 11:07:15 +03:00
ramox81 ea6eb58c53 Fix extruded solid grip preview and taper range 2026-09-03 10:35:02 +03:00
gianlucafiore 96b0587a83 fix(grips): restore tracking references during grip edits 2026-09-02 20:19:23 -03:00
Karim Jerbi 46190ccba1 refactor(selection): migrate Scene.selection to Arc<RefCell> to avoid per-frame deep clone
Scene.selection was Rc<RefCell<SelectionState>> (31 fields, ~1.6KB
with poly_points) cloned deep per view_main per pane via
(*sel_ref).clone() at view/mod.rs:760. Replace with
Arc<RefCell<SelectionState>> (Arc::new(RefCell::new(...)) at
scene/mod.rs:1436,1868), SelectionCanvas holds Arc<RefCell> and
selection_overlay takes Arc<RefCell> (overlay.rs:365,415),
view_main does Arc::clone(&tab.scene.selection) (atomic bump)
instead of deep clone. sel_ref stays borrowed for field reads
(vp_size etc.).

Bench (release, n=5000): SelectionState::clone 39-68ns (64pts) /
11-22ns (0pts) vs Arc::clone 7ns — 5-9x on the hot path.

Tests:
- selection_is_arc_not_refcell: asserts type_name contains Arc
- bench_selection_state_clone / bench_selection_arc_clone / bench_selection_state_clone_empty (ignored, release)
2026-09-02 22:14:32 +01:00
Hakan Seven 76bdab1e5b feat(display): add model lineweight scale 2026-09-02 23:03:04 +03:00
Hakan Seven 0f337db488 Keep rotation prompt visible with arc label 2026-09-02 22:02:10 +03:00
Hakan Seven 7edf268eef Keep rotation angle label on guide arc 2026-09-02 21:53:29 +03:00
Hakan Seven 93b441d4b8 Unify mixed color selection
Use the shared color selector for mixed property values and remove the legacy inline palette and its state.
2026-09-02 21:28:15 +03:00
Karim Jerbi 199a484fcb refactor(view): scope SelectionState borrow in selection_overlay block
Hold a single Ref<SelectionState> across the block; replace six redundant borrow().vp_size/last_move_pos calls with field reads on the Ref. Move the deep clone to the widget call site ((*sel_ref).clone()), preserving one clone per frame but ensuring the widget receives the same snapshot as the geometry reads.
2026-09-02 16:43:57 +01:00
Hakan Seven b1deec753c Merge main and preserve revolve history grips 2026-09-02 18:05:50 +03:00
Hakan Seven 47549b168b Merge main and preserve loft history grips 2026-09-02 17:56:00 +03:00
Hakan Seven d93be37d35 Merge main and preserve sweep history grips 2026-09-02 17:50:30 +03:00
Hakan Seven 0ab1860948 Prevent grip clicks from starting area selection (#972)
Prevent grip clicks from starting area selection
2026-09-02 17:47:13 +03:00
Hakan Seven 2bb491d874 fix(grips): capture placement clicks first 2026-09-02 17:46:49 +03:00
Hakan Seven dba81bc8b6 Use feature edges for normal 3D selection (#971)
Use feature edges for normal 3D selection
2026-09-02 17:45:27 +03:00
Hakan Seven 11e25b8e73 Complete EXTRUDE behavior and editable properties (#965)
Complete EXTRUDE behavior and editable properties
2026-09-02 17:42:15 +03:00
ramox81 15c44c0f3a Restore revolve profile and axis grips 2026-09-02 17:01:35 +03:00
Karim Jerbi d6a6dd6a7d feat(table): add TABLEDIT point picking, and consolidate InputKind
- Implement `TABLEDIT` command supporting viewport point-picking on cell interiors
- Support overlapping table hit testing with selection cycling and top-table resolution
- Support `/n` and `\n` multiline paragraph breaks (`\P`) in table cell text editing
- Unify text input modes via `InputKind` (`Point`, `SingleToken`, `FreeText`) on `CadCommand`
- Migrate 15+ commands across annotate, draw, insert, layout, and view modules
- Preserve text casing, literal spaces, and bypass arithmetic eval during FreeText input
- Add dedicated `tabledit_tests` and `free_text_entry_tests` test suites
2026-09-02 14:55:49 +01:00
ramox81 7fbde18151 Restore loft section grip editing 2026-09-02 16:26:14 +03:00
ramox81 e2472c68b8 Restore sweep construction grips 2026-09-02 15:58:36 +03:00
ramox81 708c30831c Capture pointer input during grip edits 2026-09-02 15:21:57 +03:00