TraceMaker
C++ API of the engine
Loading...
Searching...
No Matches
pour.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-3.0-or-later
2#pragma once
3// Generated pours (doc 05 §53, M20 C3): a ground or power zone the route adds to a board that has none, routed with
4// soft zones so other nets cut through it and the refill decides what it connects. The zone is written into the output
5// with the engine's fill; the designer can move, delete or refill it in KiCad like any zone.
6#include <string>
7#include <vector>
8
9#include "model/board.hpp"
10#include "model/rules.hpp"
11
12namespace tmk::passes {
13
14struct PourPlan {
15 model::Zone zone; // net, one copper layer, outline (the board's outline box; the refill clips it to the board), settings
16 std::string reason; // why this net and layer ("auto: ground net GND, back layer")
17};
18
19// Resolves `route --pour` entries against the board:
20// - "auto": only when the board has no copper zone (rule areas and teardrops aside); its ground net (a ground name such
21// as GND, GNDD or VSS, with pads; the one with the most pads) on the first inner layer, else on the back layer. A board
22// without such a net gets no pour (a note says why).
23// - "NET@LAYER": that net on that copper layer (KiCad or file layer name).
24// Settings are KiCad's defaults for a new zone (minimum width 0.25 mm, islands removed) except: pads connect solid, not
25// through thermal reliefs (spokes the routed copper cuts off are KiCad starved_thermal errors), and the clearance is the
26// net class clearance but at least 0.3 mm, so the fill keeps out of fine-pitch gaps it could not use. Throws std::invalid_argument on a bad entry, an unknown net or a layer that is not copper.
27std::vector<PourPlan> plan_pours(const model::Board& b, const model::DesignRules& rules, const std::vector<std::string>& specs,
28 std::vector<std::string>* notes = nullptr);
29
30} // namespace tmk::passes
The board model (design doc 02 §3): every object TraceMaker reads from a .kicad_pcb,...
std::vector< PourPlan > plan_pours(const model::Board &b, const model::DesignRules &rules, const std::vector< std::string > &specs, std::vector< std::string > *notes=nullptr)
Resolves route --pour entries against the board:
Design rules as KiCad defines them (design doc 08 §3–4): board minimums and net classes from the ....
model::Zone zone
net, one copper layer, outline (the board's outline box; the refill clips it to the board),...
Definition pour.hpp:15
std::string reason
why this net and layer ("auto: ground net GND, back layer")
Definition pour.hpp:16