Skip to content

Commit

Permalink
added keepout
Browse files Browse the repository at this point in the history
  • Loading branch information
imrishabh18 committed Sep 6, 2024
1 parent bc07200 commit 0106963
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
13 changes: 11 additions & 2 deletions lib/transform-soup-elements.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { AnySoupElement } from "@tscircuit/soup"
import { type Matrix, applyToPoint, decomposeTSR } from "transformation-matrix"
import {
directionToVec,
rotateDirection,
vecToDirection,
} from "./direction-to-vec"
import { type Matrix, applyToPoint, decomposeTSR } from "transformation-matrix"

export const transformSchematicElement = (
elm: AnySoupElement,
Expand Down Expand Up @@ -60,7 +60,16 @@ export const transformPCBElement = (elm: AnySoupElement, matrix: Matrix) => {
const { x, y } = applyToPoint(matrix, { x: elm.x, y: elm.y })
elm.x = x
elm.y = y
} else if (
} else if (elm.type === "pcb_keepout") {
if(elm.shape === "rect") {
const { x, y } = applyToPoint(matrix, { x: elm.x, y: elm.y })
elm.x = x
elm.y = y
} else if (elm.shape === "circle") {
elm.center = applyToPoint(matrix, elm.center)
}
}
else if (
elm.type === "pcb_silkscreen_text" ||
elm.type === "pcb_fabrication_note_text"
) {
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"zod": "^3.23.6"
},
"dependencies": {
"@tscircuit/soup": "*",
"@tscircuit/soup": "^0.0.66",
"parsel-js": "^1.1.2"
}
}

0 comments on commit 0106963

Please sign in to comment.