From 062998488e81ce12ca8af33dc146820495fa647b Mon Sep 17 00:00:00 2001 From: Rishabh Gupta Date: Fri, 6 Sep 2024 20:06:15 +0530 Subject: [PATCH 1/3] add pcb_keepout as obstacles --- .../getObstaclesFromCircuitJson.ts | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/module/lib/solver-utils/getObstaclesFromCircuitJson.ts b/module/lib/solver-utils/getObstaclesFromCircuitJson.ts index ee6a47d..f4d95c2 100644 --- a/module/lib/solver-utils/getObstaclesFromCircuitJson.ts +++ b/module/lib/solver-utils/getObstaclesFromCircuitJson.ts @@ -30,7 +30,33 @@ export const getObstaclesFromCircuitJson = (soup: AnySoupElement[]) => { connectedTo: [], }) } - } else if (element.type === "pcb_hole") { + } else if (element.type === "pcb_keepout") { + if (element.shape === "circle") { + obstacles.push({ + // @ts-ignore + type: "oval", + center: { + x: element.center.x, + y: element.center.y, + }, + width: element.radius * 2, + height: element.radius * 2, + connectedTo: [], + }) + } else if (element.shape === "rect") { + obstacles.push({ + type: "rect", + center: { + x: element.x, + y: element.y, + }, + width: element.width, + height: element.height, + connectedTo: [], + }) + } + } + else if (element.type === "pcb_hole") { if (element.hole_shape === "oval") { obstacles.push({ // @ts-ignore From ac2e66e6bd18ed75edea2eca398d3a362e8c8dc7 Mon Sep 17 00:00:00 2001 From: Rishabh Gupta Date: Fri, 6 Sep 2024 20:38:25 +0530 Subject: [PATCH 2/3] dependency update --- bun.lockb | Bin 404199 -> 404579 bytes package.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/bun.lockb b/bun.lockb index 540435fb15ec0b39f074f5d5f6a82c8f1612df68..46325e09d2a0039644303116f300b59ae00580b2 100755 GIT binary patch delta 2928 zcmcJRYfzL`7{||hS!7YUgqKzBa!~}i#C0=){v(G%w`Td{$?>Xn)_uXx) zGu^ywDhcvmpBPbcKHN0L{`el>X$Q)iq8=$bo;BXn^GyC3Mb^S8)&LtpBTr(<%Ap)qr@2>CMY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bEJqIfU7ps5?-vM-G))cHK`N>e4=vle;yOVJ(Po!G5=$1=?%-f<*li@5*id8L^uCF zS#VV!qg2WrNG^l_G~*^6w#~ib-u0rdS)M^d^z6PqC zHp{^)N46%|@=`G#t<;W4+*jr#SV} z_(r6gRL-f7zU9@NBt;0 zzZRwej6|flu%uK5dYFwu?BoKMgS2b9@9a#GyntSo_AD?9#=I@t!K}zRV7N7u58@T+ zTTOXvu|_O>AytaB7RjC2hoD()3wO#Iu z2HMFM=S7NvbXVLP!FbZKh`+%2lWCH^IMiQ*O+ap@dbapQqG!(2qH^!1X@4OrZi_9q|}%B1^* zrGkBc_6X#DVe?UcC~SZV*y0u>-u*O09V~dqZ%cbR>KWKN-s<0kEkJD-_B$P6i$6rd zv8qbp#h=2T!f>n)+VWQ45tfCzSN7~KX}z$x2Z?8a^IO%S;2pm&?YXGyS;X}K3@<+Q zRkJXS^4P)xN8X($5nbZ03tI%1$^VDT5Qd)-wM3W;)v$%DNKQx&ad!jbEK@b^kYg#hU-!+96KM<3G1<CycrcXeMZ^dctj&Z@4d^lEYXf@fNb{%r`e(Xz@JvwZ#-u^N zK=$VM<`aZZmM+BG0HI*6$~>zXUj@*fKqG~k1C0PrK2(ANF*jUOTIoTc(PoKHG}~-O z=jZ0F7Gs|_(IJm(SMJ2GzZ{}l3@t7?A)3#E0y@}gjGs94T<7&Gyojb{-Hxpl8fI=*>x!6V#uS8vet)ltZb*^HY3IS kxXlQ%c${p1NOK}~w_GsHmJ2SY)96sI;b- Date: Fri, 6 Sep 2024 23:20:20 +0530 Subject: [PATCH 3/3] type fix --- algos/tscircuit-builtin/index.ts | 4 ++-- bun.lockb | Bin 404579 -> 404548 bytes package.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/algos/tscircuit-builtin/index.ts b/algos/tscircuit-builtin/index.ts index e6d7ef4..1ba21ab 100644 --- a/algos/tscircuit-builtin/index.ts +++ b/algos/tscircuit-builtin/index.ts @@ -1,4 +1,4 @@ -import type { AnySoupElement } from "@tscircuit/soup" +import type { AnySoupElement, PCBTrace } from "@tscircuit/soup" import { buildPcbTraceElements } from "@tscircuit/builder" import { su } from "@tscircuit/soup-util" import { mm } from "@tscircuit/mm" @@ -35,7 +35,7 @@ export const tscircuitBuiltinSolver = (soup: AnySoupElement[]) => { }, ctx, ) - newElements.push(pcb_trace, ...pcb_errors, ...pcb_vias) + newElements.push(pcb_trace as PCBTrace, ...pcb_errors, ...pcb_vias) } return newElements } diff --git a/bun.lockb b/bun.lockb index 46325e09d2a0039644303116f300b59ae00580b2..735de2d6c84c44a51448bb7178f1d3cab3a2f8fa 100755 GIT binary patch delta 1601 zcmb_cYfM~46uxt3cFU!OZh^&JwqUWGf6pTN2W*&q4jn^KT01(8V|(Yh|AN4Q2iB#2BR z&qx_KN(4bz>nh8Rc8#WcNPlD!AqQ2_W!aV><>Cs-+~X=cm>}igzAr9U({~a*u-NV% zQY~VY4-b<_iid*;PPZ;K{Hq$rD)*nUE!jlKc2}fE9#1Ca#=P~|j(rUVg*}j;SL*-H zazF~nFy{WRi=Ie2MC7DH;=m5uxd+EO2la)0Jx$ZUv~}(7in{%w|KW4>yE+ft97;Xf z)%dqg` zz;Z8V#rqT2y2^`Qn>-l&^^R9+ntEsZZ`v;ooCDpZZsRQC2l@$ILo08cppVp>_?Mc6a3Hb~ zIfz_D9>NLv(=>);!m(*;B=K-*n%+>w<8qs!W`_EDHDg+hXh58j>t^UxA{tbXF-uGI z_@@(65UGeQhy=vDh(?&3r7q7%Y$ys5t&)$=QGWuh^YkTXo29YxpYxQ7z!s=Uj8)0u z3-lX8tn$M}IwHcr5^YkOabAo{e&a71NXe9Zny|@@+kVEU#VbX?vE|oxNi7Oz})}AHzkS*@iIejmA*G!vQ{!hMD1{axeb0U@iSIl!}a4%!y_zw%Gz7 z-Di4(`vP762;MQK^|h`Vdf|ICkTH17eeMhRvo?GB#upObTlM)t%rMi3x^L|5XKhE? z9Y2Jw8fu4E4(2kH4zuUv_F)zxN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X{XhV!X%=eG6%`X_rlF69xZK?)pH=^0L(^l8-6)~b}Ns76q#pnkKIM! zZJ8ewk{rso%%8ggWqmvxEDn5?C-CrwSPU-paVMDKd6_bBp1Ucng^Ih}Oq<{oQpCz- z6!HKXQw&o05*Am+Lmp|(!WcTxZN_{_%79=vXZ2nl=ImngHL9x*bmS;r^B-(Vr XFgU_DK)p?uPCY=mXi=tYx+4A$SNu*7 diff --git a/package.json b/package.json index 090681a..3504954 100644 --- a/package.json +++ b/package.json @@ -14,11 +14,11 @@ "devDependencies": { "@biomejs/biome": "^1.8.3", "@timohausmann/quadtree-ts": "^2.2.2", - "@tscircuit/builder": "1.9.5", + "@tscircuit/builder": "1.11.2", "@tscircuit/pcb-viewer": "1.4.5", "@tscircuit/props": "^0.0.26", "@tscircuit/soup": "^0.0.66", - "@tscircuit/soup-util": "^0.0.13", + "@tscircuit/soup-util": "^0.0.21", "@types/bun": "latest", "@types/d3-delaunay": "^6.0.4", "@types/debug": "^4.1.12",