Commit Graph
192 Commits
Author SHA1 Message Date
Hakan SevenandClaude Opus 5.5 805979ea36 fix(dimension): custom arrow blocks keep their polyline width
The width of a wide polyline lives on the wire as a GPU band, which the
custom-arrow extraction dropped, so the arrow drew as a hairline.

Fixes #1130

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 18:49:26 +03:00
ramox81andClaude Opus 5.5 7f8f8457c7 Frames: state-following ribbon list, DWF/DGN frames, image frame encoding and profile, frame-only picking
- The Frames list shows the drawing's frame state (hide / display and plot /
  display but not plot / frames vary), follows commands, undo and document
  switches, and lists the mixed state as a disabled item.
- DWFFRAME and DGNFRAME are frame variables of their own, kept in the header,
  and FRAME sets them with the others.
- Out-of-range frame values say "Requires an integer between 0 and 2." and
  ask again; a set value reports "Regenerating model.".
- IMAGEFRAME is stored in the image variables as bits (2 is written as 3) and
  a drawing without them uses the profile value, which setting IMAGEFRAME
  updates and the settings file keeps.
- Raster images, PDF underlays and wipeouts are picked on their frame only;
  underlay snap geometry is never picked.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-28 10:53:53 +03:00
Hakan SevenandClaude Opus 5.5 7e90d4d1a1 fix(pdf): per-piece snap bounds, linear image layering, snap op checks
Review of #1484:
- The underlay's snap geometry became one hidden wire per segment, but
  every piece took the whole page's bounding box, so each cursor move
  visited every piece. Each piece now gets its own box.
- Assigning unlayered images to the last layer compared Debug strings of
  every layered path and text per drawn item (quadratic, formatted anew
  each time); the owners are keyed once in a map.
- The `snap` automation op used (0, 0, 0) for a missing point; it now
  answers invalid_point. It also left the live snapper's base point set
  to the query's; the base point is restored.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-25 15:17:53 +03:00
ramox81andClaude Opus 5.5 edbbc9d135 PDF follow-ups: import layers, arcs and joins, names, background, page placement, snaps
- Unlayered raster images go with the PDF layer drawn last before them.
- Circular Bezier arcs import as arcs: bulged polyline segments with Join,
  ARC entities without it; straight chains still join.
- Imported PNGs go to "PDF Images" next to the PDF; import blocks are
  numbered imp31, imp32, ...
- Background darkness is its HSL lightness below one half.
- All chosen pages attach at the same insertion point.
- PDF geometry snaps as separate pieces: centre from the rim, intersections
  and perpendiculars.
- Automation: snap query with an optional base point.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-25 10:33:48 +03:00
Hakan SevenandClaude Opus 5.5 f537aff75c feat: node graph overlay; move to opencadcodec/opencadkernel/opencadgraph
The codec and kernel repositories and crates are renamed opencadcodec and
opencadkernel. Inside OCS they are depended on under short keys, so code
reads `codec::`, `kernel::` and the new `graph::` (opencadgraph, the node
graph engine). File-format and protocol spellings stay as they were: the
ACIS product id `acadrust`, the ACADRUST_* switches and the plugin
version keys `acadrust_version` / `acadrust_source`.

A button left of MCP on the command line opens a translucent node graph
over the viewport, with a palette of object, input, math, logic, list,
text and geometry nodes added by click or drag. An object node owns
drawing entities and its rows are the Properties panel's own rows for
them: the single-object page is extracted from refresh_properties as
entity_property_sections, values use the control protocol's
property_json, and writes go through set_property_value with a property
target override, so the panel, MCP and the graph share one read/write
path. A list reaching an object row makes one entity per element. Each
graph action is one undo step; the canvas pans and zooms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-25 07:34:23 +03:00
ramox81andClaude Opus 5.5 2078fc02f8 XCLIP and CLIP: clip boundaries on block references, CLIP routed by the picked object
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-24 19:39:09 +03:00
ramox81andClaude Opus 5.5 3f6bdf8c59 PDF underlays: attach dialog with pages, underlay tab, layers, import settings and file import, unload on the definition
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-24 18:31:40 +03:00
ramox81andClaude Opus 5.5 0c50013ca7 PDF underlays: attach prompts and definitions, display adjustments and clipping, Properties, snapping, PDFCLIP and PDFIMPORT
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-24 16:00:12 +03:00
Karim Jerbi eff55b27f1 perf(tessellate): optimize polyline arc sampling and skip wide fills on thin polylines
Directly sample double-single coordinates with sin_cos, short-circuit
wide fill processing on thin polylines, and preallocate band capacities.

