@tscircuit/footprinter 0.0.310 → 0.0.311

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -8495,7 +8495,11 @@ var mountedpcbmodule_def = base_def.extend({
8495
8495
  usbtype: z78.enum(["micro", "c"]).optional(),
8496
8496
  usbmicro: z78.boolean().optional().default(false),
8497
8497
  usbc: z78.boolean().optional().default(false),
8498
- screen: z78.boolean().optional().default(false).describe("add silkscreen outline for screen/display area")
8498
+ screen: z78.boolean().optional().default(false).describe("add silkscreen outline for screen/display area"),
8499
+ screenwidth: length60.optional(),
8500
+ screenheight: length60.optional(),
8501
+ screencenteroffsetx: length60.optional(),
8502
+ screencenteroffsety: length60.optional()
8499
8503
  }).transform((data) => {
8500
8504
  const pinlabelAnchorSide = determinePinlabelAnchorSide(data);
8501
8505
  let pinRowSide = data.pinRowSide;
@@ -8559,6 +8563,12 @@ var mountedpcbmodule_def = base_def.extend({
8559
8563
  calculatedWidth = 10;
8560
8564
  calculatedHeight = 10;
8561
8565
  }
8566
+ const finalWidth = data.width ?? calculatedWidth;
8567
+ const finalHeight = data.height ?? calculatedHeight;
8568
+ const screenWidth = data.screenwidth ?? finalWidth * 0.95;
8569
+ const screenHeight = data.screenheight ?? finalHeight * 0.95;
8570
+ const screenCenterOffsetX = data.screencenteroffsetx ?? 0;
8571
+ const screenCenterOffsetY = data.screencenteroffsety ?? 0;
8562
8572
  return {
8563
8573
  ...data,
8564
8574
  pinlabelAnchorSide,
@@ -8567,8 +8577,12 @@ var mountedpcbmodule_def = base_def.extend({
8567
8577
  usbtype,
8568
8578
  male: data.male ?? !data.female,
8569
8579
  female: data.female ?? false,
8570
- width: data.width ?? calculatedWidth,
8571
- height: data.height ?? calculatedHeight,
8580
+ width: finalWidth,
8581
+ height: finalHeight,
8582
+ screenwidth: screenWidth,
8583
+ screenheight: screenHeight,
8584
+ screencenteroffsetx: screenCenterOffsetX,
8585
+ screencenteroffsety: screenCenterOffsetY,
8572
8586
  pinrowleftpins: sidePinCounts.left,
8573
8587
  pinrowrightpins: sidePinCounts.right,
8574
8588
  pinrowtoppins: sidePinCounts.top,
@@ -8613,7 +8627,11 @@ var mountedpcbmodule = (raw_params) => {
8613
8627
  pinrowbottompins,
8614
8628
  usbposition,
8615
8629
  usbtype,
8616
- screen
8630
+ screen,
8631
+ screenwidth,
8632
+ screenheight,
8633
+ screencenteroffsetx,
8634
+ screencenteroffsety
8617
8635
  } = parameters;
8618
8636
  let pinlabelTextAlign = "center";
8619
8637
  if (pinlabeltextalignleft) pinlabelTextAlign = "left";
@@ -8894,12 +8912,16 @@ var mountedpcbmodule = (raw_params) => {
8894
8912
  elements.push(silkscreenpath(usbRect, { stroke_width: 0.1, layer: "top" }));
8895
8913
  }
8896
8914
  if (screen) {
8915
+ const halfScreenWidth = screenwidth / 2;
8916
+ const halfScreenHeight = screenheight / 2;
8917
+ const centerX = screencenteroffsetx;
8918
+ const centerY = screencenteroffsety;
8897
8919
  const screenOutline = [
8898
- { x: -width * 0.475, y: -height * 0.475 },
8899
- { x: width * 0.475, y: -height * 0.475 },
8900
- { x: width * 0.475, y: height * 0.475 },
8901
- { x: -width * 0.475, y: height * 0.475 },
8902
- { x: -width * 0.475, y: -height * 0.475 }
8920
+ { x: -halfScreenWidth + centerX, y: -halfScreenHeight + centerY },
8921
+ { x: halfScreenWidth + centerX, y: -halfScreenHeight + centerY },
8922
+ { x: halfScreenWidth + centerX, y: halfScreenHeight + centerY },
8923
+ { x: -halfScreenWidth + centerX, y: halfScreenHeight + centerY },
8924
+ { x: -halfScreenWidth + centerX, y: -halfScreenHeight + centerY }
8903
8925
  ];
8904
8926
  elements.push(
8905
8927
  silkscreenpath(screenOutline, { stroke_width: 0.05, layer: "top" })