mohan-bee/tscircuit-robot-vacuum
A tscircuit package created by mohan-bee.
- Version
- 1.0.0
- License
- unset
- Stars
- 0
dist/index.cjs
PCB
Schematic
'use strict';
var jsxRuntime = require('react/jsx-runtime');
var tscircuit = require('tscircuit');
var React = require('react');
const NET = (s) => `net.${s}`;
const v3 = NET("V3V3_SERVICE");
const vm = NET("VBAT_PROTECTED");
const gnd = NET("GND");
const schematicPositions = {
"U1": { "schX": -0.22999999999999998, "schY": 0.0, "schRotation": 0 },
"C1": { "schX": -4.5, "schY": 0.99, "schRotation": -90 },
"C2": { "schX": -3.3, "schY": 0.99, "schRotation": -90 },
"R1": { "schX": 1.07, "schY": 4.61, "schRotation": -90 },
"C3": { "schX": 2.525, "schY": 4.61, "schRotation": -90 },
"R2": { "schX": -0.335, "schY": 6.305, "schRotation": -90 },
"R3": { "schX": 3.31, "schY": 1.9, "schRotation": -90 },
"R4": { "schX": 5.2, "schY": 3.71, "schRotation": -90 },
"J_UART": { "schX": -1.58, "schY": 4.1, "schRotation": 0 },
"U2": { "schX": 0, "schY": 0, "schRotation": 0 },
"C21": { "schX": 2.76, "schY": 0.0, "schRotation": 0 },
"C22": { "schX": 3.1, "schY": -2, "schRotation": -90 },
"C23": { "schX": 2.47, "schY": -1, "schRotation": -90 },
"C24": { "schX": 4.05, "schY": -1, "schRotation": -90 },
"R21": { "schX": -2.67, "schY": -1.03, "schRotation": -90 },
"R22": { "schX": -3, "schY": 0.83, "schRotation": -90 },
"R23": { "schX": -4.79, "schY": -1.03, "schRotation": -90 },
"TP2": { "schX": -0.931, "schY": 2.3, "schRotation": 0 },
"J_M1": { "schX": -2.775, "schY": -2.895, "schRotation": 0 },
"U3": { "schX": 0, "schY": 0, "schRotation": 0 },
"C31": { "schX": 2.76, "schY": 0.0, "schRotation": 0 },
"C32": { "schX": 3.1, "schY": -2, "schRotation": -90 },
"C33": { "schX": 2.47, "schY": -1, "schRotation": -90 },
"C34": { "schX": 4.05, "schY": -1, "schRotation": -90 },
"R31": { "schX": -2.67, "schY": -1.03, "schRotation": -90 },
"R32": { "schX": -3, "schY": 0.83, "schRotation": -90 },
"R33": { "schX": -4.79, "schY": -1.03, "schRotation": -90 },
"TP3": { "schX": -0.931, "schY": 2.3, "schRotation": 0 },
"J_M2": { "schX": -2.775, "schY": -2.895, "schRotation": 0 },
"U4": { "schX": 0, "schY": 0, "schRotation": 0 },
"C41": { "schX": 2.76, "schY": 0.0, "schRotation": 0 },
"C42": { "schX": 3.1, "schY": -2, "schRotation": -90 },
"C43": { "schX": 2.47, "schY": -1, "schRotation": -90 },
"C44": { "schX": 4.05, "schY": -1, "schRotation": -90 },
"R41": { "schX": -2.67, "schY": -1.03, "schRotation": -90 },
"R42": { "schX": -3, "schY": 0.83, "schRotation": -90 },
"R43": { "schX": -4.79, "schY": -1.03, "schRotation": -90 },
"TP4": { "schX": -0.931, "schY": 2.3, "schRotation": 0 },
"J_M3": { "schX": -2.775, "schY": -2.895, "schRotation": 0 },
"U5": { "schX": 0, "schY": 0, "schRotation": 0 },
"C51": { "schX": 2.76, "schY": 0.0, "schRotation": 0 },
"C52": { "schX": 3.1, "schY": -2, "schRotation": -90 },
"C53": { "schX": 2.47, "schY": -1, "schRotation": -90 },
"C54": { "schX": 4.05, "schY": -1, "schRotation": -90 },
"R51": { "schX": -2.67, "schY": -1.03, "schRotation": -90 },
"R52": { "schX": -3, "schY": 0.83, "schRotation": -90 },
"R53": { "schX": -4.79, "schY": -1.03, "schRotation": -90 },
"TP5": { "schX": -0.931, "schY": 2.3, "schRotation": 0 },
"J_M4": { "schX": -2.775, "schY": -2.895, "schRotation": 0 },
"J_ENCODER_L": { "schX": 0, "schY": 0, "schRotation": 0 },
"J_ENCODER_R": { "schX": 0, "schY": 2.2, "schRotation": 0 },
"U6": { "schX": 0, "schY": 0, "schRotation": 0 },
"C61": { "schX": 2.47, "schY": -1.1, "schRotation": -90 },
"C62": { "schX": 3.71, "schY": -1.1, "schRotation": -90 },
"C63": { "schX": 4.95, "schY": -1.1, "schRotation": -90 },
"R61": { "schX": 0.295, "schY": 4.11, "schRotation": -90 },
"R62": { "schX": -0.239, "schY": -2.305, "schRotation": -90 },
"J_LIDAR": { "schX": 0.3, "schY": 0.0, "schRotation": 0 },
"J_BLOWER": { "schX": 0.18, "schY": 2.2, "schRotation": 0 },
"R63": { "schX": 2.92, "schY": 4.9, "schRotation": -90 },
"R64": { "schX": 2.31, "schY": 3.09, "schRotation": -90 },
"J_CLIFF_1": { "schX": -0.48, "schY": 4.3, "schRotation": 0 },
"R71": { "schX": 1.635, "schY": 7.615, "schRotation": -90 },
"C71": { "schX": 3.2600000000000002, "schY": 7.7700000000000005, "schRotation": -90 },
"J_CLIFF_2": { "schX": -0.48, "schY": 6.7, "schRotation": 0 },
"R72": { "schX": 4.21, "schY": 5.96, "schRotation": -90 },
"C72": { "schX": 5.82, "schY": 5.81, "schRotation": -90 },
"J_CLIFF_3": { "schX": -0.48, "schY": 8.7, "schRotation": 0 },
"R73": { "schX": 1.98, "schY": 11.23, "schRotation": -90 },
"C73": { "schX": 3.595, "schY": 11.235, "schRotation": -90 },
"J_CLIFF_4": { "schX": -0.83, "schY": 10.7, "schRotation": 0 },
"R74": { "schX": 0.695, "schY": 13.277, "schRotation": -90 },
"C74": { "schX": 2.655, "schY": 13.277, "schRotation": -90 },
"J_BUMPER_L": { "schX": 8, "schY": 4, "schRotation": 0 },
"J_BUMPER_R": { "schX": 7.315, "schY": 7.3, "schRotation": 0 },
"R81": { "schX": 5.475, "schY": 9.15, "schRotation": -90 },
"R82": { "schX": 7.415, "schY": 9.15, "schRotation": -90 },
"J_BATTERY": { "schX": -4.02, "schY": 0.4, "schRotation": 0 },
"J_LOGIC_SERVICE": { "schX": -3.89, "schY": 2.3, "schRotation": 0 }
};
const schematicPlacement = (name) => schematicPositions[name];
function EspressifS3Footprint() {
return jsxRuntime.jsxs("footprint", { children: [Array.from({ length: 14 }, (_, i) => jsxRuntime.jsx("smtpad", { portHints: [`pin${i + 1}`], shape: "rect", pcbX: -8.75, pcbY: 8.26 - i * 1.27, width: 1.5, height: 0.9 })), Array.from({ length: 12 }, (_, i) => jsxRuntime.jsx("smtpad", { portHints: [`pin${i + 15}`], shape: "rect", pcbX: -6.985 + i * 1.27, pcbY: -9.5, width: 0.9, height: 1.5 })), Array.from({ length: 14 }, (_, i) => jsxRuntime.jsx("smtpad", { portHints: [`pin${i + 27}`], shape: "rect", pcbX: 8.75, pcbY: -8.25 + i * 1.27, width: 1.5, height: 0.9 })), [-2.9, -1.5, -0.1].flatMap((x, i) => [-1.94, -0.54, 0.86].map((y, j) => jsxRuntime.jsx("smtpad", { portHints: ["pin41"], shape: "rect", pcbX: x, pcbY: -y, width: 0.9, height: 0.9 }))), jsxRuntime.jsx("courtyardrect", { width: 19.6, height: 26.6, pcbY: 2.75 }), jsxRuntime.jsx("silkscreenrect", { width: 18, height: 25.5, pcbY: 3 }), jsxRuntime.jsx("silkscreentext", { text: "ANTENNA", pcbY: 12.75, fontSize: 1 }), jsxRuntime.jsx("silkscreencircle", { pcbX: -10.2, pcbY: 8.26, radius: 0.4 })] });
}
function Pwp16Footprint() {
return jsxRuntime.jsxs("footprint", { children: [Array.from({ length: 8 }, (_, i) => jsxRuntime.jsx("smtpad", { portHints: [`pin${i + 1}`], shape: "rect", pcbX: -2.9, pcbY: 2.275 - i * 0.65, width: 1.5, height: 0.45 })), Array.from({ length: 8 }, (_, i) => jsxRuntime.jsx("smtpad", { portHints: [`pin${i + 9}`], shape: "rect", pcbX: 2.9, pcbY: -2.275 + i * 0.65, width: 1.5, height: 0.45 })), jsxRuntime.jsx("smtpad", { portHints: ["pin17"], shape: "rect", width: 3.3, height: 3.3 }), jsxRuntime.jsx("courtyardrect", { width: 8.1, height: 5.5 }), jsxRuntime.jsx("silkscreenrect", { width: 4.4, height: 5 }), jsxRuntime.jsx("silkscreencircle", { pcbX: -3.9, pcbY: 2.275, radius: 0.25 })] });
}
// TDK 14-pad 2.5 x 3.0mm LGA; custom nominal land pattern remains DFM-review pending.
function IcmFootprint() {
return jsxRuntime.jsxs("footprint", { children: [[1, 2, 3, 4].map((p, i) => jsxRuntime.jsx("smtpad", { portHints: [`pin${p}`], shape: "rect", pcbX: -1.175, pcbY: 0.75 - i * 0.5, width: 0.55, height: 0.3 })), [5, 6, 7].map((p, i) => jsxRuntime.jsx("smtpad", { portHints: [`pin${p}`], shape: "rect", pcbX: -0.5 + i * 0.5, pcbY: -1.425, width: 0.3, height: 0.55 })), [8, 9, 10, 11].map((p, i) => jsxRuntime.jsx("smtpad", { portHints: [`pin${p}`], shape: "rect", pcbX: 1.175, pcbY: -0.75 + i * 0.5, width: 0.55, height: 0.3 })), [12, 13, 14].map((p, i) => jsxRuntime.jsx("smtpad", { portHints: [`pin${p}`], shape: "rect", pcbX: 0.5 - i * 0.5, pcbY: 1.425, width: 0.3, height: 0.55 })), jsxRuntime.jsx("courtyardrect", { width: 3.4, height: 3.9 }), jsxRuntime.jsx("silkscreenrect", { width: 2.5, height: 3 }), jsxRuntime.jsx("silkscreencircle", { pcbX: -1.8, pcbY: 1, radius: 0.2 })] });
}
function Header({ name, x, y, signals, rotation = 0, pitch = 2.54, schWidth }) {
const labels = Object.fromEntries(signals.map((s, i) => [`pin${i + 1}`, s]));
return jsxRuntime.jsx("pinheader", { name: name, ...schematicPlacement(name), pinCount: signals.length, pitch: pitch, pcbX: x, pcbY: y, pcbRotation: rotation, schWidth: schWidth, pinLabels: labels, connections: Object.fromEntries(signals.map((s, i) => [`pin${i + 1}`, NET(s)])), showSilkscreenPinLabels: true });
}
function MotorDriver({ index, x, y, role }) {
const n = `U${index}`;
const prefix = `M${index - 1}`;
const ip = NET(`${prefix}_CURRENT`);
const vr = NET(`${prefix}_VREF`);
const cph = NET(`${prefix}_CPH`);
const cpl = NET(`${prefix}_CPL`);
const vcp = NET(`${prefix}_VCP`);
return jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("chip", { name: n, manufacturerPartNumber: "DRV8876PWPR", pcbX: x, pcbY: y, footprint: jsxRuntime.jsx(Pwp16Footprint, {}), cadModel: { jscad: { type: "cuboid", size: [4.4, 5, 1.2], center: [0, 0, 0.6] } }, pinAttributes: { VM: { requiresPower: true }, GND: { requiresGround: true }, PGND: { requiresGround: true }, EP: { requiresGround: true }, EN: { isInput: true }, PH: { isInput: true }, nSLEEP: { isInput: true }, nFAULT: { isOutput: true, canUseOpenDrain: true, isUsingOpenDrain: true }, VREF: { isInput: true }, IPROPI: { isOutput: true }, IMODE: { isInput: true }, PMODE: { isInput: true }, OUT1: { isOutput: true }, OUT2: { isOutput: true } }, pinLabels: { pin1: "EN", pin2: "PH", pin3: "nSLEEP", pin4: "nFAULT", pin5: "VREF", pin6: "IPROPI", pin7: "IMODE", pin8: "OUT1", pin9: "PGND", pin10: "OUT2", pin11: "VM", pin12: "VCP", pin13: "CPH", pin14: "CPL", pin15: "GND", pin16: "PMODE", pin17: "EP" }, connections: { EN: NET(`${prefix}_PWM`), PH: NET(`${prefix}_DIR`), nSLEEP: NET("MOTORS_ENABLE"), nFAULT: NET("MOTORS_nFAULT"), VREF: vr, IPROPI: ip, IMODE: gnd, OUT1: NET(`${prefix}_A`), OUT2: NET(`${prefix}_B`), VM: vm, GND: gnd, PGND: gnd, PMODE: gnd, EP: gnd, CPH: cph, CPL: cpl, VCP: vcp } }), jsxRuntime.jsx("capacitor", { name: `C${index}1`, ...schematicPlacement(`C${index}1`), capacitance: "22nF", maxVoltageRating: "50V", footprint: "0603", pcbX: x + 6, pcbY: y + 0.8, pcbRotation: 90, connections: { pin1: cph, pin2: cpl } }), jsxRuntime.jsx("capacitor", { name: `C${index}2`, ...schematicPlacement(`C${index}2`), capacitance: "100nF", maxVoltageRating: "16V", footprint: "0603", pcbX: x + 6, pcbY: y - 3, pcbRotation: 90, connections: { pin1: vcp, pin2: vm } }), jsxRuntime.jsx("capacitor", { name: `C${index}3`, ...schematicPlacement(`C${index}3`), capacitance: "100nF", maxVoltageRating: "25V", footprint: "0603", pcbX: x + 6, pcbY: y - 6, pcbRotation: 180, connections: { pin1: vm, pin2: gnd } }), jsxRuntime.jsx("capacitor", { name: `C${index}4`, ...schematicPlacement(`C${index}4`), capacitance: "22uF", maxVoltageRating: "25V", footprint: "1210", pcbX: x + 11, pcbY: y - 6, connections: { pin1: vm, pin2: gnd } }), jsxRuntime.jsx("resistor", { name: `R${index}1`, ...schematicPlacement(`R${index}1`), resistance: "2.49k", footprint: "0603", pcbX: x - 8, pcbY: y - 3, connections: { pin1: ip, pin2: gnd } }), jsxRuntime.jsx("resistor", { name: `R${index}2`, ...schematicPlacement(`R${index}2`), resistance: "10k", footprint: "0603", pcbX: x - 8, pcbY: y + 3, pcbRotation: 180, connections: { pin1: v3, pin2: vr } }), jsxRuntime.jsx("resistor", { name: `R${index}3`, ...schematicPlacement(`R${index}3`), resistance: "30.1k", footprint: "0603", pcbX: x - 8, pcbY: y, connections: { pin1: vr, pin2: gnd } }), jsxRuntime.jsx("testpoint", { name: `TP${index}`, ...schematicPlacement(`TP${index}`), doNotPlace: true, cadModel: null, footprint: jsxRuntime.jsx("footprint", { children: jsxRuntime.jsx("smtpad", { portHints: ["pin1"], shape: "circle", radius: 0.6 }) }), pcbX: x - 12, pcbY: y - 3, connections: { pin1: ip } }), jsxRuntime.jsx(Header, { name: `J_M${index - 1}`, x: x, y: y + 11, signals: [`${prefix}_A`, `${prefix}_B`] }), jsxRuntime.jsx("silkscreentext", { text: `${role} / DRV8876`, pcbX: x, pcbY: y + 16, fontSize: 1 })] });
}
function MainBoard({ routingDisabled = true, mountedTo }) {
return jsxRuntime.jsxs("board", { width: 160, height: 130, thickness: 1.6, layers: 4, routingDisabled: routingDisabled, mountedTo: mountedTo, schLayout: { layoutMode: "relative" }, children: [[-72, 72].flatMap(x => [-52, 52].map(y => jsxRuntime.jsx("hole", { name: `MOUNT_${x}_${y}`, pcbX: x, pcbY: y, diameter: 3.2 }))), jsxRuntime.jsx("silkscreentext", { text: "VACUUM / R0 - ENGINEERING DRAFT", pcbX: 0, pcbY: -61, fontSize: 1.8 }), jsxRuntime.jsx("silkscreentext", { text: "NO CHARGER / NO REGULATORS / NOT FOR FABRICATION", pcbX: 0, pcbY: -57, fontSize: 1.1 }), jsxRuntime.jsxs("schematicsheet", { name: "CONTROL", displayName: "ESP32-S3 control and programming", sheetIndex: 0, children: [jsxRuntime.jsx("chip", { name: "U1", ...schematicPlacement("U1"), manufacturerPartNumber: "ESP32-S3-WROOM-1-N16R8", pcbX: 42, pcbY: 45, footprint: jsxRuntime.jsx(EspressifS3Footprint, {}), cadModel: { jscad: { type: "cuboid", size: [18, 25.5, 3.1], center: [0, 3.77, 1.55] } }, pinAttributes: { V3V3: { requiresPower: true, requiresVoltage: 3.3 }, GND1: { requiresGround: true }, GND40: { requiresGround: true }, EP: { requiresGround: true }, EN: { isInput: true }, GPIO0: { isInput: true }, GPIO1: { isInput: true }, GPIO2: { isInput: true }, GPIO4: { isInput: true }, GPIO5: { isInput: true }, GPIO6: { isOutput: true }, GPIO7: { isOutput: true }, GPIO8: { isOutput: true }, GPIO9: { isOutput: true }, GPIO10: { isOutput: true }, GPIO11: { isOutput: true }, GPIO12: { isBidirectional: true, canUseOpenDrain: true, isUsingOpenDrain: true }, GPIO13: { isBidirectional: true, canUseOpenDrain: true, isUsingOpenDrain: true }, GPIO14: { isOutput: true }, GPIO15: { isOutput: true }, GPIO16: { isInput: true }, GPIO17: { isInput: true }, GPIO18: { isInput: true }, GPIO19: { isInput: true }, GPIO20: { isInput: true }, GPIO21: { isInput: true }, GPIO38: { isOutput: true }, GPIO39: { isInput: true }, GPIO40: { isOutput: true }, GPIO41: { isInput: true }, GPIO42: { isOutput: true }, GPIO47: { isInput: true }, GPIO48: { isInput: true }, RXD0: { isInput: true }, TXD0: { isOutput: true } }, pinLabels: { pin1: "GND1", pin2: "V3V3", pin3: "EN", pin4: "GPIO4", pin5: "GPIO5", pin6: "GPIO6", pin7: "GPIO7", pin8: "GPIO15", pin9: "GPIO16", pin10: "GPIO17", pin11: "GPIO18", pin12: "GPIO8", pin13: "GPIO19", pin14: "GPIO20", pin15: "GPIO3", pin16: "GPIO46", pin17: "GPIO9", pin18: "GPIO10", pin19: "GPIO11", pin20: "GPIO12", pin21: "GPIO13", pin22: "GPIO14", pin23: "GPIO21", pin24: "GPIO47", pin25: "GPIO48", pin26: "GPIO45", pin27: "GPIO0", pin28: "GPIO35", pin29: "GPIO36", pin30: "GPIO37", pin31: "GPIO38", pin32: "GPIO39", pin33: "GPIO40", pin34: "GPIO41", pin35: "GPIO42", pin36: "RXD0", pin37: "TXD0", pin38: "GPIO2", pin39: "GPIO1", pin40: "GND40", pin41: "EP" }, noConnect: ["GPIO3", "GPIO45", "GPIO46", "GPIO35", "GPIO36", "GPIO37"], connections: { GND1: gnd, GND40: gnd, EP: gnd, V3V3: v3, EN: NET("ESP_EN"), GPIO0: NET("BOOT"), GPIO1: NET("CLIFF_1"), GPIO2: NET("CLIFF_2"), GPIO4: NET("CLIFF_3"), GPIO5: NET("CLIFF_4"), GPIO6: NET("M1_PWM"), GPIO7: NET("M1_DIR"), GPIO8: NET("M2_PWM"), GPIO9: NET("M2_DIR"), GPIO10: NET("M3_PWM"), GPIO11: NET("M3_DIR"), GPIO12: NET("I2C_SDA"), GPIO13: NET("I2C_SCL"), GPIO14: NET("M4_PWM"), GPIO15: NET("M4_DIR"), GPIO16: NET("ENC_L_A"), GPIO17: NET("ENC_L_B"), GPIO18: NET("ENC_R_A"), GPIO21: NET("ENC_R_B"), GPIO19: NET("BUMPER_L"), GPIO20: NET("BUMPER_R"), GPIO38: NET("LIDAR_MCU_TX"), GPIO39: NET("LIDAR_MCU_RX"), GPIO40: NET("BLOWER_PWM"), GPIO41: NET("BLOWER_TACH"), GPIO42: NET("MOTORS_ENABLE"), GPIO47: NET("MOTORS_nFAULT"), GPIO48: NET("IMU_INT"), RXD0: NET("UART0_RX"), TXD0: NET("UART0_TX") } }), jsxRuntime.jsx("keepout", { shape: "rect", pcbX: 42, pcbY: 60, width: 48, height: 9.8, layers: ["top", "inner1", "inner2", "bottom"], excludeRefs: [".U1"] }), jsxRuntime.jsx("capacitor", { name: "C1", ...schematicPlacement("C1"), capacitance: "10uF", maxVoltageRating: "6.3V", footprint: "0805", pcbX: 26, pcbY: 47, connections: { pin1: v3, pin2: gnd } }), jsxRuntime.jsx("capacitor", { name: "C2", ...schematicPlacement("C2"), capacitance: "100nF", maxVoltageRating: "6.3V", footprint: "0603", pcbX: 26, pcbY: 44, connections: { pin1: v3, pin2: gnd } }), jsxRuntime.jsx("resistor", { name: "R1", ...schematicPlacement("R1"), resistance: "10k", footprint: "0603", pcbX: 24, pcbY: 37, pcbRotation: 180, connections: { pin1: v3, pin2: NET("ESP_EN") } }), jsxRuntime.jsx("capacitor", { name: "C3", ...schematicPlacement("C3"), capacitance: "1uF", maxVoltageRating: "6.3V", footprint: "0603", pcbX: 24, pcbY: 34, connections: { pin1: NET("ESP_EN"), pin2: gnd } }), jsxRuntime.jsx("resistor", { name: "R2", ...schematicPlacement("R2"), resistance: "10k", footprint: "0603", pcbX: 52, pcbY: 31, pcbRotation: 180, connections: { pin1: v3, pin2: NET("BOOT") } }), jsxRuntime.jsx("resistor", { name: "R3", ...schematicPlacement("R3"), resistance: "10k", footprint: "0603", pcbX: 20, pcbY: 25, connections: { pin1: v3, pin2: NET("MOTORS_nFAULT") } }), jsxRuntime.jsx("resistor", { name: "R4", ...schematicPlacement("R4"), resistance: "100k", footprint: "0603", pcbX: 20, pcbY: 22, connections: { pin1: NET("MOTORS_ENABLE"), pin2: gnd } }), jsxRuntime.jsx(Header, { name: "J_UART", schWidth: 1.34, x: 67, y: 34, rotation: 90, signals: ["GND", "V3V3_SERVICE", "UART0_TX", "UART0_RX", "ESP_EN", "BOOT"] })] }), jsxRuntime.jsx("schematicsheet", { name: "LEFT_MOTOR", displayName: "Left wheel motor driver", sheetIndex: 1, children: jsxRuntime.jsx(MotorDriver, { index: 2, x: -53, y: 31, role: "LEFT WHEEL" }) }), jsxRuntime.jsx("schematicsheet", { name: "RIGHT_MOTOR", displayName: "Right wheel motor driver", sheetIndex: 2, children: jsxRuntime.jsx(MotorDriver, { index: 3, x: -17, y: 31, role: "RIGHT WHEEL" }) }), jsxRuntime.jsx("schematicsheet", { name: "ROLLER_MOTOR", displayName: "Main roller motor driver", sheetIndex: 3, children: jsxRuntime.jsx(MotorDriver, { index: 4, x: -53, y: -3, role: "ROLLER" }) }), jsxRuntime.jsx("schematicsheet", { name: "SIDE_MOTOR", displayName: "Side brush motor driver", sheetIndex: 4, children: jsxRuntime.jsx(MotorDriver, { index: 5, x: -17, y: -3, role: "SIDE BRUSH" }) }), jsxRuntime.jsxs("schematicsheet", { name: "ENCODERS", displayName: "Wheel encoder connectors", sheetIndex: 5, children: [jsxRuntime.jsx(Header, { name: "J_ENCODER_L", schWidth: 1.34, x: -57, y: 57, signals: ["V3V3_SERVICE", "GND", "ENC_L_A", "ENC_L_B"] }), jsxRuntime.jsx(Header, { name: "J_ENCODER_R", schWidth: 1.34, x: -16, y: 57, signals: ["V3V3_SERVICE", "GND", "ENC_R_A", "ENC_R_B"] })] }), jsxRuntime.jsxs("schematicsheet", { name: "INERTIAL", displayName: "IMU and I2C", sheetIndex: 6, children: [jsxRuntime.jsx("chip", { name: "U6", ...schematicPlacement("U6"), manufacturerPartNumber: "ICM-42688-P", pcbX: 17, pcbY: 7, footprint: jsxRuntime.jsx(IcmFootprint, {}), cadModel: { jscad: { type: "cuboid", size: [2.5, 3, 0.9], center: [0, 0, 0.45] } }, pinAttributes: { VDD: { requiresPower: true, requiresVoltage: 3.3 }, VDDIO: { requiresPower: true, requiresVoltage: 3.3 }, GND: { requiresGround: true }, RESV7: { requiresGround: true }, CS: { isInput: true }, AD0: { isInput: true }, INT1: { isOutput: true }, INT2: { isInput: true }, SCL: { isInput: true }, SDA: { isBidirectional: true, canUseOpenDrain: true, isUsingOpenDrain: true } }, pinLabels: { pin1: "AD0", pin2: "RESV2", pin3: "RESV3", pin4: "INT1", pin5: "VDDIO", pin6: "GND", pin7: "RESV7", pin8: "VDD", pin9: "INT2", pin10: "RESV10", pin11: "RESV11", pin12: "CS", pin13: "SCL", pin14: "SDA" }, connections: { AD0: gnd, RESV2: gnd, RESV3: gnd, RESV7: gnd, RESV10: gnd, RESV11: gnd, INT1: NET("IMU_INT"), INT2: gnd, VDDIO: v3, VDD: v3, GND: gnd, CS: v3, SDA: NET("I2C_SDA"), SCL: NET("I2C_SCL") } }), jsxRuntime.jsx("capacitor", { name: "C61", ...schematicPlacement("C61"), capacitance: "100nF", maxVoltageRating: "6.3V", footprint: "0603", pcbX: 21, pcbY: 6, connections: { pin1: v3, pin2: gnd } }), jsxRuntime.jsx("capacitor", { name: "C62", ...schematicPlacement("C62"), capacitance: "2.2uF", maxVoltageRating: "6.3V", footprint: "0603", pcbX: 21, pcbY: 3, connections: { pin1: v3, pin2: gnd } }), jsxRuntime.jsx("capacitor", { name: "C63", ...schematicPlacement("C63"), capacitance: "10nF", maxVoltageRating: "6.3V", footprint: "0603", pcbX: 13, pcbY: 3, connections: { pin1: v3, pin2: gnd } }), jsxRuntime.jsx("resistor", { name: "R61", ...schematicPlacement("R61"), resistance: "4.7k", footprint: "0603", pcbX: 13, pcbY: 14, connections: { pin1: v3, pin2: NET("I2C_SDA") } }), jsxRuntime.jsx("resistor", { name: "R62", ...schematicPlacement("R62"), resistance: "4.7k", footprint: "0603", pcbX: 21, pcbY: 14, connections: { pin1: v3, pin2: NET("I2C_SCL") } }), jsxRuntime.jsx("silkscreentext", { text: "IMU / KEEP VIBRATION LOW", pcbX: 19, pcbY: -2, fontSize: 0.8 })] }), jsxRuntime.jsxs("schematicsheet", { name: "SENSORS_POWER", displayName: "Sensors, blower, and service power", sheetIndex: 7, children: [jsxRuntime.jsx(Header, { name: "J_LIDAR", schWidth: 1.34, x: 66, y: 13, rotation: 90, signals: ["V5_SERVICE", "GND", "LIDAR_MCU_RX", "LIDAR_MCU_TX"] }), jsxRuntime.jsx("silkscreentext", { text: "C1 / 5V / 3V3 UART", pcbX: 62, pcbY: 22, fontSize: 0.9 }), jsxRuntime.jsx(Header, { name: "J_BLOWER", schWidth: 1.53, x: 64, y: -9, rotation: 90, signals: ["VBAT_PROTECTED", "GND", "BLOWER_PWM", "BLOWER_TACH"] }), jsxRuntime.jsx("silkscreentext", { text: "BLOWER + BUILT-IN DRIVER", pcbX: 58, pcbY: -18, fontSize: 0.8 }), jsxRuntime.jsx("resistor", { name: "R63", ...schematicPlacement("R63"), resistance: "100k", footprint: "0603", pcbX: 53, pcbY: -9, connections: { pin1: NET("BLOWER_PWM"), pin2: gnd } }), jsxRuntime.jsx("resistor", { name: "R64", ...schematicPlacement("R64"), resistance: "10k", footprint: "0603", pcbX: 53, pcbY: -12, connections: { pin1: v3, pin2: NET("BLOWER_TACH") } }), [1, 2, 3, 4].map((i) => jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsx(Header, { name: `J_CLIFF_${i}`, x: -64 + (i - 1) * 18, y: -46, rotation: 90, signals: ["V3V3_SERVICE", "GND", `CLIFF_${i}`] }), jsxRuntime.jsx("resistor", { name: `R7${i}`, ...schematicPlacement(`R7${i}`), resistance: "10k", footprint: "0603", pcbX: -64 + (i - 1) * 18, pcbY: -35, connections: { pin1: v3, pin2: NET(`CLIFF_${i}`) } }), jsxRuntime.jsx("capacitor", { name: `C7${i}`, ...schematicPlacement(`C7${i}`), capacitance: "10nF", maxVoltageRating: "6.3V", footprint: "0603", pcbX: -60 + (i - 1) * 18, pcbY: -35, connections: { pin1: NET(`CLIFF_${i}`), pin2: gnd } })] }, i)), jsxRuntime.jsx(Header, { name: "J_BUMPER_L", x: 8, y: -46, rotation: 90, signals: ["BUMPER_L", "GND"] }), jsxRuntime.jsx(Header, { name: "J_BUMPER_R", x: 22, y: -46, rotation: 90, signals: ["BUMPER_R", "GND"] }), jsxRuntime.jsx("resistor", { name: "R81", ...schematicPlacement("R81"), resistance: "10k", footprint: "0603", pcbX: 8, pcbY: -35, connections: { pin1: v3, pin2: NET("BUMPER_L") } }), jsxRuntime.jsx("resistor", { name: "R82", ...schematicPlacement("R82"), resistance: "10k", footprint: "0603", pcbX: 22, pcbY: -35, connections: { pin1: v3, pin2: NET("BUMPER_R") } }), jsxRuntime.jsx(Header, { name: "J_BATTERY", x: -64, y: -22, signals: ["VBAT_PROTECTED", "GND"] }), jsxRuntime.jsx(Header, { name: "J_LOGIC_SERVICE", x: 63, y: -45, signals: ["GND", "V3V3_SERVICE", "V5_SERVICE"] }), jsxRuntime.jsx("silkscreenrect", { pcbX: 27, pcbY: -24, width: 33, height: 12 }), jsxRuntime.jsx("silkscreentext", { text: "BQ25798 + 5V/3V3 BUCKS", pcbX: 27, pcbY: -22, fontSize: 1 }), jsxRuntime.jsx("silkscreentext", { text: "RESERVED - NOT IMPLEMENTED", pcbX: 27, pcbY: -26, fontSize: 0.8 }), jsxRuntime.jsx("keepout", { shape: "rect", pcbX: 27, pcbY: -24, width: 33, height: 12, layers: ["top", "bottom"] })] })] });
}
const pcbMountingHoles = [-72, 72].flatMap((x) => [-52, 52].map((y) => ({ x, y })));
/** Native CSG tessellation workaround: offset cylinder facet seams from the
* cardinal cut planes. Without this, the native mesh loader produced duplicate
* near-coincident seam vertices on these two compound solids. This changes only
* the polygonal phase of round features; no exported mesh is repaired. */
function StableCylinder({ radius, height, center = [0, 0, 0] }) {
return jsxRuntime.jsx(tscircuit.jscad.translate, { offset: center, children: jsxRuntime.jsx(tscircuit.jscad.rotate, { angles: [0, 0, 0.017], children: jsxRuntime.jsx(tscircuit.jscad.cylinder, { radius: radius, height: height }) }) });
}
function Chassis() {
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(tscircuit.jscad.subtract, { children: [jsxRuntime.jsxs(tscircuit.jscad.union, { children: [jsxRuntime.jsxs(tscircuit.jscad.subtract, { children: [jsxRuntime.jsx(StableCylinder, { radius: 159, height: 60, center: [0, 0, -3] }), jsxRuntime.jsx(StableCylinder, { radius: 156.6, height: 60, center: [0, 0, 0] })] }), pcbMountingHoles.map(({ x, y }) => (jsxRuntime.jsx(StableCylinder, { radius: 4.5, height: 29.2, center: [x, y, -15.4] }, `${x},${y}`))), [-1, 1].flatMap((sx) => [-1, 1].map((sy) => (jsxRuntime.jsx(StableCylinder, { radius: 5.5, height: 60, center: [sx * 101, sy * 101, -3] }, `${sx},${sy}`))))] }), [-130, 130].map((x) => (jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [64, 80, 72], center: [x + Math.sign(x) * 11, 0, -20] }, x))), jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [144, 46, 44], center: [0, 90, -36] }), jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [25.8, 182.8, 8], center: [-95, 12, -31] }), jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [55.8, 14.8, 8], center: [-80, -69.6, -31] }), jsxRuntime.jsx(StableCylinder, { radius: 4, height: 12, center: [-120, 80, -30] }), jsxRuntime.jsx(StableCylinder, { radius: 6, height: 12, center: [0, 135, -30] }), [[-112, 105], [112, 105], [-100, -115], [100, -115]].map(([x, y]) => (jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [13, 9, 12], center: [x, y, -30] }, `${x},${y}`))), pcbMountingHoles.map(({ x, y }) => (jsxRuntime.jsx(StableCylinder, { radius: 1.25, height: 34, center: [x, y, -14] }, `b${x},${y}`))), [-1, 1].flatMap((sx) => [-1, 1].map((sy) => (jsxRuntime.jsx(StableCylinder, { radius: 1.5, height: 66, center: [sx * 101, sy * 101, -2] }, `l${sx},${sy}`)))), [-36, -24, -12, 0, 12, 24, 36].map((x) => (jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [7, 20, 18], center: [x, -153, 12] }, x)))] }), jsxRuntime.jsx(tscircuit.jscad.translate, { offset: [0, 0, -0.8], children: jsxRuntime.jsx(tscircuit.jscad.rectangle, { name: "pcb", size: [160, 130], reference: true }) })] }));
}
function Lid() {
return (jsxRuntime.jsxs(tscircuit.jscad.subtract, { children: [jsxRuntime.jsxs(tscircuit.jscad.union, { children: [jsxRuntime.jsx(tscircuit.jscad.cylinder, { radius: 160, height: 3, center: [0, 0, 33.5] }), jsxRuntime.jsxs(tscircuit.jscad.subtract, { children: [jsxRuntime.jsx(tscircuit.jscad.cylinder, { radius: 156.1, height: 5, center: [0, 0, 29.5] }), jsxRuntime.jsx(tscircuit.jscad.cylinder, { radius: 153.7, height: 7, center: [0, 0, 29.5] })] })] }), jsxRuntime.jsx(tscircuit.jscad.cylinder, { radius: 35, height: 14, center: [0, 15, 32] }), [-1, 1].flatMap((sx) => [-1, 1].map((sy) => (jsxRuntime.jsx(tscircuit.jscad.cylinder, { radius: 1.7, height: 12, center: [sx * 101, sy * 101, 32] }, `${sx},${sy}`)))), jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [70.8, 54.8, 12], center: [-43, -106, 32] })] }));
}
function Bin() {
return (jsxRuntime.jsxs(tscircuit.jscad.subtract, { children: [jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [70, 54, 29], center: [-43, -106, 16.5] }), jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [65.2, 49.2, 31], center: [-43, -106, 19.4] }), jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [25, 8, 13], center: [-65, -79, 15] }), jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [8, 30, 17], center: [-8, -106, 16] })] }));
}
function BinLid() {
return (jsxRuntime.jsxs(tscircuit.jscad.union, { children: [jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [70, 54, 3], center: [-43, -106, 33.5] }), jsxRuntime.jsxs(tscircuit.jscad.subtract, { children: [jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [64.7, 48.7, 2], center: [-43, -106, 31] }), jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [60, 44, 4], center: [-43, -106, 31] })] })] }));
}
function DirtyAirDuct() {
return (jsxRuntime.jsxs(tscircuit.jscad.subtract, { children: [jsxRuntime.jsxs(tscircuit.jscad.union, { children: [jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [125, 30, 22], center: [-45, 90, 1.4] }), jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [25, 30, 45], center: [-95, 90, -22.5] }), jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [25, 182, 15], center: [-95, 12, -37.5] }), jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [55, 14, 61], center: [-80, -69.6, -14.5] })] }), jsxRuntime.jsxs(tscircuit.jscad.union, { children: [jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [125, 25.2, 17.2], center: [-42.6, 90, 1.4] }), jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [20.2, 25.2, 45], center: [-95, 90, -20.1] }), jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [20.2, 182, 10.2], center: [-95, 12, -37.5] }), jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [50.2, 9.2, 61], center: [-80, -69.6, -12.1] })] })] }));
}
function RollerShroud() {
return (jsxRuntime.jsxs(tscircuit.jscad.subtract, { children: [jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [144, 46, 26], center: [0, 90, -23] }), jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [138, 40, 28], center: [0, 90, -26] }), jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [120, 25, 10], center: [0, 90, -10] }), jsxRuntime.jsx(tscircuit.jscad.translate, { offset: [0, 90, -32], children: jsxRuntime.jsx(tscircuit.jscad.rotate, { angles: [0, Math.PI / 2, 0], children: jsxRuntime.jsx(tscircuit.jscad.cylinder, { radius: 3.2, height: 150 }) }) })] }));
}
function CleanAirAdapter() {
return jsxRuntime.jsxs(tscircuit.jscad.subtract, { children: [jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [56.6, 35, 23], center: [20.7, -106, 16] }), jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [60, 30.2, 18.2], center: [20.7, -106, 16] })] });
}
function CasterCup() {
return jsxRuntime.jsxs(tscircuit.jscad.subtract, { children: [jsxRuntime.jsxs(tscircuit.jscad.union, { children: [jsxRuntime.jsx(StableCylinder, { radius: 18, height: 3, center: [0, 135, -28.5] }), jsxRuntime.jsx(StableCylinder, { radius: 14, height: 11, center: [0, 135, -34] })] }), jsxRuntime.jsx(StableCylinder, { radius: 12, height: 12, center: [0, 135, -38] }), jsxRuntime.jsx(StableCylinder, { radius: 5.5, height: 24, center: [0, 135, -34] }), [-1, 1].map((sign) => jsxRuntime.jsx(StableCylinder, { radius: 1.7, height: 8, center: [sign * 15.5, 135, -28.5] }, sign))] });
}
function WheelHub({ x }) {
return (jsxRuntime.jsx(tscircuit.jscad.translate, { offset: [x, 0, -20], children: jsxRuntime.jsx(tscircuit.jscad.rotate, { angles: [0, Math.PI / 2, 0], children: jsxRuntime.jsxs(tscircuit.jscad.subtract, { children: [jsxRuntime.jsx(tscircuit.jscad.cylinder, { radius: 28, height: 16 }), jsxRuntime.jsx(tscircuit.jscad.cylinder, { radius: 3.1, height: 20 }), [0, 1, 2, 3, 4, 5].map((i) => (jsxRuntime.jsx(tscircuit.jscad.cylinder, { radius: 6, height: 20, center: [17 * Math.cos(i * Math.PI / 3), 17 * Math.sin(i * Math.PI / 3), 0] }, i)))] }) }) }));
}
function WheelBracket({ x }) {
const sign = Math.sign(x);
return (jsxRuntime.jsxs(tscircuit.jscad.subtract, { children: [jsxRuntime.jsxs(tscircuit.jscad.union, { children: [jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [32, 56, 4], center: [x - sign * 25, 0, -28] }), jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [4, 48, 27], center: [x - sign * 16, 0, -16.5] })] }), jsxRuntime.jsx(tscircuit.jscad.translate, { offset: [x - sign * 16, 0, -20], children: jsxRuntime.jsx(tscircuit.jscad.rotate, { angles: [0, Math.PI / 2, 0], children: jsxRuntime.jsx(tscircuit.jscad.cylinder, { radius: 6, height: 12 }) }) }), [-18, 18].map((y) => (jsxRuntime.jsx(tscircuit.jscad.cylinder, { radius: 1.7, height: 12, center: [x - sign * 28, y, -28] }, y)))] }));
}
function BatteryTray() {
return (jsxRuntime.jsxs(tscircuit.jscad.subtract, { children: [jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [110, 65, 23], center: [0, -80, -19] }), jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [106, 61, 25], center: [0, -80, -16] }), [-32, 32].map((x) => (jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [13, 70, 3.2], center: [x, -80, -27] }, x)))] }));
}
function Bumper() {
return (jsxRuntime.jsxs(tscircuit.jscad.subtract, { children: [jsxRuntime.jsx(tscircuit.jscad.cylinder, { radius: 164, height: 18, center: [0, 0, -5] }), jsxRuntime.jsx(tscircuit.jscad.cylinder, { radius: 160.8, height: 22, center: [0, 0, -5] }), jsxRuntime.jsx(tscircuit.jscad.cuboid, { size: [340, 200, 24], center: [0, -60, -5] })] }));
}
/** Geometry-only purchased part envelope. This does not assert a supplier model. */
function Envelope({ name, size, center, shape = "box", rotation }) {
const primitive = shape === "cylinder"
? { type: "cylinder", radius: size[0] / 2, height: size[2], segments: 48 }
: { type: "cuboid", size };
return jsxRuntime.jsx(tscircuit.assembly.part, { name: name, cadModel: {
jscad: rotation ? { type: "rotate", angles: rotation, shape: primitive } : primitive,
positionOffset: { x: center[0], y: center[1], z: center[2] },
} });
}
function RobotMechanicals({ includeExplosion = true }) {
return jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(tscircuit.assembly.printedpart, { name: "CHASSIS", displayName: "Open chassis / 3mm floor", material: "petg", color: "#344252", jscad: jsxRuntime.jsx(Chassis, {}) }), jsxRuntime.jsx(tscircuit.assembly.printedpart, { name: "TOP_COVER", displayName: "Removable top cover", material: "petg", color: "#e6e9ed", jscad: jsxRuntime.jsx(Lid, {}) }), jsxRuntime.jsx(tscircuit.assembly.printedpart, { name: "DUSTBIN", displayName: "Removable dirty-air bin", material: "petg", color: "#a7c6d7", jscad: jsxRuntime.jsx(Bin, {}) }), jsxRuntime.jsx(tscircuit.assembly.printedpart, { name: "BIN_LID", material: "petg", color: "#b9cfdb", jscad: jsxRuntime.jsx(BinLid, {}) }), jsxRuntime.jsx(tscircuit.assembly.printedpart, { name: "DIRTY_AIR_DUCT", displayName: "Dirty air passage; prototype", material: "petg", color: "#da9f48", jscad: jsxRuntime.jsx(DirtyAirDuct, {}) }), jsxRuntime.jsx(tscircuit.assembly.printedpart, { name: "CLEAN_AIR_ADAPTER", displayName: "Filter-to-blower concept adapter", material: "petg", color: "#6ba4ad", jscad: jsxRuntime.jsx(CleanAirAdapter, {}) }), jsxRuntime.jsx(tscircuit.assembly.printedpart, { name: "ROLLER_SHROUD", material: "petg", color: "#44596b", jscad: jsxRuntime.jsx(RollerShroud, {}) }), jsxRuntime.jsx(tscircuit.assembly.printedpart, { name: "CASTER_CUP", material: "petg", color: "#708396", jscad: jsxRuntime.jsx(CasterCup, {}) }), jsxRuntime.jsx(tscircuit.assembly.printedpart, { name: "BATTERY_CRADLE", material: "petg", color: "#5c6b76", jscad: jsxRuntime.jsx(BatteryTray, {}) }), jsxRuntime.jsx(tscircuit.assembly.printedpart, { name: "FRONT_BUMPER", material: "petg", color: "#efb644", jscad: jsxRuntime.jsx(Bumper, {}) }), [-130, 130].map((x) => jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsx(tscircuit.assembly.printedpart, { name: x < 0 ? "LEFT_WHEEL_HUB" : "RIGHT_WHEEL_HUB", material: "petg", color: "#586775", jscad: jsxRuntime.jsx(WheelHub, { x: x }) }), jsxRuntime.jsx(tscircuit.assembly.printedpart, { name: x < 0 ? "LEFT_MOTOR_BRACKET" : "RIGHT_MOTOR_BRACKET", material: "petg", color: "#768b97", jscad: jsxRuntime.jsx(WheelBracket, { x: x }) }), jsxRuntime.jsx(Envelope, { name: x < 0 ? "LEFT_TIRE_ENVELOPE" : "RIGHT_TIRE_ENVELOPE", size: [65, 65, 18], center: [x, 0, -20], shape: "cylinder", rotation: [0, Math.PI / 2, 0] }), jsxRuntime.jsx(Envelope, { name: x < 0 ? "LEFT_GEARMOTOR_ENVELOPE" : "RIGHT_GEARMOTOR_ENVELOPE", size: [25, 25, 36], center: [x - Math.sign(x) * 36, 0, -16], shape: "cylinder", rotation: [0, Math.PI / 2, 0] })] }, x)), jsxRuntime.jsx(Envelope, { name: "PROTECTED_3S_BATTERY_ENVELOPE", size: [105, 60, 20], center: [0, -80, -18] }), jsxRuntime.jsx(Envelope, { name: "BLDC_BLOWER_ENVELOPE", size: [50, 50, 26], center: [70, -105, 16], shape: "cylinder" }), jsxRuntime.jsx(Envelope, { name: "RPLIDAR_C1_APPROX_ENVELOPE", size: [66, 66, 28], center: [0, 15, 44], shape: "cylinder" }), jsxRuntime.jsx(Envelope, { name: "ROLLER_BRISTLE_ENVELOPE", size: [40, 40, 120], center: [0, 90, -32], shape: "cylinder", rotation: [0, Math.PI / 2, 0] }), jsxRuntime.jsx(Envelope, { name: "ROLLER_MOTOR_ENVELOPE", size: [22, 22, 32], center: [88, 90, -19], shape: "cylinder", rotation: [0, Math.PI / 2, 0] }), jsxRuntime.jsx(Envelope, { name: "SIDE_BRUSH_MOTOR_ENVELOPE", size: [22, 22, 25], center: [-120, 80, -18], shape: "cylinder" }), jsxRuntime.jsx(Envelope, { name: "CASTER_BALL_ENVELOPE", size: [23, 23, 23], center: [0, 135, -41], shape: "cylinder" }), jsxRuntime.jsx(Envelope, { name: "REPLACEABLE_FILTER_ENVELOPE", size: [3, 30, 19], center: [-10, -106, 16] }), jsxRuntime.jsx(tscircuit.assembly.printedpart, { name: "SIDE_BRUSH_HUB", material: "petg", color: "#e3aa4b", jscad: jsxRuntime.jsxs(tscircuit.jscad.subtract, { children: [jsxRuntime.jsx(tscircuit.jscad.cylinder, { radius: 10, height: 5, center: [-120, 80, -45] }), jsxRuntime.jsx(tscircuit.jscad.cylinder, { radius: 1.6, height: 9, center: [-120, 80, -45] })] }) }), [0, 1, 2].map((i) => jsxRuntime.jsx(Envelope, { name: `SIDE_BRUSH_BRISTLES_${i}_ENVELOPE`, size: [42, 5, 3], center: [-120 + 21 * Math.cos(i * 2 * Math.PI / 3), 80 + 21 * Math.sin(i * 2 * Math.PI / 3), -51], rotation: [0, 0, i * 2 * Math.PI / 3] }, i)), includeExplosion && jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(tscircuit.assembly.explosion.stage, { name: "open-top", nextStageRef: "remove-bin", children: jsxRuntime.jsx(tscircuit.assembly.explosion.move, { targetRefs: ["TOP_COVER", "BIN_LID", "RPLIDAR_C1_APPROX_ENVELOPE"], offZ: 100 }) }), jsxRuntime.jsx(tscircuit.assembly.explosion.stage, { name: "remove-bin", nextStageRef: "show-drive", children: jsxRuntime.jsx(tscircuit.assembly.explosion.move, { targetRefs: ["DUSTBIN", "REPLACEABLE_FILTER_ENVELOPE"], offZ: 60 }) }), jsxRuntime.jsxs(tscircuit.assembly.explosion.stage, { name: "show-drive", children: [jsxRuntime.jsx(tscircuit.assembly.explosion.move, { targetRefs: ["LEFT_WHEEL_HUB", "LEFT_TIRE_ENVELOPE"], offX: -65 }), jsxRuntime.jsx(tscircuit.assembly.explosion.move, { targetRefs: ["RIGHT_WHEEL_HUB", "RIGHT_TIRE_ENVELOPE"], offX: 65 })] })] })] });
}
/** Native tscircuit design study. See README before fabrication. */
function RobotVacuum() {
return (jsxRuntime.jsxs(tscircuit.assembly.device, { name: "ROBOT_VACUUM_R0", children: [jsxRuntime.jsx(MainBoard, { mountedTo: "CHASSIS.pcb" }), jsxRuntime.jsx(RobotMechanicals, {})] }));
}
module.exports = RobotVacuum;