BREP_ecad_core — electronics documents, with no UI
Part of the next.BREP.io Rust B-rep kernel: cargo add BREP_ecad_core · licence summary
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 ;
The components take the next free references (R1, R2), and the program
prints one line per net with its pins; a net with no label is named N$1,
N$2, and so on.
What is in it
Document/DocumentKind— one schematic or wiring-diagram sheet (with itsboard), and its editing surface:place_assembly_component(the one door for a valued part: it takes the assembly occurrence the component is),place_power_symbol,place_unbound(a symbol with no part, for previews and power symbols),add_wire,connect,set_reference,set_value,set_net_flag,refresh_part,transform_component,delete_component.no_connectsandpower_flagsmark pins meant to be left open and nets driven from off the sheet.to_json/from_json(andto_value/from_valuefor a document kept inside a host's own JSON) save and load it.History— snapshot undo/redo, one transaction per gesture; it defaults to aDocumentand also serves symbol and footprint editing.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 (Document::netlist). A wiring diagram also answers a point-to-point connection list (connections,connections_csv).- Gates — a symbol split into separately placed sections (KiCad's units,
U1A,U1B):Pin::gate,GatePlacement,Document::transform_gate. erc— an electrical rule check over a schematic's nets (Document::erc): KiCad's default pin map plus unconnected pins, undriven power inputs, duplicate references, dangling wire ends and unplaced gates; findings carry a sheet position and, where one edit answers them, a fix.netlist— the KiCad.netnetlist (export version "E") that Pcbnew and most KiCad-reading tools take (Document::kicad_netlist), written byte-stable, and read back (read_kicad_netlist).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 libraries (import_library, reporting what it could not read inImportReport::warnings) and footprints (import_footprint), and footprint assignment helpers.kicad_git— shallow clones of KiCad's official symbol, footprint and 3D model libraries at a release tag the caller names (kicad_git::clone). It runs thegitexecutable, which must be on thePATH.footprint— natural ordering of pad and pin labels (natural_cmp,pin_numbers).autoroute— the board autorouter: aRouteJobyields aRouteOutcomeand reports progress as it goes.fabrication— Gerber X2 layers, Excellon drill files and a zip bundle (Document::fabrication), plus a pick-and-place CSV (pick_and_place_csv) and an electronics bill of materials (electronics_bom_csv).
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
Licence
In plain words: the crates are free to use as they are, including in a commercial project. If you fix or change something in the kernel, send the change back as a pull request to github.com/mmiscool/next.BREP.io_RUST_BREP_KERNEL. If you do not want to share your changes, buy a commercial licence from Autodrop3d LLC; with it you never have to share your code back.
The exact terms are in LICENSE.md, shipped in the crate (license-file in the manifest) and at
LICENSE.md; if this summary and the file ever differ, the file wins.