37 void set_zone_fills(std::size_t
index,
const std::vector<std::pair<
int, std::vector<model::Point>>>& fills);
45 std::string
write()
const {
return lb_.doc.write(); }
46 void save(
const std::string& path)
const { lb_.doc.save(path); }
56 std::uint64_t uuid_counter_ = 0;
Reads .kicad_pcb files (KiCad 9 and 10 formats) into the board model, keeping the s-expression docume...
void set_zone_fills(std::size_t index, const std::vector< std::pair< int, std::vector< model::Point > > > &fills)
Replaces the filled polygons of zone index (board.zones order) with fills (copper index,...
void add_zone(const model::Zone &z)
Adds a board-level copper zone as KiCad writes one: net, layer (the zone's single copper layer),...
void add_via(const model::Via &v)
void flip_footprint(std::size_t index, model::Point pos, double angle)
Moves footprint index to the other side of the board the way KiCad does (FOOTPRINT::Flip,...
void save(const std::string &path) const
std::string next_uuid()
Deterministic RFC-4122-style v4 UUID string.
std::string write() const
void move_footprint(std::size_t index, model::Point pos, double angle)
Moves footprint index to pos with orientation angle (degrees).
void remove_track(std::size_t index)
void remove_via(std::size_t index)
BoardEditor(LoadedBoard &board, std::uint64_t seed=1)
seed makes generated UUIDs deterministic.
bool set_copper_layer_count(int n, std::string *why=nullptr, std::vector< std::string > *notes=nullptr)
Gives the board n copper layers (even, 2..32; doc 05 §53): inner layers are added after the last one,...
void add_track(const model::Track &t)
std::string format_angle(double deg)
Formats an angle the way KiCad writes it: shortest decimal, no trailing zeros ("90",...
std::string flip_layer_name(const model::Board &board, std::string_view name)
KiCad's FlipLayer for outer layers: the first and last copper layer of board (by their names in the f...
bool flip_supported(const LoadedBoard &board, std::size_t index, std::string *why=nullptr)
True if BoardEditor::flip_footprint mirrors every item of footprint index exactly: no copper on inner...
std::int32_t NetId
0 = no net