Commit Graph
3667 Commits
Author SHA1 Message Date
Hakan Seven edc45caa14 Merge pull request #1363 from ramox81/codex/capture-minimized-guard
Refuse an automation capture while the window is minimized
2026-09-18 22:12:21 +03:00
Hakan Seven f137ce96f1 Merge pull request #1362 from ramox81/codex/axis-point-reprompt
Report a missed first 2Points pick at once for Horizontal/Vertical
2026-09-18 22:12:21 +03:00
Hakan Seven a3dc1506ac Merge pull request #1361 from ramox81/codex/constraint-edit-parity
Match edit behavior of fixed and axis-constrained entities
2026-09-18 22:12:21 +03:00
ramox81andClaude Fable 5.1 02a75ead50 Refuse an automation capture while the window is minimized
A minimized window has a 0x0 surface; the renderer's screenshot path
panicked on the empty read-back buffer and took the whole application
down. The capture op now checks the window size first and answers with
an error instead of requesting the screenshot.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 20:36:08 +03:00
ramox81andClaude Fable 5.1 cda0627804 Report a missed first 2Points pick at once for Horizontal/Vertical
The first empty-space click of the 2Points flow was only resolved against
the document together with the second one, so "No valid constraint point
found." appeared one pick late. The command now hands the first pick to
the host (`CmdResult::CheckHorizontalPoint`), which resolves it right away:
a miss reports and re-asks for the first point, a hit moves on to the
second point.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 20:36:01 +03:00
ramox81andClaude Fable 5.1 b45e8bce1f Keep the transformed length when an axis-constrained entity re-aligns
The temporary end-point pin of a transformed Horizontal/Vertical entity is
paired with the length the transform left it, so a scaled vertical line
stays scaled while a rotated one stays vertical at its rotated length.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 19:18:13 +03:00
ramox81andClaude Fable 5.1 5ac6dc279b Keep only the end point of a transformed axis-constrained entity pinned
10) A transformed entity with a Horizontal or Vertical relation keeps only
    its end point where the transform put it; the rest re-aligns to the
    axis at the retained length, so a rotated vertical line stays vertical
    below its moved end instead of the whole-entity pin contradicting the
    axis and leaving the constraint unmet.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 19:18:13 +03:00
ramox81andClaude Fable 5.1 e572625de3 Refuse an edit the constraints can only satisfy by collapsing the entity
9) When an edit contradicts a fixed point together with another constraint
   so that the only solution collapses the entity (a rotated line with a
   fixed start and a Vertical relation), the entity returns to its pre-edit
   shape instead of degenerating, as the reference does.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 19:18:13 +03:00
Hakan Seven a7ab5314f2 Merge pull request #1356 from ramox81/codex/fixed-constraint-parity
Let other constraints reconcile a partly fixed entity's free points
2026-09-18 18:59:26 +03:00
Hakan SevenandClaude Fable 5.1 2b69e6e94c fix: point cadkernel at upstream after #1352; unify duplicate-constraint message
- #1352 pinned cadkernel/cadkernel-constraints to ramox81's fork. Its one
  extra commit (cadkernel #67, SymmetricLineDirections) is now on
  HakanSeven12/cadkernel main as the same SHA, so the manifests and lock
  point back at the upstream repo at rev 0493b59.
- SYCONSTRAINT reports a repeated relation with the same message Fix and
  Vertical use, as an error instead of plain output.
- The knot-less spline test consumes the add_entity results.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 18:58:00 +03:00
Hakan Seven 3ba7b38934 Merge pull request #1357 from ramox81/codex/vertical-constraint-parity
Match Vertical geometric constraint behavior

# Conflicts:
#	src/app/commands/draw.rs
#	src/scene/parametric_constraints.rs
#	src/ui/overlay.rs
2026-09-18 18:54:12 +03:00
Hakan Seven 7ef4e9f336 Merge pull request #1356 from ramox81/codex/fixed-constraint-parity
Match Fix geometric constraint behavior

# Conflicts:
#	src/scene/parametric_constraints.rs
#	src/scene/parametric_solve.rs
2026-09-18 18:53:18 +03:00
Hakan Seven da02e38208 Merge pull request #1352 from ramox81/codex/symmetric-constraint-parity
Complete Symmetric constraint behavior
2026-09-18 18:52:41 +03:00
Hakan Seven 9613e6edf9 Merge pull request #1351 from helenkwok/feat/web-open-from-bytes
Web control: open a drawing from bytes
2026-09-18 18:52:37 +03:00
Hakan Seven 752894e82b Merge pull request #1350 from helenkwok/fix/set-properties-number-expected
set_properties: compare expected numbers by value
2026-09-18 18:52:37 +03:00
Hakan Seven 4905d99e51 Merge pull request #1347 from helenkwok/fix/wasm32-main-build
Fix wasm32 build: gate the font download and XREF open call sites
2026-09-18 18:52:37 +03:00
Hakan Seven ce6db72c78 Merge pull request #1346 from huaninstratech/fix/block-text-wipeout-depth
fix: keep block text above its own block's wipeouts (compose glyph depth through the scene graph)
2026-09-18 18:52:37 +03:00
Hakan Seven 3c1ad62e9b Merge pull request #1340 from CiberNin/fix/editor-crashes
Fix editor crashes from typed input, text, and degenerate geometry
2026-09-18 18:52:37 +03:00
Hakan Seven 37b24296d8 Merge pull request #1338 from ramox81/codex/properties-hyperlink-control
Fix Properties hyperlink collection editing
2026-09-18 18:52:37 +03:00
ramox81andClaude Fable 5.1 d837109076 Let other constraints reconcile a partly fixed entity's free points
8) A moved entity that a Fixed holds only in part no longer pins its free
   points as hard anchors: they stay where the edit put them unless another
   constraint on the entity (e.g. Vertical) moves them, so the fixed point
   holds and the solve no longer fails when the two disagree.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 18:49:48 +03:00
