Repository navigation
Description
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":xandyare parallel arrays of at least two centerline vertices; the centerline is an open polyline andthicknessis a required positive width in screenmap units.type: "el_panel":xandyare 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.thicknessis 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
- FastLED companion issue: feat(screenmap): render typed EL wire and EL panel geometry in HydroPack FastLED/FastLED#3691
Activity