TraceMaker
C++ API of the engine
Loading...
Searching...
No Matches
srj.hpp File Reference

Simple Route JSON (SRJ), tscircuit's autorouting problem format (design doc 08 §9, D90): read a problem, write it as a self-contained KiCad board plus project, and write a routed board's copper back as SRJ traces. More...

#include <optional>
#include <string>
#include <vector>
#include "core/units.hpp"
#include "model/board.hpp"

Go to the source code of this file.

Classes

struct  tmk::io::SrjPoint
struct  tmk::io::SrjObstacle
struct  tmk::io::SrjConnection
struct  tmk::io::SrjNet
 One electrical net: the connections and obstacles that tscircuit's connectivity map (lib/utils/getConnectivityMapFromSimpleRouteJson.ts) puts in one group. More...
struct  tmk::io::SrjRules
struct  tmk::io::SrjPlane
 A bus whose termination is a plane: every connection of the bus ends in a plane on layer. More...
struct  tmk::io::SrjProblem
struct  tmk::io::SrjImportOptions
struct  tmk::io::SrjBoardFiles
struct  tmk::io::SrjExport

Namespaces

namespace  tmk
namespace  tmk::io

Functions

SrjProblem tmk::io::read_srj (const std::string &text)
 Parses SRJ text.
SrjProblem tmk::io::read_srj_file (const std::string &path)
std::string tmk::io::srj_layer_name (int z, int layer_count)
 "top", "inner1", ..., "bottom" for a stack index, and back (-1 if the name is not a layer of the stack).
int tmk::io::srj_layer_index (const std::string &name, int layer_count)
SrjBoardFiles tmk::io::srj_to_kicad (const SrjProblem &problem, const SrjImportOptions &opt={})
 The board is the problem mirrored in y at the same coordinates (x, -y), one footprint per componentId.
SrjExport tmk::io::srj_export (const std::string &problem_text, const model::Board &routed)
 Writes the tracks and vias of routed (a board made by srj_to_kicad from problem_text, then routed) as SRJ traces: one trace per pair of consecutive points of a connection, following the copper between their pads, then the copper no such path used.

Variables

constexpr double tmk::io::kSrjDefaultClearanceMm = 0.15
 tscircuit's fallbacks for what a problem leaves out: its router's default obstacle margin (defaultObstacleMargin ?
constexpr double tmk::io::kSrjDefaultViaPadMm = 0.3

Detailed Description

Simple Route JSON (SRJ), tscircuit's autorouting problem format (design doc 08 §9, D90): read a problem, write it as a self-contained KiCad board plus project, and write a routed board's copper back as SRJ traces.

Field reference: lib/types/srj-types.ts in github.com/tscircuit/tscircuit-autorouter (MIT) and the page "advanced/simple-route-json" on docs.tscircuit.com. SRJ is millimetres, y up, with layers named "top", "inner1" .. "innerN", "bottom"; KiCad is y down, so y is negated on the way in and back on the way out.

Definition in file srj.hpp.