Hakan SevenandClaude Fable 5.1 9978713acc fix: UCS FACE/OBJECT pick from the interactive prompt; reuse ocs_axes
Follow-up to #1341:
- interactive UCS offers Face / OBject; bare UCS OBJECT starts an entity pick
- one UcsPickCommand serves both FACE and OBJECT
- ucs_from_normal calls the existing arbitrary-axis helper instead of a copy
- prompt catalogue key and en-US text follow the new option list

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 18:42:44 +03:00
ramox81andClaude Fable 5.1 26e458d6f7 Match Vertical geometric constraint behavior
1) VCONSTRAINT (and the new GCVERTICAL name) uses the axis constraint flow:
   "Select an object or [2Points] <2Points>:", 2Points mode with the
   reference's re-prompts and messages, and the same object types as
   Horizontal — line, polyline segment, text, MText, ellipse axis.
2) Object mode turns the object about its first vertex; a two-point relation
   across two objects slides the second object rigidly onto the axis.
3) Re-applying an axis constraint reports that the constraint already
   exists; Vertical follows the UCS Y direction.
4) The constraint bar draws Vertical as the reference's axis mark, with the
   point marker for a two-point relation.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 18:19:49 +03:00
Hakan Seven 3ba4ab9e7f Merge pull request #1341 from dichhead/main
Nix flake (dev shell + package build), object snap on by default,
Fusion Black/White themes, UCS FACE / UCS OBJECT, CREATESKETCH /
FINISHSKETCH sketch mode, BROWSER panel, and a colour wheel for the
viewport background swatches.
2026-09-18 17:49:22 +03:00
Karim Jerbi 7ea51d81d3 refactor(plugin): share legacy round-trip helper across interactive calls
Collapse the triplicated send/timeout/deadline/nested-request loop in interactive_event, get_prompt and needs_entity_pick into PluginProcess::call_simple. Timeout floors, error strings and UnexpectedResponse behavior preserved exactly. Net: +64 / -72 in one file, no behavior change. Verified: cargo check clean, cargo test -p ocs_plugin_api --lib --features host (92 passed), clippy shows only pre-existing warnings.
2026-09-18 15:40:32 +01:00
dichhead b356baa5e5 Merge branch 'HakanSeven12:main' into main 2026-09-18 16:09:59 +02:00
ramox81andClaude Fable 5.1 7901383553 Keep the original Fix ribbon icon
Restores assets/icons/constrain/fixed.svg from main; only the ribbon label
changes to "Fix".

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 17:04:50 +03:00
ramox81andClaude Fable 5.1 45f3088a89 Draw the Fix constraint bar glyph as a padlock
7) The constraint bar draws Fix as a padlock instead of the letter F: a
   white lock with a small orange point marker when one point is held, a
   red lock when a whole curve or polyline segment is held.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 16:55:11 +03:00
