TraceMaker
C++ API of the engine
Loading...
Searching...
No Matches
tmk::io::BoardEditor Class Reference

#include <io/kicad/board_editor.hpp>

Public Member Functions

 BoardEditor (LoadedBoard &board, std::uint64_t seed=1)
 seed makes generated UUIDs deterministic.
void add_track (const model::Track &t)
void add_via (const model::Via &v)
void remove_track (std::size_t index)
void remove_via (std::size_t index)
void move_footprint (std::size_t index, model::Point pos, double angle)
 Moves footprint index to pos with orientation angle (degrees).
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, top/bottom, about its own origin: local y and pad orientations negated, text angles 180° − a, F.
std::string write () const
void save (const std::string &path) const
std::string next_uuid ()
 Deterministic RFC-4122-style v4 UUID string.

Detailed Description

Definition at line 14 of file board_editor.hpp.

Constructor & Destructor Documentation

◆ BoardEditor()

tmk::io::BoardEditor::BoardEditor ( LoadedBoard & board,
std::uint64_t seed = 1 )
inline

seed makes generated UUIDs deterministic.

Definition at line 17 of file board_editor.hpp.

Member Function Documentation

◆ add_track()

void tmk::io::BoardEditor::add_track ( const model::Track & t)

◆ add_via()

void tmk::io::BoardEditor::add_via ( const model::Via & v)

◆ flip_footprint()

void tmk::io::BoardEditor::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, top/bottom, about its own origin: local y and pad orientations negated, text angles 180° − a, F.

  • <-> B.* layers, texts mirrored), then puts it at pos with the final orientation angle in degrees (flipped orientation −angle0 plus any rotation). Only for footprints where flip_supported() holds.

◆ move_footprint()

void tmk::io::BoardEditor::move_footprint ( std::size_t index,
model::Point pos,
double angle )

Moves footprint index to pos with orientation angle (degrees).

Pad and text orientations, which KiCad stores as absolute angles, are rotated by the same delta. Flipping sides is not supported here.

◆ next_uuid()

std::string tmk::io::BoardEditor::next_uuid ( )

Deterministic RFC-4122-style v4 UUID string.

◆ remove_track()

void tmk::io::BoardEditor::remove_track ( std::size_t index)

◆ remove_via()

void tmk::io::BoardEditor::remove_via ( std::size_t index)

◆ save()

void tmk::io::BoardEditor::save ( const std::string & path) const
inline

Definition at line 33 of file board_editor.hpp.

◆ write()

std::string tmk::io::BoardEditor::write ( ) const
inline

Definition at line 32 of file board_editor.hpp.


The documentation for this class was generated from the following file: