Commit Graph
222 Commits
Author SHA1 Message Date
Karim Jerbi 652f4d6bbc feat(blocks): implement Block Definition dialog (BLOCK/BMAKE) with on-screen sequencing
Implement the complete Block Definition dialog window launched via BLOCK
and BMAKE commands, featuring standard CAD layout, workflows, and entity
creation pipelines.

- Dialog UI & Layout:
  - 2-column compact CAD grid with synchronized vertical heights (580 × 390px).
  - Editable combobox with existing block names, invalid character validation,
    and inline redefinition badge.
  - Multi-line text editor widget for block descriptions (replacing single-line input).
  - Quick Select (QSELECT) button integration restoring dialog state upon completion.
  - Confirmation guard when attempting to redefine an existing block definition.
  - Centered radio buttons, clean coordinate inputs, and accessible keyboard shortcuts.

- Base Point & On-Screen Workflow:
  - BlockOnScreenCommand strictly enforces prompt sequencing: Base point is
    prompted before object selection.
  - Dynamically recalculates world_to_block and block_to_world affine transforms
    when base point is specified on-screen, preventing stale (0,0,0) normalization.
  - Supports Retain, Convert to block (INSERT placement), and Delete modes.

- Explode Enforcement:
  - Guarded EXPLODE command to prevent decomposing blocks flagged as non-explodable.

- Dynamic Themed Icons:
  - Added pick_point.svg, select_objects.svg, quick_select.svg, and warning_triangle.svg.
  - Routed all icons through the semantic theming engine so line work (#B4B6B9)
    and accents (#6DB7ED) adapt automatically to the active theme.

- Tests:
  - Added unit tests for retain/convert/delete modes, redefinition, explodable flag,
    on-screen base point transform recalculation, and command sequencing.
2026-09-22 17:05:15 +01:00
copilot-swe-agent[bot] 41101efaa5 fix(trim): skip empty preview polyline segment samples
Co-authored-by: dasmatus <[email protected]>
(cherry picked from commit fb13a7aaa6)
2026-09-20 21:29:15 +03:00
Claude e83c8a28a5 fix(trim): skip polyline segments with no plan-view shape
`sample_entity_xy` walks a polyline's exploded segments and drops the
vertex each segment shares with the previous one. A segment whose curve
plane is upright — any non-horizontal run of a 3D polyline — has no XY
curve, so `entity_curve_xy` declines it and the segment samples to
nothing. With nothing accumulated yet, the seam test compared the two
empty ends as equal and then sliced the empty sample from index 1:

    panicked at src/modules/draw/modify/trim.rs:3982:42:
    range start index 1 out of range for slice of length 0

On the web build that panic unwinds through winit's event-loop runner
and leaves its state borrowed, which is the "RefCell already borrowed"
follow-on in the same report.

Skip an empty sample instead, which leaves the seam handling to the
segments that do have a plan-view shape.

Fixes HakanSeven12/OpenCADStudio#1318

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TQzYZsXBwPZ5HwBaGitEUV
(cherry picked from commit ac9a6ce91a)
2026-09-20 21:29:15 +03:00
Christopher OverbeckandClaude Opus 5 a3d65e2fc8 Bound typed counts and values that could crash the editor
- ARRAYRECT, ARRAYPOLAR, ARRAYPATH, ARRAY3D and COPY Array reject item
  counts above 100,000 (checked as a product of every dimension) and keep
  the prompt open. Unbounded counts allocated one transform per item and
  aborted on allocation failure. Stored defaults are clamped as well.
- EXPLODE leaves a MINSERT above the same limit intact instead of
  materializing every cell.
- Typed lengths and angles reject non-finite values and magnitudes above
  1e15; SCALE rejects a non-finite factor.
- Zero-radius FILLET compares candidate intersections with total_cmp and
  rejects non-finite results; partial_cmp().unwrap() panicked on NaN.
- SOLID falls back to a minimal kernel tolerance when its corners' extent
  overflows, since Tolerance::new panics on infinity.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-17 10:33:18 -05:00
Christopher OverbeckandClaude Opus 5 38aa2ee34d Avoid slicing text inside multi-byte characters
Right-to-left line reordering walked each atom's byte range and sliced the
line at every byte, panicking when a neutral multi-byte character such as a
guillemet preceded the first strong character. Walk characters instead.

FIND/FINDALL located the REPLACE keyword in a Unicode-uppercased copy and
sliced the original with that offset; uppercasing can change byte length
(dotless i, ligatures). Uppercase ASCII only, which keeps offsets aligned.
FILLET and CHAMFER inline R/D shorthands now test the original text before
slicing past the first character.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-17 10:33:18 -05:00
PanosandClaude Opus 5 0fbb5bcb4f ui: neutral wording in code and help text; keywords first in the command menu
Comments and the Options help text describe the behaviour of commercial
solutions without naming any product. The command menu puts the command's
keywords directly under Enter / Cancel, with Recent Input and Snap
Overrides below them, so the choices that change from step to step are the
closest to the pointer.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-17 12:05:15 +03:00
PanosandClaude Opus 5 d753874fe4 feat(modify): commercial solutions keyword options for MOVE, COPY, FILLET, CHAMFER, OFFSET
MOVE: Displacement, Enter at the second point uses the base as the vector.
COPY: Displacement, mOde (Single/Multiple), Undo of the last copy.
FILLET: Undo of the last fillet (the command refreshes its entity cache
through the new CadCommand::on_document_undone hook after the host undoes
the document step). CHAMFER: Multiple and Undo. OFFSET: Erase (the offset
replaces its source), Layer (Current/Source), Undo, Exit.
POLY3D, TRACE, MIRROR and MEASUREGEOM expose the keywords they already
accepted as options, so the context menu and option buttons list them.

The pinned prompt now keeps informational bracket groups such as
"[3 objects]" and only drops real option listings when the buttons take over.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-17 12:05:14 +03:00
Hakan Seven 65c0fe5494 fix: align dynamic angle input with drawing units 2026-09-17 09:50:41 +03:00
Hakan Seven 48a734ba9b Merge pull request #1272 from kevin9327/fix/linear-dimension-off-world-z 2026-09-15 12:29:27 +03:00
Felix RiestraandClaude Sonnet 5 0f739b459d Add bounding-box object alignment (ALIGNLEFT/TOP/etc.), ported from Mac2CAM
Six one-shot alignment commands for the current selection —
ALIGNLEFT/ALIGNHCENTER/ALIGNRIGHT/ALIGNTOP/ALIGNVCENTER/ALIGNBOTTOM —
distinct from the existing point-picking ALIGN/ALIGN3D command: each
nudges every selected object (or complete group, via new
Scene::selected_object_units) so its bounding-box edge/center lines up
with the extreme edge/center already present in the selection, closer
to a word processor's "align objects" than AutoCAD's 3-point ALIGN.

Wired as plain one-click Tool entries in the Modify extension panel,
next to the existing ALIGN entry, matching that panel's flat-list
convention (no point prompts, so no dropdown submenu needed).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-09-15 01:08:41 +02:00
kevin9327andClaude Opus 5 c13e86b87d fix(dimension): draw linear and aligned dimensions in their own plane off world Z
A linear or aligned dimension whose normal is not world Z was drawn and
exploded as if it lay in world XY. The builders read the offset and the
extension directions in XY only, so a dimension turned into a working plane
such as XZ lost its offset (now along Z): the dimension line fell onto the
measured points and the extension lines stuck out along world Y.

Move such a dimension into its own OCS before building it and map the result
back onto its plane, as arc length and large radial dimensions already do,
for both tessellation and EXPLODE.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-15 07:00:47 +09:00
gianlucafiore 5d77c2dd00 feat(fillet): allow radius from two picked points 2026-09-12 21:41:34 -03:00
gianlucafiore 7ab311d86c fix(move): keep source geometry visible during preview 2026-09-12 21:41:34 -03:00
Karim Jerbi f79bad8adf fix(trim): handle polyline arc segments and preserve curvature
- Intersect cutting boundaries against polyline arc segments via KernelArc instead of chord lines
- Project click points onto BulgeArc geometry to evaluate accurate click parameters
- Proportionally scale and preserve bulges on surviving partial arc segments via extract_sub_polyline
- Update crossing trim and hover wire preview to support polyline arc geometry
2026-09-11 14:33:49 +01:00
Hakan Seven 71a7b365ef Merge pull request #1208 from Ramox81/codex/kernel-lengthen-support-curves-20260911 2026-09-11 16:11:42 +03:00
Hakan Seven db684019d9 Merge pull request #1207 from Ramox81/codex/parity-setbylayer-settings-20260911 2026-09-11 16:09:55 +03:00
Hakan Seven f51d492994 Merge pull request #1205 from Ramox81/codex/fix-break-curve-spans-20260911 2026-09-11 16:04:53 +03:00
Hakan Seven 03445c697a Merge pull request #1204 from Ramox81/codex/parity-splinedit-fit-data-20260911 2026-09-11 16:01:27 +03:00
Hakan Seven 173552ed0e Merge pull request #1203 from Ramox81/codex/parity-pedit-jointype-20260911 2026-09-11 15:58:25 +03:00
ramox81 1e82fb9f78 Pass join settings through the shared polyline result handler 2026-09-11 15:17:42 +03:00
ramox81 65161e82db Add independent layer property settings during selection 2026-09-11 15:10:51 +03:00
ramox81 0b880ccda8 Add persisted polyline join type and selected connector geometry 2026-09-11 15:07:11 +03:00
Hakan Seven 7edf0de603 Merge updated pull request #1188 from Ramox81/pedit-enhancements 2026-09-11 14:55:26 +03:00
Hakan Seven 7d28cc5256 Merge pull request #1188 from Ramox81/pedit-enhancements 2026-09-11 14:32:32 +03:00
ramox81 5aaa0e128b Normalize circular arc break fragment angles 2026-09-11 14:24:12 +03:00
ramox81 9ae04cd30f Add fit-data purge and endpoint tangent editing 2026-09-11 14:23:10 +03:00
ramox81 9f37c0eb39 Break polylines at picked segment parameters preserving bulges and widths 2026-09-11 14:15:42 +03:00
ramox81 aa11b10c9a Extend selected polyline terminals using bounded kernel intersections 2026-09-11 14:05:50 +03:00
ramox81 6b12dfc9e7 Use curve spans for arc and ellipse breaks 2026-09-11 14:04:29 +03:00
ramox81 7d1de1d76f Edit spline fit points with add move and delete workflows 2026-09-11 13:57:38 +03:00
ramox81 c3987f427d List polyline conversion in open spline editing prompt 2026-09-11 13:37:03 +03:00
Hakan Seven 30b6441ef9 Complete bounded spline polyline conversion 2026-09-11 13:33:17 +03:00
Hakan Seven e0bc84b4ad Merge latest pull request #1199 from ramox81/codex/join-source-workflow 2026-09-11 13:23:27 +03:00
Hakan Seven e39906b8b7 Merge latest pull request #1187 from ramox81/codex/complete-splinedit-options
# Conflicts:
#	src/modules/draw/modify/splinedit.rs
2026-09-11 13:23:27 +03:00
Hakan Seven da34032ffc Harden spline editing and source joins 2026-09-11 13:23:00 +03:00
ramox81 e875b2ec5d Resolve fit-only source and candidate splines for joining 2026-09-11 13:03:34 +03:00
Hakan Seven e11796af29 Merge pull request #1199 from ramox81/codex/join-source-workflow 2026-09-11 13:02:17 +03:00
ramox81 356c8b5a7b Keep multiple polyline editing active across selected joins 2026-09-11 12:57:58 +03:00
Hakan Seven 67768a3eca Merge pull request #1187 from ramox81/codex/complete-splinedit-options 2026-09-11 12:52:49 +03:00
ramox81 deb9129e91 Convert splines to bounded straight-segment polylines 2026-09-11 12:52:07 +03:00
Hakan Seven 08b184e314 Merge pull request #1186 from ramox81/codex/complete-reverse-command
# Conflicts:
#	src/entities/helix.rs
2026-09-11 12:51:29 +03:00
ramox81 9536f60bff Apply supporting-curve LENGTHEN changes and retain polyline widths 2026-09-11 12:49:02 +03:00
Hakan Seven 9e74df4c67 Merge pull request #1193 from ramox81/codex/complete-lengthen-options 2026-09-11 12:42:06 +03:00
Hakan Seven 5d7e1b5f0c Merge pull request #1192 from ramox81/codex/complete-align-3d 2026-09-11 12:37:55 +03:00
ramox81 29cd7fa82b Resolve fit-only spatial splines before order elevation 2026-09-11 12:35:34 +03:00
ramox81 ed6e962b78 Compact redundant polynomial knots after order elevation 2026-09-11 12:33:49 +03:00
ramox81 7181770c73 Elevate spatial spline order through the NURBS kernel 2026-09-11 12:33:35 +03:00
Hakan Seven 4a1dddfbe5 Test wipeout and break command interactions 2026-09-11 12:25:24 +03:00
Hakan Seven cf9ddf8586 Merge PR #1185: Support first-point reset and same-point breaks 2026-09-11 12:21:38 +03:00
Hakan Seven 32952e3eda Merge PR #1179: Add tolerant OVERKILL cleanup options
# Conflicts:
#	src/app/commands/styleprops.rs
2026-09-11 12:16:24 +03:00