Karim Jerbi 1bc20b9ecc refactor(plugin): share timeout helpers between process and process::v4
Delete the 5 copy-pasted timeout helpers in process/v4.rs (CALL_TIMEOUT_DEFAULT, call_timeout, request_timeout, execute_code_timeout, base_max_floor, request_kind) and reuse the canonical process.rs versions, now pub(crate). Prevents floor drift between v1 and v4 paths. Net: +3 / -59, no behavior change. Verified: cargo check -p ocs_plugin_api clean, cargo test -p ocs_plugin_api --lib --features host (92 passed).
2026-09-18 14:18:23 +01:00
Karim Jerbi b7de6a3287 refactor(ui): centralize muted_style in style::common
Delete the byte-identical 0.68 muted_style copies across 13 window modules and import crate::ui::style::common::muted_style instead. print_all keeps its local name via muted_style as muted so call sites are untouched. Divergent alphas (0.60/0.62/0.65/0.72) and missing_fonts weak.text left alone to avoid visual changes. Net: +13 / -78, no visual change. Verified: cargo check --all-targets clean, cargo test --lib ui::style (3 passed).
2026-09-18 14:00:05 +01:00
Karim Jerbi b8a7f5edfb refactor(ui): centralize hdivider/vsep in style::form
Deduplicate the byte-identical 1px divider helpers previously copy-pasted across 6 modules. form::{hdivider, vseparator} is now canonical, with a form::vsep alias for legacy call sites. style_manager re-exports both so scale_manager and anno_object_scale imports keep working unchanged. Delete locals in style_manager, plotstyle, dimstyle, layout_manager, attribute_editor. Replace thin wrappers in window/plot with direct imports. no visual change.
2026-09-18 13:43:29 +01:00
ramox81andClaude Fable 5.1 f998b59193 Match Fix geometric constraint behavior
1) FXCONSTRAINT (and the new GCFIX name) prompts "Select point or [Object]
   <Object>:" — a pick fixes that constraint point; Enter or O asks for one
   line, polyline segment, circle, arc, ellipse or spline; misses and
   unsupported objects report the reference messages and re-prompt.
2) Point, block, text, MText, attribute and table insertion points are
   addressable constraint points.
3) Re-applying Fixed to the same point or object reports that the constraint
   already exists instead of adding a duplicate.
4) A persistent Fixed holds its pre-edit geometry through MOVE, ROTATE,
   SCALE, STRETCH, grip and Properties edits: fixed points stay, free points
   of a partly fixed entity follow the edit, and size retention skips fixed
   entities.
5) Object mode on a polyline fixes the picked segment (natively persisted)
   instead of the whole polyline; arc segments pin endpoints, center and
   radius.
6) Ribbon label "Fix" with a padlock icon.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 15:38:33 +03:00
Karim Jerbi 9545e36975 fix(wix): remove RefreshShellIcons ie4uinit custom action
[SystemFolder] resolves to SysWOW64 on x64, where ie4uinit.exe
does not exist (only System32). This logged MSI 1721 on every
silent install. Icon associations via ProgId/Extension need no
manual refresh, so drop the action instead of switching to
System64Folder.
2026-09-18 13:19:57 +01:00
Karim Jerbi 2b38f798c0 Add GPU backend probe with automatic fallback for older GPUs
Older GPUs without usable DirectX 12 Feature Level 12_0 or working
Vulkan support (e.g. legacy Intel iGPUs and other old parts), and old
GLES drivers whose shader compiler rejects iced's own shaders, crash
at startup or on the first drawing viewport: StagingBelt aborts in
Buffer::get_mapped_range (panic=abort, silent exit) on the DX12 path,
and shader compilation fails inside iced's gradient pipeline on the
GLES path. Selecting a working backend via WGPU_BACKEND before iced
boots avoids both classes.

