ShiboSoftwareDev/solar-battery-charger-module

This hardware setup integrates a solar panel, a lithium-ion battery, and a multi-rail buck converter with a battery charging IC, protection circuitry, and monitoring components, enabling solar power harvesting, battery charging, and power distribution in an embedded system.

Version
1.0.4
License
unset
Stars
0

patches/@tscircuit%2Fcopper-pour-solver@0.0.42.patch

diff --git a/dist/index.js b/dist/index.js
index 88e38650f4adc0b90823af5a19f33494a31773bd..ddd4724efa14cdaa021c6cb9e8455aa687f6b1a8 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -438,7 +438,7 @@ var processObstaclesForPour = (pads, pourConnectivityKey, margins, boardOutline)
       continue;
     }
     if (isPolygonPad(pad)) {
-      const margin = isHoleOrCutout ? cutoutMargin ?? 0 : 0;
+      const margin = isHoleOrCutout ? cutoutMargin ?? 0 : padMargin;
       const seen = /* @__PURE__ */ new Set();
       const uniquePoints = pad.points.filter((p) => {
         const key = `${p.x},${p.y}`;
@@ -827,6 +827,14 @@ var convertCircuitJsonToInputProblem = (circuitJson, options) => {
           radius: smtpad.radius,
           ccwRotation: smtpad.shape === "rotated_pill" ? smtpad.ccw_rotation : 0
         });
+      } else if (smtpad.shape === "polygon") {
+        pads.push({
+          shape: "polygon",
+          padId: smtpad.pcb_smtpad_id,
+          layer: smtpad.layer,
+          connectivityKey,
+          points: smtpad.points
+        });
       }
     } else if (elm.type === "pcb_plated_hole") {
       const platedHole = elm;
diff --git a/lib/circuit-json/convert-circuit-json-to-input-problem.ts b/lib/circuit-json/convert-circuit-json-to-input-problem.ts
index f97d7a77c48702448ddc745a59517aa748ee4bf3..8313c8a67776693df85b8aa2f6dd7315eca8ff15 100644
--- a/lib/circuit-json/convert-circuit-json-to-input-problem.ts
+++ b/lib/circuit-json/convert-circuit-json-to-input-problem.ts
@@ -96,6 +96,14 @@ export const convertCircuitJsonToInputProblem = (
           ccwRotation:
             smtpad.shape === "rotated_pill" ? smtpad.ccw_rotation : 0,
         } as InputPillPad)
+      } else if (smtpad.shape === "polygon") {
+        pads.push({
+          shape: "polygon",
+          padId: smtpad.pcb_smtpad_id,
+          layer: smtpad.layer,
+          connectivityKey,
+          points: smtpad.points,
+        } as InputPolygonPad)
       }
     } else if (elm.type === "pcb_plated_hole") {
       const platedHole = elm as PcbPlatedHole
diff --git a/lib/solvers/copper-pour/process-obstacles.ts b/lib/solvers/copper-pour/process-obstacles.ts
index a48e0b0a526bf5f3864ff08112a3e238067f47a0..71a5c185a7aa3d16ae50565341c571d2d9ff3346 100644
--- a/lib/solvers/copper-pour/process-obstacles.ts
+++ b/lib/solvers/copper-pour/process-obstacles.ts
@@ -143,7 +143,7 @@ export const processObstaclesForPour = (
     }
 
     if (isPolygonPad(pad)) {
-      const margin = isHoleOrCutout ? (cutoutMargin ?? 0) : 0
+      const margin = isHoleOrCutout ? (cutoutMargin ?? 0) : padMargin
 
       const seen = new Set<string>()
       const uniquePoints = pad.points.filter((p) => {