0hmX/pcbgolf-modular-checkpoint

A partial 3D assembly of seven separate PCBs—five USB carriers, an MCU board, and an SBU board—with modeled USB/DC connectors, but no routing, wiring, supports, or tilted-board mounting.

Version
0.0.6
License
UNLICENSED
Stars
0

dist/index.cjs

PCBPCB preview for dist/index.cjs
SchematicSchematic preview for dist/index.cjs
'use strict';

var jsxRuntime = require('react/jsx-runtime');
var tscircuit = require('tscircuit');
var usb = require('././assets/usb-4b47a9a7.glb');
var usb_carrier = require('././assets/usb_carrier-0435fc24.glb');
var dc = require('././assets/dc-4fb07cc0.glb');
var mcu = require('././assets/mcu-41693bab.glb');
var sbu = require('././assets/sbu-c49aac54.glb');

var pose = [
	{
		name: "J1_DC",
		model: "dc",
		rotation: {
			x: 90,
			y: 0,
			z: 0
		},
		position: {
			x: 6.150000000000002,
			y: 14.000000100002628,
			z: 3.4250000000000003
		}
	},
	{
		name: "J5",
		model: "usb",
		rotation: {
			x: 0,
			y: -90,
			z: 90
		},
		position: {
			x: 21.03414865201095,
			y: 5.091480005351036,
			z: 5.943656867327304
		}
	},
	{
		name: "J5_CARRIER",
		model: "usb_carrier",
		rotation: {
			x: 0,
			y: -90,
			z: 90
		},
		position: {
			x: 21.03414865201095,
			y: 5.091480005351036,
			z: 5.943656867327304
		}
	},
	{
		name: "J6",
		model: "usb",
		rotation: {
			x: 90,
			y: 0,
			z: 0
		},
		position: {
			x: 16.364148642010946,
			y: 13.033979803143279,
			z: 0.9500840681727776
		}
	},
	{
		name: "J6_CARRIER",
		model: "usb_carrier",
		rotation: {
			x: 90,
			y: 0,
			z: 0
		},
		position: {
			x: 16.364148642010946,
			y: 13.033979803143279,
			z: 0.9500840681727776
		}
	},
	{
		name: "J7",
		model: "usb",
		rotation: {
			x: 90,
			y: 180,
			z: 180
		},
		position: {
			x: 13.760868404657975,
			y: 14.43397981314328,
			z: 5.9236568673273045
		}
	},
	{
		name: "J7_CARRIER",
		model: "usb_carrier",
		rotation: {
			x: 90,
			y: 180,
			z: 180
		},
		position: {
			x: 13.760868404657975,
			y: 14.43397981314328,
			z: 5.9236568673273045
		}
	},
	{
		name: "J8",
		model: "usb",
		rotation: {
			x: 0,
			y: -90,
			z: -90
		},
		position: {
			x: -1.0200000099999977,
			y: 5.2365549809874175,
			z: 0.9500840681727776
		}
	},
	{
		name: "J8_CARRIER",
		model: "usb_carrier",
		rotation: {
			x: 0,
			y: -90,
			z: -90
		},
		position: {
			x: -1.0200000099999977,
			y: 5.2365549809874175,
			z: 0.9500840681727776
		}
	},
	{
		name: "J3",
		model: "usb",
		rotation: {
			x: 90,
			y: 180,
			z: 0
		},
		position: {
			x: 1.080208218271014,
			y: 14.388131133477415,
			z: 0.9500840681727778
		}
	},
	{
		name: "J3_CARRIER",
		model: "usb_carrier",
		rotation: {
			x: 90,
			y: 180,
			z: 0
		},
		position: {
			x: 1.080208218271014,
			y: 14.388131133477415,
			z: 0.9500840681727778
		}
	},
	{
		name: "MCU_PCB",
		model: "mcu",
		rotation: {
			x: 0,
			y: 90,
			z: 90
		},
		position: {
			x: 12.585,
			y: 0.5,
			z: 7.123656867327305
		}
	},
	{
		name: "CH1_SBU2_PCB",
		model: "sbu",
		rotation: {
			x: 0,
			y: 90,
			z: 90
		},
		position: {
			x: 14.31,
			y: 1,
			z: 6.3
		}
	}
];

const models = { usb, usb_carrier, dc, mcu, sbu };
const parts = pose.map(part => ({
    name: part.name,
    model: part.model,
    cadModel: {
        glbUrl: models[part.model],
        positionOffset: part.position,
        rotationOffset: part.rotation,
        modelOriginPosition: { x: 0, y: 0, z: 0 },
        modelUnitToMmScale: 1,
    },
}));

// Each native PCB stays a separate model. <board> cannot yet tilt in 3D.
// Electrical layouts remain in st7p70_mcu.circuit.json and ch1_sbu2.circuit.json.
const AssemblyBoards = () => jsxRuntime.jsx(jsxRuntime.Fragment, { children: parts.filter(p => !["usb", "dc"].includes(p.model)).map(p => (jsxRuntime.jsx(tscircuit.assembly.subassembly, { name: p.name, cadModel: p.cadModel }, p.name))) });

// Seven PCBs: five USB carriers, MCU and one SBU PCB.
// This 3D view adds no routing, wires, supports or manufacturing qualification.
var assemblyMain = () => (jsxRuntime.jsx(tscircuit.assembly.device, { name: "PCBGOLF_PARTIAL_WITNESS", children: jsxRuntime.jsx(AssemblyBoards, {}) }));

module.exports = assemblyMain;