tscircuit/autorouting-dataset-01

This code manages the hardware and electronic components for circuit design and PCB layout, defining components like resistors, capacitors, transistors, connectors, and footprints, and providing tools for component placement, PCB topology, and electrical connections.

Version
1.0.102
License
unset
Stars
4

dist/index.cjs

'use strict';

var jsxRuntime = require('react/jsx-runtime');
var seveibar_smdUsbC = require('@tsci/seveibar.smd-usb-c');

/**
 * Decide when the autorouter should run in CLI-only dataset generation.
 */
const shouldAutorouterRun = () => {
    var _a;
    if (typeof process === "undefined" || !process.env)
        return false;
    if (process.env.TSCIRCUIT_DATASET_DISABLE_AUTOROUTER === "true") {
        return false;
    }
    const isCli = typeof window === "undefined" && Array.isArray(process.argv);
    if (!isCli)
        return false;
    const argv = (_a = process.argv) !== null && _a !== void 0 ? _a : [];
    return argv.some((arg) => arg.includes("create-dataset"));
};

var circuit001 = () => {
    return (jsxRuntime.jsxs("board", { routingDisabled: !shouldAutorouterRun(), width: "12mm", height: "30mm", children: [jsxRuntime.jsx(seveibar_smdUsbC.SmdUsbC, { name: "J1", connections: {
                    GND1: "net.GND",
                    GND2: "net.GND",
                    VBUS1: "net.VBUS",
                    VBUS2: "net.VBUS",
                }, pcbY: -10.5 }), jsxRuntime.jsx("led", { name: "LED", supplierPartNumbers: {
                    jlcpcb: ["965799"],
                }, color: "red", footprint: "0603", pcbX: 3, pcbY: 12 }), jsxRuntime.jsx("pushbutton", { name: "SW1", pcbRotation: "90deg", footprint: "pushbutton_id1.3mm_od2mm", connections: { pin1: ".R1 > .pos", pin2: "net.VBUS" }, supplierPartNumbers: {
                    jlcpcb: ["C110153"],
                } }), jsxRuntime.jsx("resistor", { name: "R1", footprint: "0603", resistance: "1k", pcbX: -3, pcbY: 7 }), jsxRuntime.jsx("trace", { from: "R1.neg", to: "LED.pos" }), jsxRuntime.jsx("trace", { from: "LED.neg", to: "net.GND" })] }));
};

module.exports = circuit001;