原理图演示美化与交叉跨越处理
导线交叉自动跳线(结点圆点抑制、半径收缩/合并避让)、未连接端点标记、结点颜色统一、功能框调色板圆角化;输出演示级 SVG。
Badges only claim the demo-run passed on that host; cross-host installation is handled by the adapter layer.
Preview gallery
Process this wire-crossing drawing: plan hops with shrink reasons, flag unconnected endpoints, style blocks with the Ant Design palette, and emit a presentation SVG.
Content matches the files inside the package; extracted by the publish pipeline.
LCEDA schematic presentation bundle
Offline re-implementation of the presentation rules of two LCEDA extensions (eda-sch-beautify MIT, sch-beautify Apache-2.0); see references/PROVENANCE.md. Collaborative whiteboard / comment tools (jlc-module-whiteboard, cocomment) and docs-tools vectorization are editor-bound and documented as procedures only.
What the script computes
scripts/demo.mjs (Node >= 20, no dependencies):
- Wire classification: horizontal/vertical within 0.5 axis tolerance; diagonals ignored for crossings.
- Crossover detection: strict interior h x v crossings; T-junctions (within max(0.5, 0.01) of an endpoint) are connections, not crossovers. A junction dot within 0.6 of the crossing also marks a connection and suppresses the hop.
- Hop arcs on the vertical wire: base radius max(2, 3strokeWidth), shrunk by 0.25 steps to min 1.2 to avoid dots (r + 0.5) and text boxes (width = chars * fontSize * 0.55). Adjacent hops on one wire closer than 2r + 0.5 shrink to (gap - 0.5)/2, or merge into one arc rx = gap/2 when the gap is below 21.2 + 0.5. Plan cost = arcs + 10 * merged-skips.
- Unconnected markers: #999999 dots with exactly one wire endpoint within 0.6 are flagged (warning) — the wire ends unconnected.
- Junction recolor: dots touching >= 2 wires should take the majority wire color; mismatches reported.
- Rectangle styling: fill from palette[i % len] (Ant Design 5-depth, TailwindCSS 600, draw.io dark/light), cornerRadius = pct/100 * min(w,h), title y = topLeftY +/- lineWidth +/- fontSize/2 (outside/inside).
- Artifact: presentation.svg with styled rectangles, hop arcs, junction dots and flagged unconnected markers.
Run
node scripts/demo.mjs --out-dir <dir> [--input <json>]
Default input: scripts/fixtures/input.json. stdout is an
edaskills.report.v1 report; <dir> receives presentation.svg.
Input shape: { "strokeWidth"?, "wires": [{x1,y1,x2,y2,color?,width?}], "dots"?: [{x,y,r?,color?}], "texts"?: [{x,y,text,fontSize}], "rects"?: [{x,y,w,h,lineWidth?,title?}], "style"?: {palette?, cornerPct?, titlePos?, titleFontSize?} }.
When to use
- Clean up crossover readability before sharing a schematic screenshot or review PDF.
- Apply a consistent block-diagram color scheme with rounded corners and outside/inside titles.
- Find dangling grey endpoint markers and mismatched junction colors.
Not for: automatic rerouting or wire editing in the editor (the SVG is a preview; write-back uses the reported arc parameters), image-based background detection, or collaborative annotation.
Dependencies
Demo run
node v24.19.0 · 2026/11/19
- [info] HOP_SHRUNK (150,50): hop radius 3 -> 2.50 to avoid dots/text
- [info] HOP_GROUP_SHRUNK (180,50-180,53): adjacent hops shrunk to r=1.25 (gap 3.00)
- [info] HOP_PLAN (wires): 9 crossings -> 7 hop arcs (cost 7)
- [warning] UNCONNECTED_MARKER (20,120): grey degree-1 endpoint marker: wire ends unconnected here
- [info] JUNCTION_RECOLOR (100,100): junction dot should take majority wire color #000000
FAQ
Ratings & reviews
Not rated0 ratings
Sign in to rate this skill.
Sign inVersions
- v1.0.0Latest234.7 KB
首发种子版本。