Skip to content

Add assembly and enclosure Circuit JSON elements#649

Draft
seveibar wants to merge 1 commit into
mainfrom
agent/add-enclosure-elements
Draft

Add assembly and enclosure Circuit JSON elements#649
seveibar wants to merge 1 commit into
mainfrom
agent/add-enclosure-elements

Conversation

@seveibar

Copy link
Copy Markdown
Contributor

Summary

  • add source_assembly_device for product-level physical assembly identity
  • add source_fdm_enclosure with direct assembly and selected-board relationships plus normalized enclosure dimensions
  • add shape-discriminated source_cutout_aperture records owned by source components
  • add cad_fdm_enclosure for positioned enclosure CAD/JSCAD output without synthetic PCB component ownership
  • export all four schemas and include them in any_circuit_element
  • add parsing, unit normalization, shape validation, and union coverage tests
  • regenerate the Circuit JSON reference documentation

Why

The parametric enclosure flow needs first-class Circuit JSON records instead of retaining assembly/enclosure intent only in the live React tree and emitting enclosure CAD through synthetic source_component and pcb_component owners. These records make the product relationship and generated enclosure output explicit and serializable.

Initial relationships and scope

  • source_fdm_enclosure.source_assembly_device_id identifies the physical product.
  • source_fdm_enclosure.source_board_id stores the resolved board relationship rather than a TSX selector.
  • source_cutout_aperture.source_component_id keeps aperture requirements part-owned.
  • cad_fdm_enclosure.source_fdm_enclosure_id links generated CAD directly to its source enclosure.
  • wall_thickness is required; optional dimensions and construction parameters preserve authoring flexibility.
  • aperture geometry is limited to the currently released rect, pill, and circle contracts.
  • mounting-stack/anchor and interaction-surface placement vocabularies are intentionally deferred until their public contracts stabilize.

Developer impact

Renderers can emit and consume enclosure source/CAD records directly through CircuitJson and any_circuit_element. CAD consumers can use JSCAD, standard model URLs, or model_asset without fabricating ECAD ownership records.

Validation

  • bun test (264 passing)
  • bunx tsc --noEmit
  • bun run build
  • bun run lint:zod
  • bun run check-snake-case
  • bunx biome format .
  • bun run generate-docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant