BREP_ecad_core — electronics documents, with no UI
BREP_ecad_core is the document model and the algorithms behind the BREP CAD
application's electronics workbenches: schematic, wiring diagram and board
documents, KiCad 9 symbol and footprint import, connectivity and netlisting, a
board autorouter, design-rule checks, and fabrication output.
It has no UI, no GPU and no CAD-kernel dependency — only serde, serde_json
and uuid — so it suits a command-line tool, a server, or a host with its own
editor. The egui editors over these documents are
BREP_ecad_egui.
Example
Import a KiCad library, place two resistors, wire them, read the nets back and save the sheet:
use ;
With KiCad's Device.kicad_sym this prints N$1: R1.1, N$2: R1.2, R2.2 and
N$3: R2.1.
What is in it
Document/DocumentKind— one schematic or wiring-diagram sheet, and its editing surface:place,place_part,add_wire,connect,set_reference,set_net_flag,refresh_part.Historyrecords edits as undoable steps.to_json/from_jsonsave and load it.Point— integer micrometres, +Y down on a sheet, with quarter-turnrotate,offsetand gridsnapped.Symbol,Pin,Component,Wire,Net,Netlist— symbols and their pins, placed instances, wires with the edits a router needs, and the connectivity read out of a sheet. A wiring diagram also answers a point-to-point connection list (connections,connections_csv).erc— an electrical rule check over a schematic's nets: KiCad's default pin map plus unconnected pins, undriven power inputs, duplicate references and dangling wire ends.netlist— the KiCad.netnetlist (export version "E") that Pcbnew and most KiCad-reading tools take, written byte-stable, and read back.board— printed circuit board layout:Board, pads, footprints, placements, tracks, vias, zones, net classes and design rules. Copper connectivity comes from geometry, net identity from the schematic.kicad— import from KiCad 9 symbol and footprint libraries, reporting everything it could not read inImportReport.autoroute— the board autorouter: aRouteJobyields aRouteOutcomeand reports progress as it goes.fabrication— Gerber X2 layers, Excellon drill files and a zip bundle.
Object IDs are random version 4 UUIDs. On wasm32-unknown-unknown the
randomness comes from the host: enable the uuid crate's js feature, or
configure another getrandom backend, or creating an object fails.
The autorouter and design checks are compute-heavy. A host that builds this
crate in a debug profile will want opt-level = 2 for it:
[]
= 2
Feature flags
-
fixtures(off by default) — two KiCad starter symbol libraries (kicad_symbols,kicad_symbol) and a footprint generator, for tests. Ask for it as a dev-dependency, which Cargo keeps out of a normal build:[] = { = "0.1", = ["fixtures"] }
Third-party data
The fixtures data is read with include_str!, so the crate archive
redistributes it: assets/kicad/Device.kicad_sym and
assets/kicad/Connector_Generic.kicad_sym are selections from the
KiCad symbol libraries and
are CC-BY-SA 4.0 with KiCad's design exception, not under this crate's
licence. assets/kicad/LICENSE.md carries their terms and
assets/kicad/PROVENANCE.json the upstream revision, the definitions selected
and the changes made; THIRD-PARTY-NOTICES.md summarises both. All three ship
in the crate.
Licence
The Autodrop3d licence in LICENSE.md, shipped in the crate (license-file
in the manifest). It is not an SPDX licence: read it before you modify or
redistribute the crate.