Skip to main content

Crate brep_ecad_core

Crate brep_ecad_core 

Source
Expand description

UI-independent schematic, wiring-diagram and board documents, KiCad import, connectivity, rule checks, autorouting and fabrication output.

Document is one sheet (schematic or wiring diagram, DocumentKind) with its board; Document::netlist reads its connectivity and History keeps undo/redo snapshots. Coordinates are integer micrometres (Point), +Y down.

Modules:

  • kicad: KiCad 9 symbol library and footprint import.
  • kicad_git: shallow clones of KiCad’s official libraries (runs git).
  • erc: the electrical rule check.
  • netlist: KiCad .net netlist export and read-back.
  • board: PCB layout, connectivity and design rules.
  • autoroute: the board autorouter.
  • fabrication: Gerber X2, Excellon drill files, pick-and-place, BOM and a zip bundle.
  • footprint: natural ordering of pad and pin labels.
  • graphic: drawn geometry on a footprint’s silkscreen, fabrication and courtyard layers.
  • font: the silkscreen’s stroke font.

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. See the README for an example.

Modules§

autoroute
Grid-based autorouter.
board
Printed circuit board layout: footprints, copper, connectivity, and design checks.
erc
Electrical rule check: what a schematic’s pins say about how they may be joined, checked against the nets Document::netlist builds.
fabrication
Manufacturing outputs: Gerber X2 layers, Excellon drill files, and a zip bundle.
font
The stroke font the silkscreen is written in: reference designators and drawn text.
footprint
Ordering pad and pin labels, which are free strings that usually carry numbers.
graphic
Drawn geometry on the non-copper layers of a footprint: silkscreen, fabrication drawing and courtyard, on either side.
kicad
KiCad 6+ symbol and footprint importers with inherited and multi-unit device support.
kicad_git
KiCad’s official libraries, cloned with git.
netlist
A schematic’s netlist as KiCad writes one: the .net s-expression file (export version “E”) that Pcbnew, and most tools that read KiCad, take in.
pin_functions
A pin’s alternate functions (Pin::alternates) and the one each placed part shows (Component::pin_functions). Documentary only: nets, ERC and the netlist bind by number and read the main name and type.
seat_check
Whether a part’s 3D model sits on its own footprint: each pcb connection point against the pad with its pin number (the pin seat check, “Pin seats on pads”).
sheet
One sheet over a board’s schematic and the harness wiring round it.

Structs§

Component
Connection
One row of a wiring diagram’s connection list.
Document
GatePlacement
One gate of a component on the sheet: the gate’s geometry, taken about pivot in symbol coordinates, turned by rotation quarter turns and put at at.
History
Snapshot history: one transaction per gesture; no filesystem or UI dependency. Defaults to a document, and also serves the symbol and footprint editors.
Label
Net
NetPin
Netlist
PartSource
The part a component was placed from: the host’s key for that part, and the signature of the version whose symbol and pads were copied. A host compares the signature against the part as it stands now to find components to refresh.
Pin
Point
Integer micrometres; positive Y points down on a schematic sheet.
Symbol
Terminal
A stable reference to a component terminal, independent of drawing position.
Uuid
A Universally Unique Identifier (UUID).
Wire

Enums§

ConnectionTarget
Interactive connection targets. Junctions use their exact sheet coordinates.
DocumentKind
What a document is drawn for.
Graphic

Constants§

DOCUMENT_VERSION
Current document format version.
WIRING_DOCUMENT_VERSION
Format version of wiring diagrams. It is newer than a schematic’s so that earlier builds refuse a wiring diagram instead of opening it as a schematic.

Functions§

gate_letter
The letter a sheet adds to a reference for gate gate: A for 1, B for 2, …, Z, then AA, as KiCad names units.
on_segment