- Probe each candidate backend (Windows: dx12,vulkan,gl; Linux:
  vulkan,gl) in an isolated --gpu-probe child: device request,
  staging-style mapped upload, render pipeline creation (its fragment
  shader reads a private vec4 array, catching old-Mesa compile
  failures), offscreen render and readback. First fully-passing
  backend wins; explicit --backend / WGPU_BACKEND / --safe-mode
  always win, and Windows keeps preferring DX12/Vulkan (#55).
- Software adapters (WARP/llvmpipe/SwiftShader) are the last resort
  before a best-effort GL attempt: slow but alive.
- The crash sentinel names the attempted backend so only implicated
  backends are skipped next launch.
- Winning probes report adapter limits; GPUs without shader storage
  buffers get the packed compatibility renderer automatically, with
  a startup command-line notice so the switch is never silent.
2026-09-18 11:26:25 +01:00
ramox81 9aadc97c11 feat: complete symmetric constraint behavior 2026-09-18 10:27:00 +03:00
Helen Kwok 2a78ebe2c1 Web control: open a drawing from bytes
On the web build, {"op":"open","path":…} resolves the name against the
browser's recent-files cache, so a file that is not already there cannot be
opened by the control channel. Accept {"op":"open","name":…,
"data_base64":…} instead: the bytes go through the same parse, caching
and recovery path as a file chosen in the browser picker
(io::open_bytes_web, now shared with pick_and_load_web).

Native builds keep path-based open and reject data_base64 with
invalid_request.

Refs #1349
2026-09-18 16:43:29 +09:30
Helen Kwok be78ecc7d9 set_properties: compare expected numbers by value
serde_json keeps 10 and 10.0 as different Numbers, so an expected of 10
never matched a stored whole-number float, and a JavaScript client cannot
send 10.0 at all. Compare numbers by value (recursively through arrays and
objects); everything else keeps structural equality.

Fixes #1348
2026-09-18 15:46:23 +09:30
Helen Kwok 000d8a1687 Fix wasm32 build: gate the font download and XREF open call sites
crate::network and the open crate are desktop-only, but the community-font
download (font_repo.rs) and the XREF row Open action call them
unconditionally, so cargo check --target wasm32-unknown-unknown fails on
main. Gate both; on the web download_fonts returns an error, since the web
build has no network client or fonts folder.
2026-09-18 15:18:54 +09:30
huanld 3a3f0c83d7 fix(test): make the upstream plot-dialog tests pass on Windows
- app_with_fixture embedded CARGO_MANIFEST_DIR straight into an
  automation JSON string; on Windows the backslashes become invalid
  JSON escapes and the open failed. Build the payload with json!.
- driver_options_are_edited_remembered_and_sent_with_the_job exercises
  the CUPS options editor, which Windows never opens (PrinterProperties
  routes to the system dialog there); gate it to non-Windows.
2026-09-18 08:39:01 +07:00
huanld 36d5c4db79 fix(render): compose PLOTSTYLE wire-fill depth like the wire pipeline
When a display plot style maps an ACI to a fill pattern, wire fill
triangles are re-emitted as PLOTSTYLE hatches. Those took
depth_override raw — a per-block child label for block wires and 0.0
for top-level ones — while everything else in the hatch/wipeout pass
sorts at the composed depths[insert] + label * half. The fill could
land outside its host's band and get buried under its own block's
masks (same shape as the block-text bug).

Both the display and PDF paths now travel through wire_draw_depth /
the PlotWire's composed depth, and the display cache key rides the
depth generation so a DRAWORDER edit re-ranks the fills without
needing a wire rebuild.
2026-09-18 08:38:35 +07:00
huanld 454d99b1d3 fix(scene): block text keeps its draw-order slot against sibling wipes
Unselected block text (the BS33-11 Mark/SectionMark labels) was erased by
its own block's wipeout pass and only came back through the selection
xray. Two compounding causes:

- Glyph quads rendered at the bare insert level, an exact depth tie with
  every sibling fill, so the later wipeout pass won LessEqual. Wire
  batches now carry the composed child rank as depth_override (the same
  units the scene graph composes: depths[insert] + label * half), which
  the block-text upload resolves per instance. Glyph vertices stay
  neutral on purpose — baking the raw per-block label into them
  double-counts and, for a negative rank, sinks the text BELOW its own
  masks.
- The wipeout pipeline's depth bias (-8 quanta) was larger than the
  whole within-block band: once child ranks compress into the insert's
  half-band, sibling steps are ~3 quanta and a wipeout-to-text gap is
  only 9-16 quanta of the 24-bit buffer. The mask only needs to break
  exact ties, so the bias is now WIPEOUT_DEPTH_BIAS_QUANTA = 2.

block_text_draw_depth regression pins the contract: neutral vertices,
override carrying the rank, and a margin over the wipe that exceeds the
bias on a 600-entity scene.
2026-09-18 08:38:35 +07:00
dichhead bec382a99b Merge branch 'HakanSeven12:main' into main 2026-09-17 17:56:03 +02:00
Christopher OverbeckandClaude Opus 5 37059cb0d6 Repair knot-less splines on every load path
load_file, used by headless export, xrefs and block import, finalizes a
drawing without purging, so the spline degree repair never ran there and
`--export drawing.dxf out.dwg` still hit the knot underflow. Run the repair
when any load is finalized.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 10:33:18 -05:00
Christopher OverbeckandClaude Opus 5 1ac9309f85 Guard constraint solving and DWG export against degenerate geometry
Retaining a line's length added a P2PDistance constraint, whose gradient
divides by the current distance. For a zero-length line the solver got a NaN
Jacobian and its SVD fallback never returned, freezing the editor (e.g.
ECONSTRAINT on a line drawn by clicking one point twice). Hold coincident
endpoints together with per-axis differences instead.

Control-point splines read without knots are given a degree their control
points can carry (at most n - 1) and a clamped knot vector when a drawing
loads. Generating knots for fewer points than the degree underflowed during
DWG write: a panic in debug builds, an unbounded allocation in release, and
reachable from autosave. A lone control point with no knots or fit points is
purged as corrupt.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 10:33:18 -05: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) <noreply@anthropic.com>
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) <noreply@anthropic.com>
2026-09-17 10:33:18 -05:00
ramox81 6a1c649016 Fix Properties hyperlink collection editor 2026-09-17 18:17:25 +03:00
Panos 472bb9883d Merge pull request #1337 from HakanSeven12/plot/b1-plot-settings-compat
fix(plot): write page setups in the file format's canonical form
2026-09-17 18:14:17 +03:00
PanosandClaude Opus 5 8e09bd8463 fix(plot): follow the fixture's page-setup conventions
A drawing saved by a commercial CAD application (tests/fixtures/plot,
provided by Panos: one 10 m line, three layouts) corrects several
assumptions of the previous commit:

