Skip to content

feat(screenmap): add typed EL wire and EL panel geometry segments #451

Closed

Description

@zackees

Summary

Extend screenmap v2 with geometry-native electroluminescent (EL) segments. An LED strip is a sequence of point samples; EL wire is a thick open centerline; an EL panel is a filled closed polygon. The geometry must survive parsing, preview, recording, and export instead of being flattened into fake LED points.

Current behavior

The v2 parser and gfx normalization path treat every segment as parallel x/y point arrays. FastLED's current ScreenMap representation has the same limitation: a point LUT and one diameter. This makes an EL panel/wire impossible to describe faithfully and makes a browser preview show dots/rings rather than the actual emitting shape.

Companion implementation issue in FastLED: FastLED/FastLED#3691

Proposed v2 contract

Existing segments with no type remain LED strips and parse exactly as they do today.

New typed segments:

  • type: "el_wire": x and y are parallel arrays of at least two centerline vertices; the centerline is an open polyline and thickness is a required positive width in screenmap units.
  • type: "el_panel": x and y are parallel arrays of at least three polygon vertices; the renderer closes the final-to-first edge, so the closing vertex is not duplicated. The polygon is filled. thickness is not used for panels.
  • Each EL segment is one output channel, regardless of its number of vertices. A frame value for that channel controls the whole wire/panel.
  • Preserve existing id, pin, group, and optional metadata. Reject malformed typed segments (missing/unequal arrays, too few vertices, non-positive wire thickness, non-finite coordinates) with an actionable error.

Example acceptance fixture (tests/fixtures/el-shapes-triangles-wire.json) ? visually < | >:

{
  "version": 2,
  "groups": {
    "left-panel": { "color": "#ef4444" },
    "center-wire": { "color": "#f59e0b" },
    "right-panel": { "color": "#3b82f6" }
  },
  "segments": [
    {
      "id": "left-panel",
      "type": "el_panel",
      "pin": "pin1",
      "group": "left-panel",
      "x": [-20, -42, -42],
      "y": [0, -24, 24]
    },
    {
      "id": "center-wire",
      "type": "el_wire",
      "pin": "pin2",
      "group": "center-wire",
      "x": [-10, 10],
      "y": [0, 0],
      "thickness": 5
    },
    {
      "id": "right-panel",
      "type": "el_panel",
      "pin": "pin3",
      "group": "right-panel",
      "x": [20, 42, 42],
      "y": [0, -24, 24]
    }
  ]
}

Acceptance criteria

  • Add typed domain/normalized geometry models without breaking v1 or untyped v2 files.
  • Parser unit tests prove round-trip preservation of type, vertices, thickness, channel ordering, and one-channel-per-shape semantics.
  • Add negative tests for each malformed condition above.
  • Update the screenmap maker/editor and shared gfx consumers so the fixture renders two filled triangles and one 5-unit thick centerline, not point markers.
  • Update FLED/channel accounting so this fixture has exactly three EL channels; mixed LED strips continue to count their individual LEDs plus one channel per EL shape.
  • Add an integration/browser assertion that the fixture loads and visibly renders the < | > geometry.
  • Document the extension and add the fixture to the repository's test/sample data.
  • Add a FastLED-compatible fixture/acceptance reference and cross-link the companion issue above.

Out of scope

This issue does not change the electrical driver waveform. Hardware EL panels/wire remain driven through their assigned pin/channel; this is the shared geometry and browser/FLED representation.

Related

Activity

  1. added
    enhancement
    on Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions