Skip to content

Daedalus Product Structure Workflow

Scope

This note documents the minimal product-structure flow added on top of the existing drafting editor:

  • Body merge command with selection continuity.
  • Part editor support for attaching multiple bodies.
  • Assembly editor support for adding multiple part instances.
  • v3/v4 layout load coverage via fixture-based E2E tests.

Data Model (v4 cadDocument extras)

cadDocument in layout v4 carries the core drafting entities plus product-structure extras:

  • profiles: source profile references.
  • bodies: generated bodies (CadBody).
  • parts: body groups (CadPart).
  • assemblies: part-instance groups (CadAssembly).
  • selection extras:
    • selectedBodyId
    • analysisTargetBodyId
    • selectedPartId
    • selectedAssemblyId

These fields are normalized in normalizeLayoutData, persisted via snapshot payloads, and restored by restoreSnapshot/loadFromServer.

Body Merge Command

Command aliases:

  • BODYMERGE
  • BMERGE

Supported input styles:

  • explicit IDs: BODYMERGE body-a,body-b
  • fallback to checkbox selection in the Body panel
  • final fallback to currently selected body (must still resolve to 2+ valid IDs to execute)

Execution path:

  1. Parse/resolve target body IDs.
  2. Build merged body (CadBody) with:
    • unioned sourceProfileIds
    • inherited source drawing ID
    • generated new body ID
  3. Replace source bodies with merged body.
  4. Rewrite every part's bodyIds to replace removed body IDs with new merged ID.
  5. Route post-merge selection through resolveSelectionByCadRule by intentionally setting a removed anchor ID before replacement.

The key point is selection continuity: after merge, the new body is selected by the same rule used for other CAD entity list mutations.

Part / Assembly Minimal Editing UI

Part: multi-body attach

  • UI: body checkbox list under selected part editor.
  • Action: Add Selected Bodies to Part.
  • Behavior:
    • collect checked IDs
    • ignore missing IDs
    • append uniquely to part.bodyIds

Assembly: multi-part instance attach

  • UI: part checkbox list under selected assembly editor.
  • Action: Add Selected Parts to Assembly.
  • Behavior:
    • collect checked part IDs
    • create one new CadPartInstance per selected part
    • append instances to target assembly

Selection Rules

resolveSelectionByCadRule is the single selection continuity rule for list-based CAD targets. It is now used for:

  • profiles
  • bodies (including merge)
  • parts
  • assemblies

Transient UI selections (bodyMergeSelectionIds, partBodySelectionIds, assemblyPartSelectionIds) are auto-pruned by watchers when underlying lists change.

E2E Coverage

Added fixtures:

  • frontend/e2e/fixtures/daedalus-layout-v3.json
  • frontend/e2e/fixtures/daedalus-layout-v4.json

Added test:

  • frontend/e2e/daedalus-load-layout-fixtures.spec.js

Cases:

  1. v3 fixture loads from mocked API and keeps product-structure counts empty.
  2. v4 fixture loads from mocked API and restores body/part/assembly counts and selected IDs.

Bridge additions used by test:

  • loadServerLayoutById(id)
  • runWorkspace3DCommand(command)
  • richer getSnapshot() payload for body/part/assembly counts and selected IDs.

Simplification Notes

  • Removed duplicated declare global block for window.__DAEDALUS_E2E__ type declaration.
  • Kept behavior changes minimal and localized to the drafting integration hub (D_Daedalus.vue).
  • Avoided introducing new stores/modules for this incremental step to reduce migration risk.

Last updated:

この記事の著者

MECHPHAISTOS | センサーを使わない保全

Yoshitaka Notoです。保全業務に携わり、AI時代の3Kと呼ばれるメンテナンス保全をもっと楽にしたい。 そういった保全ツール開発してます。