1. Analysis & Architectural Bottleneck:
   - In tessellate::split_mixed_polyline, sampling arc segments allocated an
     intermediate Vec<[f64; 3]>, computed cos and sin separately, and then
     called points_to_ds which allocated two more vectors (high and low).
   - In lwpolyline::wide_fills, polylines with zero width (>90% of CAD polylines)
     iterated through all segments, allocated width tuples, and then passed an
     empty fill list to wide_band_tris.
   - In common::tapered_band_points, vector capacities were unreserved.

2. Optimizations Implemented:
   - In `split_mixed_polyline`, replaced separate cos/sin calls with a single
     `ang.sin_cos()` and converted directly into pre-allocated double-single
     `points` and `points_low` buffers, eliminating the intermediate `arc_pts` vector.
   - In `points_to_ds`, added early exit if capacity is 0.
   - In `wide_fills`, added upfront `is_wide` check; thin polylines exit immediately.
   - In `wide_band_tris`, added immediate return for empty fills.
   - In `tapered_band_points`, reserved vector capacity `seg_count + 1` upfront.

3. Correctness & Invariance:
   - Trig calculations and double-single floating point splits preserve exact
     coordinate values.
   - Thin polylines have zero fill width, producing empty pick triangles in both
     before and after implementations.
   - Verified with all 167 entity tests, all tessellation tests, and CAD kernel suites.

4. Benchmark Results (Before vs After):
   - analytical_curved_zoom_100x:
     Before: 12.75M FPS (0.01 ms)
     After:  14.08M FPS (0.01 ms)
     Improvement: -9.4% latency (+10.4% FPS throughput)
   - scene_entity_ingestion_10k:
     Before: 1.99 ms (1.01M entities/s)
     After:  1.82 ms (1.10M entities/s)
     Improvement: -8.5% latency (+8.9% throughput)
   - spatial_interaction_index_build:
     Before: 0.77 ms (2.47M wires/s)
     After:  0.71 ms (2.68M wires/s)
     Improvement: -8.2% latency (+8.5% throughput)
   - draworder_depth_map_incremental_patch:
     Before: 0.40 µs (2.50M patches/s)
     After:  0.36 µs (2.78M patches/s)
     Improvement: -10.0% latency (+11.2% throughput)
   - wide_and_tapered_arc_tessellation:
     Before: 6.36 ms (235.8k entities/s)
     After:  5.97 ms (251.1k entities/s)
     Improvement: -6.0% latency (+6.5% throughput)
   - analytical_curved_tessellation:
     Before: 7.79 ms (359.5k entities/s)
     After:  7.38 ms (379.2k entities/s)
     Improvement: -5.2% latency (+5.5% throughput)
   - wire_partitioning_per_frame:
     Before: 0.18 ms
     After:  0.06 ms
     Improvement: -64.9% latency (3x faster)
