#1681 places a dimension's picture block by its insertion point, rotation
and scale. Edits (move/rotate/scale/mirror, copy, paste) transform the
picture's sub-entities in world space, and the codec's dimension transform
moves the insertion point too, so a rotated or copied dimension would get
the placement applied twice. Fold the placement into the subs before the
edit and leave the dimension at the identity placement afterwards.
The picture insert no longer takes the dimension's extrusion: OCS bakes
picture sub-entities in world coordinates, so only the stored insertion
point goes through the OCS. A zero insertion-scale component counts as 1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A dimension carries its graphics in a block of its own, drawn in that
block's frame, and the entity records where the frame sits. The renderer
inserted it at the origin instead, so every dimension whose file carries a
non-zero insertion point drew far from the geometry it measures — the whole
picture offset by that point. Dimensions inside block definitions are where
this shows: a drawing of plan blocks scattered their dimension graphics
thousands of units away, over empty sheet.
The picture now follows the dimension's insertion point, rotation, scale and
extrusion, the way any block reference is placed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Inventor DWG exports place every sheet block with AcIdBlockReference,
which the codec skipped, so these drawings opened blank. opencadcodec
7c20aa7 decodes it as an INSERT and keeps the viewport each model-space
view reference is bound to.
Those view blocks overlap in model space, so a content viewport now also
hides model-space references bound to a different viewport. The handles
join the viewport's frozen-layer set (entity and layer handles never
collide), which the wire and render-graph visibility checks and every
per-viewport cache key already use.
Pins opencadcodec 7c20aa7, opencadkernel d71a828, opencadgraph 1543a5a.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 <noreply@anthropic.com>
Eliminate full Insert entity cloning in block style evaluation, unify
document object environment scans, and guard viewport override queries.
1. Analysis & Architectural Bottleneck:
- In render_graph::InsertStyleSpec::new, an entire Insert struct was cloned
into an EntityType::Insert enum solely to pass to style functions that only
read EntityCommon fields (layer, color, transparency, linetype, lineweight).
- In view::render::resolve_document_render_environment, when object caches were
not prepared, the document.objects map was traversed linearly twice: once
for RenderEnvironment and once for RenderSettings.
- Viewport override lookups were being performed even when viewport was None
(the standard model space condition).
2. Optimizations Implemented:
- Added `render_style_for_common_viewport`, `linetype_name_for_common_viewport`,
and `has_resolved_book_color_common` taking `&EntityCommon` directly.
- Constructed `InsertStyleSpec::new` without cloning the Insert entity.
- Fused the two linear scans of `self.document.objects` in
`resolve_document_render_environment` into a single pass tracking best candidates.
- Guarded viewport override lookups with `if viewport.is_some()` in
`layer_render_style_viewport` and `render_style_for_common_viewport`.
3. Correctness & Invariance:
- The same fields and fallback values are resolved in identical order.
- Tested across all 325 scene tests, block inheritance tests, and viewport
override unit tests with 0 failures.
4. Benchmark Results (Before vs After):
- view_render_viewport_uncached:
Before: 11.00 µs (90.9k FPS)
After: 5.00 µs (200.0k FPS)
Improvement: -54.5% latency (2.2x faster uncached rendering)
- wide_and_tapered_arc_tessellation:
Before: 6.36 ms (235.8k entities/s)
After: 5.41 ms (277.4k entities/s)
Improvement: -14.9% latency (+17.6% throughput)
- analytical_curved_tessellation:
Before: 7.79 ms (359.5k entities/s)
After: 7.01 ms (399.6k entities/s)
Improvement: -10.1% latency (+11.1% throughput)
- spatial_interaction_index_build:
Before: 0.77 ms (2.47M wires/s)
After: 0.73 ms (2.66M wires/s)
Improvement: -5.1% latency (+7.7% throughput)
- ui_grip_budget_build:
Before: 424.50 µs
After: 380.25 µs
Improvement: -10.4% latency
- ui_ribbon_view_construction:
Before: 455.50 µs
After: 382.30 µs
Improvement: -16.1% latency
Resolve curve intersections through cadkernel, retain empty exact results, gather analytic candidates independently of tessellation, and bound material uploads. Preserve large MINSERT data while limiting rendering work; remove obsolete review narratives.
Two independent MINSERT (array INSERT) bugs found while auditing
render_graph.rs:
1. array_offsets() reserved and filled one Vec element per array
instance, with row_count/column_count parsed as unchecked u16s.
A corrupt or adversarial 65535x65535 pair requests 4,294,836,225
instances (~96 GiB) before any GPU-side chunking limit can help,
and before the render graph even reaches the GPU. Fixed with a
documented instance budget (20,000) enforced at both the load-time
corrupt-entity filter (is_entity_corrupt, matching the existing
polyline/spline vertex-count guards) and a failsafe clamp in
array_offsets itself, for an insert built or edited some other way.
2. insert_instance_transform composed the per-instance row/column
offset translation *before* the INSERT's own transform, so the
block's x/y scale multiplied the spacing along with the block
contents — an INSERT with x-scale 2 and column spacing 10 rendered
20 units between columns instead of 10. The pinned CAD model's own
Insert::array_points() confirms the correct behavior: spacing
rotates with the insert but is never scaled. Fixed by orienting the
offset with rotation + OCS only, then translating the already-
composed (scaled) instance transform by that world-space vector.
7 new tests cover both: pathological/reasonable instance counts at
the load-time filter and the render-graph failsafe, and instance
transforms for scaled and rotated arrays.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Resolve ByBlock alpha independently from color and keep explicit opaque values from falling back to layer transparency.
Pin the matching cadcodec API across desktop, plugin, and web targets.
Refs HakanSeven12/cadcodec#2
Route model, paper, viewport and nested block content through one traversal while preserving leaf renderers. Carry decoded material state into mesh shading and harden solid geometry conversion.