@tscircuit/footprinter 0.0.309 → 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
@@ -8494,7 +8494,12 @@ var mountedpcbmodule_def = base_def.extend({
8494
8494
  usbbottom: z78.boolean().optional().default(false),
8495
8495
  usbtype: z78.enum(["micro", "c"]).optional(),
8496
8496
  usbmicro: z78.boolean().optional().default(false),
8497
- usbc: z78.boolean().optional().default(false)
8497
+ usbc: z78.boolean().optional().default(false),
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()
8498
8503
  }).transform((data) => {
8499
8504
  const pinlabelAnchorSide = determinePinlabelAnchorSide(data);
8500
8505
  let pinRowSide = data.pinRowSide;
@@ -8558,6 +8563,12 @@ var mountedpcbmodule_def = base_def.extend({
8558
8563
  calculatedWidth = 10;
8559
8564
  calculatedHeight = 10;
8560
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;
8561
8572
  return {
8562
8573
  ...data,
8563
8574
  pinlabelAnchorSide,
@@ -8566,8 +8577,12 @@ var mountedpcbmodule_def = base_def.extend({
8566
8577
  usbtype,
8567
8578
  male: data.male ?? !data.female,
8568
8579
  female: data.female ?? false,
8569
- width: data.width ?? calculatedWidth,
8570
- height: data.height ?? calculatedHeight,
8580
+ width: finalWidth,
8581
+ height: finalHeight,
8582
+ screenwidth: screenWidth,
8583
+ screenheight: screenHeight,
8584
+ screencenteroffsetx: screenCenterOffsetX,
8585
+ screencenteroffsety: screenCenterOffsetY,
8571
8586
  pinrowleftpins: sidePinCounts.left,
8572
8587
  pinrowrightpins: sidePinCounts.right,
8573
8588
  pinrowtoppins: sidePinCounts.top,
@@ -8611,7 +8626,12 @@ var mountedpcbmodule = (raw_params) => {
8611
8626
  pinrowtoppins,
8612
8627
  pinrowbottompins,
8613
8628
  usbposition,
8614
- usbtype
8629
+ usbtype,
8630
+ screen,
8631
+ screenwidth,
8632
+ screenheight,
8633
+ screencenteroffsetx,
8634
+ screencenteroffsety
8615
8635
  } = parameters;
8616
8636
  let pinlabelTextAlign = "center";
8617
8637
  if (pinlabeltextalignleft) pinlabelTextAlign = "left";
@@ -8891,6 +8911,22 @@ var mountedpcbmodule = (raw_params) => {
8891
8911
  }
8892
8912
  elements.push(silkscreenpath(usbRect, { stroke_width: 0.1, layer: "top" }));
8893
8913
  }
8914
+ if (screen) {
8915
+ const halfScreenWidth = screenwidth / 2;
8916
+ const halfScreenHeight = screenheight / 2;
8917
+ const centerX = screencenteroffsetx;
8918
+ const centerY = screencenteroffsety;
8919
+ const screenOutline = [
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 }
8925
+ ];
8926
+ elements.push(
8927
+ silkscreenpath(screenOutline, { stroke_width: 0.05, layer: "top" })
8928
+ );
8929
+ }
8894
8930
  return {
8895
8931
  circuitJson: elements,
8896
8932
  parameters