Commit Graph
1264 Commits
Author SHA1 Message Date
Hakan SevenandClaude Opus 4.8 a360da25fb chore(deps): bump acadrust to edfe3bd (AcDs record-table data-offset blob pairing)
Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-04 07:00:24 +03:00
Hakan SevenandClaude Opus 4.8 d6ad3100fe chore(deps): bump acadrust to f65a7e4 (AcDs record-table blob pairing)
Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-04 05:49:45 +03:00
Hakan Seven 33f1150fad chore(release): v0.7.4 v0.7.4 2026-07-04 01:46:33 +03:00
Hakan SevenandClaude Opus 4.8 b3ead4f691 chore(deps): bump acadrust to 063da6f (AcDs SAB blob handle-pairing fix)
Fixes BIM 3D solids rendering at wrong positions — the AcDs SAB blob→solid
pairing now follows handle order instead of object-stream order, so every
solid gets its own geometry and body transform. Corrects the regression that
broke 3D solids in 0.7.3 (they were correct in 0.7.2) and places wall/floor
solids that previously piled near the origin.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-04 01:42:31 +03:00
Hakan SevenandClaude Opus 4.8 e78e137664 fix(paper): keep model 3D solids off the paper-space sheet
The paper layout sheet pass reused the full model mesh set, so every
top-level 3D solid piled onto the paper origin — the sheet camera works
in paper coordinates, not model space. Guard `meshes` on
`inst.paper_sheet` the same way wires/hatches/images already are: the
sheet shows only paper-native content; the model's solids render inside
the floating content viewports (model camera + per-viewport scissor).