- rotation is relative to the medium's own orientation: an unchanged sheet
  keeps the driver's exact medium (its PDF driver lists landscape media of
  its own, written with rotation 0; a system printer's portrait A3 plotted
  landscape carries 90); only a newly picked sheet is written as the
  catalogue's portrait medium
- the stored scale factor (DXF 147) is the ratio × 25.4 on millimetre page
  setups and the plain ratio on inch ones; the "use standard scale" bit
  stays clear for standard and custom scales and is set for fit-to-paper;
  a standard code is kept across a paper-unit conversion ("1:1" on an
  inch page setup over a millimetre paper space is 1 in = 25.4 units)
- layout plots take the same scale path as every other area, so a foreign
  layout's paper-space unit survives
- "plot with plot styles" / "display plot styles" round-trip as the
  dialog's checkboxes, independent of a style table being named
- layout limits place the sheet at minus its displayed margins, the way the
  source application does (the printable corner is the paper-space origin);
  the margin ↔ rotation mapping shared by the printable-area guide now
  turns the medium's top margin into the layout's left one at 90°

The fixture round-trips through the dialog with every stored field
unchanged; picking a new sheet on it writes the canonical form.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-17 18:04:38 +03:00
PanosandClaude Opus 5 276e7c7bf1 fix(plot): write page setups in the file format's canonical form
One writer (plot_settings_from_dialog) now serves both the layout's embedded
settings and named page setups, so the two can no longer drift apart:

- media are stored as the portrait sheet with the orientation in the
  rotation code (0/90/180/270; upside-down adds a half turn) instead of
  swapped width/height with rotation limited to 0/180
- standard scales are written by their code (1:1 … 100:1) with matching
  numerator/denominator; other scales as a readable custom ratio in the
  layout's own paper unit, converting from the drawing's scale-family unit
  (a metre drawing plotting "1:100" stores 10 mm = 1 unit, an inch layout
  stores 1 in = 2540 units); reading converts back and keeps a ratio the
  scale list has no name for instead of snapping to 1:1
- the layout's paper unit and every flag the dialog does not edit survive a
  round trip untouched; layout limits follow the paper-space unit
- new drawings, new layouts, CLEAR and the automation "new" op share one
  default page setup (canonical A4 name, rotation 90, none_device, 1:1
  layout plot) through Scene::reset_to_new_drawing

Scene gains scale_family_unit_mm, scale_ratio and a scale-name ratio parser
(ratios and architectural names). Round-trip tests cover orientation,
standard/custom/fit scales, unit conversion, named-setup parity, preserved
flags and the default layout.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-17 18:04:38 +03:00
Hakan Seven 8429ad50ec fix: harden dimension and constraint bar changes 2026-09-17 18:04:06 +03:00