imrishabh18/nema17-motor-controller-flex

An RP2040-based USB‑C/USB‑PD controller board that powers and drives a NEMA17 stepper via a DRV8825, with current/temperature/voltage monitoring, optional AS5600 encoder, buzzer/RGB status indicators, QSPI flash, and flexible motor/encoder connections.

Version
1.2.0
License
unset
Stars
0

mechanical/revision-placement.ts

import placement from "./next-placement.json";

/** Absolute board coordinates; subtract the origin for parts in translated groups. */
export function revisionPlacement(name: string, origin = {x: 0, y: 0}) {
  const position = (placement as Record<string, {pcbX:number; pcbY:number; pcbRotation:number}>)[name];
  if (!position) throw new Error(`Missing PCB placement for ${name}`);
  return {...position, pcbX:position.pcbX-origin.x, pcbY:position.pcbY-origin.y};
}