Also name 3DSOLID/REGION/BODY/SURFACE/MESH/SOLID/MULTILEADER in dxf_name
(they fell through to "ENTITY"), and add a SELHANDLES diagnostic that
reports the active space plus a per-type / per-block selection breakdown.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 23:29:18 +03:00
Hakan SevenandClaude Opus 4.8 313a0eacfd chore(deps): bump acadrust to 6d5c47b (issue 225 — DWG opens in strict readers)
Pulls the acadrust fixes that make a saved DWG containing 3D solids open
cleanly in a strict conformance reader: the AcDsPrototype datastore section is
now built correctly (segment-header ds_version, datidx, and the handle-sorted
search index) so 3D solids keep their geometry instead of being dropped, and a
dim-style/block handle collision on read is repaired so layouts round-trip.
Validated end-to-end on two real 107- and 273-solid files.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 21:17:04 +03:00
Hakan SevenandClaude Opus 4.8 c3e86d08cc feat(snap): OTRACK ortho lock + edge-extension tracking (#218, #219)
#218: with Ortho on and a base point the axis is now a hard lock — a lone
tracking ray can't pull the cursor off it. Only a tracking ray crossing
the ortho axis locks (the corner-finding case); otherwise the ortho
constraint applies as the fallback, so Ortho reliably locks when OTRACK
is also on.

#219: an acquired corner now contributes an alignment ray along its own
edge direction(s) (captured once at acquisition), so OTRACK follows a
segment's extension, not just the ortho/polar axes. Acquisition is also
captured on leave — a perfectly still cursor emits no move events, so
"pause on a corner, then drag" now reliably acquires it. The acquired
marker projects through the active pane's camera + rect (canvas offset
included) instead of vanishing, and the active alignment path is drawn
as a full-length dashed guide through the corner.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 20:34:20 +03:00
Hakan SevenandClaude Opus 4.8 0322128f48 fix(snap): extension guides stay visible at extended intersections (#247, #259)
Extension osnap now offers a ray off every polyline vertex, not just the
first and last, and snaps to where two segments' extension lines would
cross. That crossing is emitted as an Intersection so it outranks the
per-segment extension feet on their own lines. When it wins, both
contributing extensions are re-detected — off-ray distance measured in
screen space so the tolerance holds at UTM coordinates — and the overlay
draws a dashed guide from each endpoint through the crossing, so both
extension paths remain visible instead of vanishing when caught.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 17:46:08 +03:00
Hakan SevenandClaude Opus 4.8 f4fffa1359 chore(release): v0.7.3
Co-Authored-By: Claude Opus 4.8 <[email protected]>
v0.7.3
2026-07-03 16:55:43 +03:00
Hakan SevenandClaude Opus 4.8 726984e3a5 feat(properties): show Thickness in the General group
Thickness (DXF 39) is a General-group property in the palette, but it is
stored per-entity, so it was previously shown (inconsistently) only in the
Geometry section of a few entities. Surface it in General for every entity
type that carries an extrusion thickness (arc, circle, line, lwpolyline,
point, polyface mesh, 2D polyline, shape, 2D solid, text) via
entity_thickness / set_entity_thickness, routed through apply_common_prop.

Removes the now-duplicate Thickness rows (and dead apply arms) from the
arc/circle/shape/solid Geometry sections so it is never shown twice.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 16:51:05 +03:00
Hakan SevenandClaude Opus 4.8 ab0a4f790c fix(insert): place block attributes by their ATTDEF geometry, follow the block (#255)
Inserting a block piled every attribute at the origin: each AttributeEntity
was built from just tag + value with default geometry. Carry the full
AttributeDefinition through the attreq flow and build attributes with
AttributeEntity::from_definition, then apply the block's insertion transform
so each lands in WCS at its proper position / alignment / rotation.

Attributes are stored in world space, so moving the block must move them
too. The MOVE command already did (acadrust translate_insert); apply_grip
(grip-drag) and the Position X/Y/Z property edit now translate the
attributes by the same world delta so they no longer stay behind.

Rotate/scale/mirror of a block still don't carry the attributes — acadrust's
transform_insert has no attribute pass — tracked separately.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 16:47:39 +03:00
Hakan SevenandClaude Opus 4.8 818638d3aa feat(ui): bulk layer on/off, lock, freeze, transparency + Ctrl+A (#236)
The Layer Manager already applied colour/linetype/lineweight in bulk;
extend that to the rest:

- Visibility, lock and freeze toggles now act on every selected layer, not
  just the clicked row. The clicked row's new state becomes the target for
  all. Transparency edits apply to the whole selection too.
- Clicking a linetype/lineweight combo on a row that is already part of a
  multi-selection no longer collapses the selection (the whole row is one
  mouse_area whose plain-click select would otherwise reset it), so those
  edits stay bulk.
- Ctrl/Cmd+A selects every layer row while the Layer Manager is open, and
  all drawing objects otherwise.

Two now-unused Scene layer-toggle helpers are removed (the handlers set the
flags directly and bump once).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 16:06:10 +03:00
Hakan SevenandClaude Opus 4.8 5e4e7c1020 fix(commands): ADDSELECTED keeps CLAYER, adopts dimension style (#239)
Two follow-ups to ADDSELECTED:

- It no longer permanently changes the current layer/colour/linetype/
  lineweight. The template's properties are captured as the drawing
  defaults only while the launched draw command runs; a snapshot taken in
  cmd_add_selected is restored the moment that command ends (central hook
  in apply_cmd_result) or is interrupted by another command.
- Dimensions are supported: add_selected_verb maps each DimensionType to
  its DIM* command, and the template's dimension style is adopted as the
  current DIMSTYLE (restored afterwards). commit_entity_handle now stamps
  every new dimension with the current DIMSTYLE — the DIM commands left the
  default "Standard" on the entity, so a normal dimension also picks up
  the active style now.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 16:05:54 +03:00
Hakan SevenandClaude Opus 4.8 f9b6834ad9 feat(export): exact ACIS geometry for planar solids on save
OCS models 3-D solids with truck, but extrude/boolean results carried no ACIS
body, so other CAD apps dropped them on open. Add an exact planar exporter and
run it at save time.

- scene::convert::acis_export::planar_solid_to_sat walks a truck Solid whose
  faces are all planes bounded by straight edges into a vertex/face-ring mesh
  and builds an exact ACIS body via acadrust's build_planar_body. Curved
  faces/edges return None (left for the NURBS path). A signed-volume check
  flips the winding if the shell comes out inside-out.
- OpenCADStudio::sync_truck_solids_to_acis fills in ACIS geometry for every
  cached truck solid that still has none, just before a Save / Save-As, so the
  written DWG/DXF carries real modeler geometry.
- Bump acadrust to 9142a50 (build_planar_body + classic-ACIS AcDs roundtrip fix).

Booleans (already cached as truck solids) now export exact geometry. Extruded
polygons will too once the EXTRUDE command caches its truck solid (a separate
change kept out of this commit because command_driver.rs holds unrelated
in-progress edits).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 15:43:37 +03:00
Hakan SevenandClaude Opus 4.8 79a5ac6fed fix(scene): correct MIRROR of TEXT under MIRRTEXT (commit + preview)
Root cause: the glyph tessellator advanced the pen by advance*width_factor
while the transform already scales the pen position by the width factor, so
a backward (negative width factor) run kept its word order and grew on the
same side of the anchor instead of mirroring across it. Advance in unscaled
glyph units to match text_local_bounds; the transform applies the factor once.

On top of that:
- The renderer honours the entity's own text-generation flags (DXF 71: bit 2
  backward / bit 4 upside-down) XOR the text style's flags, and signs the
  horizontal anchor by the width factor so Center/Right backward text mirrors
  about its anchor.
- MIRRTEXT on: a MIRROR toggles both group-71 bits so the reflected rotation
  renders a true glyph mirror (backward-upright for a vertical axis, flipped
  for a horizontal one).
- MIRRTEXT off: the text flips left<->right and lands mirror-symmetric to the
  source (right-reading) instead of hugging the axis.
- The MIRROR preview re-derives text ghosts to match the commit; mirrored()
  now reflects the double-single residual too.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 12:42:55 +03:00
Hakan SevenandClaude Opus 4.8 a24232842c feat(commands): prompt for a system-variable value on the next line
Typing a bare system-variable name (MIRRTEXT, FILLMODE, LTSCALE, …) now
echoes the current value and prompts "Enter new value for <NAME> <cur>:",
capturing the next command-line entry as the new value — Enter keeps the
current one, Escape cancels. The single-line "MIRRTEXT 1" form still works.
Mirrors the awaiting_vports pattern: a pending_setvar field on the app,
consumed at the top of on_command_submit.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 12:42:55 +03:00
Hakan SevenandClaude Opus 4.8 24f7329468 fix(input): numpad decimal key always types a decimal point
On German/European layouts the numpad decimal key emits a comma, which the
coordinate parser rejects. Match the physical NumpadDecimal / NumpadComma
key and emit '.' regardless of the OS layout. (#201)

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 09:52:35 +03:00
Hakan SevenandClaude Opus 4.8 7bab7c7b8d feat(ui): replace app-menu logo with a quick-access file toolbar
Remove the OCS-logo button and the dropdown menu it opened; the top strip
now shows direct New / Open / Save / Save As / Print buttons ahead of the
undo/redo controls. Drop the HELP and OPTIONS commands (HELP dumped text to
the command line, OPTIONS aliased the drafting-settings popup).

The app-menu overlay is gone, so its rendering code, MENU_ITEMS, four dead
messages, and the LOGO_RED / GEAR / HELP assets are removed. The recents
list it held is the only survivor — moved into OpenCADStudio.recent_files
via a new app/recent.rs, backing the Start page's Recent Documents panel.

Quick-access icons are redrawn in a cleaner style (file-plus, folder-open,
device-floppy, file-export, printer) and tinted light so they read on the
dark strip; FOLDER / DOC keep their old glyphs for the file browser.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 09:51:49 +03:00
Hakan SevenandClaude Opus 4.8 2bc5c2a686 fix(commands): JUSTIFYTEXT sets vertical alignment for single-line TEXT
The Text branch only set horizontal_alignment, so TL/BL/MC etc. never
moved the text box vertically. Map the T*/M*/B* codes to Top/Middle/Bottom
and re-sync the alignment point. (#246)

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 09:51:34 +03:00
Hakan SevenandClaude Opus 4.8 3d761bdcd3 fix(scene): honor MIRRTEXT on the MIRROR copy path
transform_entities kept text/mtext/shape right-reading when MIRRTEXT is
off, but the default MIRROR-with-copy path did not, so copied text mirrored
backwards. Extract the capture/restore into shared helpers and apply them
in copy_entities too. (#243)

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 09:51:34 +03:00
Hakan SevenandClaude Opus 4.8 c95c2dda6c fix(entities): swap ELLIPSE axes when minor grip passes major length
Dragging the minor-axis grip past the major length clamped the stored
ratio to 1.0, pinning the grip at the major radius. Rotate the definition
instead — the minor direction becomes the new major axis — so the shorter
axis stays major and the DXF/DWG ratio stays <= 1.0. (#242)

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 09:51:34 +03:00
Hakan SevenandClaude Opus 4.8 123d4e9083 feat(properties): make read-only values selectable text instead of click-copy
Replace the click-to-instantly-copy read-only cell with a non-editable but
selectable text field: the user selects the value (drag / double-click /
Ctrl+A) and copies with Ctrl+C, the normal expected gesture. The field
carries the full un-truncated value, styled flat (no input box or focus
ring) so it still reads as read-only but with a visible selection colour.
Keystrokes route to Noop, so it can be selected/copied but never edited.

Removes the PropCopyValue message + handler and the mouse_area copy hook.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 08:14:37 +03:00
Hakan SevenandClaude Opus 4.8 c59a584d14 feat(properties): copy read-only property values to the clipboard
A read-only value cell is now click-to-copy: clicking writes the full,
un-elided value to the system clipboard (copy cursor on hover). One
change in render_ro_row, so it covers every read-only row for every
entity. Adds Message::PropCopyValue routed through iced::clipboard::write.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 08:06:00 +03:00
Hakan SevenandClaude Opus 4.8 4d2471cafd feat(properties): audit editable vs read-only across all entities
Reclassify every property row to match standard palette behaviour: a row
is editable only when its value maps directly to a stored field AND its
apply_geom_prop handler is wired; computed/derived/count/handle/
cross-object values stay read-only.

Newly editable (all apply-wired): attribute tag/prompt; ellipse major
radius; hatch Double; lwpolyline closed/linetype-gen; mline style;
multileader annotative/landing/background-fill; polyline 2D+3D vertex
coords/segment widths/linetype-gen; shape style; spline control/fit
point coords, weight, fit tolerance, tangents; table break-option flags;
text alignment point, upside-down, backward; underlay display flags.

Corrections: spline Degree -> read-only (editing desynced the knot
vector); removed a duplicate leader "Arrowhead" row.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 08:06:00 +03:00
Hakan SevenandClaude Opus 4.8 35468004e6 test(core): ignore ribbon_groups microbenchmark by default
The once_lock_eliminates_allocation_after_first_call test from PR #257
is a timing microbenchmark that Box::leaks ~400k strings by design to
defeat allocator reuse. Mark it #[ignore] so it stays out of the default
suite; cache correctness is already covered by the pointer-identity test.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 07:48:31 +03:00
Hakan SevenandKarim Jerbi f11fc7dcb4 Merge PR #257: cache ribbon_groups() with OnceLock
perf(core): return &[RibbonGroup] instead of rebuilding the tree each
call. Function-local OnceLock per module + From<&T> IPC conversions +
borrow-based ribbon widget rendering.

Co-authored-by: Karim Jerbi <[email protected]>
2026-07-03 07:47:43 +03:00
Hakan SevenandClaude Opus 4.8 b4e3902d64 fix(properties): stop block Attributes section rendering twice
A block reference's Attributes group was built in two places — the Insert
entity's own properties() builder and an older panel injection left from
the issue-192 attribute-editing work — so it appeared twice in the panel.
Both produced identical AttrText rows (get_value() just returns &value).
Drop the panel injection; the entity builder is the single source and
also covers multi-select. Attribute edits still route by tag, unchanged.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 07:21:21 +03:00
Hakan SevenandClaude Opus 4.8 b5bee92335 chore(deps): bump acadrust to e06182f (AcDs 3DSOLID fix, issue 225)
Pulls the acadrust fix that links R2013+ 3DSOLID/REGION/BODY geometry to its
AcDs SAB blob (writes the has_ds_data flag, corrects the AcDsPrototype header,
and pairs blobs in object-stream order). DWG files saved with 3D solids now
reopen with their geometry intact in AutoCAD/BricsCAD instead of being dropped
as an empty data stream.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 07:04:07 +03:00
Hakan SevenandClaude Opus 4.8 1523eda00f feat(properties): fill solid-history + viewport clipped rows
Bump acadrust to ef0e231 (region/body history handle + viewport clip
boundary now stored) and populate the rows the builders left blank:

- Solid3D / Body "Show History": derived from the history handle's
  presence (there is no separate stored bool — the DWG carries only the
  H 350 history link).
- Body "History": the history handle, matching how Solid3D already shows
  it.
- Viewport "Clipped": Yes when the clip-boundary handle is non-NULL.

Hatch Origin X/Y and Boundary retention stay blank by design: they are
not part of the persisted AcDbHatch record in DWG or DXF (retention is a
BHATCH command setting), so there is nothing to read.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 00:17:58 +03:00
Hakan SevenandClaude Opus 4.8 f50ad0dde4 feat(properties): fill placeholder rows from acadrust fields + doc lookups
Bump acadrust to a46cb8b (spline knot parameterization + mtext line-space
style now stored) and populate rows the builders left blank:

Entity-local: spline Knot Parameterization + closed-spline Area (shoelace),
mtext Line space style, hatch Spacing (pattern-line offset), leader Text
offset (annotation offset), region Area + Perimeter (wire-loop approx).

Doc-dependent (resolved in app/properties.rs where the document is
reachable): insert Block Unit + Unit factor (block record units vs
INSUNITS), underlay Name + Path (definition object), leader Text style /
vertical placement / overall scale and tolerance Text style (dimension
style), multileader Max points + segment angles (mleader style).

Rows needing an annotation-scale / sheet-set subsystem or an internal
PDF/DWF layer parser are intentionally left blank.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 00:05:58 +03:00
Hakan SevenandClaude Opus 4.8 0a9c27e39d feat(entities): render + property builder for loaded Helix entities
A helix loaded from a DWG (AcDbHelix) previously fell through to the
fallback: it did not render, had no grips, could not be moved, and showed
only a Type row. Add src/entities/helix.rs which drives all of these
through the embedded spline (render/grips/transform) and exposes the
generating parameters — base point, turns, turn height, height, base/top
radius, turn slope, twist, constrain — as the Geometry group per the
properties spec. Wire Helix into the to_truck / grips / apply_grip /
geometry_properties / apply_geom_prop / apply_transform dispatch lists.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-03 00:05:58 +03:00
Hakan SevenandClaude Opus 4.8 4398341632 chore(properties): remove dead helpers left by property-builder rewrite
The spec-conforming property builders dropped the rows that used these
helpers, leaving them unreferenced: hookline_dir_str (leader),
length_and_area (lwpolyline), render_mode_label / STD_VIEWS /
viewport_view_label (viewport). No behavior change.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-02 23:34:01 +03:00
Hakan SevenandClaude Opus 4.8 1043a3d561 feat(properties): fill spline Fit Tolerance + tangent rows from acadrust
The Fit Tolerance and Start/End Tangent X/Y/Z rows were placeholders while
the pinned acadrust lacked those fields. Now that the bump exposes
Spline::fit_tolerance / begin_tangent / end_tangent, populate them.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-02 23:34:01 +03:00
Hakan SevenandClaude Opus 4.8 147255aa40 build(deps): bump acadrust to 486c0a9; handle the Helix entity
Pull in this session's acadrust work — the HELIX / ACAD_TABLE read+write,
underlay reader/writer/definition, spline tolerances & tangents, etc. The new
EntityType::Helix variant breaks three exhaustive matches; add its arm to
entity_type_name, the UI-name / DXF-name maps and entity_type_key.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-02 23:28:37 +03:00
Hakan SevenandClaude Opus 4.8 41f4a062dc feat(properties): resolve Hyperlink (XDATA) and custom Material name
Fill the two placeholder rows added earlier. Read the General group's
Hyperlink from the entity's XDATA (the "PE_URL" application record's first
string). When an entity carries an explicit material (material_flags == 3),
resolve its material_handle to the Material object's name and show it in the
3D Visualization group instead of "Custom".

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-02 23:25:02 +03:00
Hakan SevenandClaude Opus 4.8 1f2d543755 feat(properties): dimension style-derived property groups
Resolve a dimension's DimStyle from the document and inject its full spec
groups — Lines & Arrows, Text, Fit, Primary Units, Alternate Units,
Tolerances — mirroring the ~80 dimension variables (dimasz, dimclrd, dimtxt,
dimdec, dimtol, dimzin bit flags, …) as read-only rows. The panel already had
doc access for the dim-style picker; extend it to append style_sections(style)
after the dimension's own Misc/Geometry groups.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-02 23:17:54 +03:00
Hakan SevenandClaude Opus 4.8 f4c60a39a9 feat(properties): add 3D Visualization group + General Plot style/Hyperlink
Per the COMMON section of PROPERTIES.md. Insert a "3D Visualization" group
(Material, Shadow display) after General for every graphical object, and add
Plot style + Hyperlink rows to General. Material / plot style / shadow are
sourced from the entity's flags (ByLayer / ByBlock / custom); resolving a
custom material or plot-style handle to its name, and reading the hyperlink
from XDATA, are follow-ups that need document access.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-02 23:07:50 +03:00
Hakan SevenandClaude Opus 4.8 b9cebab951 feat(properties): conform entity property groups to PROPERTIES.md
Rewrite each entity's property builder to the per-entity group/row spec:
the correct sections (Geometry, Misc, Text, Pattern, Lines & Arrows, Leaders,
Block, …) with the spec's rows and real computed values — Diameter,
Circumference, Area, Delta X/Y/Z, Angle, Total angle, Arc length, Radius ratio,
etc. — plus apply routing for the editable rows.

Covers ~26 entities (Line, Circle, Arc, Point, Ellipse, Spline, polylines,
Ray/XLine, Insert, Text, MText, Hatch, Leader, MultiLeader, Tolerance, Solid,
Solid3D/Region/Body, meshes, MLine, Raster/Wipeout, Underlay, Table, Viewport,
Attribute, OLE). The 3D Visualization/Material group and the full Dimension
spec are deferred (they need document access for material/dimstyle name
resolution). Rows whose data is not in the pinned acadrust revision are shown
as empty placeholders, to be filled when the dependency is bumped.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-02 23:03:18 +03:00
Karim Jerbi 73b05e1dec perf(core): cache ribbon_groups() with OnceLock, avoid per-frame tree allocations
Change CadModule::ribbon_groups() from -> Vec<RibbonGroup> to -> &[RibbonGroup],
backed by a per-module OnceLock cache. The ribbon group tree is static data
(&'static str, Copy enums) that was being fully reconstructed — Vecs, String
clones, enum discriminants — on every call, including all three per-frame
call sites (view(), dropdown_overlay(), style_combo_overlay()).

- 7 built-in modules + 2 plugin templates cache via function-local OnceLock.
  Safe because each is a unit struct with exactly one instance per process
  (plugins run in isolated child processes; see PluginProcess::spawn()).
- SharedCadModule avoids the static pattern entirely, storing groups in an
  instance field (owned.rs).
- IPC runner converts &RibbonGroup -> OwnedRibbonGroup directly via new
  From<&T> impls, avoiding an intermediate clone.
- render_small/render_large and the two make_tool_row closures now borrow
  (&RibbonItem, &[ToolDef]) instead of taking ownership, so the view loop
  doesn't need to clone items to satisfy the old by-value signatures.
- Various match-ergonomics deref fixes (*id, *default, *icon, etc.) from
  the &RibbonItem pattern change.
2026-07-02 21:00:57 +01:00
Hakan SevenandClaude Opus 4.8 b2b2bfb246 refactor(properties): entity property groups return Vec<PropSection>
Groundwork for making the Properties panel conform to the per-entity group/row
spec (PROPERTIES.md). The panel already renders a Vec of sections, but each
entity could only express a single geometry section.

Change PropertyEditable::geometry_properties (and the EntityTypeOps enum
dispatch) to return Vec<PropSection>, update the two impl macros, and flatten
in properties_sectioned so the panel shows [General] + the entity's groups.
Every entity builder is wrapped to return its existing section as a one-element
Vec — pure mechanical change, no rows or titles altered, panel output identical.

Enables Phase 2: rewriting each entity's groups/rows to match the spec.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-02 22:46:19 +03:00
Hakan SevenandClaude Opus 4.8 8164e14a19 fix(plugin): auto-register unknown layers so added entities survive DWG save (#252)
An entity added via a plugin's AddEntity with a common.layer name that no
LAYER command ever created kept its layer in-session, but the DWG writer
resolves an unknown layer name to a NULL handle, so on reopen the entity
collapsed to layer 0.

Add a shared Scene::ensure_layer(name) that registers a missing layer with a
real handle (allocate_handle, per #67) and call it from add_entity and
update_entity. This covers the plugin AddEntity/UpdateEntity IPC and every
internal add path without a new IPC request. Existing/empty/"0" layers are
no-ops, so normal draw commands are unaffected.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-02 20:36:16 +03:00
Hakan SevenandClaude Opus 4.8 f9f7138370 feat(plugin): persist XDATA to DWG and let plugins modify/delete entities (#249, #250)
#249 — plugin XDATA written via write_record survived only in memory: the
acadrust DWG writer dropped ExtendedData::records on save. Bump acadrust to
e88a9a6 (records now encode to EED and decode back on read) and fix the host
side that fed it:
  - ensure_app_id allocates a real APPID handle; a null handle serializes as
    0 and the EED reference can't resolve, so the XDATA vanished on reopen.
  - write_record / remove_record drop stale raw_dwg_eed for the target app so
    an edit made after a save/reopen wins over the pre-edit bytes.

#250 — out-of-process plugins got a throwaway document_mut() snapshot, so
edits to existing entities were silently discarded and deletion wasn't
expressible at all. Add the missing mutation surface:
  - UpdateEntity / RemoveEntity IPC requests + HostApi::update_entity /
    remove_entity (default in-process impls, RPC overrides on the client that
    invalidate the stale document cache).
  - Scene::update_entity replaces the entity in place, preserving its handle
    and owning block, and reseeds only its derived caches; remove reuses the
    cache-coherent erase_entities (which also honours layer locks).
  - document_mut() is documented as a local-only snapshot out-of-process.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-02 15:39:26 +03:00
Hakan SevenandClaude Opus 4.8 a763144622 fix(xref): tessellate xref'd solids so they render (#203)
XREFs are merged into the document on the UI thread AFTER the background
worker already built the mesh caches, so those caches contained none of
the xref'd geometry. The wire pass rebuilds from the document each frame
(bump_geometry covers it), but 3D-solid meshes are only produced by
populate_meshes_from_document, which never re-ran after the merge — so
xref'd solids (walls, floors, roofs) were loaded but never tessellated
and never drawn. Re-run it once a xref actually resolves.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-02 10:20:24 +03:00
Hakan SevenandClaude Opus 4.8 d0dcc6cb4c fix(render): size mesh-batch buffers to the device limit
The batch split at a fixed 6M-vertex cap that assumed 40 B/vertex, but
MeshVertex grew to 52 B when the double-single `position_low` field was
added — so a full chunk was 6M x 52 = 312 MB, past wgpu's 256 MB
max_buffer_size, and Device::create_buffer panicked on large models.

Derive the caps from device.limits().max_buffer_size and the real vertex
size, bound both the vertex buffer and the (fatter) wire-index buffer,
and split any single mesh too large for one chunk into triangle-soup
sub-chunks so no batch buffer can exceed the device limit.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-02 10:20:24 +03:00
Hakan SevenandClaude Opus 4.8 0e74a11724 feat(web): show Patreon supporters on the web build too
The browser can't call the Patreon API directly (CORS, and the token
would be exposed in the bundle), so the web build fetches a
pre-generated supporters.json served on the same origin. The Pages
workflow generates it server-side with the token (CI secret) after the
trunk build. Native keeps its live API fetch.

serde_json moves to the shared dependencies so the wasm build can parse
the list.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-02 01:25:24 +03:00
Hakan SevenandClaude Opus 4.8 572e9aca01 fix(camera): keep ortho depth precision constant across zoom
The orthographic near/far span was ±1000x the camera distance, so
zooming out ballooned the depth range and collapsed z-buffer precision:
coincident solids, meshes and wires then flipped draw order (meshes drew
in front of solids only when zoomed out, correct order when zoomed in).

Size the depth half-range from the drawing's extent instead — the bbox
diagonal on fit_to_bounds, the view height on a restored saved view —
and hold it constant as the camera zooms, so precision no longer depends
on distance. Falls back to the old distance-scaled range when unset.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-02 01:23:27 +03:00
Hakan SevenandClaude Opus 4.8 7185f6e4fa fix(render): draw 3D surface fills at their real depth, not draw order
PolyfaceMesh / PolygonMesh / SubDMesh fills and 3DFACE quads were
classified as 2D fills and given the draw-order z-bias, so they were
pulled toward the camera and drew over solids. The tessellator emits a
mesh's edges and its fill as separate WireModels (points-only vs
fill-only), so the old `!points.is_empty()` discriminator misrouted the
fill. Classify a fill as a 3D surface by its double-single low residual
(`fill_tris_low`) instead, and drop the draw-order bias from 3DFACE
quads. 2D annotation fills (text greek, MultiLeader / dimension
backgrounds) leave `fill_tris_low` empty and keep ordering by rank.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-02 01:23:27 +03:00
Hakan SevenandClaude Opus 4.8 8a69ef9de3 chore(release): bump to 0.7.2
Co-Authored-By: Claude Opus 4.8 <[email protected]>
v0.7.2
2026-07-02 01:02:40 +03:00
Hakan SevenandClaude Opus 4.8 608fe5ec3e feat(start): show paying Patreon supporters on the Start page
Add a right-hand rail on the Start page listing active paying patrons
(name + pledge amount, highest first) with a "Support on Patreon" button.
The list is fetched once at boot from the Patreon API in the background;
free followers, $0 tiers, declined and former patrons are excluded.

The creator access token is read at build time from OCS_PATREON_TOKEN
(option_env!), so it never lives in source or git — the release workflow
passes it from a repo secret, and build.rs re-bakes when it changes.
Without a token the rail just shows the support button.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-02 01:00:22 +03:00
Hakan SevenandClaude Opus 4.8 80ad27ec67 feat(start): add a second intro video next to the first
Show two clickable video thumbnails side by side on the Start page; a
click opens the video in the system browser. Refactor the card into a
shared builder and bundle the second thumbnail.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-02 00:27:25 +03:00