Skip to content

feature: draw a colored braided sleeve around a cable bundle (#503) - #504

Open
VoltixSpark wants to merge 2 commits into
wireviz:devfrom
VoltixSpark:feature/colored-sleeve
Open

VoltixSpark wants to merge 2 commits into
wireviz:devfrom
VoltixSpark:feature/colored-sleeve

Conversation

@VoltixSpark

Copy link
Copy Markdown

Refs #503

What

Adds an optional sleeve_color cable attribute that draws a colored braided sleeve/wrap around the conductor bundle, and adds a + Sleeve indicator with the color name to the cable header.

WireViz can already list a sleeve via additional_components (BOM only); this renders it on the diagram, which is useful for harnesses that use colored braided sleeving as a build and identification aid.

Screenshot

colored sleeve

Example

cables:
  W1:
    category: bundle
    wirecount: 4
    gauge: 18 AWG
    length: 0.8
    colors: [BK, BK, RD, RD]
    sleeve_color: RD

Implementation

  • wv_dataclasses.py: new Cable.sleeve_color (SingleColor), converted in __post_init__ like the other color fields.
  • wv_graphviz.py: gv_sleeve_braid_band() builds a two-tone basket-weave band; gv_conductor_table() draws it across the top and bottom of the bundle with thin colored side rails when sleeve_color is set; the cable header gains a + Sleeve <color> indicator.
  • docs/syntax.md and docs/CHANGELOG.md updated.

Composes with shield, works for both bundles and sheathed cables, and has no effect when unset. No new runtime dependencies.

Notes / open questions

  • GraphViz HTML labels cannot draw a true diagonal braid, so the band is a two-tone basket-weave approximation (the sleeve color plus a darker shade). I am happy to adjust the visual treatment based on maintainer preference (for example, a plain tinted "tube" fill is an easy alternative).
  • The band currently uses a fixed cell count; if you would prefer it to track the conductor-table width exactly, I can iterate.
  • Formatted with black and isort per CONTRIBUTING. Generated example/tutorial outputs are intentionally not included.

…#503)

Add an optional `sleeve_color` cable attribute. When set, the conductor bundle
is drawn inside a colored braided sleeve - a two-tone basket-weave band across
the top and bottom of the conductor table with thin colored side rails - and a
"+ Sleeve" indicator with the color name is added to the cable header.

Upstream can already list a sleeve via additional_components (BOM only); this
draws it on the diagram. Composes with shield, works for bundles and sheathed
cables, and has no effect when unset.

Refs wireviz#503
Concise tutorial example (source .yml + .md description) showing how to draw a
colored braided sleeve around a bundle. Generated outputs are not committed;
the owner rebuilds them.

Refs wireviz#503
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