2026-09-24 09:05:08 +01:00
Hakan Seven c5eec2a507 fix: preserve exact mixed polyline intersections 2026-09-17 16:56:52 +03:00
ramox81 61e5271055 Keep wipeout frames continuous 2026-09-11 17:27:34 +03:00
ramox81 21a232ef8d Fix XLine and wipeout properties 2026-09-11 17:11:52 +03:00
Hakan Seven c4506bf0d9 Merge pull request #1206 from Ramox81/codex/fix-region-measurement-persistence-20260911 2026-09-11 16:08:10 +03:00
ramox81 974d5997d0 Use modeler region bounds in automation queries and filters 2026-09-11 15:09:42 +03:00
ramox81 b42ae9d4a8 Restore region bounds and exact profile measurements after reload 2026-09-11 15:09:41 +03:00
ramox81 c64d8a359f Bound fit-only splines through their interpolated control hull 2026-09-11 14:59:32 +03:00
Hakan Seven 4201b0a031 Merge pull request #1131 from ramox81/codex/thicken-surface-grips 2026-09-10 17:05:43 +03:00
ramox81 11057cc5e9 Fix extrusion surface properties and snapping 2026-09-10 16:07:05 +03:00
ramox81 a24d1e6108 Fix live extrusion surface grip editing 2026-09-10 14:53:48 +03:00
Karim Jerbi 0ad31ece6f fix(render): correct polyline segment widths, flat arc end caps, and zero-width endpoints 2026-09-10 12:43:25 +01:00
Karim Jerbi 6ca16738f0 fix(properties): sync polyline segment widths with global width and display varies when differing 2026-09-10 12:30:33 +01:00
Hakan Seven f69f0b32be fix(sectionplane): persist and clip section modes correctly 2026-09-09 20:53:05 +03:00
Karim Jerbi 9bbc5c3182 feat(render): render thick and tapered analytical arcs directly on GPU
- Repurpose CircleInstance center_high.w and params.w for start_width and end_width (preserving exact 128-byte stride)
- Route wide polylines, tapered polylines with bulges, and donuts through split_mixed_polyline into GPU analytical arc instances
- Compute physical annular bands, width tapers, and round end caps in circle.wgsl using world-space distances to prevent 3D perspective foreshortening distortion
- Expand bounding quad margins dynamically with grazing-angle compensation to eliminate clipping
- Relax pick_tris check in wire classification and partition routines so wide entities retain CPU picking while drawing analytically
- Add unit and hardware GPU integration tests, including tilted 3D perspective rendering verification
2026-09-09 13:02:02 +01:00
ramox81 7913f8e2da Merge remote-tracking branch 'origin/main' into codex/shell-parity
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	crates/ocs_doc_api/Cargo.toml
#	src/modules/model/mod.rs
2026-09-08 19:49:35 +03:00
ramox81 be06a756da Implement solid shell workflow and properties 2026-09-08 19:37:35 +03:00
Hakan Seven fd3ddc1608 Finish Ramox edge and slice integration 2026-09-08 19:02:08 +03:00
Karim Jerbi a754fac6d4 Attach analytical arc to polyline Arc mode rubber-band preview 2026-09-08 13:16:49 +01:00
Karim Jerbi d988a09987 feat(render): split mixed polyline bulge arcs into GPU analytical curves and tag benchmark 2026-09-07 17:22:01 +01:00
Hakan Seven e51c4d0932 Merge updated origin/main 2026-09-07 19:01:54 +03:00
ramox81 1e118b2e90 Complete exact INTERSECT behavior 2026-09-07 16:32:01 +03:00
Karim Jerbi 0425f979f9 feat(render): GPU analytical rendering for circles, arcs, and ellipses
- Render planar circles, circular arcs, ellipses, and elliptical arcs analytically via GPU-instanced screen-space quads and WGSL shaders.
- Implement exact arc sweep clamping with round end caps matching the CAD wire shader.
- Implement robust Newton-Raphson closest-point solver for ellipses with isotropic screen-space derivative anti-aliasing.
- Integrate into wire pipeline and PersistentWireArena upload paths.
- Remove unused mesh_volume_centroid function in doc_api.
2026-09-07 13:50:12 +01:00
PanosandClaude Opus 5 391a74a615 perf: let one tessellation serve every background
Switching to a Layout re-tessellated the whole model — `memo_miss=186455`,
2034 ms — to arrive at geometry identical to what was already in the memo.
The only thing that differed was colour.

`local_wires_for` already knows this: it stores the raw colour and drops
its background argument with `let _ = bg_color;`, noting that
`Batches::finalize` applies `adapt_to_bg` last, "so the cache no longer
has to rebuild on BACKGROUND / layout-switch". The tessellation memo's
guard had not been told, and still mixed the background in, so every
entry was discarded on a switch.

`finalize` now records what its colour resolution consumed — the raw
colour, the raw glyph colours, and the three flags it branches on — as
`WireModel::bg_adapt`, and `resolve_colors_for_bg` replays it for another
background. The guard drops the background, so a memo entry serves any
layout.

The resolution recomputes from the recorded raw colour rather than from
the resolved one, which makes it idempotent and therefore safe over a set
that mixes memo hits with freshly tessellated misses. Re-adapting the
resolved colour would not be safe: `adapt_to_bg` snaps a near-white colour
to pure black on a light background, and pure black comes back pure
*white* on a dark one, losing the tint. A test pins that asymmetry so the
raw colour is not optimised away later.

The contract is tested against the real `finalize` rather than a copy of
its logic: for every background pair, building under one and resolving for
the other lands exactly where building under the other would have.

`bg_adapt` is `None` for wires built anywhere else, and the resolution
skips them, so nothing outside the block cache changes colour. It is also
`None` when the resolution would be a no-op — a preserved colour with no
canvas fill looks the same under every background — which keeps the common
case at no cost.

Ordering is unchanged: the pass runs inside the builder, before
`append_scene_markers` and `apply_refedit_fade`, both of which have their
own separate background dependency.

`wires-build` gains `colors=` so the pass has a number of its own.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-05 18:53:16 +03:00
ramox81 847d218c35 Complete EXTRUDE behavior and properties 2026-09-02 10:25:00 +03:00
Hakan Seven 6606da5029 fix(blocks): complete block-backed instance rendering 2026-09-01 22:41:12 +03:00
Hakan Seven 19629d1246 fix(blocks): unify block-backed content
Route pictures, table cells, leader content, symbols, and arrows through one dependency and transform graph.\n\nRefs #864
2026-08-31 01:09:32 +03:00
Hakan Seven abb4f4bf56 fix(blocks): unify nested object transforms
Route block-backed entities through one local geometry and accumulated transform path.

Refs #864
2026-08-30 23:30:14 +03:00
gianlucafiore a2d4caf2f0 fix(render): improve dashed linetype rendering 2026-08-27 13:51:05 -03:00
Hakan Seven 81e7add1dd fix(tolerance): complete workflow integration
Sync current main and companion codec changes before preserving unsupported frame rows, rendering in the entity plane, and sharing final layout metrics with placement preview.
2026-08-27 00:14:08 +03:00
ramox81 de294447a9 Complete geometric tolerance workflow and properties 2026-08-26 13:54:20 +03:00
Hakan Seven 2ed4a5d8f3 fix(dimension): hide definition markers
Keep direct POINT helpers out of baked dimension pictures while preserving nested arrow block geometry.

Refs #864
2026-08-25 23:51:11 +03:00
Hakan Seven 4209c35ba3 fix(polyline): render fill mode boundaries
Use kernel-produced band outlines when FILLMODE is off. Preserve centerline linetype stations through inserts, clipping, projection, and PDF export.
2026-08-24 22:18:44 +03:00
Hakan Seven 06cd0ec6a9 feat(model): add exact solid modelling tools 2026-08-23 22:53:31 +03:00
Hakan Seven 44a40eda0b fix(model): restore saved solid booleans
Reload exact B-reps from solid history or ACIS before model operations and pin the closed-cut kernel fix.
2026-08-23 19:35:48 +03:00
Hakan Seven e94cbedaa2 fix(save): preserve 3D view and thumbnails
Persist camera, render state, and solid fallback geometry across saves. Generate previews from a clean live viewport and refresh recent-file thumbnails immediately.
2026-08-23 17:59:12 +03:00
Hakan Seven 343b6cda7d feat(mline): align creation and editing 2026-08-23 00:30:41 +03:00
Hakan Seven 7293bec1b9 fix(point): preserve relative marker sizing
Keep rendering, picking, block transforms, and plotted output on the
same viewport-relative PDSIZE geometry without overloading wire width
fields.
2026-08-22 22:22:01 +03:00
ramox81 2263168a2a Complete multiline command and properties behavior 2026-08-22 20:20:34 +03:00
ramox81 c5fe70627a Honor point display geometry and sizing 2026-08-22 17:18:30 +03:00
Hakan Seven b648000e78 Merge pull request #850 from ramox81/codex/associative-center-mark 2026-08-21 20:19:54 +03:00
Hakan Seven a59537c337 Merge pull request #848 from ramox81/codex/complete-solid-workflow 2026-08-21 19:54:38 +03:00