TraceMaker
C++ API of the engine
Loading...
Searching...
No Matches
project_reader.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-3.0-or-later
2#pragma once
3// Reads design rules from a KiCad project: <name>.kicad_pro (JSON) and <name>.kicad_dru (s-expressions).
4#include <string>
5
6#include "model/rules.hpp"
7
8namespace tmk::io {
9
10// `board_path` is the .kicad_pcb; the project and rule files are looked up next to it with the same stem.
11// Missing files give KiCad's defaults and a warning, never an exception.
12model::DesignRules read_design_rules(const std::string& board_path);
13
14// Parses a KiCad length with an optional unit suffix ("0.2mm", "8mil", "0.01in", "150um", "0.2") to nm.
15std::optional<Coord> parse_length(std::string_view s);
16
17} // namespace tmk::io
std::optional< Coord > parse_length(std::string_view s)
Parses a KiCad length with an optional unit suffix ("0.2mm", "8mil", "0.01in", "150um",...
model::DesignRules read_design_rules(const std::string &board_path)
board_path is the .kicad_pcb; the project and rule files are looked up next to it with the same stem.
Design rules as KiCad defines them (design doc 08 §3–4): board minimums and net classes from the ....