11 Commits
Author SHA1 Message Date
huanldandClaude Opus 5.5 279a87418e feat(automation): entity, block, publishing and REST operations from the fork
The operations docs/automation/API-SPEC.md (PR #1383) describes, brought
over from huaninstratech/OpenCADStudio so the specification no longer runs
ahead of the code:

- entity CRUD: entities_create, entities_delete, entities_transform,
  entities_copy_to, and `where` filters on query
- blocks and export: block_define, block_delete, a normalised wblock
- publishing: layout_create, page_setup_set, plot (per_page included)
- metadata: sysvar, xdata_set / xdata_get, file_identity
- collections: group_create, selection_set_save / load
- control plane: batch, events, view_focus, close
- the REST transport: `--http <port>`, the /api/v1 routes and their
  OpenAPI 3 description
- person-in-the-loop picks: user_select and getpoint, hosted by the GUI
  over the same REST routes, with on-screen pending signals

Taken from the fork's commits b7a7ed80, 69396b42, 64f1cf6a, c3aafc8e,
bb5a7bfa, 52317a5c, 50d293ba, b90e194f, 517c6397, 53a5c4c9, a49ac045,
37de5a46, a78b1822, 6d9aed2a, 33f522da, 5b5cafe2, 02a7e78d, 94df40dc,
fd5bc14d, 485fac61 and 2c5fc994.

Left out on purpose: 37de5a46 also removed the donation surface (the
Patreon fetch, the donation prompt, the Start-page supporters rail, the
DONATE command and its locale strings) and replaced the About dialog's call
to action; that is the fork's own product decision and stays out. The
fork's version bump and its unrelated IFC/BIM work are not part of this.

Adapted while porting: the REST server and the GUI bridge are desktop-only
and a template start is refused in the web build, so the wasm target still
compiles; the two plot tests read the PDF through the shared stream helper,
because exported streams are Flate-compressed; the benches set the new
crosshair field; comments and docs describe each operation in its own
terms rather than by another product's API names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 13:41:07 +03:00
huanld 33a0817a98 docs(automation): consolidated vendor-neutral API specification
A single self-contained reference for external client developers:
conventions and units, the four transports, session/state, the full
symbolic error catalogue with the retryable set, the complete operation
catalogue (documents and identity, entity create/modify/query with
where filters, block lifecycle, layouts and plotting, metadata and
sysvars, groups and selection sets, embedded vs linked images,
commands and batches), the REST endpoint table, worked examples and
the versioning policy. Names only open formats and protocols.
2026-09-19 16:53:06 +07:00
huanld cc1b1e2051 ci(release): parse codesign entitlements as xml on newer runners
codesign -d --entitlements - on current macOS runner images prefixes the
plist with text headers, so the sandbox entitlement assertion died with
plistlib InvalidFileException and took the .dmg build down with it.
--xml prints the bare plist on both old and new codesign builds.
2026-09-19 16:53:06 +07:00
huanld 8cabadd147 fix(settings): keep isometric drafting session-only
A persisted ISODRAFT flag turned every drawing's crosshair into the
isoplane pair (one vertical, one diagonal arm) on every launch, with no
visible control to switch it back off — F5 (ISOPLANE) only cycles the
plane. Drop the flag when saving and ignore it when an old settings
file still carries it; turning it on stays a per-session choice.
2026-09-19 16:52:25 +07:00
huanld dc23d4073a fix(io): survive locked, shrinking and cloud-placeholder drawings
Opening a drawing that another program or machine holds without read
sharing used to fail with a raw OS error, and the memory-mapped fast
path could kill the process outright: a mapped file that shrinks
mid-parse (a writer saving over it) or a cloud placeholder that cannot
page in raises an in-page exception no Rust code can catch.

Read the DWG through a guarded fast path instead: mmap when possible,
and fall back to one in-memory snapshot read — opened with the most
permissive share mode Windows offers (FILE_SHARE_READ | WRITE |
DELETE) — whenever the map fails or an I/O error surfaces mid-parse.
A snapshot can never fault: a concurrent writer just ends the read
early. Sharing violations (os error 32/33) now answer with a message
that names the file and the remedy, and OneDrive-style placeholder
attributes skip mmap entirely.
2026-09-19 16:52:24 +07:00
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
huanld a45207f7c9 ci(release): gate signing steps on env mirrors of secrets
Step-level if: conditions cannot read the secrets context, which made
GitHub reject the workflow file outright (startup failure, zero jobs).
The signing waterfall now keys off job-level env booleans mirrored from
the credential secrets - a pattern actionlint accepts.
2026-09-16 17:52:01 +07:00
huanld 53cd8e0109 ci(release): signing waterfall so forks build without upstream secrets
Forks do not inherit repository secrets, and the previous hardwired
Azure Trusted Signing steps failed the Windows job outright on a fork.
Each signing step is now gated on its credentials being present and the
pipeline falls through: Azure Trusted Signing (upstream setup, unchanged
when the secrets exist) -> PFX certificate from WINDOWS_PFX_BASE64 /
WINDOWS_PFX_PASSWORD via signtool with RFC-3161 timestamping -> unsigned
with a note in the job summary. The build and installer assembly always
complete.
2026-09-16 17:34:27 +07:00
huanld 28efbffd57 feat: embed images (OLE2FRAME), print pipeline fixes, plot prefs, community fonts
- IMAGEEMBED: pack raster images into OLE2FRAME entities so a .dwg is
  self-contained; 'Embed Image' entry in the XREF attach menu; control/MCP
  op embed_image for external tools; dxf_name for OLE2FRAME queries.
- Scene: populate_images_from_document now rebuilds OLE2FRAME and PDF
  underlay models too (they used to vanish after any XREF op).
- Printing: add PRINTER_ENUM_NETWORK pass when listing printers; GDI
  spooler fallback (hayro raster at 300 DPI + StretchDIBits) for hosts
  whose PDF handler registers no print verb; DEVMODE orientation with a
  90-degree raster rotation fallback for v4 drivers; fix the fit-scale
  precedence bug that printed blank pages.
- PDF export dialogs on Windows use the async file dialog so the native
  overwrite confirmation no longer deadlocks the UI thread.
- Plot dialog: persist the chosen printer (saved on selection) and the
  picked plot window across sessions; page setups with no device no
  longer reset the output device.
- Community fonts: detect unresolvable .shx references on open and offer
  a download from the repository's fonts/ folder (contribution guide in
  fonts/README.md); custom font source URL setting for intranet font
  servers; downloaded fonts resolve from the per-user fonts directory.
2026-09-16 16:42:21 +07:00